This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#Tue Aug 09 08:58:31 CEST 2022
|
||||
#Tue Jan 17 11:35:04 CET 2023
|
||||
autoSaveScanData=true
|
||||
simulation=false
|
||||
commandExecutionEvents=false
|
||||
@@ -48,4 +48,5 @@ versionTrackingLogin={context}/svcusr-hlapp_robot
|
||||
noBytecodeFiles=false
|
||||
versionTrackingRemote=git@git.psi.ch\:pshell_config/x07db.git
|
||||
dataProvider=h5
|
||||
dataScanLazyTableCreation=false
|
||||
saveCommandStatistics=false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#Wed Jan 11 10:54:13 CET 2023
|
||||
LastRunDate=230111
|
||||
FileSequentialNumber=100
|
||||
DaySequentialNumber=7
|
||||
#Tue Jan 17 17:14:23 CET 2023
|
||||
LastRunDate=230117
|
||||
FileSequentialNumber=136
|
||||
DaySequentialNumber=16
|
||||
|
||||
@@ -133,7 +133,7 @@ public class EnergyScan extends ScriptProcessor {
|
||||
ArrayList data = new ArrayList();
|
||||
data.add(new Object[][]{new Object[]{textName.getText()}});
|
||||
data.add(model.getDataVector());
|
||||
data.add(spinnerPasses.getValue());
|
||||
data.add(new Object[][]{new Object[]{spinnerPasses.getValue()}});
|
||||
String json = EncoderJson.encode(data, true);
|
||||
Files.write(currentFile.toPath(), json.getBytes());
|
||||
updateButtons();
|
||||
|
||||
207
plugins/XPS.form
207
plugins/XPS.form
@@ -52,8 +52,6 @@
|
||||
<EmptySpace type="separate" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="buttonAddToQueue" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="separate" max="32767" attributes="0"/>
|
||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="textFileId" linkSize="4" min="-2" pref="67" max="-2" attributes="0"/>
|
||||
@@ -70,13 +68,12 @@
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jPanel2" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="7" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="textFileId" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="textCurScan" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonAddToQueue" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
@@ -133,7 +130,6 @@
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jScrollPane1" pref="0" max="32767" attributes="0"/>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
@@ -146,14 +142,13 @@
|
||||
<Component id="buttonSave" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="buttonUp" linkSize="8" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="buttonDown" linkSize="8" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerPasses" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="buttonInsert" linkSize="8" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="buttonDelete" linkSize="8" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonAddToQueue" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jPanel1" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@@ -170,16 +165,14 @@
|
||||
<Component id="buttonSave" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonClear" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jScrollPane1" pref="150" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="buttonInsert" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonDelete" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonUp" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonDown" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jPanel1" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="11" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="buttonAddToQueue" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerPasses" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -211,47 +204,6 @@
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonSaveActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||
<AuxValues>
|
||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTable" name="table">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
|
||||
<Table columnCount="3" rowCount="0">
|
||||
<Column editable="true" title="Enabled" type="java.lang.Boolean"/>
|
||||
<Column editable="true" title="Region Name" type="java.lang.Object"/>
|
||||
<Column editable="false" title="Arguments" type="java.lang.String"/>
|
||||
</Table>
|
||||
</Property>
|
||||
<Property name="selectionMode" type="int" value="0"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tableMouseReleased"/>
|
||||
<EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="tableKeyReleased"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JButton" name="buttonInsert">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Insert"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonInsertActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonDelete">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Delete"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonDeleteActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonClear">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Clear"/>
|
||||
@@ -260,22 +212,133 @@
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonClearActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonUp">
|
||||
<Component class="javax.swing.JButton" name="buttonAddToQueue">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Move Up"/>
|
||||
<Property name="text" type="java.lang.String" value="Add To Queue"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonUpActionPerformed"/>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonAddToQueueActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonDown">
|
||||
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Move Down"/>
|
||||
<Property name="text" type="java.lang.String" value="Passes:"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonDownActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerPasses">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="1" maximum="100" minimum="1" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Container class="javax.swing.JPanel" name="jPanel1">
|
||||
<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="Regions"/>
|
||||
</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="jScrollPane1" pref="0" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="buttonUp" linkSize="8" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="buttonDown" linkSize="8" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="buttonInsert" linkSize="8" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="buttonDelete" linkSize="8" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jScrollPane1" pref="85" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="buttonInsert" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonDelete" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonUp" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonDown" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JButton" name="buttonUp">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Move Up"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonUpActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||
<AuxValues>
|
||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTable" name="table">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
|
||||
<Table columnCount="3" rowCount="0">
|
||||
<Column editable="true" title="Enabled" type="java.lang.Boolean"/>
|
||||
<Column editable="true" title="Region Name" type="java.lang.Object"/>
|
||||
<Column editable="false" title="Arguments" type="java.lang.String"/>
|
||||
</Table>
|
||||
</Property>
|
||||
<Property name="selectionMode" type="int" value="0"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tableMouseReleased"/>
|
||||
<EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="tableKeyReleased"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JButton" name="buttonDown">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Move Down"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonDownActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonInsert">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Insert"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonInsertActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonDelete">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Delete"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonDeleteActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||
@@ -308,13 +371,5 @@
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonAddToQueue">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Add To Queue"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonAddToQueueActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
|
||||
145
plugins/XPS.java
145
plugins/XPS.java
@@ -134,7 +134,7 @@ public class XPS extends ScriptProcessor {
|
||||
try{
|
||||
textCurScan.setText(getGlobalVar("CURRENT_REGION").toString());
|
||||
} catch(Exception ex){
|
||||
getLogger().log(Level.WARNING, null, ex);
|
||||
getLogger().log(Level.FINER, null, ex);
|
||||
textCurScan.setText("");
|
||||
}
|
||||
try{
|
||||
@@ -150,7 +150,7 @@ public class XPS extends ScriptProcessor {
|
||||
}
|
||||
}
|
||||
} catch(Exception ex){
|
||||
getLogger().log(Level.WARNING, null, ex);
|
||||
getLogger().log(Level.FINER, null, ex);
|
||||
table.clearSelection();
|
||||
}
|
||||
} else {
|
||||
@@ -202,6 +202,7 @@ public class XPS extends ScriptProcessor {
|
||||
|
||||
args.put("FILE", null);
|
||||
args.put("NAME", getScanName());
|
||||
args.put("PASSES", spinnerPasses.getValue());
|
||||
args.put("REGIONS", regions);
|
||||
return args;
|
||||
}
|
||||
@@ -221,6 +222,7 @@ public class XPS extends ScriptProcessor {
|
||||
ArrayList data = new ArrayList();
|
||||
data.add(new Object[][]{new Object[]{textName.getText()}});
|
||||
data.add(model.getDataVector());
|
||||
data.add(new Object[][]{new Object[]{spinnerPasses.getValue()}});
|
||||
String json = EncoderJson.encode(data, true);
|
||||
Files.write(currentFile.toPath(), json.getBytes());
|
||||
updateButtons();
|
||||
@@ -232,6 +234,7 @@ public class XPS extends ScriptProcessor {
|
||||
currentFile = null;
|
||||
textName.setText("");
|
||||
model.setRowCount(0);
|
||||
spinnerPasses.setValue(1);
|
||||
} else {
|
||||
Path path = Paths.get(fileName);
|
||||
String json = new String(Files.readAllBytes(path));
|
||||
@@ -239,6 +242,7 @@ public class XPS extends ScriptProcessor {
|
||||
Object[][][] vector = (Object[][][]) EncoderJson.decode(json, Object[][][].class);
|
||||
textName.setText(String.valueOf(vector[0][0][0]));
|
||||
model.setDataVector(vector[1], SwingUtils.getTableColumnNames(table));
|
||||
spinnerPasses.setValue((vector.length>2) ? (Integer)vector[2][0][0] : 1);
|
||||
}
|
||||
updateButtons();
|
||||
}
|
||||
@@ -284,19 +288,22 @@ public class XPS extends ScriptProcessor {
|
||||
textName = new javax.swing.JTextField();
|
||||
buttonOpen = new javax.swing.JButton();
|
||||
buttonSave = new javax.swing.JButton();
|
||||
buttonClear = new javax.swing.JButton();
|
||||
buttonAddToQueue = new javax.swing.JButton();
|
||||
jLabel3 = new javax.swing.JLabel();
|
||||
spinnerPasses = new javax.swing.JSpinner();
|
||||
jPanel1 = new javax.swing.JPanel();
|
||||
buttonUp = new javax.swing.JButton();
|
||||
jScrollPane1 = new javax.swing.JScrollPane();
|
||||
table = new javax.swing.JTable();
|
||||
buttonDown = new javax.swing.JButton();
|
||||
buttonInsert = new javax.swing.JButton();
|
||||
buttonDelete = new javax.swing.JButton();
|
||||
buttonClear = new javax.swing.JButton();
|
||||
buttonUp = new javax.swing.JButton();
|
||||
buttonDown = new javax.swing.JButton();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
textFileId = new javax.swing.JTextField();
|
||||
buttonResetId = new javax.swing.JButton();
|
||||
jLabel4 = new javax.swing.JLabel();
|
||||
textCurScan = new javax.swing.JTextField();
|
||||
buttonAddToQueue = new javax.swing.JButton();
|
||||
|
||||
jScrollPane2.setViewportView(jEditorPane1);
|
||||
|
||||
@@ -345,6 +352,33 @@ public class XPS extends ScriptProcessor {
|
||||
}
|
||||
});
|
||||
|
||||
buttonClear.setText("Clear");
|
||||
buttonClear.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonClearActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonAddToQueue.setText("Add To Queue");
|
||||
buttonAddToQueue.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonAddToQueueActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
jLabel3.setText("Passes:");
|
||||
|
||||
spinnerPasses.setModel(new javax.swing.SpinnerNumberModel(1, 1, 100, 1));
|
||||
|
||||
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Regions"));
|
||||
|
||||
buttonUp.setText("Move Up");
|
||||
buttonUp.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonUpActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
table.setModel(new javax.swing.table.DefaultTableModel(
|
||||
new Object [][] {
|
||||
|
||||
@@ -381,6 +415,13 @@ public class XPS extends ScriptProcessor {
|
||||
});
|
||||
jScrollPane1.setViewportView(table);
|
||||
|
||||
buttonDown.setText("Move Down");
|
||||
buttonDown.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonDownActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonInsert.setText("Insert");
|
||||
buttonInsert.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
@@ -395,26 +436,40 @@ public class XPS extends ScriptProcessor {
|
||||
}
|
||||
});
|
||||
|
||||
buttonClear.setText("Clear");
|
||||
buttonClear.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonClearActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
||||
jPanel1.setLayout(jPanel1Layout);
|
||||
jPanel1Layout.setHorizontalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
||||
.addComponent(buttonUp)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(buttonDown)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonInsert)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(buttonDelete)))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
buttonUp.setText("Move Up");
|
||||
buttonUp.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonUpActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonDelete, buttonDown, buttonInsert, buttonUp});
|
||||
|
||||
buttonDown.setText("Move Down");
|
||||
buttonDown.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonDownActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
jPanel1Layout.setVerticalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buttonInsert)
|
||||
.addComponent(buttonDelete)
|
||||
.addComponent(buttonUp)
|
||||
.addComponent(buttonDown))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
|
||||
jPanel2.setLayout(jPanel2Layout);
|
||||
@@ -423,7 +478,6 @@ public class XPS extends ScriptProcessor {
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addComponent(jLabel1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
@@ -435,18 +489,14 @@ public class XPS extends ScriptProcessor {
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(buttonSave))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
|
||||
.addComponent(buttonUp)
|
||||
.addComponent(jLabel3)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(buttonDown)
|
||||
.addComponent(spinnerPasses, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonInsert)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(buttonDelete)))
|
||||
.addComponent(buttonAddToQueue))
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
jPanel2Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonDelete, buttonDown, buttonInsert, buttonUp});
|
||||
|
||||
jPanel2Layout.setVerticalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
@@ -458,14 +508,12 @@ public class XPS extends ScriptProcessor {
|
||||
.addComponent(buttonSave)
|
||||
.addComponent(buttonClear))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGap(11, 11, 11)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buttonInsert)
|
||||
.addComponent(buttonDelete)
|
||||
.addComponent(buttonUp)
|
||||
.addComponent(buttonDown))
|
||||
.addContainerGap())
|
||||
.addComponent(buttonAddToQueue)
|
||||
.addComponent(jLabel3)
|
||||
.addComponent(spinnerPasses, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
);
|
||||
|
||||
jLabel2.setText("File ID:");
|
||||
@@ -485,13 +533,6 @@ public class XPS extends ScriptProcessor {
|
||||
textCurScan.setEditable(false);
|
||||
textCurScan.setHorizontalAlignment(javax.swing.JTextField.CENTER);
|
||||
|
||||
buttonAddToQueue.setText("Add To Queue");
|
||||
buttonAddToQueue.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonAddToQueueActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
@@ -516,8 +557,6 @@ public class XPS extends ScriptProcessor {
|
||||
.addGap(18, 18, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addComponent(buttonAddToQueue)
|
||||
.addGap(18, 18, Short.MAX_VALUE)
|
||||
.addComponent(jLabel2)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(textFileId, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
@@ -533,13 +572,12 @@ public class XPS extends ScriptProcessor {
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGap(7, 7, 7)
|
||||
.addGap(8, 8, 8)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel2)
|
||||
.addComponent(textFileId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel4)
|
||||
.addComponent(textCurScan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(buttonAddToQueue))
|
||||
.addComponent(textCurScan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buttonResetId)
|
||||
@@ -718,10 +756,13 @@ public class XPS extends ScriptProcessor {
|
||||
private javax.swing.JEditorPane jEditorPane1;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JLabel jLabel3;
|
||||
private javax.swing.JLabel jLabel4;
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JPanel jPanel2;
|
||||
private javax.swing.JScrollPane jScrollPane1;
|
||||
private javax.swing.JScrollPane jScrollPane2;
|
||||
private javax.swing.JSpinner spinnerPasses;
|
||||
private javax.swing.JTable table;
|
||||
private javax.swing.JTextField textCurScan;
|
||||
private javax.swing.JTextField textFileId;
|
||||
|
||||
@@ -93,11 +93,14 @@ def dummy_trigger_scienta():
|
||||
"""
|
||||
Trigger detector to update the array sizes and calibration
|
||||
"""
|
||||
print "Dummy trigger... "
|
||||
iterations = scienta.getIterations()
|
||||
scienta.setIterations(1)
|
||||
try:
|
||||
trigger_scienta()
|
||||
finally:
|
||||
scienta.setIterations(iterations)
|
||||
print "Done"
|
||||
|
||||
|
||||
def clear_output():
|
||||
App.getInstance().mainFrame.clearScanDisplays()
|
||||
|
||||
@@ -18,7 +18,9 @@ print "REGIONS: ", REGIONS
|
||||
print "PASSES: ", PASSES
|
||||
|
||||
IOC_AUTO_SAVE = False
|
||||
DUMMY_TRIGGER = True
|
||||
DUMMY_TRIGGER = False
|
||||
SPLIT_PASSES = False
|
||||
|
||||
|
||||
set_device_alias(scienta.getSpectrum(), "spectrum")
|
||||
set_device_alias(scienta.getDataMatrix(), "image")
|
||||
@@ -29,6 +31,7 @@ sensors=[i0, scienta.stats[0], scienta.getSpectrum()] #), scienta.getDataMatrix(
|
||||
def before_read(position, scan):
|
||||
trigger_scienta()
|
||||
|
||||
clear_output()
|
||||
if DUMMY_TRIGGER:
|
||||
dummy_trigger_scienta()
|
||||
|
||||
@@ -37,7 +40,9 @@ if IOC_AUTO_SAVE:
|
||||
capture.write(1)
|
||||
|
||||
try:
|
||||
rscan(energy, sensors, REGIONS, latency = 0.0, passes=PASSES, split=True, before_read=before_read, after_read=after_readout, name = NAME)
|
||||
rscan(energy, sensors, REGIONS, latency = 0.0, passes=PASSES, split=SPLIT_PASSES, \
|
||||
before_read=before_read, after_read=after_readout, \
|
||||
name=NAME, lazy=not DUMMY_TRIGGER)
|
||||
finally:
|
||||
if IOC_AUTO_SAVE:
|
||||
capture.write(0)
|
||||
|
||||
@@ -13,7 +13,8 @@ if FILE:
|
||||
NAME , SCANS= cfg[0], cfg[1]
|
||||
print "FILE: ", FILE
|
||||
print "SCANS: ", SCANS
|
||||
|
||||
|
||||
DUMMY_TRIGGER=False
|
||||
|
||||
"""
|
||||
scienta.getState().assertReady()
|
||||
@@ -37,12 +38,13 @@ sensors=[i0, scienta.getSpectrum()]
|
||||
def before_read(position, scan):
|
||||
trigger_scienta()
|
||||
|
||||
|
||||
dummy_trigger_scienta()
|
||||
clear_output()
|
||||
if DUMMY_TRIGGER:
|
||||
dummy_trigger_scienta()
|
||||
|
||||
|
||||
try:
|
||||
tscan(sensors, SCANS, 0.001, before_read=before_read, after_read=after_readout, name = NAME)
|
||||
tscan(sensors, SCANS, 0.001, before_read=before_read, after_read=after_readout, name=NAME, lazy=not DUMMY_TRIGGER)
|
||||
finally:
|
||||
scienta.zeroSupplies()
|
||||
|
||||
|
||||
@@ -1,25 +1,23 @@
|
||||
import json
|
||||
|
||||
CURRENT_REGION = ""
|
||||
CURRENT_INDEX = -1
|
||||
|
||||
if get_exec_pars().debug:
|
||||
print "Setting debug parameters"
|
||||
NAME = None
|
||||
FILE = None
|
||||
PASSES = 1
|
||||
R1 = """{
|
||||
"scienta.acquisitionMode" : "Swept",
|
||||
"scienta.elementSet" : "HiPPHAXPES",
|
||||
"scienta.lensMode" : "T_HiPPHAXPES",
|
||||
"scienta.lowEnergy" : 387.0,
|
||||
"scienta.acquisitionMode" : "Swept",
|
||||
"scienta.slices" : 1.0,
|
||||
"scienta.stepSize" : 0.25,
|
||||
"scienta.passEnergy" : 2,
|
||||
"scienta.detectorMode" : "ADC",
|
||||
"scienta.energyMode" : "Kinetic",
|
||||
"scienta.centerEnergy" : 397.0,
|
||||
"scienta.passEnergy" : 2,
|
||||
"scienta.lowEnergy" : 387.0,
|
||||
"scienta.centerEnergy" : 397.0,
|
||||
"scienta.highEnergy" : 407.0,
|
||||
"scienta.slices" : 1.0,
|
||||
"scienta.stepSize" : 0.25,
|
||||
"scienta.stepTime" : 1.0,
|
||||
"scienta.highEnergy" : 407.0,
|
||||
"scienta.iterations" : 1.0
|
||||
} """
|
||||
|
||||
@@ -29,17 +27,31 @@ if FILE:
|
||||
FILE = get_context().setup.expandPath("{home}/parameters/" + FILE)
|
||||
with open(FILE) as json_file:
|
||||
cfg = json.load(json_file)
|
||||
NAME , REGIONS= cfg[0][0][0], cfg[1]
|
||||
NAME , REGIONS, PASSES= cfg[0][0][0], cfg[1], cfg[2]
|
||||
print "FILE: ", FILE
|
||||
print "NAME: ", NAME
|
||||
#print "REGIONS: ", REGIONS
|
||||
|
||||
|
||||
print "PASSES: ", PASSES
|
||||
|
||||
DUMMY_TRIGGER = False
|
||||
CURRENT_REGION = ""
|
||||
CURRENT_INDEX = -1
|
||||
PLOT_TYPES={"spectrum":1, "energy":1}
|
||||
|
||||
|
||||
for r in REGIONS:
|
||||
name=r[0]
|
||||
pars = json.loads(r[1])
|
||||
for k,v in pars.items():
|
||||
if (v is None) or (v== float("NaN")):
|
||||
raise Exception ("Invalid value in region: ", r, " parameter: ", k)
|
||||
|
||||
set_device_alias(scienta.getSpectrum(), "spectrum")
|
||||
set_device_alias(scienta.getSpectrumScale(), "energy")
|
||||
set_device_alias(scienta.getDataMatrix(), "image")
|
||||
set_device_alias(scienta.stats[0], "sum")
|
||||
|
||||
sensors=[i0, scienta.stats[0], scienta.getSpectrum()]
|
||||
sensors=[i0, scienta.stats[0], scienta.getSpectrum(), scienta.getSpectrumScale()] #), scienta.getDataMatrix()]
|
||||
|
||||
|
||||
def apply_pars(pars):
|
||||
@@ -49,36 +61,50 @@ def apply_pars(pars):
|
||||
scienta.energyMode = scienta.energyMode.valueOf(pars["scienta.energyMode"])
|
||||
scienta.acquisitionMode = scienta.acquisitionMode.valueOf(pars["scienta.acquisitionMode"])
|
||||
scienta.passEnergy = pars["scienta.passEnergy"]
|
||||
scienta.getLowEnergy().writeAsync(pars["scienta.centerEnergy"])
|
||||
scienta.getCenterEnergy().writeAsync(pars["scienta.passEnergy"])
|
||||
scienta.getLowEnergy().writeAsync(pars["scienta.lowEnergy"])
|
||||
scienta.getCenterEnergy().writeAsync(pars["scienta.centerEnergy"])
|
||||
scienta.getHighEnergy().writeAsync(pars["scienta.highEnergy"])
|
||||
scienta.getSlices().writeAsync(pars["scienta.slices"])
|
||||
scienta.getStepSize().writeAsync(pars["scienta.stepSize"])
|
||||
scienta.getStepTime().writeAsync(pars["scienta.stepTime"])
|
||||
scienta.setIterations(int(pars["scienta.iterations"]))
|
||||
|
||||
|
||||
|
||||
def set_region_index(index):
|
||||
global REGIONS, CURRENT_REGION, CURRENT_INDEX
|
||||
r=REGIONS[index]
|
||||
name=r[0]
|
||||
pars = json.loads(r[1])
|
||||
CURRENT_REGION = name
|
||||
CURRENT_INDEX = CURRENT_INDEX+1
|
||||
print "Region: ", name
|
||||
print "Pars: ", pars
|
||||
apply_pars(pars)
|
||||
|
||||
def before_read(position, scan):
|
||||
#trigger_scienta()
|
||||
#set_region_index(scan.getRecordIndexInPass()-1)
|
||||
#time.sleep(0.5)
|
||||
trigger_scienta()
|
||||
pass
|
||||
|
||||
|
||||
#dummy_trigger_scienta()
|
||||
|
||||
clear_output()
|
||||
|
||||
try:
|
||||
for r in REGIONS:
|
||||
name=r[0]
|
||||
pars = json.loads(r[1])
|
||||
CURRENT_REGION = name
|
||||
CURRENT_INDEX = CURRENT_INDEX+1
|
||||
print "Region: ", name
|
||||
print "Pars: ", pars
|
||||
apply_pars(pars)
|
||||
time.sleep(5.0)
|
||||
|
||||
#tscan(sensors, 1, 0.001, before_read=before_read, after_read=after_readout, name = NAME)
|
||||
finally:
|
||||
scienta.zeroSupplies()
|
||||
for i in range(len(REGIONS)):
|
||||
set_region_index(i)
|
||||
#tscan(sensors, len(REGIONS), 0.1, \
|
||||
#passes=PASSES, split=SPLIT_PASSES, \
|
||||
#before_read=before_read, after_read=after_readout, name = NAME)
|
||||
if DUMMY_TRIGGER:
|
||||
dummy_trigger_scienta()
|
||||
|
||||
tscan(sensors, PASSES, 0.1, tag=CURRENT_REGION, \
|
||||
before_read=before_read, after_read=after_readout, \
|
||||
name=NAME, lazy=not DUMMY_TRIGGER, plot_types=PLOT_TYPES)
|
||||
|
||||
finally:
|
||||
print "Finalizing"
|
||||
scienta.zeroSupplies()
|
||||
print "Quit script"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user