Fix panel update if invalid values
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import ch.psi.pshell.device.Device;
|
||||
import ch.psi.pshell.device.DeviceAdapter;
|
||||
import ch.psi.pshell.device.DeviceBase.DeviceInvalidParameterException;
|
||||
import ch.psi.pshell.device.DeviceListener;
|
||||
|
||||
|
||||
@@ -166,6 +167,7 @@ public final class ScientaPanel extends DevicePanel {
|
||||
Scienta.AcquisitionMode acquisitionMode;
|
||||
Scienta.EnergyMode energyMode;
|
||||
Scienta.DetectorMode detectorMode;
|
||||
Integer pass;
|
||||
double low;
|
||||
double center;
|
||||
double high;
|
||||
@@ -173,8 +175,7 @@ public final class ScientaPanel extends DevicePanel {
|
||||
//int frames;
|
||||
double time;
|
||||
double size;
|
||||
int slices;
|
||||
int pass;
|
||||
int slices;
|
||||
int iterations;
|
||||
|
||||
int current;
|
||||
@@ -188,13 +189,35 @@ public final class ScientaPanel extends DevicePanel {
|
||||
|
||||
dd.spectrum = getDevice().getSpectrum().getValue();
|
||||
|
||||
dd.lensMode = getDevice().getLensMode();
|
||||
dd.elementSet = getDevice().getElementSet();
|
||||
try{
|
||||
dd.lensMode = getDevice().getLensMode();
|
||||
} catch (DeviceInvalidParameterException ex){
|
||||
dd.lensMode = null;
|
||||
}
|
||||
try{
|
||||
dd.elementSet = getDevice().getElementSet();
|
||||
} catch (DeviceInvalidParameterException ex){
|
||||
dd.elementSet = null;
|
||||
} try{
|
||||
dd.acquisitionMode = getDevice().getAcquisitionMode();
|
||||
dd.energyMode = getDevice().getEnergyMode();
|
||||
dd.detectorMode = getDevice().getDetectorMode();
|
||||
dd.pass = getDevice().getPassEnergy();
|
||||
|
||||
} catch (DeviceInvalidParameterException ex){
|
||||
dd.acquisitionMode = null;
|
||||
}
|
||||
try{
|
||||
dd.energyMode = getDevice().getEnergyMode();
|
||||
} catch (DeviceInvalidParameterException ex){
|
||||
dd.energyMode = null;
|
||||
}
|
||||
try{
|
||||
dd.detectorMode = getDevice().getDetectorMode();
|
||||
} catch (DeviceInvalidParameterException ex){
|
||||
dd.detectorMode = null;
|
||||
}
|
||||
try{
|
||||
dd.pass = getDevice().getPassEnergy();
|
||||
} catch (DeviceInvalidParameterException ex){
|
||||
dd.pass = null;
|
||||
}
|
||||
dd.low = getDevice().getLowEnergy().getValue();
|
||||
dd.center = getDevice().getCenterEnergy().getValue();
|
||||
dd.high = getDevice().getHighEnergy().getValue();
|
||||
|
||||
Reference in New Issue
Block a user