PSSS improvements

This commit is contained in:
gac-bernina
2021-05-07 15:43:37 +02:00
parent 2bcbb2b157
commit a0fb826e6f
5 changed files with 62 additions and 19 deletions

View File

@@ -1,9 +1,11 @@
import ch.psi.pshell.bs.PipelineServer;
import ch.psi.pshell.core.Context;
import ch.psi.pshell.epics.ChannelDouble;
import ch.psi.pshell.imaging.RendererMode;
import ch.psi.pshell.plot.Plot;
import ch.psi.pshell.plot.LinePlotJFree;
import ch.psi.pshell.ui.Panel;
import ch.psi.utils.Convert;
import ch.psi.utils.State;
import ch.psi.utils.Str;
import java.awt.CardLayout;
@@ -51,6 +53,16 @@ public class PSSS extends Panel {
spinnerAverage.setValue(( (Number) eval("get_psss_averaging()", true)).intValue());
try{
Double energy = (((ChannelDouble)getDevice("energy_machine")).take(-1));
energy=Convert.roundDouble(energy, 0);
spFromEn.setValue(energy-150);
spToEn.setValue(energy+150);
} catch (Exception ex) {
getLogger().log(Level.WARNING, null, ex);
}
} catch (Exception ex) {
getLogger().log(Level.WARNING, null, ex);
}