diff --git a/config/plugins.properties b/config/plugins.properties
index 1cba725d..9a73e4bb 100644
--- a/config/plugins.properties
+++ b/config/plugins.properties
@@ -1,5 +1,5 @@
OTF.java=enabled
-ScientaPanel.java=disabled
+ScientaPanel.java=enabled
Scienta.java=disabled
XPSSpectrum.java=enabled
HoloScan.java=enabled
diff --git a/config/variables.properties b/config/variables.properties
index 2f97f634..329fd890 100644
--- a/config/variables.properties
+++ b/config/variables.properties
@@ -1,4 +1,4 @@
-#Fri Nov 12 13:33:29 CET 2021
-LastRunDate=211112
-FileSequentialNumber=10001
-DaySequentialNumber=27
+#Mon Nov 15 13:26:54 CET 2021
+LastRunDate=211115
+FileSequentialNumber=10002
+DaySequentialNumber=1
diff --git a/plugins/ScientaPanel.form b/plugins/ScientaPanel.form
index 1a1c004b..9bb91d08 100644
--- a/plugins/ScientaPanel.form
+++ b/plugins/ScientaPanel.form
@@ -286,7 +286,7 @@
-
+
diff --git a/plugins/ScientaPanel.java b/plugins/ScientaPanel.java
index ce4e5603..b336c14e 100644
--- a/plugins/ScientaPanel.java
+++ b/plugins/ScientaPanel.java
@@ -1,4 +1,4 @@
-package ch.psi.pshell.swing;
+import ch.psi.pshell.swing.*;
import ch.psi.pshell.device.Device;
import ch.psi.pshell.device.DeviceAdapter;
@@ -118,6 +118,7 @@ public final class ScientaPanel extends DevicePanel {
getDevice().getSpectrum().addListener(spectrumListener);
//cameraPanel.startTimer(3000, 0);
startTimer(3000, 0);
+ getDevice().getSpectrum().updateAsync();
}
}
@@ -131,6 +132,7 @@ public final class ScientaPanel extends DevicePanel {
}
};
+ /*
DeviceListener spectrumListener = new DeviceAdapter() {
@Override
public void onValueChanged(final Device device, final Object value, final Object former) {
@@ -139,6 +141,7 @@ public final class ScientaPanel extends DevicePanel {
});
}
};
+ */
@Override
protected void onHide() {
@@ -162,6 +165,7 @@ public final class ScientaPanel extends DevicePanel {
public class DeviceData {
double[] spectrum;
+ double[] spectrumX;
LensMode lensMode;
ElementSet elementSet;
AcquisitionMode acquisitionMode;
@@ -187,7 +191,8 @@ public final class ScientaPanel extends DevicePanel {
DeviceData dd = new DeviceData();
//read-once
- dd.spectrum = getDevice().getSpectrum().getValue();
+ dd.spectrum = getDevice().getSpectrum().read();
+ dd.spectrumX = getDevice().getSpectrumX();
dd.lensMode = getDevice().getLensMode();
dd.elementSet = getDevice().getElementSet();
@@ -208,6 +213,7 @@ public final class ScientaPanel extends DevicePanel {
dd.current = getDevice().getCurrentChannel().getValue().intValue();
dd.total = getDevice().getTotalChannels().getValue().intValue();
dd.iterations = getDevice().getIterations();
+
return dd;
}
@@ -233,8 +239,6 @@ public final class ScientaPanel extends DevicePanel {
protected void onBackgroundUpdateFinished(Object data) {
DeviceData dd = (DeviceData) data;
- updateSpectrum();
-
updateValueField(valueLow, dd.low);
updateValueField(valueCenter, dd.center);
updateValueField(valueHigh, dd.high);
@@ -253,6 +257,21 @@ public final class ScientaPanel extends DevicePanel {
updateComboField(comboEnergy, dd.energyMode);
updateComboField(comboElement, dd.elementSet);
updateComboField(comboPass, dd.pass);
+
+ try {
+ if ((dd.spectrum == null)||(dd.spectrumX==null)) {
+ throw new Exception("Invalid spectrum");
+ }
+ if (dd.spectrumX.length