Update psss_panel

This commit is contained in:
2026-01-08 14:53:08 +01:00
parent b8d2a5501d
commit e920126f26

View File

@@ -1,6 +1,8 @@
import ch.psi.pshell.device.Device;
import ch.psi.pshell.device.DeviceListener;
import ch.psi.pshell.camserver.PipelineSource;
import ch.psi.pshell.device.Cacheable;
import ch.psi.pshell.device.ProcessVariable;
import ch.psi.pshell.framework.Context;
import ch.psi.pshell.framework.Panel;
import ch.psi.pshell.device.Register;
@@ -79,12 +81,12 @@ public class PSSS extends Panel {
spinnerAverage.setValue(( (Number) eval("get_psss_averaging()", true)).intValue());
try{
Double energy = (((ChannelDouble)getDevice("energy_machine")).take(-1));
Double energy = (((Cacheable<Number>)getDevice("energy_machine")).take(-1)).doubleValue();
energy=Convert.roundDouble(energy, 0);
spFromEn.setValue(energy-150);
spToEn.setValue(energy+150);
} catch (Exception ex) {
getLogger().warning("Error reading energy_machine");
getLogger().warning("Error reading energy_machine: " + ex.toString());
}
this.getDevice("psss_energy").addListener(new DeviceListener() {