/**
 * Copyright (C) 2010-14 pvmanager developers. See COPYRIGHT.TXT
 * All rights reserved. Use is subject to license terms. See LICENSE.TXT
 */
package org.epics.pvmanager.sample;

import org.epics.pvmanager.CompositeDataSource;
import org.epics.pvmanager.PVManager;
import org.epics.pvmanager.file.FileDataSource;
import org.epics.pvmanager.formula.ArrayFunctionSet;
import org.epics.pvmanager.formula.FormulaRegistry;
import org.epics.pvmanager.formula.MathFunctionSet;
import org.epics.pvmanager.formula.NumberOperatorFunctionSet;
import org.epics.pvmanager.formula.StringFunctionSet;
import org.epics.pvmanager.formula.TableFunctionSet;
import org.epics.pvmanager.jca.JCADataSourceBuilder;
import org.epics.pvmanager.loc.LocalDataSource;
import org.epics.pvmanager.sim.SimulationDataSource;
import org.epics.pvmanager.util.Executors;
import org.epics.pvmanager.sys.SystemDataSource;

/**
 *
 * @author carcassi
 */
public class SetupUtil {
    public static void defaultCASetup() {
        CompositeDataSource dataSource = new CompositeDataSource();
        dataSource.putDataSource("sim", SimulationDataSource.simulatedData());
        dataSource.putDataSource("ca", new JCADataSourceBuilder().build());
        dataSource.putDataSource("loc", new LocalDataSource());
        dataSource.putDataSource("sys", new SystemDataSource());
        dataSource.putDataSource("file", new FileDataSource());
        dataSource.setDefaultDataSource("ca");
        PVManager.setDefaultDataSource(dataSource);
        FormulaRegistry.getDefault().registerFormulaFunctionSet(new ArrayFunctionSet());
        FormulaRegistry.getDefault().registerFormulaFunctionSet(new MathFunctionSet());
        FormulaRegistry.getDefault().registerFormulaFunctionSet(new NumberOperatorFunctionSet());
        FormulaRegistry.getDefault().registerFormulaFunctionSet(new TableFunctionSet());
        FormulaRegistry.getDefault().registerFormulaFunctionSet(new StringFunctionSet());
    }
    public static void defaultCASetupForSwing() {
        PVManager.setDefaultNotificationExecutor(Executors.swingEDT());
        defaultCASetup();
    }
}

@@ -1,12 +1,11 @@
 /**
-%0D
 %0A * Copy
@@ -61,17 +61,16 @@
 IGHT.TXT
-%0D
 %0A * All 
@@ -134,22 +134,20 @@
 ENSE.TXT
-%0D
 %0A */
-%0D
 %0Apackage
@@ -174,19 +174,17 @@
 .sample;
-%0D%0A%0D
+%0A
 %0Aimport 
@@ -215,33 +215,32 @@
 ositeDataSource;
-%0D
 %0Aimport org.epic
@@ -261,17 +261,16 @@
 Manager;
-%0D
 %0Aimport 
@@ -301,33 +301,32 @@
 .FileDataSource;
-%0D
 %0Aimport org.epic
@@ -354,33 +354,32 @@
 rrayFunctionSet;
-%0D
 %0Aimport org.epic
@@ -414,17 +414,16 @@
 egistry;
-%0D
 %0Aimport 
@@ -458,33 +458,32 @@
 MathFunctionSet;
-%0D
 %0Aimport org.epic
@@ -520,33 +520,32 @@
 atorFunctionSet;
-%0D
 %0Aimport org.epic
@@ -574,33 +574,32 @@
 ringFunctionSet;
-%0D
 %0Aimport org.epic
@@ -635,17 +635,16 @@
 tionSet;
-%0D
 %0Aimport 
@@ -688,17 +688,16 @@
 Builder;
-%0D
 %0Aimport 
@@ -728,33 +728,32 @@
 LocalDataSource;
-%0D
 %0Aimport org.epic
@@ -789,17 +789,16 @@
 aSource;
-%0D
 %0Aimport 
@@ -832,17 +832,16 @@
 ecutors;
-%0D
 %0Aimport 
@@ -885,20 +885,16 @@
 rce;
-%0D%0A%0D
+%0A
 %0A/**
-%0D
 %0A *
-%0D
 %0A * 
@@ -913,14 +913,12 @@
 assi
-%0D
 %0A */
-%0D
 %0Apub
@@ -938,17 +938,16 @@
 upUtil %7B
-%0D
 %0A    pub
@@ -976,25 +976,24 @@
 tCASetup() %7B
-%0D
 %0A        Com
@@ -1048,17 +1048,16 @@
 ource();
-%0D
 %0A       
@@ -1123,25 +1123,116 @@
 atedData());
-%0D
+%0A        System.setProperty(%22com.cosylab.epics.caj.CAJContext.max_array_bytes%22, %2210000000%22);
 %0A        dat
@@ -1291,25 +1291,24 @@
 ().build());
-%0D
 %0A        dat
@@ -1351,33 +1351,32 @@
 alDataSource());
-%0D
 %0A        dataSou
@@ -1416,33 +1416,32 @@
 emDataSource());
-%0D
 %0A        dataSou
@@ -1484,25 +1484,24 @@
 taSource());
-%0D
 %0A        dat
@@ -1535,17 +1535,16 @@
 e(%22ca%22);
-%0D
 %0A       
@@ -1587,17 +1587,16 @@
 Source);
-%0D
 %0A       
@@ -1668,33 +1668,32 @@
 yFunctionSet());
-%0D
 %0A        Formula
@@ -1756,33 +1756,32 @@
 hFunctionSet());
-%0D
 %0A        Formula
@@ -1854,33 +1854,32 @@
 rFunctionSet());
-%0D
 %0A        Formula
@@ -1947,25 +1947,24 @@
 ctionSet());
-%0D
 %0A        For
@@ -2041,24 +2041,22 @@
 nSet());
-%0D
 %0A    %7D
-%0D
 %0A    pub
@@ -2097,17 +2097,16 @@
 wing() %7B
-%0D
 %0A       
@@ -2169,17 +2169,16 @@
 gEDT());
-%0D
 %0A       
@@ -2199,16 +2199,13 @@
 p();
-%0D
 %0A    %7D
-%0D
 %0A%7D
-%0D
 %0A

increase max_array_size