public static void main(String[] args) throws Exception { PVManager.setDefaultDataSource(new LocalDataSource()); System.out.println("nChannels \"timeToStart (ms)\" \"avgLoad (ms)\""); for (int i = 0; i < 9; i++) { int nPvs = (int) Math.pow(4, i); profile(nPvs); } }
public static void main(String[] args) throws Exception { //System.setProperty("com.cosylab.epics.caj.CAJContext.max_array_bytes", "20000000"); PVManager.setDefaultDataSource(new SimulationDataSource()); final PVReader<Object> reader = PVManager.read(channel("gaussian()")) .readListener(new PVReaderListener<Object>() { @Override public void pvChanged(PVReaderEvent<Object> event) { System.out.println("Monitor called"); } }) .maxRate(Duration.ofMillis(10)); Thread.sleep(10000); reader.close(); System.out.println("After five seconds"); Thread.sleep(10000); System.out.println("After another five seconds"); PVManager.getDefaultDataSource().close(); System.out.println("Done"); } }
/** Creates new form MockPVFrame */ public MockSyncArrayTableFrame() { PVManager.setDefaultNotificationExecutor(swingEDT()); PVManager.setDefaultDataSource(SimulationDataSource.simulatedData()); initComponents(); }
/** Creates new form MockPVFrame */ public MockTablePVFrame2() { PVManager.setDefaultNotificationExecutor(swingEDT()); PVManager.setDefaultDataSource(SimulationDataSource.simulatedData()); initComponents(); }
/** Creates new form MockPVFrame */ public ReportRateFrame() { PVManager.setDefaultNotificationExecutor(swingEDT()); PVManager.setDefaultDataSource(SimulationDataSource.simulatedData()); initComponents(); }
/** Creates new form MockPVFrame */ public MockTablePVFrame() { PVManager.setDefaultNotificationExecutor(swingEDT()); PVManager.setDefaultDataSource(SimulationDataSource.simulatedData()); initComponents(); }
public static void main(String[] args) throws Exception { PVManager.setDefaultDataSource(new SimulationDataSource()); System.out.println("Note that events cannot be stopped while they are in-flight."); System.out.println("Therefore you may see one event arriving after the pause or after the close.");
public void programmaticDataSourceConfiguration() { // The recommended method to configure data sources is through // the configuration files in DIIRT_HOME. // If is needed, you can still change the configuration through // the programmatic API. This can be useful for unit testing // or standalone applications. You should not do this in shared // environment, like CS-Studio. // This loads the configuration from DIIRT_HOME, and sets the // resulting JCADataSource as the only data source. // This can be used when creating an application that still // allows the users to provide their own configuration. PVManager.setDefaultDataSource(new JCADataSourceProvider().createInstance()); // This uses the default configuration, ignorint the user configuration // and sets the resulting JCADataSource as the only data source. // This can be useful for unit testsing, where the code should be // in complete control of the settings. PVManager.setDefaultDataSource(new JCADataSourceConfiguration().create()); // As a general rule: creating the data source from the provider, uses // the user configuration. Creating it from the configuration allows you // to create everything from scratch, ignoring user settings. // For ultimate control, you can modify all the parameters, // and even create the JCA context yourself Context jcaContext = null; PVManager.setDefaultDataSource(new JCADataSourceConfiguration() .monitorMask(Monitor.VALUE | Monitor.ALARM) .jcaContext(jcaContext).create()); // For more options of this and other data sources, // check their javadocs. }
public static void main(String[] args) throws Exception { System.out.println(Double.NEGATIVE_INFINITY); System.out.println(System.getProperty("java.library.path")); System.loadLibrary("jca"); PVManager.setDefaultDataSource(new JCADataSourceConfiguration() .jcaContextClass(JCALibrary.JNI_THREAD_SAFE).create()); PVReader<Object> pvReader = PVManager.read(channel("counter1")) .readListener(new PVReaderListener<Object>() { @Override public void pvChanged(PVReaderEvent<Object> event) { System.out.println(event.getPvReader().getValue()); } }) .maxRate(Duration.ofMillis(100)); Thread.sleep(5000); pvReader.close(); // testNativeTypeSupport(); // testVDoubleSupport(); // testVIntSupport(); // testVStringSupport(); // testVEnumSupport(); // testVDoubleArraySupport(); // testVFloatArraySupport(); // testVByteArraySupport(); // testVShortArraySupport(); // testVIntArraySupport(); // testVStringArraySupport(); }
public void programmaticCompositeDataSourceConfiguration() { // The recommended method to configure data sources is through // the configuration files in DIIRT_HOME. // If is needed, you can still change the configuration through // the programmatic API. This can be useful for unit testing // or standalone applications. You should not do this in shared // environment, like CS-Studio. // Create a composite data source, and add different data sources. // You can either add a DataSourceProvider or a DataSource. CompositeDataSource composite = new CompositeDataSource(); composite.putDataSource(new JCADataSourceProvider()); composite.putDataSource("sim", new SimulationDataSource()); // If no prefix is given to a channel, use JCA as default composite.setConfiguration(new CompositeDataSourceConfiguration().defaultDataSource("ca")); // Set the composite as the default PVManager.setDefaultDataSource(composite); // For more options, check CompositeDataSource. }
PVManager.setDefaultDataSource(source); final PVReader<Object> pv = PVManager.read(channel("carcassi:compressExample2")) .readListener(new PVReaderListener<Object>() {