diff --git a/ch.psi.fda.cdump/pom.xml b/ch.psi.fda.cdump/pom.xml
index b481813..e060f8b 100644
--- a/ch.psi.fda.cdump/pom.xml
+++ b/ch.psi.fda.cdump/pom.xml
@@ -8,7 +8,7 @@
ch.psi
ch.psi.fda.core
- 0.0.1-SNAPSHOT
+ 0.0.2
diff --git a/ch.psi.fda.cdump/src/main/java/ch/psi/fda/cdump/CdumpListener.java b/ch.psi.fda.cdump/src/main/java/ch/psi/fda/cdump/CdumpListener.java
index ecfa9b9..09575c5 100644
--- a/ch.psi.fda.cdump/src/main/java/ch/psi/fda/cdump/CdumpListener.java
+++ b/ch.psi.fda.cdump/src/main/java/ch/psi/fda/cdump/CdumpListener.java
@@ -74,7 +74,7 @@ public class CdumpListener implements PropertyChangeListener {
int nelements = value.length;
int n = nelements % numberOfElements;
if (n != 0) {
- throw new RuntimeException("Array size is not a multiple of 65536");
+ throw new RuntimeException("Array size is not a multiple of "+numberOfElements);
}
numberOfWaveforms = nelements / numberOfElements;
for(int i=0;i.
+ *
+ */
+package ch.psi.fda.cdump;
+
+import gov.aps.jca.cas.ProcessVariable;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Deque;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.logging.Logger;
+
+import ch.psi.jcae.cas.CaServer;
+import ch.psi.jcae.cas.ProcessVariableInt;
+import ch.psi.jcae.cas.ProcessVariableIntWaveform;
+
+public class CdumpTestIOC {
+
+ private static final Logger logger = Logger.getLogger(CdumpTestIOC.class.getName());
+
+ public static void main(String[] args) {
+
+ List processVariables = new ArrayList();
+
+ // Data channel
+ ProcessVariableIntWaveform pv = new ProcessVariableIntWaveform("CDUMP:WAVE", null, 8);
+ processVariables.add(pv);
+
+ // This PV has the states READY (0) and GO (1)
+ ProcessVariableInt pvControl = new ProcessVariableInt("CDUMP:CONTROL", null);
+ processVariables.add(pvControl);
+
+ // Sampling rate channel
+ //{"1Hz","2Hz", "5Hz", "10Hz", "20Hz", "50Hz", "100Hz", "200Hz", "500Hz", "1kHz", "2kHz", "5kHz", "10kHz", "20kHz", "50kHz", "100kHz"};
+ ProcessVariableInt pvSamplingRate = new ProcessVariableInt("CDUMP:SAMPLING", null);
+ processVariables.add(pvSamplingRate);
+
+
+ CaServer s = new CaServer(processVariables);
+ s.startAsDaemon();
+
+ Deque deque = new LinkedList();
+ deque.push(new int[] { 1, 2, 3, 4, 11, 12, 13, 14 });
+ deque.push(new int[] { 5, 6, 7, 8, 15, 16, 17, 18 });
+
+ while (true) {
+ if (pvControl.getValue() == 1) { // if control channel is on GO
+ int[] v = deque.pollFirst();
+ logger.finest(Arrays.toString(v));
+ pv.setValue(v);
+
+ deque.addLast(v);
+ }
+
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ }
+
+ }
+ }
+}
diff --git a/ch.psi.fda.cdump/src/test/resources/cdump.properties b/ch.psi.fda.cdump/src/test/resources/cdump.properties
new file mode 100644
index 0000000..1c786ca
--- /dev/null
+++ b/ch.psi.fda.cdump/src/test/resources/cdump.properties
@@ -0,0 +1,4 @@
+ch.psi.fda.cdump.dataChannel=CDUMP:WAVE
+ch.psi.fda.cdump.controlChannel=CDUMP:CONTROL
+ch.psi.fda.cdump.samplingRateChannel=CDUMP:SAMPLING
+ch.psi.fda.cdump.nelements=4