Closedown
This commit is contained in:
@@ -20,23 +20,19 @@
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="panelPlot" max="32767" attributes="0"/>
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jPanel2" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="panelParameters" max="32767" attributes="0"/>
|
||||
<Component id="panelData" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jPanel1" max="32767" attributes="0"/>
|
||||
<Component id="jPanel3" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="panelData" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="panelParameters" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@@ -46,32 +42,24 @@
|
||||
<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" max="-2" attributes="0">
|
||||
<Component id="panelParameters" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="panelData" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="panelParameters" min="-2" pref="157" max="-2" attributes="0"/>
|
||||
<Component id="jPanel1" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jPanel1" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="jPanel3" max="32767" attributes="0"/>
|
||||
<Component id="panelData" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jPanel3" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jPanel2" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="panelPlot" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="panelPlot">
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="panelParameters">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
@@ -97,7 +85,7 @@
|
||||
<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>
|
||||
<EmptySpace type="separate" pref="29" max="32767" attributes="0"/>
|
||||
<EmptySpace type="separate" 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"/>
|
||||
@@ -111,7 +99,7 @@
|
||||
<Component id="spinnerOffset" linkSize="5" alignment="1" max="-2" attributes="0"/>
|
||||
<Component id="spinnerAlpha" linkSize="5" alignment="1" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="23" max="32767" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -274,7 +262,7 @@
|
||||
<Component id="buttonConfigure" linkSize="6" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="comboRunType" linkSize="6" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="23" max="32767" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -293,7 +281,7 @@
|
||||
<Component id="jLabel11" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="comboRunType" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<EmptySpace pref="15" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -369,6 +357,7 @@
|
||||
<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"/>
|
||||
<Component id="buttonPlot" linkSize="7" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
@@ -388,6 +377,8 @@
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="radioI0" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="buttonPlot" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -452,6 +443,14 @@
|
||||
<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">
|
||||
@@ -481,7 +480,7 @@
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="buttonDefaults" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@@ -500,7 +499,7 @@
|
||||
<Component id="textFolder" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonDefaults" alignment="3" min="-2" pref="27" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -561,7 +560,7 @@
|
||||
<Component id="buttonExecute" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="buttonAbort" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) 2014 Paul Scherrer Institute. All rights reserved.
|
||||
*/
|
||||
|
||||
import ch.psi.pshell.core.Controller;
|
||||
import ch.psi.pshell.core.Controller.ControllerStateException;
|
||||
import ch.psi.pshell.core.PlotDescriptor;
|
||||
import ch.psi.pshell.dev.Device;
|
||||
@@ -11,7 +10,6 @@ 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.LinePlotJFree;
|
||||
import ch.psi.pshell.plot.LinePlotSeries;
|
||||
import ch.psi.pshell.plot.Plot;
|
||||
import ch.psi.utils.swing.MonitoredPanel;
|
||||
@@ -83,9 +81,37 @@ public class EnergyScan extends Panel {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onApplicationStateChange(State state, State former) {
|
||||
protected void onStateChange(State state, State former) {
|
||||
getComponent().setEnabled(state == State.Ready);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onExecutedFile(String fileName, Object result){
|
||||
try {
|
||||
switch (fileName){
|
||||
case "EnergyScan":
|
||||
if (result instanceof Exception ){
|
||||
batchIndex=0;
|
||||
batch=null;
|
||||
throw ((Exception)result);
|
||||
}
|
||||
if (batch!=null){
|
||||
batchIndex++;
|
||||
if (batchIndex>=batch.length){
|
||||
batchIndex=0;
|
||||
batch=null;
|
||||
} else {
|
||||
panel.setMode(batch[batchIndex]);
|
||||
panel.run();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
SwingUtils.showException(panel, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void doUpdate() {
|
||||
@@ -106,9 +132,6 @@ public class EnergyScan extends Panel {
|
||||
Mode[] batch;
|
||||
int batchIndex;
|
||||
|
||||
LinePlotBase plot;
|
||||
LinePlotSeries series;
|
||||
|
||||
LinePlotBase scanPlot;
|
||||
LinePlotSeries scanSeries;
|
||||
|
||||
@@ -117,11 +140,6 @@ public class EnergyScan extends Panel {
|
||||
public PluginPanel() {
|
||||
initComponents();
|
||||
buttonDefaultsActionPerformed(null);
|
||||
plot = new LinePlotJFree();
|
||||
plot.setTitle("");
|
||||
series = new LinePlotSeries("data");
|
||||
plot.addSeries(series);
|
||||
panelPlot.add(plot);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -134,6 +152,7 @@ public class EnergyScan extends Panel {
|
||||
textFile.setEnabled(value);
|
||||
textFolder.setEnabled(value);
|
||||
buttonDefaults.setEnabled(value);
|
||||
buttonPlot.setEnabled(value);
|
||||
checkParameterControls();
|
||||
}
|
||||
|
||||
@@ -149,55 +168,52 @@ public class EnergyScan extends Panel {
|
||||
|
||||
void plot() {
|
||||
try {
|
||||
System.out.println("-------");
|
||||
System.out.println(count);
|
||||
Integer c = count.take();
|
||||
if (c == null) {
|
||||
series.clear();
|
||||
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) {
|
||||
series.clear();
|
||||
scanSeries.clear();
|
||||
if ((scanPlot!=null) &&(scanSeries!=null)&& scanPlot.isShowing()){
|
||||
Integer c = count.take();
|
||||
if (c == null) {
|
||||
scanSeries.clear();
|
||||
} else {
|
||||
edata.setSize(c);
|
||||
double[] xdata = edata.read();
|
||||
series.setData(xdata, ydata);
|
||||
scanSeries.setData(xdata, ydata);
|
||||
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) {
|
||||
SwingUtils.showException(this, ex);
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void loadConfig() {
|
||||
DefaultComboBoxModel model = (DefaultComboBoxModel) comboSetup.getModel();
|
||||
@@ -332,37 +348,18 @@ public class EnergyScan extends Panel {
|
||||
String folder = expandPath(textFolder.getText());
|
||||
args.put("FOLDER", folder);
|
||||
runAsync("EnergyScan", args);
|
||||
plot.getAxis(Plot.AxisId.X).setRange(Math.min(e1, e2), Math.max(e1, e2));
|
||||
scanPlot.getAxis(Plot.AxisId.X).setRange(Math.min(e1, e2), Math.max(e1, e2));
|
||||
if (scanPlot!=null){
|
||||
scanPlot.getAxis(Plot.AxisId.X).setRange(Math.min(e1, e2), Math.max(e1, e2));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void onExecutedFile(String fileName, Object result){
|
||||
try {
|
||||
switch (fileName){
|
||||
case "EnergyScan":
|
||||
if (result instanceof Exception ){
|
||||
batchIndex=0;
|
||||
batch=null;
|
||||
throw ((Exception)result);
|
||||
}
|
||||
if (batch!=null){
|
||||
batchIndex++;
|
||||
if (batchIndex>=batch.length){
|
||||
batchIndex=0;
|
||||
batch=null;
|
||||
} else {
|
||||
setMode(batch[batchIndex]);
|
||||
run();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
SwingUtils.showException(this, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void startPlot() throws Exception{
|
||||
PlotDescriptor descriptors = new PlotDescriptor("Scan Data");
|
||||
ArrayList<LinePlot> plots = getController().plot(new PlotDescriptor[]{descriptors},null);
|
||||
scanPlot = (LinePlotBase) plots.get(0);
|
||||
scanSeries = scanPlot.getSeries(0);
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -370,7 +367,6 @@ public class EnergyScan extends Panel {
|
||||
private void initComponents() {
|
||||
|
||||
buttonGroupPlot = new javax.swing.ButtonGroup();
|
||||
panelPlot = new javax.swing.JPanel();
|
||||
panelParameters = new javax.swing.JPanel();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
spinnerE1 = new javax.swing.JSpinner();
|
||||
@@ -398,6 +394,7 @@ public class EnergyScan extends Panel {
|
||||
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();
|
||||
@@ -408,8 +405,6 @@ public class EnergyScan extends Panel {
|
||||
buttonExecute = new javax.swing.JButton();
|
||||
buttonAbort = new javax.swing.JButton();
|
||||
|
||||
panelPlot.setLayout(new java.awt.BorderLayout());
|
||||
|
||||
panelParameters.setBorder(javax.swing.BorderFactory.createTitledBorder("Parameters"));
|
||||
|
||||
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
@@ -467,7 +462,7 @@ public class EnergyScan extends Panel {
|
||||
.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))
|
||||
.addGap(18, 29, Short.MAX_VALUE)
|
||||
.addGap(18, 18, 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)
|
||||
@@ -479,7 +474,7 @@ public class EnergyScan extends Panel {
|
||||
.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))
|
||||
.addContainerGap(23, Short.MAX_VALUE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
panelParametersLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {comboMode, spinnerE1, spinnerTime});
|
||||
@@ -556,7 +551,7 @@ public class EnergyScan extends Panel {
|
||||
.addComponent(comboSetup, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(buttonConfigure, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(comboRunType, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(23, Short.MAX_VALUE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonConfigure, comboRunType, comboSetup});
|
||||
@@ -574,7 +569,7 @@ public class EnergyScan extends Panel {
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel11)
|
||||
.addComponent(comboRunType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addContainerGap(15, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Plot Options"));
|
||||
@@ -621,6 +616,13 @@ public class EnergyScan extends Panel {
|
||||
}
|
||||
});
|
||||
|
||||
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(
|
||||
@@ -632,11 +634,12 @@ public class EnergyScan extends Panel {
|
||||
.addComponent(radioTFY)
|
||||
.addComponent(radioE)
|
||||
.addComponent(radioF)
|
||||
.addComponent(radioI0))
|
||||
.addComponent(radioI0)
|
||||
.addComponent(buttonPlot))
|
||||
.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.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonPlot, radioE, radioF, radioI0, radioTEY, radioTFY});
|
||||
|
||||
jPanel2Layout.setVerticalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
@@ -651,7 +654,9 @@ public class EnergyScan extends Panel {
|
||||
.addComponent(radioF)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(radioI0)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonPlot)
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
panelData.setBorder(javax.swing.BorderFactory.createTitledBorder("Data"));
|
||||
@@ -702,7 +707,7 @@ public class EnergyScan extends Panel {
|
||||
.addComponent(jLabel7)
|
||||
.addComponent(textFolder, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(buttonDefaults, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(4, 4, 4))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Scan Control"));
|
||||
@@ -739,56 +744,47 @@ public class EnergyScan extends Panel {
|
||||
.addComponent(buttonExecute)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(buttonAbort)
|
||||
.addGap(4, 4, 4))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(panelPlot, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(panelParameters, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(panelData, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
|
||||
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
||||
.addComponent(panelData, 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))
|
||||
.addContainerGap())
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(16, 16, 16)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(panelParameters, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(panelData, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
||||
.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)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(panelPlot, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(panelData, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.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))
|
||||
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addContainerGap())
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void buttonExecuteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonExecuteActionPerformed
|
||||
try {
|
||||
PlotDescriptor descriptors = new PlotDescriptor("Scan Data");
|
||||
ArrayList<LinePlot> plots = getController().plot(new PlotDescriptor[]{descriptors},null);
|
||||
scanPlot = (LinePlotBase) plots.get(0);
|
||||
scanSeries = plot.getSeries(0);
|
||||
|
||||
startPlot();
|
||||
batchIndex = 0;
|
||||
switch(comboRunType.getSelectedIndex()){
|
||||
case 5:
|
||||
@@ -860,12 +856,23 @@ public class EnergyScan extends Panel {
|
||||
textFolder.setText("{year}_{month}/{date}");
|
||||
}//GEN-LAST:event_buttonDefaultsActionPerformed
|
||||
|
||||
private void buttonPlotActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPlotActionPerformed
|
||||
try {
|
||||
startPlot();
|
||||
plot();
|
||||
} catch (Exception ex) {
|
||||
SwingUtils.showException(this, ex);
|
||||
}
|
||||
|
||||
}//GEN-LAST:event_buttonPlotActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton buttonAbort;
|
||||
private javax.swing.JButton buttonConfigure;
|
||||
private javax.swing.JButton buttonDefaults;
|
||||
private javax.swing.JButton buttonExecute;
|
||||
private javax.swing.ButtonGroup buttonGroupPlot;
|
||||
private javax.swing.JButton buttonPlot;
|
||||
private javax.swing.JComboBox comboMode;
|
||||
private javax.swing.JComboBox comboRunType;
|
||||
private javax.swing.JComboBox comboSetup;
|
||||
@@ -885,7 +892,6 @@ public class EnergyScan extends Panel {
|
||||
private javax.swing.JPanel jPanel3;
|
||||
private javax.swing.JPanel panelData;
|
||||
private javax.swing.JPanel panelParameters;
|
||||
private javax.swing.JPanel panelPlot;
|
||||
private javax.swing.JRadioButton radioE;
|
||||
private javax.swing.JRadioButton radioF;
|
||||
private javax.swing.JRadioButton radioI0;
|
||||
|
||||
Reference in New Issue
Block a user