Closedown
This commit is contained in:
+54
-159
@@ -29,11 +29,7 @@
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jPanel3" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="panelParameters" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jPanel2" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="panelParameters" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@@ -43,10 +39,7 @@
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="16" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jPanel2" linkSize="12" max="-2" attributes="0"/>
|
||||
<Component id="panelParameters" linkSize="12" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="panelParameters" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="panelData" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
@@ -74,30 +67,42 @@
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel5" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel3" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="spinnerE1" linkSize="2" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerTime" linkSize="2" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="comboMode" linkSize="2" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel5" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel3" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="spinnerE1" linkSize="2" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerTime" linkSize="2" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="comboMode" linkSize="2" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="checkSetOffset" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel9" linkSize="4" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel8" linkSize="4" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel4" linkSize="4" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" linkSize="4" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="spinnerE2" linkSize="5" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerDelay" linkSize="5" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerOffset" linkSize="5" alignment="1" max="-2" attributes="0"/>
|
||||
<Component id="spinnerAlpha" linkSize="5" alignment="1" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel9" linkSize="4" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel4" linkSize="4" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" linkSize="4" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="spinnerE2" linkSize="5" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerDelay" linkSize="5" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerAlpha" linkSize="5" alignment="1" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel8" linkSize="4" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spinnerOffset" linkSize="5" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
@@ -124,15 +129,16 @@
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="comboMode" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerOffset" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="spinnerAlpha" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerOffset" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="checkSetOffset" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -221,6 +227,7 @@
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0.0" maximum="20.0" minimum="-20.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel9">
|
||||
@@ -236,6 +243,14 @@
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="checkSetOffset">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Set Offset"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkSetOffsetActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="jPanel1">
|
||||
@@ -251,7 +266,7 @@
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<EmptySpace pref="22" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel10" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel11" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
@@ -265,7 +280,7 @@
|
||||
<Component id="buttonConfigure" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<EmptySpace pref="22" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -339,126 +354,6 @@
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="jPanel2">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
||||
<TitledBorder title="Plot Options"/>
|
||||
</Border>
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="radioTEY" linkSize="7" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="radioTFY" linkSize="7" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="radioE" linkSize="7" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="radioF" linkSize="7" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="radioI0" linkSize="7" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="buttonPlot" max="32767" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="radioTEY" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="radioTFY" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="radioE" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="radioF" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="radioI0" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="buttonPlot" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JRadioButton" name="radioTEY">
|
||||
<Properties>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="buttonGroupPlot"/>
|
||||
</Property>
|
||||
<Property name="selected" type="boolean" value="true"/>
|
||||
<Property name="text" type="java.lang.String" value="TEY"/>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[100, 22]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="radioPlotActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JRadioButton" name="radioTFY">
|
||||
<Properties>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="buttonGroupPlot"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="TFY"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="radioPlotActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JRadioButton" name="radioE">
|
||||
<Properties>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="buttonGroupPlot"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="TEYraw"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="radioPlotActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JRadioButton" name="radioF">
|
||||
<Properties>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="buttonGroupPlot"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="TFYraw"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="radioPlotActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JRadioButton" name="radioI0">
|
||||
<Properties>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="buttonGroupPlot"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="I0"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="radioPlotActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonPlot">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Plot"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonPlotActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="panelData">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
@@ -527,12 +422,12 @@
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<EmptySpace pref="22" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="buttonAbort" min="-2" pref="100" max="-2" attributes="0"/>
|
||||
<Component id="buttonExecute" min="-2" pref="100" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<EmptySpace pref="22" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
|
||||
+54
-265
@@ -15,14 +15,6 @@ import ch.psi.utils.State;
|
||||
import ch.psi.utils.swing.DsvEditor;
|
||||
import ch.psi.utils.swing.Editor.EditorDialog;
|
||||
import ch.psi.pshell.data.PlotDescriptor;
|
||||
import ch.psi.pshell.device.Device;
|
||||
import ch.psi.pshell.device.DeviceAdapter;
|
||||
import ch.psi.pshell.epics.ChannelDoubleArray;
|
||||
import ch.psi.pshell.epics.ChannelInteger;
|
||||
import ch.psi.pshell.plot.LinePlot;
|
||||
import ch.psi.pshell.plot.LinePlotBase;
|
||||
import ch.psi.pshell.plot.LinePlotSeries;
|
||||
import ch.psi.pshell.plot.Plot;
|
||||
import ch.psi.pshell.ui.Panel;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
@@ -38,44 +30,13 @@ public class EnergyScan extends Panel {
|
||||
buttonDefaultsActionPerformed(null);
|
||||
setBackgroundUpdate(true);
|
||||
}
|
||||
|
||||
ChannelDoubleArray data;
|
||||
ChannelDoubleArray edata;
|
||||
ChannelDoubleArray idata;
|
||||
ChannelDoubleArray fdata;
|
||||
ChannelInteger count;
|
||||
|
||||
double[] offsets = new double[4];
|
||||
/*
|
||||
//Overridable callbacks
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
loadConfig();
|
||||
}
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void onInitialize(int runCount) {
|
||||
super.onInitialize(runCount);
|
||||
|
||||
loadConfig();
|
||||
|
||||
count = (ChannelInteger) getController().getDevicePool().getByName("count");
|
||||
data = (ChannelDoubleArray) getController().getDevicePool().getByName("data");
|
||||
edata = (ChannelDoubleArray) getController().getDevicePool().getByName("edata");
|
||||
idata = (ChannelDoubleArray) getController().getDevicePool().getByName("idata");
|
||||
fdata = (ChannelDoubleArray) getController().getDevicePool().getByName("fdata");
|
||||
|
||||
|
||||
count.addListener(new DeviceAdapter() {
|
||||
@Override
|
||||
public void onValueChanged(Device device, Object value, Object former) {
|
||||
update();
|
||||
}
|
||||
});
|
||||
update();
|
||||
//loadConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -87,11 +48,6 @@ public class EnergyScan extends Panel {
|
||||
public void onExecutedFile(String fileName, Object result) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doUpdate() {
|
||||
plot();
|
||||
}
|
||||
|
||||
void stopScan() {
|
||||
try{
|
||||
getLogger().info("Stopping scan");
|
||||
@@ -116,9 +72,6 @@ public class EnergyScan extends Panel {
|
||||
Mode[] batch;
|
||||
int batchIndex;
|
||||
|
||||
LinePlotBase scanPlot;
|
||||
LinePlotSeries scanSeries;
|
||||
|
||||
@Override
|
||||
public void setEnabled(boolean value) {
|
||||
super.setEnabled(value);
|
||||
@@ -127,8 +80,7 @@ public class EnergyScan extends Panel {
|
||||
comboRunType.setEnabled(value);
|
||||
buttonConfigure.setEnabled(value);
|
||||
textFile.setEnabled(value);
|
||||
buttonDefaults.setEnabled(value);
|
||||
buttonPlot.setEnabled(value);
|
||||
buttonDefaults.setEnabled(value);
|
||||
checkParameterControls();
|
||||
}
|
||||
|
||||
@@ -140,58 +92,10 @@ public class EnergyScan extends Panel {
|
||||
}
|
||||
}
|
||||
spinnerAlpha.setEnabled(enabled && comboMode.getSelectedItem().equals("LINEAR"));
|
||||
spinnerOffset.setEnabled(checkSetOffset.isSelected() && enabled);
|
||||
}
|
||||
|
||||
void plot() {
|
||||
try {
|
||||
if ((scanPlot != null) && (scanSeries != null) && scanPlot.isShowing() && (count != null)) {
|
||||
//buttonGroupPlot.getSelection().
|
||||
Integer c = count.take();
|
||||
if (c == null) {
|
||||
scanSeries.clear();
|
||||
} else {
|
||||
double[] ydata = null;
|
||||
if (radioE.isSelected()) {
|
||||
data.setSize(c);
|
||||
ydata = data.read();
|
||||
} else if (radioF.isSelected()) {
|
||||
fdata.setSize(c);
|
||||
ydata = fdata.read();
|
||||
} else if (radioI0.isSelected()) {
|
||||
idata.setSize(c);
|
||||
ydata = idata.read();
|
||||
} else if (radioTEY.isSelected()) {
|
||||
data.setSize(c);
|
||||
idata.setSize(c);
|
||||
ydata = data.read();
|
||||
double[] i0 = idata.read();
|
||||
for (int i = 0; i < c; i++) {
|
||||
ydata[i] = (i0[i] == 0.0) ? Double.NaN : ydata[i] / i0[i];
|
||||
}
|
||||
} else if (radioTFY.isSelected()) {
|
||||
fdata.setSize(c);
|
||||
idata.setSize(c);
|
||||
ydata = fdata.read();
|
||||
double[] i0 = idata.read();
|
||||
for (int i = 0; i < c; i++) {
|
||||
ydata[i] = (i0[i] == 0.0) ? Double.NaN : ydata[i] / i0[i];
|
||||
}
|
||||
}
|
||||
if (ydata == null) {
|
||||
scanSeries.clear();
|
||||
} else {
|
||||
edata.setSize(c);
|
||||
double[] xdata = edata.read();
|
||||
scanSeries.setData(xdata, ydata);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void loadConfig() {
|
||||
DefaultComboBoxModel model = (DefaultComboBoxModel) comboSetup.getModel();
|
||||
model.removeAllElements();
|
||||
@@ -320,7 +224,7 @@ public class EnergyScan extends Panel {
|
||||
args.put("TIME", (Double) spinnerTime.getValue());
|
||||
args.put("DELAY", (Double) spinnerDelay.getValue());
|
||||
args.put("MODE", comboMode.getSelectedItem().toString());
|
||||
args.put("OFFSET", (Double) spinnerOffset.getValue());
|
||||
args.put("OFFSET", checkSetOffset.isSelected() ? (Double) spinnerOffset.getValue() : null);
|
||||
args.put("ALPHA", (Double) spinnerAlpha.getValue());
|
||||
|
||||
String file = expandPath(textFile.getText());
|
||||
@@ -353,17 +257,6 @@ public class EnergyScan extends Panel {
|
||||
}
|
||||
return ok;
|
||||
});
|
||||
|
||||
if (scanPlot != null) {
|
||||
scanPlot.getAxis(Plot.AxisId.X).setRange(Math.min(e1, e2), Math.max(e1, e2));
|
||||
}
|
||||
}
|
||||
|
||||
void startPlot() throws Exception {
|
||||
PlotDescriptor descriptors = new PlotDescriptor("Energy Scan");
|
||||
ArrayList<LinePlot> plots = getController().plot(new PlotDescriptor[]{descriptors}, null);
|
||||
scanPlot = (LinePlotBase) plots.get(0);
|
||||
scanSeries = scanPlot.getSeries(0);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -386,19 +279,13 @@ public class EnergyScan extends Panel {
|
||||
spinnerOffset = new javax.swing.JSpinner();
|
||||
jLabel9 = new javax.swing.JLabel();
|
||||
spinnerAlpha = new javax.swing.JSpinner();
|
||||
checkSetOffset = new javax.swing.JCheckBox();
|
||||
jPanel1 = new javax.swing.JPanel();
|
||||
comboSetup = new javax.swing.JComboBox();
|
||||
buttonConfigure = new javax.swing.JButton();
|
||||
jLabel10 = new javax.swing.JLabel();
|
||||
jLabel11 = new javax.swing.JLabel();
|
||||
comboRunType = new javax.swing.JComboBox();
|
||||
jPanel2 = new javax.swing.JPanel();
|
||||
radioTEY = new javax.swing.JRadioButton();
|
||||
radioTFY = new javax.swing.JRadioButton();
|
||||
radioE = new javax.swing.JRadioButton();
|
||||
radioF = new javax.swing.JRadioButton();
|
||||
radioI0 = new javax.swing.JRadioButton();
|
||||
buttonPlot = new javax.swing.JButton();
|
||||
panelData = new javax.swing.JPanel();
|
||||
buttonDefaults = new javax.swing.JButton();
|
||||
jLabel6 = new javax.swing.JLabel();
|
||||
@@ -443,39 +330,54 @@ public class EnergyScan extends Panel {
|
||||
jLabel8.setText("Offset:");
|
||||
|
||||
spinnerOffset.setModel(new javax.swing.SpinnerNumberModel(0.0d, -20.0d, 20.0d, 1.0d));
|
||||
spinnerOffset.setEnabled(false);
|
||||
|
||||
jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel9.setText("Alpha:");
|
||||
|
||||
spinnerAlpha.setModel(new javax.swing.SpinnerNumberModel(0.0d, 0.0d, 90.0d, 1.0d));
|
||||
|
||||
checkSetOffset.setText("Set Offset");
|
||||
checkSetOffset.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
checkSetOffsetActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout panelParametersLayout = new javax.swing.GroupLayout(panelParameters);
|
||||
panelParameters.setLayout(panelParametersLayout);
|
||||
panelParametersLayout.setHorizontalGroup(
|
||||
panelParametersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelParametersLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(panelParametersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelParametersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(spinnerE1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(spinnerTime, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(comboMode, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(panelParametersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(panelParametersLayout.createSequentialGroup()
|
||||
.addGroup(panelParametersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelParametersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(spinnerE1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(spinnerTime, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(comboMode, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addComponent(checkSetOffset))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(panelParametersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel9, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jLabel8, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelParametersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(spinnerE2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(spinnerDelay, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(spinnerOffset, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(spinnerAlpha, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelParametersLayout.createSequentialGroup()
|
||||
.addGroup(panelParametersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel9, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelParametersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(spinnerE2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(spinnerDelay, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(spinnerAlpha, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelParametersLayout.createSequentialGroup()
|
||||
.addComponent(jLabel8)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spinnerOffset, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
@@ -504,12 +406,13 @@ public class EnergyScan extends Panel {
|
||||
.addGroup(panelParametersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel5)
|
||||
.addComponent(comboMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel8)
|
||||
.addComponent(spinnerOffset, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(5, 5, 5)
|
||||
.addGroup(panelParametersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerAlpha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel9))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelParametersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel8)
|
||||
.addComponent(spinnerOffset, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(checkSetOffset))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
@@ -544,7 +447,7 @@ public class EnergyScan extends Panel {
|
||||
jPanel1Layout.setHorizontalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addContainerGap(22, Short.MAX_VALUE)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel10, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jLabel11, javax.swing.GroupLayout.Alignment.TRAILING))
|
||||
@@ -555,7 +458,7 @@ public class EnergyScan extends Panel {
|
||||
.addComponent(comboSetup, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(buttonConfigure)))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addContainerGap(22, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {comboRunType, comboSetup});
|
||||
@@ -575,96 +478,6 @@ public class EnergyScan extends Panel {
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Plot Options"));
|
||||
|
||||
buttonGroupPlot.add(radioTEY);
|
||||
radioTEY.setSelected(true);
|
||||
radioTEY.setText("TEY");
|
||||
radioTEY.setMinimumSize(new java.awt.Dimension(100, 22));
|
||||
radioTEY.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
radioPlotActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonGroupPlot.add(radioTFY);
|
||||
radioTFY.setText("TFY");
|
||||
radioTFY.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
radioPlotActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonGroupPlot.add(radioE);
|
||||
radioE.setText("TEYraw");
|
||||
radioE.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
radioPlotActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonGroupPlot.add(radioF);
|
||||
radioF.setText("TFYraw");
|
||||
radioF.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
radioPlotActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonGroupPlot.add(radioI0);
|
||||
radioI0.setText("I0");
|
||||
radioI0.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
radioPlotActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonPlot.setText("Plot");
|
||||
buttonPlot.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonPlotActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
|
||||
jPanel2.setLayout(jPanel2Layout);
|
||||
jPanel2Layout.setHorizontalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(radioTEY, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(radioTFY)
|
||||
.addComponent(radioE)
|
||||
.addComponent(radioF)
|
||||
.addComponent(radioI0))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonPlot, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jPanel2Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {radioE, radioF, radioI0, radioTEY, radioTFY});
|
||||
|
||||
jPanel2Layout.setVerticalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(radioTEY, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(radioTFY)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(radioE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(radioF)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(radioI0)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(buttonPlot)
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
panelData.setBorder(javax.swing.BorderFactory.createTitledBorder("File"));
|
||||
|
||||
buttonDefaults.setText("Default");
|
||||
@@ -722,11 +535,11 @@ public class EnergyScan extends Panel {
|
||||
jPanel3Layout.setHorizontalGroup(
|
||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addContainerGap(22, Short.MAX_VALUE)
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(buttonAbort, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(buttonExecute, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addContainerGap(22, Short.MAX_VALUE))
|
||||
);
|
||||
jPanel3Layout.setVerticalGroup(
|
||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
@@ -750,19 +563,14 @@ public class EnergyScan extends Panel {
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addComponent(panelParameters, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
||||
.addComponent(panelParameters, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGap(0, 0, 0))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(16, 16, 16)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(panelParameters, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(panelParameters, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(panelData, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
@@ -774,13 +582,10 @@ public class EnergyScan extends Panel {
|
||||
|
||||
layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jPanel1, jPanel3});
|
||||
|
||||
layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jPanel2, panelParameters});
|
||||
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void buttonExecuteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonExecuteActionPerformed
|
||||
try {
|
||||
startPlot();
|
||||
batchIndex = 0;
|
||||
switch (comboRunType.getSelectedIndex()) {
|
||||
case 5:
|
||||
@@ -853,10 +658,6 @@ public class EnergyScan extends Panel {
|
||||
checkParameterControls();
|
||||
}//GEN-LAST:event_comboModeActionPerformed
|
||||
|
||||
private void radioPlotActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioPlotActionPerformed
|
||||
plot();
|
||||
}//GEN-LAST:event_radioPlotActionPerformed
|
||||
|
||||
private void comboRunTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboRunTypeActionPerformed
|
||||
try {
|
||||
if (!isManualRun()) {
|
||||
@@ -872,15 +673,9 @@ public class EnergyScan extends Panel {
|
||||
textFile.setText("{el}_{mode}");
|
||||
}//GEN-LAST:event_buttonDefaultsActionPerformed
|
||||
|
||||
private void buttonPlotActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPlotActionPerformed
|
||||
try {
|
||||
startPlot();
|
||||
plot();
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
|
||||
}//GEN-LAST:event_buttonPlotActionPerformed
|
||||
private void checkSetOffsetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkSetOffsetActionPerformed
|
||||
spinnerOffset.setEnabled(checkSetOffset.isSelected());
|
||||
}//GEN-LAST:event_checkSetOffsetActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton buttonAbort;
|
||||
@@ -888,7 +683,7 @@ public class EnergyScan extends Panel {
|
||||
private javax.swing.JButton buttonDefaults;
|
||||
private javax.swing.JButton buttonExecute;
|
||||
private javax.swing.ButtonGroup buttonGroupPlot;
|
||||
private javax.swing.JButton buttonPlot;
|
||||
private javax.swing.JCheckBox checkSetOffset;
|
||||
private javax.swing.JComboBox comboMode;
|
||||
private javax.swing.JComboBox comboRunType;
|
||||
private javax.swing.JComboBox comboSetup;
|
||||
@@ -903,15 +698,9 @@ public class EnergyScan extends Panel {
|
||||
private javax.swing.JLabel jLabel8;
|
||||
private javax.swing.JLabel jLabel9;
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JPanel jPanel2;
|
||||
private javax.swing.JPanel jPanel3;
|
||||
private javax.swing.JPanel panelData;
|
||||
private javax.swing.JPanel panelParameters;
|
||||
private javax.swing.JRadioButton radioE;
|
||||
private javax.swing.JRadioButton radioF;
|
||||
private javax.swing.JRadioButton radioI0;
|
||||
private javax.swing.JRadioButton radioTEY;
|
||||
private javax.swing.JRadioButton radioTFY;
|
||||
private javax.swing.JSpinner spinnerAlpha;
|
||||
private javax.swing.JSpinner spinnerDelay;
|
||||
private javax.swing.JSpinner spinnerE1;
|
||||
|
||||
+56
-8
@@ -13,6 +13,37 @@ FILE = 'Fe_plus'
|
||||
ALPHA=0
|
||||
"""
|
||||
|
||||
p=None
|
||||
def start_plot():
|
||||
global p
|
||||
p = plot([None, None, None,None, None], ["TEY", "TFY", "TEYraw", "TFYraw", "I0"])
|
||||
|
||||
def update_plot():
|
||||
global p
|
||||
c = count.take()
|
||||
if c is None:
|
||||
for i in range(len(p)):
|
||||
p[i].getSeries(0).clear()
|
||||
else:
|
||||
data.setSize(c)
|
||||
fdata.setSize(c)
|
||||
idata.setSize(c)
|
||||
edata.setSize(c)
|
||||
teyr= data.read()
|
||||
tfyr= fdata.read()
|
||||
i0 = idata.read()
|
||||
x = edata.read()
|
||||
#from operator import truediv
|
||||
l = lambda x,y: (None if (y==0.0) else x/y) #truediv
|
||||
tey=map(l, teyr, i0)
|
||||
tfy=map(l, tfyr, i0)
|
||||
p[0].getSeries(0).setData(x, tey)
|
||||
p[1].getSeries(0).setData(x, tfy)
|
||||
p[2].getSeries(0).setData(x, teyr)
|
||||
p[3].getSeries(0).setData(x, tfyr)
|
||||
p[4].getSeries(0).setData(x, i0)
|
||||
|
||||
|
||||
|
||||
print "\nStarting energy scan - Parameters: ",
|
||||
print E1,E2,TIME,DELAY,str(MODE) ,str(OFFSET) ,str(FOLDER) ,str(FILE) ,str(ALPHA)
|
||||
@@ -39,7 +70,7 @@ if MODE is not None:
|
||||
pol_angle.write(ALPHA) #TODO: CAPUT
|
||||
wait_device(pol_done, "DONE") #TODO: NEEDED?
|
||||
if OFFSET is not None:
|
||||
pol_offset.write(OFFSET) #TODO: CAPUT
|
||||
#pol_offset.write(OFFSET) #TODO: CAPUT
|
||||
wait_device(pol_done, "DONE")
|
||||
|
||||
caput('E1', E1)
|
||||
@@ -50,31 +81,48 @@ set_energy (E1)
|
||||
caput('FILE', FILE)
|
||||
time.sleep(0.1)
|
||||
|
||||
open_valve()
|
||||
open_valve(0.0) #TODO: WHY WRITING AGAIN???
|
||||
#open_valve()
|
||||
#open_valve(0.0) #TODO: WHY WRITING AGAIN???
|
||||
|
||||
time.sleep(DELAY)
|
||||
|
||||
caput('START', '1')
|
||||
|
||||
#Post-actions
|
||||
wait_channel('START', 'STOP', type = 's')
|
||||
|
||||
time.sleep(2.0)
|
||||
print "Finished Energy scan"
|
||||
waiting = True
|
||||
def plot_task():
|
||||
global waiting
|
||||
pos=count.take()
|
||||
start_plot()
|
||||
while waiting:
|
||||
if count.take() != pos:
|
||||
update_plot()
|
||||
pos = count.take()
|
||||
time.sleep(0.1)
|
||||
|
||||
ret = fork(plot_task)
|
||||
try:
|
||||
#Post-actions
|
||||
wait_channel('START', 'STOP', type = 's')
|
||||
time.sleep(2.0)
|
||||
print "Finished Energy scan"
|
||||
finally:
|
||||
waiting = False
|
||||
join(ret)
|
||||
|
||||
#File convertion
|
||||
newName = folder + time.strftime("%Y%m%d_%H%M_", start) + FILE + "_0000.txt";
|
||||
name = getNewestFile()
|
||||
|
||||
if name == newest:
|
||||
if name == newest:#TODO: WHY WRITING AGAIN???
|
||||
|
||||
raise Exception("Data file not created")
|
||||
|
||||
if not os.path.isfile(name):
|
||||
raise Exception("Data file not found: " + name)
|
||||
|
||||
convert_file(name, newName)
|
||||
#plot_file(newName)
|
||||
print("Success")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user