OTF
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#Mon Nov 15 15:51:17 CET 2021
|
||||
LastRunDate=211115
|
||||
FileSequentialNumber=10022
|
||||
DaySequentialNumber=21
|
||||
#Tue Nov 16 11:05:36 CET 2021
|
||||
LastRunDate=211116
|
||||
FileSequentialNumber=10032
|
||||
DaySequentialNumber=10
|
||||
|
||||
162
plugins/OTF.form
162
plugins/OTF.form
@@ -54,15 +54,46 @@
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="228" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="checkCur1" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="checkCur2" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="103" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="530" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="checkCur1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="checkCur2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JCheckBox" name="checkCur1">
|
||||
<Properties>
|
||||
<Property name="selected" type="boolean" value="true"/>
|
||||
<Property name="text" type="java.lang.String" value="Sample Current"/>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
<Property name="name" type="java.lang.String" value="SampleCurrent" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="checkCur2">
|
||||
<Properties>
|
||||
<Property name="selected" type="boolean" value="true"/>
|
||||
<Property name="text" type="java.lang.String" value="Ref Current"/>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
<Property name="name" type="java.lang.String" value="RefCurrent" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="panelPositioner">
|
||||
<Properties>
|
||||
@@ -82,7 +113,7 @@
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jLabel4" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spinnerE1" max="32767" attributes="0"/>
|
||||
<Component id="spinnerE1" pref="110" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="jLabel5" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
@@ -99,26 +130,6 @@
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spinnerModulo" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="jLabel8" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spinnerMode" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="jLabel9" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel10" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel11" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel12" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="spinnerBeta1" max="32767" attributes="0"/>
|
||||
<Component id="spinnerBeta2" alignment="1" max="32767" attributes="0"/>
|
||||
<Component id="spinnerTheta1" max="32767" attributes="0"/>
|
||||
<Component id="spinnerTheta2" alignment="1" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@@ -127,11 +138,7 @@
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="spinnerMode" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="50" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="spinnerE1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
@@ -142,36 +149,16 @@
|
||||
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="spinnerBeta1" 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="jLabel10" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerBeta2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="spinnerTheta1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel11" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel12" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerTheta2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="50" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="spinnerTime" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="spinnerModulo" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="136" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="378" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -212,7 +199,7 @@
|
||||
<Component class="javax.swing.JSpinner" name="spinnerTime">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="1" maximum="1440" minimum="1" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
<SpinnerModel initial="1.0" maximum="1440.0" minimum="1.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
@@ -225,81 +212,10 @@
|
||||
<Component class="javax.swing.JSpinner" name="spinnerModulo">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="4" maximum="10" minimum="1" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
<SpinnerModel initial="1" maximum="10" minimum="1" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel8">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Mode:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerMode">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel type="list">
|
||||
<ListItem value="ENERGY"/>
|
||||
<ListItem value="ANGLE"/>
|
||||
</SpinnerModel>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spinnerModeStateChanged"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel9">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Beta1(deg):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerBeta1">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="-86.325" maximum="360.0" minimum="-360.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel10">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Beta2(deg):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerBeta2">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="-86.365" maximum="360.0" minimum="-360.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel11">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Theta1(deg):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerTheta1">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="87.345" maximum="360.0" minimum="-360.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerTheta2">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="87.37" maximum="360.0" minimum="-360.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel12">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Theta2(deg):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="jPanel3">
|
||||
|
||||
151
plugins/OTF.java
151
plugins/OTF.java
@@ -29,16 +29,10 @@ public class OTF extends Panel {
|
||||
for (Component c : SwingUtils.getComponentsByType(panelPositioner, JSpinner.class)) {
|
||||
c.setEnabled(enabled);
|
||||
}
|
||||
boolean energy = spinnerMode.getValue().equals("ENERGY");
|
||||
spinnerMode.setEnabled(enabled);
|
||||
spinnerTime.setEnabled(enabled);
|
||||
spinnerModulo.setEnabled(enabled);
|
||||
spinnerE1.setEnabled(enabled && energy);
|
||||
spinnerE2.setEnabled(enabled && energy);
|
||||
spinnerBeta1.setEnabled(enabled && !energy);
|
||||
spinnerBeta2.setEnabled(enabled && !energy);
|
||||
spinnerTheta1.setEnabled(enabled && !energy);
|
||||
spinnerTheta2.setEnabled(enabled && !energy);
|
||||
spinnerE1.setEnabled(enabled);
|
||||
spinnerE2.setEnabled(enabled);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -75,13 +69,9 @@ public class OTF extends Panel {
|
||||
}
|
||||
args.put("SENSORS", sensors);
|
||||
*/
|
||||
args.put("MODE", spinnerMode.getValue());
|
||||
args.put("MODE", "ENERGY");
|
||||
args.put("E1", spinnerE1.getValue());
|
||||
args.put("E2", spinnerE2.getValue());
|
||||
args.put("BETA1", spinnerBeta1.getValue());
|
||||
args.put("BETA2", spinnerBeta2.getValue());
|
||||
args.put("THETA1", spinnerTheta1.getValue());
|
||||
args.put("THETA2", spinnerTheta2.getValue());
|
||||
args.put("E2", spinnerE2.getValue());
|
||||
args.put("TIME", spinnerTime.getValue());
|
||||
args.put("MODULO", spinnerModulo.getValue());
|
||||
args.put("ENDSCAN", checkEndScan.isSelected());
|
||||
@@ -93,6 +83,8 @@ public class OTF extends Panel {
|
||||
private void initComponents() {
|
||||
|
||||
panelSensors = new javax.swing.JPanel();
|
||||
checkCur1 = new javax.swing.JCheckBox();
|
||||
checkCur2 = new javax.swing.JCheckBox();
|
||||
panelPositioner = new javax.swing.JPanel();
|
||||
jLabel4 = new javax.swing.JLabel();
|
||||
spinnerE1 = new javax.swing.JSpinner();
|
||||
@@ -102,16 +94,6 @@ public class OTF extends Panel {
|
||||
spinnerTime = new javax.swing.JSpinner();
|
||||
jLabel7 = new javax.swing.JLabel();
|
||||
spinnerModulo = new javax.swing.JSpinner();
|
||||
jLabel8 = new javax.swing.JLabel();
|
||||
spinnerMode = new javax.swing.JSpinner();
|
||||
jLabel9 = new javax.swing.JLabel();
|
||||
spinnerBeta1 = new javax.swing.JSpinner();
|
||||
jLabel10 = new javax.swing.JLabel();
|
||||
spinnerBeta2 = new javax.swing.JSpinner();
|
||||
jLabel11 = new javax.swing.JLabel();
|
||||
spinnerTheta1 = new javax.swing.JSpinner();
|
||||
spinnerTheta2 = new javax.swing.JSpinner();
|
||||
jLabel12 = new javax.swing.JLabel();
|
||||
jPanel3 = new javax.swing.JPanel();
|
||||
buttonStart = new javax.swing.JButton();
|
||||
buttonAbort = new javax.swing.JButton();
|
||||
@@ -119,15 +101,35 @@ public class OTF extends Panel {
|
||||
|
||||
panelSensors.setBorder(javax.swing.BorderFactory.createTitledBorder("Sensors"));
|
||||
|
||||
checkCur1.setSelected(true);
|
||||
checkCur1.setText("Sample Current");
|
||||
checkCur1.setEnabled(false);
|
||||
checkCur1.setName("SampleCurrent"); // NOI18N
|
||||
|
||||
checkCur2.setSelected(true);
|
||||
checkCur2.setText("Ref Current");
|
||||
checkCur2.setEnabled(false);
|
||||
checkCur2.setName("RefCurrent"); // NOI18N
|
||||
|
||||
javax.swing.GroupLayout panelSensorsLayout = new javax.swing.GroupLayout(panelSensors);
|
||||
panelSensors.setLayout(panelSensorsLayout);
|
||||
panelSensorsLayout.setHorizontalGroup(
|
||||
panelSensorsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 228, Short.MAX_VALUE)
|
||||
.addGroup(panelSensorsLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(panelSensorsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(checkCur1)
|
||||
.addComponent(checkCur2))
|
||||
.addContainerGap(103, Short.MAX_VALUE))
|
||||
);
|
||||
panelSensorsLayout.setVerticalGroup(
|
||||
panelSensorsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 530, Short.MAX_VALUE)
|
||||
.addGroup(panelSensorsLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(checkCur1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(checkCur2)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
panelPositioner.setBorder(javax.swing.BorderFactory.createTitledBorder("Parameters"));
|
||||
@@ -145,42 +147,12 @@ public class OTF extends Panel {
|
||||
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel6.setText("Time(min):");
|
||||
|
||||
spinnerTime.setModel(new javax.swing.SpinnerNumberModel(1, 1, 1440, 1));
|
||||
spinnerTime.setModel(new javax.swing.SpinnerNumberModel(1.0d, 1.0d, 1440.0d, 1.0d));
|
||||
|
||||
jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel7.setText("Modulo:");
|
||||
|
||||
spinnerModulo.setModel(new javax.swing.SpinnerNumberModel(4, 1, 10, 1));
|
||||
|
||||
jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel8.setText("Mode:");
|
||||
|
||||
spinnerMode.setModel(new javax.swing.SpinnerListModel(new String[] {"ENERGY", "ANGLE"}));
|
||||
spinnerMode.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spinnerModeStateChanged(evt);
|
||||
}
|
||||
});
|
||||
|
||||
jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel9.setText("Beta1(deg):");
|
||||
|
||||
spinnerBeta1.setModel(new javax.swing.SpinnerNumberModel(-86.325d, -360.0d, 360.0d, 1.0d));
|
||||
|
||||
jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel10.setText("Beta2(deg):");
|
||||
|
||||
spinnerBeta2.setModel(new javax.swing.SpinnerNumberModel(-86.365d, -360.0d, 360.0d, 1.0d));
|
||||
|
||||
jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel11.setText("Theta1(deg):");
|
||||
|
||||
spinnerTheta1.setModel(new javax.swing.SpinnerNumberModel(87.345d, -360.0d, 360.0d, 1.0d));
|
||||
|
||||
spinnerTheta2.setModel(new javax.swing.SpinnerNumberModel(87.37d, -360.0d, 360.0d, 1.0d));
|
||||
|
||||
jLabel12.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel12.setText("Theta2(deg):");
|
||||
spinnerModulo.setModel(new javax.swing.SpinnerNumberModel(1, 1, 10, 1));
|
||||
|
||||
javax.swing.GroupLayout panelPositionerLayout = new javax.swing.GroupLayout(panelPositioner);
|
||||
panelPositioner.setLayout(panelPositionerLayout);
|
||||
@@ -192,7 +164,7 @@ public class OTF extends Panel {
|
||||
.addGroup(panelPositionerLayout.createSequentialGroup()
|
||||
.addComponent(jLabel4)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spinnerE1))
|
||||
.addComponent(spinnerE1, javax.swing.GroupLayout.DEFAULT_SIZE, 110, Short.MAX_VALUE))
|
||||
.addGroup(panelPositionerLayout.createSequentialGroup()
|
||||
.addComponent(jLabel5)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
@@ -204,35 +176,16 @@ public class OTF extends Panel {
|
||||
.addGroup(panelPositionerLayout.createSequentialGroup()
|
||||
.addComponent(jLabel7)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spinnerModulo))
|
||||
.addGroup(panelPositionerLayout.createSequentialGroup()
|
||||
.addComponent(jLabel8)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spinnerMode))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelPositionerLayout.createSequentialGroup()
|
||||
.addGroup(panelPositionerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jLabel9)
|
||||
.addComponent(jLabel10)
|
||||
.addComponent(jLabel11)
|
||||
.addComponent(jLabel12))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelPositionerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(spinnerBeta1)
|
||||
.addComponent(spinnerBeta2, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(spinnerTheta1)
|
||||
.addComponent(spinnerTheta2, javax.swing.GroupLayout.Alignment.TRAILING))))
|
||||
.addComponent(spinnerModulo)))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
panelPositionerLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel10, jLabel11, jLabel12, jLabel4, jLabel5, jLabel6, jLabel7, jLabel8, jLabel9});
|
||||
panelPositionerLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel4, jLabel5, jLabel6, jLabel7});
|
||||
|
||||
panelPositionerLayout.setVerticalGroup(
|
||||
panelPositionerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelPositionerLayout.createSequentialGroup()
|
||||
.addGroup(panelPositionerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel8))
|
||||
.addGap(50, 50, 50)
|
||||
.addContainerGap()
|
||||
.addGroup(panelPositionerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerE1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel4))
|
||||
@@ -241,30 +194,14 @@ public class OTF extends Panel {
|
||||
.addComponent(spinnerE2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel5))
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(panelPositionerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerBeta1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel9))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelPositionerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel10)
|
||||
.addComponent(spinnerBeta2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(panelPositionerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerTheta1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel11))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelPositionerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel12)
|
||||
.addComponent(spinnerTheta2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(50, 50, 50)
|
||||
.addGroup(panelPositionerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel6))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(panelPositionerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerModulo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel7))
|
||||
.addContainerGap(136, Short.MAX_VALUE))
|
||||
.addContainerGap(378, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Scan Control"));
|
||||
@@ -355,34 +292,22 @@ public class OTF extends Panel {
|
||||
}
|
||||
}//GEN-LAST:event_buttonAbortActionPerformed
|
||||
|
||||
private void spinnerModeStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerModeStateChanged
|
||||
onStateChange(getState(), getState());
|
||||
}//GEN-LAST:event_spinnerModeStateChanged
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton buttonAbort;
|
||||
private javax.swing.JButton buttonStart;
|
||||
private javax.swing.JCheckBox checkCur1;
|
||||
private javax.swing.JCheckBox checkCur2;
|
||||
private javax.swing.JCheckBox checkEndScan;
|
||||
private javax.swing.JLabel jLabel10;
|
||||
private javax.swing.JLabel jLabel11;
|
||||
private javax.swing.JLabel jLabel12;
|
||||
private javax.swing.JLabel jLabel4;
|
||||
private javax.swing.JLabel jLabel5;
|
||||
private javax.swing.JLabel jLabel6;
|
||||
private javax.swing.JLabel jLabel7;
|
||||
private javax.swing.JLabel jLabel8;
|
||||
private javax.swing.JLabel jLabel9;
|
||||
private javax.swing.JPanel jPanel3;
|
||||
private javax.swing.JPanel panelPositioner;
|
||||
private javax.swing.JPanel panelSensors;
|
||||
private javax.swing.JSpinner spinnerBeta1;
|
||||
private javax.swing.JSpinner spinnerBeta2;
|
||||
private javax.swing.JSpinner spinnerE1;
|
||||
private javax.swing.JSpinner spinnerE2;
|
||||
private javax.swing.JSpinner spinnerMode;
|
||||
private javax.swing.JSpinner spinnerModulo;
|
||||
private javax.swing.JSpinner spinnerTheta1;
|
||||
private javax.swing.JSpinner spinnerTheta2;
|
||||
private javax.swing.JSpinner spinnerTime;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ STEPS (int or tuple)
|
||||
LATENCY (double)
|
||||
RELATIVE (BOOLEAN)
|
||||
FLY_SCAN (BOOLEAN)
|
||||
ENDSCAN (BOOLEAN)
|
||||
"""
|
||||
|
||||
#set_preference(Preference.PLOT_TYPES,{'ImageIntegrator':1})
|
||||
|
||||
@@ -159,6 +159,24 @@ def release_keithleys():
|
||||
KeiSample.release()
|
||||
KeiReference.release()
|
||||
|
||||
def otf(mode="ENERGY", e1=None, e2=None, beta1=None, beta2=None, theta1=None, theta2=None, \
|
||||
time=1.0, modulo=1, turn_off_beam=False):
|
||||
"""
|
||||
mode: "ENERGY" or "AMNGLE"
|
||||
"""
|
||||
run("otf", {
|
||||
"MODE":mode, \
|
||||
"E1":float(e1) if e1 is not None else None, \
|
||||
"E2":float(e2) if e2 is not None else None, \
|
||||
"BETA1":float(beta1) if beta1 is not None else None, \
|
||||
"BETA2":float(beta2) if beta2 is not None else None, \
|
||||
"THETA1":float(theta1) if theta1 is not None else None, \
|
||||
"THETA2":float(theta2) if theta2 is not None else None, \
|
||||
"TIME":float(time), \
|
||||
"MODULO":int(modulo), \
|
||||
"ENDSCAN":turn_off_beam, \
|
||||
})
|
||||
|
||||
diag_channels = []
|
||||
diag_channels.append(Scienta.channelBegin) #diag_channels.append(ChannelDouble("ChannelBegin", "X03DA-SCIENTA:cam1:CHANNEL_BEGIN_RBV"))
|
||||
diag_channels.append(Scienta.channelEnd) #diag_channels.append(ChannelDouble("ChannelEnd", "X03DA-SCIENTA:cam1:CHANNEL_END_RBV"))
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
if get_exec_pars().source==CommandSource.ui:
|
||||
#Debugging parameters
|
||||
if not get_exec_pars().getCommand(False).args:
|
||||
1/0
|
||||
MODE = "ANGLE"
|
||||
E1 = 450.0
|
||||
E2 = 460.0
|
||||
@@ -6,18 +8,20 @@ if get_exec_pars().source==CommandSource.ui:
|
||||
BETA2 = -86.365
|
||||
THETA1 = 87.345
|
||||
THETA2 = 87.370
|
||||
TIME = 1 #min
|
||||
MODULO=4
|
||||
TIME = 1.0 #min
|
||||
MODULO=1
|
||||
ENDSCAN=False
|
||||
|
||||
|
||||
|
||||
if MODE=="ANGLE":
|
||||
raise Exception("Angle mode not supported")
|
||||
print "\nStart OTF scan... Beta", BETA1,"->",BETA2," Theta", THETA1,"->",THETA2, TIME,"- min modulo=",MODULO
|
||||
if None in [BETA1, BETA2, THETA1, THETA2]:
|
||||
raise Exception("Invalid angle")
|
||||
else:
|
||||
print "\nStart OTF scan...", E1,"eV ->",E2,"eV,",TIME,"- min modulo=",MODULO
|
||||
|
||||
if None in [E1, E2]:
|
||||
raise Exception("Invalid energy")
|
||||
|
||||
wait_beam()
|
||||
sensors = SampleCurrent, RefCurrent, MonoBeta, MonoTheta, MonoEnergy
|
||||
@@ -97,10 +101,7 @@ def after_read(rec):
|
||||
try:
|
||||
print "Scanning...",
|
||||
try:
|
||||
if MODE=="ANGLE":
|
||||
mscan(SampleCurrent, sensors, -1, None, range="auto", take_initial=False, after_read=after_read, monitors=[MonoEnergy, SampleCurrent, MachineCurrent])
|
||||
else:
|
||||
mscan(SampleCurrent, sensors, -1, None, range="auto", take_initial=False, after_read=after_read, domain_axis="MonoEnergy", monitors=[MonoEnergy, SampleCurrent, MachineCurrent])
|
||||
mscan(SampleCurrent, sensors, -1, None, range="auto", take_initial=False, after_read=after_read, domain_axis="MonoEnergy", snaps=diag_channels)
|
||||
finally:
|
||||
ret[0].cancel(True)
|
||||
|
||||
@@ -108,8 +109,8 @@ except:
|
||||
if not scan_completed:
|
||||
print sys.exc_info()
|
||||
print("Aborting...")
|
||||
caput('X03DA-OTF:RUN', 'STOP')
|
||||
raise
|
||||
finally:
|
||||
caput('X03DA-OTF:RUN', 'STOP')
|
||||
if ENDSCAN:
|
||||
after_scan()
|
||||
Reference in New Issue
Block a user