From 3ed066e4cb099ac8c360d12db88a69be15bcf6be Mon Sep 17 00:00:00 2001 From: gac-x09la Date: Fri, 11 Mar 2022 14:58:04 +0100 Subject: [PATCH] Scienta test mode --- src/Scienta.java | 229 ++++------- src/ScientaPanel.form | 585 +++++++++------------------ src/ScientaPanel.java | 893 +++++++++++------------------------------- 3 files changed, 483 insertions(+), 1224 deletions(-) diff --git a/src/Scienta.java b/src/Scienta.java index ba5514e..fc16a9e 100644 --- a/src/Scienta.java +++ b/src/Scienta.java @@ -1,25 +1,14 @@ -import ch.psi.jcae.ChannelException; import ch.psi.pshell.device.AccessType; -import ch.psi.pshell.device.ArrayCalibration; import ch.psi.pshell.device.CameraImageDescriptor; import ch.psi.pshell.device.MatrixCalibration; import ch.psi.pshell.device.Device; -import ch.psi.pshell.device.DeviceAdapter; -import ch.psi.pshell.device.DeviceListener; -import ch.psi.pshell.device.Readable.ReadableCalibratedArray; import ch.psi.pshell.device.Writable; import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.logging.Level; import ch.psi.pshell.epics.*; -import static ch.psi.pshell.epics.Scienta.PASS_ENERGY_VALUES; import ch.psi.utils.Arr; -import ch.psi.utils.Convert; -import ch.psi.utils.State; -import java.util.concurrent.ExecutionException; -import java.util.logging.Logger; /** * Implementation of Scienta spectrometer analyser. @@ -31,8 +20,9 @@ public class Scienta extends AreaDetector { final ControlledVariable lowEnergy, centerEnergy, highEnergy, stepSize, lowThetaY, centerThetaY, highThetaY, stepSizeThetaY, centerThetaX; final ControlledVariable excitationEnergy; final GenericArray data; - final ChannelInteger totalSteps, currentStep, exposuresComplete, acquisitionMode; - final ChannelString lensMode, passEnergy, estTime, detectorState; + final ChannelInteger totalSteps, currentStep, exposuresComplete; + final DiscretePositioner lensMode, acquisitionMode, energyMode, detectorMode, elementSet, passEnergy; + final ChannelString estTime, detectorState; final ChannelByteArray status; final ChannelInteger slices, slicesReadback, channels, channelsReadback; final Stats[] stats; @@ -81,9 +71,13 @@ public class Scienta extends AreaDetector { ThetaXCount = new ChannelInteger(name + " Theta count", channelCtrl + ":SLICE_COUNT_RBV", false); ThetaXCount.setAccessType(AccessType.Read); - passEnergy = new ChannelString(name + " pass energy", channelCtrl + ":PASS_ENERGY", false); - lensMode = new ChannelString(name + " lens mode", channelCtrl + ":LENS_MODE", false); - acquisitionMode = new ChannelInteger(name + " acquisition mode", channelCtrl + ":ACQ_MODE", false); + passEnergy = new DiscretePositioner(name + " pass energy", channelCtrl + ":PASS_ENERGY", channelCtrl + ":PASS_ENERGY_RBV"); + lensMode = new DiscretePositioner(name + " lens mode", channelCtrl + ":LENS_MODE", channelCtrl + ":LENS_MODE_RBV"); + acquisitionMode = new DiscretePositioner(name + " acquisition mode", channelCtrl + ":ACQ_MODE", channelCtrl + ":ACQ_MODE_RBV"); + energyMode = new DiscretePositioner(name + " energy mode", channelCtrl + ":ENERGY_MODE", channelCtrl + ":ENERGY_MODE_RBV"); + detectorMode = new DiscretePositioner(name + " detector mode", channelCtrl + ":DETECTOR_MODE", channelCtrl + ":DETECTOR_MODE_RBV"); + elementSet = new DiscretePositioner(name + " element set", channelCtrl + ":ELEMENT_SET_RBV", channelCtrl + ":ELEMENT_SET_RBV"); + elementSet.setAccessType(AccessType.Read); slices = new ChannelInteger(name + " slices", channelCtrl + ":SLICES", false); slicesReadback = new ChannelInteger(name + " slices rbv", channelCtrl + ":SLICES_RBV", false); @@ -106,14 +100,23 @@ public class Scienta extends AreaDetector { estTime.setAccessType(AccessType.Read); detectorState= new ChannelString(name + " detector state", channelCtrl + ":DetectorState_RBV", false); detectorState.setAccessType(AccessType.Read); - status= new ChannelByteArray(name + " status", channelCtrl + ":StatusMessage_RBV"); + status= new ChannelByteArray(name + " status", channelCtrl + ":StatusMessage_RBV", -1, false){ + protected void onReadout(Object value){ + this.setCache((value==null)?"":new String((byte[])value)); + } + //protected Object convertFromRead(byte[] value){ + // return (value==null) ? "" : new String((byte[])value); + //} + + }; status.setAccessType(AccessType.Read); monitoredChildren = new Device[]{acquire, lowEnergy,centerEnergy,highEnergy,energyWidth,energyCount, lowThetaY, centerThetaY, highThetaY, stepSizeThetaY, ThetaYWidth,ThetaYCount, lowThetaX, centerThetaX, highThetaX, stepSizeThetaX, ThetaXWidth,ThetaXCount, - stepSize,totalSteps,currentStep, exposuresComplete, passEnergy, lensMode,acquisitionMode, + stepSize,totalSteps,currentStep, exposuresComplete, passEnergy, + lensMode, acquisitionMode, energyMode, detectorMode, elementSet, slices, slicesReadback, channels, channelsReadback, excitationEnergy, estTime, detectorState, status }; @@ -141,17 +144,12 @@ public class Scienta extends AreaDetector { @Override protected void doSetSimulated() { super.doSetSimulated(); - setCache(passEnergy, String.valueOf(PASS_ENERGY_VALUES[0])); - setCache(lensMode, LensMode.Transmission.toString()); - setCache(acquisitionMode, 0); - - setSimulatedValue("ENERGY_MODE", EnergyMode.Binding.toString()); - setSimulatedValue("DETECTOR_MODE", DetectorMode.ADC.toString()); - setSimulatedValue("ELEMENT_SET", ElementSet.High_Pass_XPS.toString()); - setSimulatedValue("ACQ_MODE", AcquisitionMode.Fixed.toString()); - setSimulatedValue("LENS_MODE", LensMode.Transmission.toString()); - setSimulatedValue("PASS_ENERGY", String.valueOf(PASS_ENERGY_VALUES[0])); - setSimulatedValue("ELEMENT_SET_RBV", ElementSet.High_Pass_XPS); + setCache(passEnergy, "2"); + setCache(lensMode, "Transmission"); + setCache(acquisitionMode, "Fixed"); + setCache(energyMode, "Binding"); + setCache(detectorMode, "ADC"); + setCache(elementSet, "High_Pass_XPS"); } @Override @@ -200,169 +198,86 @@ public class Scienta extends AreaDetector { } //Modes - public enum AcquisitionMode { - Fixed, - Swept_Energy, - Swept_ThetaY, - Swept_Energy_ThetaY + + public void setAcquisitionMode(String mode) throws IOException, InterruptedException { //acquisitionMode.write(String.valueOf(mode).replaceAll("_", " ")); + acquisitionMode.write(mode); } - public void setAcquisitionMode(AcquisitionMode mode) throws IOException, InterruptedException { - //acquisitionMode.write(String.valueOf(mode).replaceAll("_", " ")); - acquisitionMode.write(Arr.getIndex(AcquisitionMode.values(), (mode==null) ? 0 : mode)); + public String getAcquisitionMode() throws IOException, InterruptedException { + return acquisitionMode.getValue(); } - public AcquisitionMode getAcquisitionMode() throws IOException, InterruptedException { - //String val = acquisitionMode.getValue(); - //return (AcquisitionMode) convertCtrlEnum(val, AcquisitionMode.class); - try{ - int val = acquisitionMode.getValue(); - return AcquisitionMode.values()[val]; - } catch (Exception ex){ - return null; - } + public void setEnergyMode(String mode) throws IOException, InterruptedException { + energyMode.write(mode); } - public enum EnergyMode { - Binding, - Kinetic + public String getEnergyMode() throws IOException, InterruptedException { + return energyMode.getValue(); } - public void setEnergyMode(EnergyMode mode) throws IOException, InterruptedException { - writeCtrlEnum("ENERGY_MODE", String.valueOf(mode)); + public void setLensMode(String mode) throws IOException, InterruptedException { + lensMode.write(mode); } - public EnergyMode getEnergyMode() throws IOException, InterruptedException { - return (EnergyMode) readCtrlEnum("ENERGY_MODE", EnergyMode.class); - } - - public enum LensMode { - A14L_01, - A14L_08, - A30L_01, - A30L_08, - DA14L_01, - DA14L_08, - DA30L_01, - DA30L_08, - Transmission, - Transmission_XPS + public String getLensMode() throws IOException, InterruptedException { + return lensMode.getValue(); } - public enum LensModeTest { - A14_01, - A14_08, - A30_01, - A30_08, - A7_08, - DA14_01, - DA14_08, - DA30_01, - DA30_08, - DA7_08, - Transmission, - Transmission_XPS + public String[] getLensModes() throws IOException, InterruptedException { + return lensMode.getPositions(); } - - public Class getLensModeClass(){ - return test ? LensModeTest.class : LensMode.class; + + public void setDetectorMode(String mode) throws IOException, InterruptedException { + detectorMode.write(mode); } - public void setLensMode(Object mode) throws IOException, InterruptedException { - //writeCtrlEnum("LENS_MODE", String.valueOf(mode)); - String m = mode.toString(); - lensMode.write(m.equals("Transmission_XPS") ? "Transmission XPS" : m); + public String getDetectorMode() throws IOException, InterruptedException { + return detectorMode.getValue(); } - public Object getLensMode() throws IOException, InterruptedException { - //return (LensMode) readCtrlEnum("LENS_MODE", LensMode.class); - String val = lensMode.getValue(); - return convertCtrlEnum(val, LensMode.class); - } - - public enum DetectorMode { - Pulse, - ADC - } - - public void setDetectorMode(DetectorMode mode) throws IOException, InterruptedException { - writeCtrlEnum("DETECTOR_MODE", String.valueOf(mode)); - } - - public DetectorMode getDetectorMode() throws IOException, InterruptedException { - return (DetectorMode) readCtrlEnum("DETECTOR_MODE", DetectorMode.class); - } - - public enum ElementSet { - High_Pass_XPS, - Low_Pass_UPS - } - - public void setElementSet(ElementSet mode) throws IOException, InterruptedException { + public void setElementSet(String mode) throws IOException, InterruptedException { throw new IOException("Read-only value"); - //writeCtrlEnum("ELEMENT_SET", String.valueOf(mode)); } - public ElementSet getElementSet() throws IOException, InterruptedException { - return readCtrl("ELEMENT_SET_RBV", String.class).equals("High Pass (XPS)") ? ElementSet.High_Pass_XPS : ElementSet.Low_Pass_UPS; + public String getElementSet() throws IOException, InterruptedException { + return elementSet.getValue(); } - - public static final int[] PASS_ENERGY_VALUES = new int[]{1, 2, 5, 10, 20}; + public void setPassEnergy(int energy) throws IOException, InterruptedException { - //writeCtrl("PASS_ENERGY", String.valueOf(energy)); - passEnergy.write(String.valueOf(energy)); - + setPassEnergy(String.valueOf(energy)); } - public int getPassEnergy() throws IOException, InterruptedException { - //String ret = (String) readCtrl("PASS_ENERGY", String.class); - String ret = passEnergy.getValue(); - try { - return Integer.valueOf(ret); - } catch (Exception ex) { - throw new DeviceInvalidParameterException("Pass Energy", ret); - } + public void setPassEnergy(String energy) throws IOException, InterruptedException { + passEnergy.write(energy); } - public void zeroSupplies() throws IOException, InterruptedException { - writeCtrl("ZERO_SUPPLIES", 1); + public String getPassEnergy() throws IOException, InterruptedException { + return passEnergy.getValue(); } - public Writable getPassEnergyDev(){ - return (Writable) (Object value) -> { - setPassEnergy(Integer.valueOf(String.valueOf(value))); - }; + public DiscretePositioner getPassEnergyDev(){ + return passEnergy; } - public Writable getElementSetDev(){ - return (Writable) (Object value) -> { - setElementSet(ElementSet.valueOf(String.valueOf(value))); - }; + public DiscretePositioner getElementSetDev(){ + return elementSet; } - public Writable getDetectorModeDev(){ - return (Writable) (Object value) -> { - setDetectorMode(DetectorMode.valueOf(String.valueOf(value))); - }; + public DiscretePositioner getDetectorModeDev(){ + return detectorMode; } - public Writable getLensModeDev(){ - return (Writable) (Object value) -> { - setLensMode(String.valueOf(value)); - }; + public DiscretePositioner getLensModeDev(){ + return lensMode; } - public Writable getAcquisitionModeDev(){ - return (Writable) (Object value) -> { - setAcquisitionMode(AcquisitionMode.valueOf(String.valueOf(value))); - }; + public DiscretePositioner getAcquisitionModeDev(){ + return acquisitionMode; } - public Writable getEnergyModeDev(){ - return (Writable) (Object value) -> { - setEnergyMode(EnergyMode.valueOf(String.valueOf(value))); - }; + public DiscretePositioner getEnergyModeDev(){ + return energyMode; } public Writable getRangeDev(){ @@ -385,6 +300,9 @@ public class Scienta extends AreaDetector { }; } + public void zeroSupplies() throws IOException, InterruptedException { + writeCtrl("ZERO_SUPPLIES", 1); + } //Progress @@ -518,7 +436,8 @@ public class Scienta extends AreaDetector { public ControlledVariable getExcitationEnergy() { return excitationEnergy; - } + } + public List getChannelRange() throws IOException, InterruptedException { ArrayList ret = new ArrayList<>(); @@ -544,7 +463,7 @@ public class Scienta extends AreaDetector { ret.add(200.0); ret.add(400.0); } else { - String lens=getLensMode().toString(); + String lens=getLensMode(); if (lens.startsWith("D")){ ret.add(lowThetaY.getReadback().getValue()); ret.add(highThetaY.getReadback().getValue()); diff --git a/src/ScientaPanel.form b/src/ScientaPanel.form index 5588058..3b1525d 100644 --- a/src/ScientaPanel.form +++ b/src/ScientaPanel.form @@ -70,8 +70,8 @@ - - + + @@ -110,9 +110,8 @@ - - - + + @@ -120,22 +119,24 @@ - - - - - - - - + + + + + + + + + + - - - - - + + + + + @@ -146,53 +147,33 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + @@ -212,105 +193,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -335,14 +241,14 @@ - - - - - - - - + + + + + + + + @@ -351,7 +257,7 @@ - + @@ -363,8 +269,8 @@ - + @@ -393,60 +299,24 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -459,12 +329,22 @@ - + + + + + + + + + - - - - + + + + + + @@ -475,25 +355,6 @@ - - - - - - - - - - - - - - - - - - - @@ -516,14 +377,14 @@ - - - - - - - - + + + + + + + + @@ -531,8 +392,8 @@ - - + + @@ -574,66 +435,24 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -646,12 +465,22 @@ - + + + + + + + + + - - - - + + + + + + @@ -678,14 +507,14 @@ - - - - - - - - + + + + + + + + @@ -693,8 +522,8 @@ - - + + @@ -742,14 +571,6 @@ - - - - - - - - @@ -762,24 +583,6 @@ - - - - - - - - - - - - - - - - - - @@ -792,31 +595,31 @@ - + - - - - - + - + + + - - - - - + - + - - - - - + + + + + + + + + + + @@ -827,23 +630,29 @@ - - - - - - + + + + + + + + + + + + + + + - - - - + @@ -861,17 +670,17 @@ - + - - - + + + - - - - - + + + + + @@ -881,10 +690,10 @@ - - + + @@ -898,14 +707,6 @@ - - - - - - - - @@ -920,13 +721,9 @@ - - - - - - - + + + @@ -948,27 +745,27 @@ - - + + + + - - - + - - - + - + + + @@ -981,22 +778,22 @@ + - - - - + + + + - @@ -1014,29 +811,11 @@ - - - - - - - - - - - - - - - - - - @@ -1047,28 +826,34 @@ - - - - - - - - - - + - + - + - + + + + + + + + + + + + + + + + diff --git a/src/ScientaPanel.java b/src/ScientaPanel.java index 88b3b04..64e51df 100644 --- a/src/ScientaPanel.java +++ b/src/ScientaPanel.java @@ -2,12 +2,6 @@ import ch.psi.pshell.device.Device; import ch.psi.pshell.device.DeviceAdapter; import ch.psi.pshell.device.DeviceListener; import ch.psi.utils.State; -import ch.psi.utils.swing.SwingUtils; -import java.awt.Component; -import java.io.IOException; -import java.util.logging.Level; -import javax.swing.DefaultComboBoxModel; -import javax.swing.JComboBox; import javax.swing.SwingUtilities; import ch.psi.pshell.swing.*; @@ -18,44 +12,6 @@ public final class ScientaPanel extends DevicePanel { public ScientaPanel() { initComponents(); - ValueSelection.ValueSelectionListener valueListener = (ValueSelection origin, double value, boolean editing) -> { - if (editing) { - try { - if (origin == valueLow) { - getDevice().getLowEnergy().writeAsync(value); - } else if (origin == valueCenter) { - getDevice().getCenterEnergy().writeAsync(value); - } else if (origin == valueHigh) { - getDevice().getHighEnergy().writeAsync(value); - } else if (origin == valueStep) { - getDevice().getEnergyStepSize().writeAsync(value); - } else if (origin == valueSlices) { - getDevice().getSlices().writeAsync((int) value); - } else if (origin == valueChannels) { - getDevice().getChannels().writeAsync((int) value); - } - } catch (Exception ex) { - showException(ex); - } - } - }; - - for (Component vs : SwingUtils.getComponentsByType(this, ValueSelection.class)) { - if (((ValueSelection) vs).isEnabled()) { - ((ValueSelection) vs).addListener(valueListener); - } - } - SwingUtils.setEnumCombo(comboLens, Scienta.LensMode.class); - SwingUtils.setEnumCombo(comboElement, Scienta.ElementSet.class); - SwingUtils.setEnumCombo(comboAcquisition, Scienta.AcquisitionMode.class); - SwingUtils.setEnumCombo(comboEnergy, Scienta.EnergyMode.class); - SwingUtils.setEnumCombo(comboDetector, Scienta.DetectorMode.class); - - DefaultComboBoxModel model = new DefaultComboBoxModel(); - for (Integer energy : Scienta.PASS_ENERGY_VALUES) { - model.addElement(energy); - } - comboPass.setModel(model); } public boolean getShowCameraPanel() { @@ -77,37 +33,57 @@ public final class ScientaPanel extends DevicePanel { getDevice().getCurrentStep().removeListener(progressListener); } super.setDevice(device); - SwingUtils.setEnumCombo(comboLens,getDevice().getLensModeClass()); - cameraPanel.setDevice(device); - if (device == null) { - stopTimer(); - } else { - getDevice().getCurrentStep().addListener(progressListener); - //cameraPanel.startTimer(3000, 0); - startTimer(3000, 0); - } - valueLow.setMaxValue(getDevice().getLowEnergy().getMaxValue()); - valueLow.setMinValue(getDevice().getLowEnergy().getMinValue()); - valueCenter.setMaxValue(getDevice().getCenterEnergy().getMaxValue()); - valueCenter.setMinValue(getDevice().getCenterEnergy().getMinValue()); - valueHigh.setMaxValue(getDevice().getHighEnergy().getMaxValue()); - valueHigh.setMinValue(getDevice().getHighEnergy().getMinValue()); - valueLowTY.setMaxValue(getDevice().getLowThetaY().getMaxValue()); - valueLowTY.setMinValue(getDevice().getLowThetaY().getMinValue()); - valueCenterTY.setMaxValue(getDevice().getCenterThetaY().getMaxValue()); - valueCenterTY.setMinValue(getDevice().getCenterThetaY().getMinValue()); - valueHighTY.setMaxValue(getDevice().getHighThetaY().getMaxValue()); - valueHighTY.setMinValue(getDevice().getHighThetaY().getMinValue()); - valueCenterTX.setMaxValue(getDevice().getCenterThetaX().getMaxValue()); - valueCenterTX.setMinValue(getDevice().getCenterThetaX().getMinValue()); + cameraPanel.setDevice(device); + + if (getDevice() != null) { + getDevice().getCurrentStep().addListener(progressListener); + comboLens.setDevice(getDevice().getLensModeDev()); + comboElement.setDevice(getDevice().getElementSetDev()); + comboAcquisition.setDevice(getDevice().getAcquisitionModeDev()); + comboEnergy.setDevice(getDevice().getEnergyModeDev()); + comboDetector.setDevice(getDevice().getDetectorModeDev()); + comboPass.setDevice(getDevice().getPassEnergyDev()); + + valueLow.setDevice(getDevice().getLowEnergy()); + valueCenter.setDevice(getDevice().getCenterEnergy()); + valueHigh.setDevice(getDevice().getHighEnergy()); + valueStep.setDevice(getDevice().getEnergyStepSize()); + valueWidth.setDevice(getDevice().getEnergyWidth()); + valueCount.setDevice(getDevice().getEnergyCount()); + + valueLowTX.setDevice(getDevice().getLowThetaX()); + valueCenterTX.setDevice(getDevice().getCenterThetaX()); + valueHighTX.setDevice(getDevice().getHighThetaX()); + valueStepTX.setDevice(getDevice().getThetaXStepSize()); + valueWidthTX.setDevice(getDevice().getThetaXWidth()); + valueCountTX.setDevice(getDevice().getThetaXCount()); + + valueLowTY.setDevice(getDevice().getLowThetaY()); + valueCenterTY.setDevice(getDevice().getCenterThetaY()); + valueHighTY.setDevice(getDevice().getHighThetaY()); + valueStepTY.setDevice(getDevice().getThetaYStepSize()); + valueWidthTY.setDevice(getDevice().getThetaYWidth()); + valueCountTY.setDevice(getDevice().getThetaYCount()); + + valueEst.setDevice(getDevice().getEstTime()); + valueExcit.setDevice(getDevice().getExcitationEnergy()); + valueSlices.setDevice(getDevice().getSlices()); + valueChannels.setDevice(getDevice().getChannels()); + + valueState.setDevice(getDevice().getDetectorState()); + valueStatus.setDevice(getDevice().getStatus()); + valueCurrent.setDevice(getDevice().getCurrentStep()); + valueTotal.setDevice(getDevice().getTotalSteps()); + valueImageCounter.setDevice(getDevice().getImageCounter()); + } } + DeviceListener progressListener = new DeviceAdapter() { @Override public void onValueChanged(final Device device, final Object value, final Object former) { SwingUtilities.invokeLater(() -> { - valueCurrent.setValue((Integer) value); progress.setValue((int) (getDevice().getProgress() * 1000)); }); } @@ -119,11 +95,6 @@ public final class ScientaPanel extends DevicePanel { super.onHide(); } - @Override - protected void onTimer() { - startBackgroundUpdate(); - } - //Callbacks @Override protected void onDeviceStateChanged(State state, State former) { @@ -133,187 +104,6 @@ public final class ScientaPanel extends DevicePanel { protected void onDeviceValueChanged(Object state, Object former) { } - public class DeviceData { - - Object lensMode; - Scienta.ElementSet elementSet; - Scienta.AcquisitionMode acquisitionMode; - Scienta.EnergyMode energyMode; - Scienta.DetectorMode detectorMode; - - double low; - double center; - double high; - double step; - double width; - int count; - - double lowTY; - double centerTY; - double highTY; - double stepTY; - double widthTY; - int countTY; - - double lowTX; - double centerTX; - double highTX; - double stepTX; - double widthTX; - int countTX; - - int pass; - int slices; - int channels; - double excit; - String est; - - int current; - int total; - String state; - String status; - int imageCount; - } - - @Override - protected DeviceData doBackgroundUpdate() throws IOException, InterruptedException { - DeviceData dd = new DeviceData(); - try{ - //read-once - try{ - dd.lensMode = getDevice().getLensMode(); - } catch (Exception ex){ - dd.lensMode = null; - } - try{ - dd.elementSet = getDevice().getElementSet(); - } catch (Exception ex){ - dd.elementSet = null; - } - try{ - dd.acquisitionMode = getDevice().getAcquisitionMode(); - } catch (Exception ex){ - dd.acquisitionMode = null; - } - try{ - dd.energyMode = getDevice().getEnergyMode(); - } catch (Exception ex){ - dd.energyMode = null; - } - try{ - dd.detectorMode = getDevice().getDetectorMode(); - } catch (Exception ex){ - dd.detectorMode = null; - } - try{ - dd.pass = getDevice().getPassEnergy(); - } catch (Exception ex){ - dd.pass = 0; - } - - dd.low = getDevice().getLowEnergy().getValue(); - dd.center = getDevice().getCenterEnergy().getValue(); - dd.high = getDevice().getHighEnergy().getValue(); - dd.step = getDevice().getEnergyStepSize().getValue(); - dd.width = getDevice().getEnergyWidth().getValue(); - dd.count = getDevice().getEnergyCount().getValue(); - - dd.lowTY = getDevice().getLowThetaY().getValue(); - dd.centerTY = getDevice().getCenterThetaY().getValue(); - dd.highTY = getDevice().getHighThetaY().getValue(); - dd.stepTY = getDevice().getThetaYStepSize().getValue(); - dd.widthTY = getDevice().getThetaYWidth().getValue(); - dd.countTY = getDevice().getThetaYCount().getValue(); - - dd.lowTX = getDevice().getLowThetaX().getValue(); - dd.centerTX = getDevice().getCenterThetaX().getValue(); - dd.highTX = getDevice().getHighThetaX().getValue(); - dd.stepTX = getDevice().getThetaXStepSize().getValue(); - dd.widthTX = getDevice().getThetaXWidth().getValue(); - dd.countTX = getDevice().getThetaXCount().getValue(); - - dd.current = getDevice().getCurrentStep().getValue().intValue(); - dd.total = getDevice().getTotalSteps().getValue().intValue(); - dd.slices =((Number) getDevice().getSlices().getValue()).intValue(); - dd.channels = ((Number)getDevice().getChannels().getValue()).intValue(); - - dd.status = new String( getDevice().getStatus().getValue()); - dd.state = getDevice().getDetectorState().getValue(); - dd.imageCount = getDevice().getImageCounter().getValue(); - - dd.excit = getDevice().getExcitationEnergy().getValue(); - dd.est = getDevice().getEstTime().getValue(); - } catch (Exception ex) { - getLogger().log(Level.WARNING, null, ex); - } - return dd; - } - - void updateValueField(ValueSelection field, double value) { - try { - field.setValue(value); - } catch (Exception ex) { - getLogger().log(Level.FINE, null, ex); - } - } - - void updateComboField(JComboBox field, Object value) { - try { - if (field.getSelectedItem() != value) { - field.setSelectedItem(value); - } - } catch (Exception ex) { - getLogger().log(Level.FINE, null, ex); - } - } - - @Override - protected void onBackgroundUpdateFinished(Object data) { - try { - DeviceData dd = (DeviceData) data; - updateValueField(valueLow, dd.low); - updateValueField(valueCenter, dd.center); - updateValueField(valueHigh, dd.high); - updateValueField(valueStep, dd.step); - updateValueField(valueWidth, dd.width); - updateValueField(valueCount, dd.count); - - updateValueField(valueLowTY, dd.lowTY); - updateValueField(valueCenterTY, dd.centerTY); - updateValueField(valueHighTY, dd.highTY); - updateValueField(valueStepTY, dd.stepTY); - updateValueField(valueWidthTY, dd.widthTY); - updateValueField(valueCountTY, dd.countTY); - - updateValueField(valueLowTX, dd.lowTX); - updateValueField(valueCenterTX, dd.centerTX); - updateValueField(valueHighTX, dd.highTX); - updateValueField(valueStepTX, dd.stepTX); - updateValueField(valueWidthTX, dd.widthTX); - updateValueField(valueCountTX, dd.countTX); - - updateValueField(valueSlices, dd.slices); - updateValueField(valueChannels, dd.channels); - updateValueField(valueTotal, dd.total); - updateValueField(valueCurrent, dd.current); - updateValueField(valueImageCounter, dd.imageCount); - updateValueField(valuExcit, dd.excit); - - updateComboField(comboLens, dd.lensMode); - updateComboField(comboAcquisition, dd.acquisitionMode); - updateComboField(comboDetector, dd.detectorMode); - updateComboField(comboEnergy, dd.energyMode); - updateComboField(comboElement, dd.elementSet); - updateComboField(comboPass, dd.pass); - - textStatus.setText(String.valueOf(dd.status)); - textState.setText(String.valueOf(dd.state)); - textEst.setText(String.valueOf(dd.est)); - progress.setValue((int) (getDevice().getProgress() * 1000)); - } catch (Exception ex) { - getLogger().log(Level.WARNING, null, ex); - } - } /** @@ -329,78 +119,78 @@ public final class ScientaPanel extends DevicePanel { jPanel6 = new javax.swing.JPanel(); jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); - comboLens = new javax.swing.JComboBox(); jLabel2 = new javax.swing.JLabel(); - comboAcquisition = new javax.swing.JComboBox(); jLabel3 = new javax.swing.JLabel(); - comboEnergy = new javax.swing.JComboBox(); jLabel4 = new javax.swing.JLabel(); - comboDetector = new javax.swing.JComboBox(); jLabel5 = new javax.swing.JLabel(); - comboElement = new javax.swing.JComboBox(); jPanel4 = new javax.swing.JPanel(); jLabel12 = new javax.swing.JLabel(); - valueLow = new ch.psi.pshell.swing.ValueSelection(); jLabel13 = new javax.swing.JLabel(); - valueCenter = new ch.psi.pshell.swing.ValueSelection(); jLabel14 = new javax.swing.JLabel(); - valueHigh = new ch.psi.pshell.swing.ValueSelection(); jLabel15 = new javax.swing.JLabel(); - valueWidth = new ch.psi.pshell.swing.ValueSelection(); - valueCount = new ch.psi.pshell.swing.ValueSelection(); jLabel20 = new javax.swing.JLabel(); jLabel33 = new javax.swing.JLabel(); - valueStep = new ch.psi.pshell.swing.ValueSelection(); + valueLow = new ch.psi.pshell.swing.RegisterPanel(); + valueCenter = new ch.psi.pshell.swing.RegisterPanel(); + valueHigh = new ch.psi.pshell.swing.RegisterPanel(); + valueStep = new ch.psi.pshell.swing.RegisterPanel(); + valueCount = new ch.psi.pshell.swing.RegisterPanel(); + valueWidth = new ch.psi.pshell.swing.RegisterPanel(); jLabel11 = new javax.swing.JLabel(); - comboPass = new javax.swing.JComboBox(); jPanel10 = new javax.swing.JPanel(); jLabel34 = new javax.swing.JLabel(); - valueLowTY = new ch.psi.pshell.swing.ValueSelection(); jLabel35 = new javax.swing.JLabel(); - valueCenterTY = new ch.psi.pshell.swing.ValueSelection(); jLabel36 = new javax.swing.JLabel(); - valueHighTY = new ch.psi.pshell.swing.ValueSelection(); jLabel37 = new javax.swing.JLabel(); - valueWidthTY = new ch.psi.pshell.swing.ValueSelection(); - valueCountTY = new ch.psi.pshell.swing.ValueSelection(); jLabel38 = new javax.swing.JLabel(); jLabel39 = new javax.swing.JLabel(); - valueStepTY = new ch.psi.pshell.swing.ValueSelection(); + valueLowTY = new ch.psi.pshell.swing.RegisterPanel(); + valueCenterTY = new ch.psi.pshell.swing.RegisterPanel(); + valueHighTY = new ch.psi.pshell.swing.RegisterPanel(); + valueStepTY = new ch.psi.pshell.swing.RegisterPanel(); + valueWidthTY = new ch.psi.pshell.swing.RegisterPanel(); + valueCountTY = new ch.psi.pshell.swing.RegisterPanel(); jPanel11 = new javax.swing.JPanel(); jLabel40 = new javax.swing.JLabel(); jLabel41 = new javax.swing.JLabel(); - valueCenterTX = new ch.psi.pshell.swing.ValueSelection(); jLabel42 = new javax.swing.JLabel(); jLabel43 = new javax.swing.JLabel(); - valueWidthTX = new ch.psi.pshell.swing.ValueSelection(); - valueCountTX = new ch.psi.pshell.swing.ValueSelection(); jLabel44 = new javax.swing.JLabel(); jLabel45 = new javax.swing.JLabel(); - valueStepTX = new ch.psi.pshell.swing.ValueSelection(); - valueHighTX = new ch.psi.pshell.swing.ValueSelection(); - valueLowTX = new ch.psi.pshell.swing.ValueSelection(); + valueLowTX = new ch.psi.pshell.swing.RegisterPanel(); + valueCenterTX = new ch.psi.pshell.swing.RegisterPanel(); + valueHighTX = new ch.psi.pshell.swing.RegisterPanel(); + valueStepTX = new ch.psi.pshell.swing.RegisterPanel(); + valueWidthTX = new ch.psi.pshell.swing.RegisterPanel(); + valueCountTX = new ch.psi.pshell.swing.RegisterPanel(); jLabel46 = new javax.swing.JLabel(); - textEst = new javax.swing.JTextField(); jLabel9 = new javax.swing.JLabel(); - valuExcit = new ch.psi.pshell.swing.ValueSelection(); + comboLens = new ch.psi.pshell.swing.DiscretePositionerSelector(); + comboAcquisition = new ch.psi.pshell.swing.DiscretePositionerSelector(); + comboEnergy = new ch.psi.pshell.swing.DiscretePositionerSelector(); + comboDetector = new ch.psi.pshell.swing.DiscretePositionerSelector(); + comboElement = new ch.psi.pshell.swing.DiscretePositionerSelector(); + comboPass = new ch.psi.pshell.swing.DiscretePositionerSelector(); + valueExcit = new ch.psi.pshell.swing.RegisterPanel(); + valueEst = new ch.psi.pshell.swing.RegisterPanel(); jPanel7 = new javax.swing.JPanel(); jLabel10 = new javax.swing.JLabel(); - valueSlices = new ch.psi.pshell.swing.ValueSelection(); buttonZeroSupplies = new javax.swing.JButton(); jLabel17 = new javax.swing.JLabel(); - valueChannels = new ch.psi.pshell.swing.ValueSelection(); + valueSlices = new ch.psi.pshell.swing.RegisterPanel(); + valueChannels = new ch.psi.pshell.swing.RegisterPanel(); jPanel5 = new javax.swing.JPanel(); progress = new javax.swing.JProgressBar(); jLabel6 = new javax.swing.JLabel(); - valueCurrent = new ch.psi.pshell.swing.ValueSelection(); jLabel16 = new javax.swing.JLabel(); - valueTotal = new ch.psi.pshell.swing.ValueSelection(); jLabel7 = new javax.swing.JLabel(); jLabel18 = new javax.swing.JLabel(); - valueImageCounter = new ch.psi.pshell.swing.ValueSelection(); jLabel19 = new javax.swing.JLabel(); - textState = new javax.swing.JTextField(); - textStatus = new javax.swing.JTextField(); + valueCurrent = new ch.psi.pshell.swing.RegisterPanel(); + valueTotal = new ch.psi.pshell.swing.RegisterPanel(); + valueState = new ch.psi.pshell.swing.RegisterPanel(); + valueStatus = new ch.psi.pshell.swing.RegisterPanel(); + valueImageCounter = new ch.psi.pshell.swing.RegisterPanel(); cameraPanel.setBorder(null); @@ -409,98 +199,41 @@ public final class ScientaPanel extends DevicePanel { jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel1.setText("Lens:"); - comboLens.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); - comboLens.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - comboLensActionPerformed(evt); - } - }); - jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel2.setText("Acquisition:"); - comboAcquisition.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); - comboAcquisition.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - comboAcquisitionActionPerformed(evt); - } - }); - jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel3.setText("Energy Mode:"); - comboEnergy.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); - comboEnergy.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - comboEnergyActionPerformed(evt); - } - }); - jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel4.setText("Detector:"); - comboDetector.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); - comboDetector.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - comboDetectorActionPerformed(evt); - } - }); - jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel5.setText("Element:"); - comboElement.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); - comboElement.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - comboElementActionPerformed(evt); - } - }); - jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Energy")); jLabel12.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel12.setText("Low:"); - valueLow.setDecimals(3); - valueLow.setShowButtons(false); - jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel13.setText("Center:"); - valueCenter.setDecimals(3); - valueCenter.setMinValue(0.0); - valueCenter.setShowButtons(false); - jLabel14.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel14.setText("High:"); - valueHigh.setDecimals(3); - valueHigh.setShowButtons(false); - jLabel15.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel15.setText("Width:"); - valueWidth.setDecimals(3); - valueWidth.setEnabled(false); - valueWidth.setMaxValue(2000.0); - valueWidth.setMinValue(0.0); - valueWidth.setShowButtons(false); - - valueCount.setDecimals(3); - valueCount.setEnabled(false); - valueCount.setMaxValue(2000.0); - valueCount.setShowButtons(false); - jLabel20.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel20.setText("Count:"); jLabel33.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel33.setText("Step:"); - valueStep.setDecimals(3); - valueStep.setMaxValue(2000.0); - valueStep.setMinValue(0.0); - valueStep.setShowButtons(false); + valueCount.setReadOnly(true); + + valueWidth.setReadOnly(true); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); @@ -517,22 +250,24 @@ public final class ScientaPanel extends DevicePanel { .addComponent(jLabel20, javax.swing.GroupLayout.Alignment.TRAILING)) .addComponent(jLabel33)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(valueWidth, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(valueCount, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(valueHigh, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(valueCenter, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(valueLow, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(valueStep, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(valueCenter, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(valueHigh, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(valueStep, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(valueWidth, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(valueCount, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(valueLow, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); jPanel4Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel12, jLabel13, jLabel14, jLabel15, jLabel20, jLabel33}); + jPanel4Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {valueCenter, valueCount, valueHigh, valueLow, valueStep, valueWidth}); + jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() - .addGap(4, 4, 4) + .addGap(6, 6, 6) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabel12) .addComponent(valueLow, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) @@ -542,8 +277,8 @@ public final class ScientaPanel extends DevicePanel { .addComponent(valueCenter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(jLabel14) - .addComponent(valueHigh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(valueHigh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel14)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabel33) @@ -562,65 +297,29 @@ public final class ScientaPanel extends DevicePanel { jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel11.setText("Pass Energy:"); - comboPass.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "2", "5", "10", "20", "50", "100", "200" })); - comboPass.setToolTipText(""); - comboPass.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - comboPassActionPerformed(evt); - } - }); - jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder("Theta Y")); jLabel34.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel34.setText("Low:"); - valueLowTY.setDecimals(3); - valueLowTY.setMaxValue(1000.0); - valueLowTY.setMinValue(-1000.0); - valueLowTY.setShowButtons(false); - jLabel35.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel35.setText("Center:"); - valueCenterTY.setDecimals(3); - valueCenterTY.setMaxValue(1000.0); - valueCenterTY.setMinValue(-1000.0); - valueCenterTY.setShowButtons(false); - jLabel36.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel36.setText("High:"); - valueHighTY.setDecimals(3); - valueHighTY.setMaxValue(1000.0); - valueHighTY.setMinValue(-1000.0); - valueHighTY.setShowButtons(false); - jLabel37.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel37.setText("Width:"); - valueWidthTY.setDecimals(3); - valueWidthTY.setEnabled(false); - valueWidthTY.setMaxValue(2000.0); - valueWidthTY.setMinValue(0.0); - valueWidthTY.setShowButtons(false); - - valueCountTY.setDecimals(3); - valueCountTY.setEnabled(false); - valueCountTY.setMaxValue(2000.0); - valueCountTY.setMinValue(0.0); - valueCountTY.setShowButtons(false); - jLabel38.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel38.setText("Count:"); jLabel39.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel39.setText("Step:"); - valueStepTY.setDecimals(3); - valueStepTY.setMaxValue(2000.0); - valueStepTY.setMinValue(0.0); - valueStepTY.setShowButtons(false); + valueWidthTY.setReadOnly(true); + + valueCountTY.setReadOnly(true); javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10); jPanel10.setLayout(jPanel10Layout); @@ -636,13 +335,13 @@ public final class ScientaPanel extends DevicePanel { .addComponent(jLabel37) .addComponent(jLabel38)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(valueWidthTY, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(valueCountTY, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(valueHighTY, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(valueCenterTY, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(valueLowTY, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(valueStepTY, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(valueCenterTY, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(valueHighTY, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(valueStepTY, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(valueWidthTY, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(valueCountTY, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(valueLowTY, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); @@ -651,7 +350,7 @@ public final class ScientaPanel extends DevicePanel { jPanel10Layout.setVerticalGroup( jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel10Layout.createSequentialGroup() - .addGap(4, 4, 4) + .addGap(6, 6, 6) .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabel34) .addComponent(valueLowTY, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) @@ -686,52 +385,27 @@ public final class ScientaPanel extends DevicePanel { jLabel41.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel41.setText("Center:"); - valueCenterTX.setDecimals(3); - valueCenterTX.setMaxValue(1000.0); - valueCenterTX.setMinValue(-1000.0); - valueCenterTX.setShowButtons(false); - jLabel42.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel42.setText("High:"); jLabel43.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel43.setText("Width:"); - valueWidthTX.setDecimals(3); - valueWidthTX.setEnabled(false); - valueWidthTX.setMaxValue(2000.0); - valueWidthTX.setMinValue(0.0); - valueWidthTX.setShowButtons(false); - - valueCountTX.setDecimals(3); - valueCountTX.setEnabled(false); - valueCountTX.setMaxValue(2000.0); - valueCountTX.setMinValue(0.0); - valueCountTX.setShowButtons(false); - jLabel44.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel44.setText("Count:"); jLabel45.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel45.setText("Step:"); - valueStepTX.setDecimals(3); - valueStepTX.setEnabled(false); - valueStepTX.setMaxValue(2000.0); - valueStepTX.setMinValue(0.0); - valueStepTX.setShowButtons(false); + valueLowTX.setReadOnly(true); - valueHighTX.setDecimals(3); - valueHighTX.setEnabled(false); - valueHighTX.setMaxValue(1000.0); - valueHighTX.setMinValue(-1000.0); - valueHighTX.setShowButtons(false); + valueHighTX.setReadOnly(true); - valueLowTX.setDecimals(3); - valueLowTX.setEnabled(false); - valueLowTX.setMaxValue(1000.0); - valueLowTX.setMinValue(-1000.0); - valueLowTX.setShowButtons(false); + valueStepTX.setReadOnly(true); + + valueWidthTX.setReadOnly(true); + + valueCountTX.setReadOnly(true); javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11); jPanel11.setLayout(jPanel11Layout); @@ -747,13 +421,13 @@ public final class ScientaPanel extends DevicePanel { .addComponent(jLabel40, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel41, javax.swing.GroupLayout.Alignment.TRAILING)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(valueCenterTX, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(valueStepTX, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(valueHighTX, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(valueLowTX, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(valueWidthTX, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(valueCountTX, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(valueCenterTX, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(valueHighTX, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(valueStepTX, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(valueWidthTX, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(valueCountTX, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(valueLowTX, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); @@ -762,7 +436,7 @@ public final class ScientaPanel extends DevicePanel { jPanel11Layout.setVerticalGroup( jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel11Layout.createSequentialGroup() - .addGap(4, 4, 4) + .addGap(6, 6, 6) .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabel40) .addComponent(valueLowTX, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) @@ -792,15 +466,10 @@ public final class ScientaPanel extends DevicePanel { jLabel46.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel46.setText("Time Estimated:"); - textEst.setEditable(false); - jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel9.setText("Excit.:"); - valuExcit.setDecimals(3); - valuExcit.setMaxValue(2000.0); - valuExcit.setMinValue(0.0); - valuExcit.setShowButtons(false); + valueEst.setReadOnly(true); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); @@ -825,71 +494,60 @@ public final class ScientaPanel extends DevicePanel { .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(comboLens, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(comboAcquisition, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(comboEnergy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(comboLens, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(comboAcquisition, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel5) .addComponent(jLabel4))) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addGap(0, 0, Short.MAX_VALUE) - .addComponent(jLabel11)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addComponent(valuExcit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(valueExcit, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) + .addComponent(comboEnergy, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jLabel46))) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel11, javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel46, javax.swing.GroupLayout.Alignment.TRAILING)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(comboPass, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(comboElement, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(comboDetector, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(textEst, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(comboDetector, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE) + .addComponent(comboElement, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE) + .addComponent(comboPass, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE) + .addComponent(valueEst, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)))) .addContainerGap()) ); - jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel1, jLabel2, jLabel3, jLabel4, jLabel5}); + jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel1, jLabel11, jLabel2, jLabel3, jLabel4, jLabel46, jLabel5}); - jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {comboAcquisition, comboDetector, comboElement, comboEnergy, comboLens, comboPass, textEst, valuExcit}); + jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {comboAcquisition, comboDetector, comboElement, comboEnergy, comboLens, comboPass}); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(4, 4, 4) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel1) - .addComponent(comboLens, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel2) - .addComponent(comboAcquisition, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel4) - .addComponent(comboDetector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel5) - .addComponent(comboElement, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) + .addComponent(jLabel1) + .addComponent(comboLens, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel4) + .addComponent(comboDetector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel3) - .addComponent(comboEnergy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(valuExcit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(comboPass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel11)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel46) - .addComponent(textEst, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel9)))) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) + .addComponent(jLabel2) + .addComponent(comboAcquisition, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel5) + .addComponent(comboElement, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) + .addComponent(jLabel3) + .addComponent(comboEnergy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel11) + .addComponent(comboPass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) + .addComponent(jLabel9) + .addComponent(jLabel46) + .addComponent(valueExcit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(valueEst, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) @@ -903,11 +561,6 @@ public final class ScientaPanel extends DevicePanel { jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel10.setText("Slices:"); - valueSlices.setDecimals(0); - valueSlices.setMaxValue(10000.0); - valueSlices.setMinValue(0.0); - valueSlices.setShowButtons(false); - buttonZeroSupplies.setText("Zero Supplies"); buttonZeroSupplies.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -918,11 +571,6 @@ public final class ScientaPanel extends DevicePanel { jLabel17.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel17.setText("Channels:"); - valueChannels.setDecimals(0); - valueChannels.setMaxValue(10000.0); - valueChannels.setMinValue(0.0); - valueChannels.setShowButtons(false); - javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7); jPanel7.setLayout(jPanel7Layout); jPanel7Layout.setHorizontalGroup( @@ -931,30 +579,28 @@ public final class ScientaPanel extends DevicePanel { .addContainerGap() .addComponent(jLabel10) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(valueSlices, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(valueSlices, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel17) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(valueChannels, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, Short.MAX_VALUE) - .addComponent(buttonZeroSupplies, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(valueChannels, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) + .addGap(50, 50, 50) + .addComponent(buttonZeroSupplies, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); jPanel7Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel10, jLabel17}); - jPanel7Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {valueChannels, valueSlices}); - jPanel7Layout.setVerticalGroup( jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup() .addGap(4, 4, 4) .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabel10) - .addComponent(valueSlices, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel17) - .addComponent(valueChannels, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(buttonZeroSupplies)) + .addComponent(buttonZeroSupplies) + .addComponent(valueSlices, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(valueChannels, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); @@ -964,35 +610,23 @@ public final class ScientaPanel extends DevicePanel { jLabel6.setText("Current step:"); - valueCurrent.setDecimals(0); - valueCurrent.setEnabled(false); - valueCurrent.setMaxValue(100000.0); - valueCurrent.setMinValue(0.0); - valueCurrent.setShowButtons(false); - jLabel16.setText("Total:"); - valueTotal.setDecimals(0); - valueTotal.setEnabled(false); - valueTotal.setMaxValue(100000.0); - valueTotal.setMinValue(0.0); - valueTotal.setShowButtons(false); - jLabel7.setText("Det. State:"); jLabel18.setText("Image Counter:"); - valueImageCounter.setDecimals(0); - valueImageCounter.setEnabled(false); - valueImageCounter.setMaxValue(100000.0); - valueImageCounter.setMinValue(0.0); - valueImageCounter.setShowButtons(false); - jLabel19.setText("Status:"); - textState.setEditable(false); + valueCurrent.setReadOnly(true); - textStatus.setEditable(false); + valueTotal.setReadOnly(true); + + valueState.setReadOnly(true); + + valueStatus.setReadOnly(true); + + valueImageCounter.setReadOnly(true); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); @@ -1004,52 +638,50 @@ public final class ScientaPanel extends DevicePanel { .addGroup(jPanel5Layout.createSequentialGroup() .addComponent(jLabel6) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(valueCurrent, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, 18) + .addComponent(valueCurrent, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel16) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(valueTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(12, 12, 12) - .addComponent(valueTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, 18) .addComponent(progress, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel5Layout.createSequentialGroup() .addComponent(jLabel19) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(textStatus)) + .addComponent(valueStatus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel5Layout.createSequentialGroup() .addComponent(jLabel7) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(textState) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jLabel18) + .addComponent(valueState, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(valueImageCounter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addComponent(jLabel18) + .addGap(6, 6, 6) + .addComponent(valueImageCounter, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); jPanel5Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel19, jLabel6, jLabel7}); - jPanel5Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {valueCurrent, valueImageCounter, valueTotal}); - jPanel5Layout.setVerticalGroup( jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabel7) + .addComponent(valueState, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel18) - .addComponent(valueImageCounter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(textState, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(valueImageCounter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabel19) - .addComponent(textStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(valueStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) .addComponent(jLabel6) .addComponent(valueCurrent, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel16) .addComponent(valueTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(progress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel16)) + .addComponent(progress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); @@ -1068,8 +700,8 @@ public final class ScientaPanel extends DevicePanel { .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, 0) - .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) ); javax.swing.GroupLayout scientaPanelLayout = new javax.swing.GroupLayout(scientaPanel); @@ -1099,83 +731,6 @@ public final class ScientaPanel extends DevicePanel { ); }// //GEN-END:initComponents - private void comboLensActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboLensActionPerformed - try { - if (!isBackgroundUpdate()) { - Scienta.LensMode mode = (Scienta.LensMode) comboLens.getSelectedItem(); - if (mode != null) { - getDevice().setLensMode(mode); - } - } - } catch (Exception ex) { - showException(ex); - } - - }//GEN-LAST:event_comboLensActionPerformed - - private void comboAcquisitionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboAcquisitionActionPerformed - try { - if (!isBackgroundUpdate()) { - Scienta.AcquisitionMode mode = (Scienta.AcquisitionMode) comboAcquisition.getSelectedItem(); - if (mode != null) { - getDevice().setAcquisitionMode(mode); - } - } - } catch (Exception ex) { - showException(ex); - } - }//GEN-LAST:event_comboAcquisitionActionPerformed - - private void comboEnergyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboEnergyActionPerformed - try { - if (!isBackgroundUpdate()) { - Scienta.EnergyMode mode = (Scienta.EnergyMode) comboEnergy.getSelectedItem(); - if (mode != null) { - getDevice().setEnergyMode(mode); - } - } - } catch (Exception ex) { - showException(ex); - } - }//GEN-LAST:event_comboEnergyActionPerformed - - private void comboDetectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboDetectorActionPerformed - try { - if (!isBackgroundUpdate()) { - Scienta.DetectorMode mode = (Scienta.DetectorMode) comboDetector.getSelectedItem(); - if (mode != null) { - getDevice().setDetectorMode(mode); - } - } - } catch (Exception ex) { - showException(ex); - } - }//GEN-LAST:event_comboDetectorActionPerformed - - private void comboElementActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboElementActionPerformed - try { - if (!isBackgroundUpdate()) { - Scienta.ElementSet mode = (Scienta.ElementSet) comboElement.getSelectedItem(); - if (mode != null) { - getDevice().setElementSet(mode); - } - } - } catch (Exception ex) { - showException(ex); - } - }//GEN-LAST:event_comboElementActionPerformed - - private void comboPassActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboPassActionPerformed - try { - if (!isBackgroundUpdate()) { - int val = (int) comboPass.getSelectedItem(); - getDevice().setPassEnergy(val); - } - } catch (Exception ex) { - showException(ex); - } - }//GEN-LAST:event_comboPassActionPerformed - private void buttonZeroSuppliesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonZeroSuppliesActionPerformed try { getDevice().zeroSupplies(); @@ -1187,12 +742,12 @@ public final class ScientaPanel extends DevicePanel { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton buttonZeroSupplies; private ch.psi.pshell.swing.CameraPanel cameraPanel; - private javax.swing.JComboBox comboAcquisition; - private javax.swing.JComboBox comboDetector; - private javax.swing.JComboBox comboElement; - private javax.swing.JComboBox comboEnergy; - private javax.swing.JComboBox comboLens; - private javax.swing.JComboBox comboPass; + private ch.psi.pshell.swing.DiscretePositionerSelector comboAcquisition; + private ch.psi.pshell.swing.DiscretePositionerSelector comboDetector; + private ch.psi.pshell.swing.DiscretePositionerSelector comboElement; + private ch.psi.pshell.swing.DiscretePositionerSelector comboEnergy; + private ch.psi.pshell.swing.DiscretePositionerSelector comboLens; + private ch.psi.pshell.swing.DiscretePositionerSelector comboPass; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel11; @@ -1235,32 +790,32 @@ public final class ScientaPanel extends DevicePanel { private javax.swing.JPanel jPanel7; private javax.swing.JProgressBar progress; private javax.swing.JPanel scientaPanel; - private javax.swing.JTextField textEst; - private javax.swing.JTextField textState; - private javax.swing.JTextField textStatus; - private ch.psi.pshell.swing.ValueSelection valuExcit; - private ch.psi.pshell.swing.ValueSelection valueCenter; - private ch.psi.pshell.swing.ValueSelection valueCenterTX; - private ch.psi.pshell.swing.ValueSelection valueCenterTY; - private ch.psi.pshell.swing.ValueSelection valueChannels; - private ch.psi.pshell.swing.ValueSelection valueCount; - private ch.psi.pshell.swing.ValueSelection valueCountTX; - private ch.psi.pshell.swing.ValueSelection valueCountTY; - private ch.psi.pshell.swing.ValueSelection valueCurrent; - private ch.psi.pshell.swing.ValueSelection valueHigh; - private ch.psi.pshell.swing.ValueSelection valueHighTX; - private ch.psi.pshell.swing.ValueSelection valueHighTY; - private ch.psi.pshell.swing.ValueSelection valueImageCounter; - private ch.psi.pshell.swing.ValueSelection valueLow; - private ch.psi.pshell.swing.ValueSelection valueLowTX; - private ch.psi.pshell.swing.ValueSelection valueLowTY; - private ch.psi.pshell.swing.ValueSelection valueSlices; - private ch.psi.pshell.swing.ValueSelection valueStep; - private ch.psi.pshell.swing.ValueSelection valueStepTX; - private ch.psi.pshell.swing.ValueSelection valueStepTY; - private ch.psi.pshell.swing.ValueSelection valueTotal; - private ch.psi.pshell.swing.ValueSelection valueWidth; - private ch.psi.pshell.swing.ValueSelection valueWidthTX; - private ch.psi.pshell.swing.ValueSelection valueWidthTY; + private ch.psi.pshell.swing.RegisterPanel valueCenter; + private ch.psi.pshell.swing.RegisterPanel valueCenterTX; + private ch.psi.pshell.swing.RegisterPanel valueCenterTY; + private ch.psi.pshell.swing.RegisterPanel valueChannels; + private ch.psi.pshell.swing.RegisterPanel valueCount; + private ch.psi.pshell.swing.RegisterPanel valueCountTX; + private ch.psi.pshell.swing.RegisterPanel valueCountTY; + private ch.psi.pshell.swing.RegisterPanel valueCurrent; + private ch.psi.pshell.swing.RegisterPanel valueEst; + private ch.psi.pshell.swing.RegisterPanel valueExcit; + private ch.psi.pshell.swing.RegisterPanel valueHigh; + private ch.psi.pshell.swing.RegisterPanel valueHighTX; + private ch.psi.pshell.swing.RegisterPanel valueHighTY; + private ch.psi.pshell.swing.RegisterPanel valueImageCounter; + private ch.psi.pshell.swing.RegisterPanel valueLow; + private ch.psi.pshell.swing.RegisterPanel valueLowTX; + private ch.psi.pshell.swing.RegisterPanel valueLowTY; + private ch.psi.pshell.swing.RegisterPanel valueSlices; + private ch.psi.pshell.swing.RegisterPanel valueState; + private ch.psi.pshell.swing.RegisterPanel valueStatus; + private ch.psi.pshell.swing.RegisterPanel valueStep; + private ch.psi.pshell.swing.RegisterPanel valueStepTX; + private ch.psi.pshell.swing.RegisterPanel valueStepTY; + private ch.psi.pshell.swing.RegisterPanel valueTotal; + private ch.psi.pshell.swing.RegisterPanel valueWidth; + private ch.psi.pshell.swing.RegisterPanel valueWidthTX; + private ch.psi.pshell.swing.RegisterPanel valueWidthTY; // End of variables declaration//GEN-END:variables }