Sprint 12/21

This commit is contained in:
gac-x11ma
2020-12-09 15:06:55 +01:00
parent 13352381ed
commit b0718601c2
19 changed files with 1717 additions and 682 deletions

Binary file not shown.

Binary file not shown.

BIN
config/ROIs/test.roi Normal file

Binary file not shown.

BIN
config/ROIs/test2.roi Normal file

Binary file not shown.

View File

@@ -1,10 +1,9 @@
#Thu Nov 09 14:56:48 CET 2017
#Wed Dec 02 17:22:08 CET 2020
auth=None
from=pshell.sim@psi.ch
host=smtpint.psi.ch
port=0
pwd=
smsSuffix=@sms.switch.ch
#to=armin.kleibert@psi.ch;alexandre.gobbo@psi.ch
to=alexandre.gobbo@psi.ch
usr=
smsSuffix=@sms.switch.ch
host=smtpint.psi.ch
from=pshell.sim@psi.ch
to=
pwd=

View File

@@ -1,21 +1,21 @@
#Tue Dec 01 10:09:37 CET 2020
#Wed Dec 09 13:19:23 CET 2020
HARMONIC_ID_1=1
RSYNC_USER=e18413
RSYNC_USER=
OUTLIERS_THRESHOLD=1000000000
NORM_FILE=/sls/X11MA/data/X11MA/Data1/public/PEEM/2020_09/i1904_1_0.tif
AUTO_SWITCH_VALVE=true
DRY_RUN=true
POL_ID_2=Lin_Hor
POL_ID_2=Lin_Ver
OFFSET_ID_1=-1.5
ID=ID2
OFFSET_ID_2=-1.3
proposal=proposal
ENERGY=709.1
proposer=proposer
POL_ID_1=Lin_Ver
POL_ID_1=Lin_Hor
RSYNC_HOST=
sample=sample
RSYNC_PATH=BFO_16nm
RSYNC_PATH=
pgroup=pgroup
ALPHA_ID_2=45.0
ALPHA_ID_1=15.0

View File

@@ -1,4 +1,4 @@
#Sat Nov 28 14:51:50 CET 2020
LastRunDate=201128
FileSequentialNumber=4741
DaySequentialNumber=24
#Wed Dec 09 15:05:53 CET 2020
LastRunDate=201209
FileSequentialNumber=4799
DaySequentialNumber=25

View File

@@ -17,20 +17,39 @@
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="panelBeamline" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="checkDryMode" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="panelBeamline" max="32767" attributes="0"/>
<EmptySpace pref="24" max="32767" attributes="0"/>
<EmptySpace pref="23" max="32767" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="checkDryMode" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="panelBeamline">
<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="Setup"/>
</Border>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
@@ -63,6 +82,8 @@
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="buttonUndo" min="-2" pref="166" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="buttonApply" min="-2" pref="166" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
@@ -98,8 +119,11 @@
<Component id="checkAutoValve" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace type="separate" max="32767" attributes="0"/>
<Component id="buttonApply" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="buttonApply" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonUndo" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
@@ -488,7 +512,28 @@
<Property name="deviceName" type="java.lang.String" value="energy_opt_desc"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="buttonUndo">
<Properties>
<Property name="text" type="java.lang.String" value="Undo"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonUndoActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JCheckBox" name="checkDryMode">
<Properties>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkDryModeActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="Dry Mode"/>
</Properties>
</Component>
</SubComponents>
</Form>

View File

@@ -19,6 +19,8 @@ import javax.swing.SwingConstants;
*/
public class Beamline extends Panel {
boolean updatingControls;
public enum ID {
ID1,
ID2,
@@ -44,7 +46,7 @@ public class Beamline extends Panel {
SwingUtils.setEnumCombo(comboPol1, Beamline.Polarization.class, true);
SwingUtils.setEnumCombo(comboPol2, Beamline.Polarization.class, true);
Component[] parameterControls = new Component[0];
Component[] parameterControls = new Component[]{};
for (JPanel panel : new JPanel[]{panelBeamline}) {
for (Class cls : new Class[]{JComboBox.class, JSpinner.class, JToggleButton.class}) {
parameterControls = Arr.append(parameterControls, SwingUtils.getComponentsByType(panel, cls));
@@ -71,6 +73,38 @@ public class Beamline extends Panel {
@Override
public void onInitialize(int runCount) {
try {
updateBeamlineSetup();
} catch (IOException ex) {
showException(ex);
}
}
@Override
public void onStateChange(State state, State former) {
try{
updatingControls = true;
checkDryMode.setSelected((boolean) this.eval("get_dry_run()", true));
//updateBeamlineSetup();
} catch (Exception ex){
checkDryMode.setSelected(false);
} finally{
updatingControls = false;
}
updateControls();
}
@Override
public void onExecutedFile(String fileName, Object result) {
}
//Callback to perform update - in event thread
@Override
protected void doUpdate() {
}
void updateBeamlineSetup() throws IOException{
String id = getSetting("ID");
Double en = Double.valueOf(getSetting("ENERGY"));
String pol1 = getSetting("POL_ID_1");
@@ -90,48 +124,34 @@ public class Beamline extends Panel {
comboPol2.setSelectedItem(pol2);
spinnerAlp2.setValue(alp2);
spinnerHar2.setValue(har2);
spinnerOff2.setValue(off2);
checkAutoValve.setSelected(String.valueOf(getSetting("AUTO_SWITCH_VALVE")).equalsIgnoreCase("true"));
} catch (IOException ex) {
showException(ex);
}
}
@Override
public void onStateChange(State state, State former) {
updateControls();
}
@Override
public void onExecutedFile(String fileName, Object result) {
}
//Callback to perform update - in event thread
@Override
protected void doUpdate() {
spinnerOff2.setValue(off2);
checkAutoValve.setSelected(String.valueOf(getSetting("AUTO_SWITCH_VALVE")).equalsIgnoreCase("true"));
}
void updateControls() {
boolean editable = getState().isInitialized() && !getState().isProcessing();
boolean is_id1 = comboID.getSelectedIndex() != 1;
boolean is_id2 = comboID.getSelectedIndex() != 0;
buttonApply.setEnabled(editable);
for (Component c : parameterControls) {
c.setEnabled(editable);
}
updatingControls = true;
try{
boolean editable = getState().isInitialized() && !getState().isProcessing();
boolean is_id1 = comboID.getSelectedIndex() != 1;
boolean is_id2 = comboID.getSelectedIndex() != 0;
buttonApply.setEnabled(editable);
if (editable) {
spinnerAlp1.setEnabled(is_id1 && (comboPol1.getSelectedItem() == Beamline.Polarization.Lin.toString()));
spinnerAlp2.setEnabled(is_id2 & (comboPol2.getSelectedItem() == Beamline.Polarization.Lin.toString()));
spinnerHar1.setEnabled(is_id1 );
spinnerHar2.setEnabled(is_id2 );
spinnerOff1.setEnabled(is_id1 );
spinnerOff2.setEnabled(is_id2 );
comboPol1.setEnabled(is_id1 );
comboPol2.setEnabled(is_id2 );
for (Component c : parameterControls) {
c.setEnabled(editable);
}
if (editable) {
spinnerAlp1.setEnabled(is_id1 && (comboPol1.getSelectedItem() == Beamline.Polarization.Lin.toString()));
spinnerAlp2.setEnabled(is_id2 & (comboPol2.getSelectedItem() == Beamline.Polarization.Lin.toString()));
spinnerHar1.setEnabled(is_id1 );
spinnerHar2.setEnabled(is_id2 );
spinnerOff1.setEnabled(is_id1 );
spinnerOff2.setEnabled(is_id2 );
comboPol1.setEnabled(is_id1 );
comboPol2.setEnabled(is_id2 );
}
} finally {
updatingControls = false;
}
}
@@ -201,6 +221,11 @@ public class Beamline extends Panel {
checkAutoValve = new javax.swing.JCheckBox();
deviceValuePanel1 = new ch.psi.pshell.swing.DeviceValuePanel();
deviceValuePanel10 = new ch.psi.pshell.swing.DeviceValuePanel();
buttonUndo = new javax.swing.JButton();
checkDryMode = new javax.swing.JCheckBox();
jLabel1 = new javax.swing.JLabel();
panelBeamline.setBorder(javax.swing.BorderFactory.createTitledBorder("Setup"));
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
jLabel3.setText("ID:");
@@ -419,6 +444,13 @@ public class Beamline extends Panel {
deviceValuePanel10.setDeviceName("energy_opt_desc");
buttonUndo.setText("Undo");
buttonUndo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonUndoActionPerformed(evt);
}
});
javax.swing.GroupLayout panelBeamlineLayout = new javax.swing.GroupLayout(panelBeamline);
panelBeamline.setLayout(panelBeamlineLayout);
panelBeamlineLayout.setHorizontalGroup(
@@ -445,6 +477,8 @@ public class Beamline extends Panel {
.addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(panelBeamlineLayout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonUndo, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(buttonApply, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
);
@@ -477,25 +511,46 @@ public class Beamline extends Panel {
.addComponent(deviceValuePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(checkAutoValve)))
.addGap(18, 18, Short.MAX_VALUE)
.addComponent(buttonApply)
.addGap(18, 18, 18)
.addGroup(panelBeamlineLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(buttonApply)
.addComponent(buttonUndo))
.addContainerGap())
);
panelBeamlineLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {comboID, deviceValuePanel1, deviceValuePanel10, spinnerImgEng});
checkDryMode.setEnabled(false);
checkDryMode.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
checkDryModeActionPerformed(evt);
}
});
jLabel1.setText("Dry Mode");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(panelBeamline, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(checkDryMode)
.addGap(2, 2, 2)
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGap(0, 0, 0)
.addComponent(panelBeamline, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap(24, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 23, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(checkDryMode)
.addComponent(jLabel1))
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
@@ -520,16 +575,38 @@ public class Beamline extends Panel {
}//GEN-LAST:event_buttonApplyActionPerformed
private void checkAutoValveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkAutoValveActionPerformed
try{
setSetting("AUTO_SWITCH_VALVE", checkAutoValve.isSelected());
} catch (Exception ex){
showException (ex);
if (!updatingControls){
try{
setSetting("AUTO_SWITCH_VALVE", checkAutoValve.isSelected());
} catch (Exception ex){
showException (ex);
}
}
}//GEN-LAST:event_checkAutoValveActionPerformed
private void checkDryModeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkDryModeActionPerformed
if (!updatingControls){
try{
this.eval("set_dry_run("+ (checkDryMode.isSelected() ? "True" : "False") + ")", true);
} catch (Exception ex){
showException (ex);
}
}
}//GEN-LAST:event_checkDryModeActionPerformed
private void buttonUndoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonUndoActionPerformed
try{
updateBeamlineSetup();
} catch (Exception ex){
showException (ex);
}
}//GEN-LAST:event_buttonUndoActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton buttonApply;
private javax.swing.JButton buttonUndo;
private javax.swing.JCheckBox checkAutoValve;
private javax.swing.JCheckBox checkDryMode;
private javax.swing.JComboBox<String> comboID;
private javax.swing.JComboBox<String> comboPol1;
private javax.swing.JComboBox<String> comboPol2;
@@ -543,6 +620,7 @@ public class Beamline extends Panel {
private ch.psi.pshell.swing.DeviceValuePanel deviceValuePanel7;
private ch.psi.pshell.swing.DeviceValuePanel deviceValuePanel8;
private ch.psi.pshell.swing.DeviceValuePanel deviceValuePanel9;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;

View File

@@ -16,7 +16,7 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jTabbedPane1" alignment="0" pref="691" max="32767" attributes="0"/>
<Component id="jTabbedPane1" alignment="0" pref="680" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
@@ -185,7 +185,7 @@
<Component id="jLabel31" linkSize="17" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="spinnerOutliersThreshold" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="326" max="32767" attributes="0"/>
<EmptySpace min="0" pref="315" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
@@ -302,15 +302,16 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="17" max="-2" attributes="0"/>
<Component id="rendererRoi" pref="444" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane1" alignment="1" min="-2" pref="200" max="-2" attributes="0"/>
<Component id="buttonRoiRemove" alignment="1" min="-2" pref="200" max="-2" attributes="0"/>
<Component id="buttonRoiAdd" alignment="1" min="-2" pref="200" max="-2" attributes="0"/>
</Group>
<Component id="rendererRoi" pref="427" max="32767" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="jScrollPane1" alignment="0" pref="200" max="32767" attributes="0"/>
<Component id="buttonRoiRemove" alignment="0" pref="200" max="32767" attributes="0"/>
<Component id="buttonRoiAdd" alignment="0" pref="200" max="32767" attributes="0"/>
<Component id="jLabel26" min="-2" max="-2" attributes="0"/>
<Component id="buttonRoiClear" alignment="0" max="32767" attributes="0"/>
<Component id="buttonRoiOpen" alignment="0" max="32767" attributes="0"/>
<Component id="buttonRoiSave" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="13" max="-2" attributes="0"/>
</Group>
@@ -328,8 +329,14 @@
<Component id="buttonRoiRemove" min="-2" pref="25" max="-2" attributes="0"/>
<EmptySpace type="separate" min="-2" max="-2" attributes="0"/>
<Component id="jLabel26" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="328" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="223" max="32767" attributes="0"/>
<EmptySpace type="separate" min="-2" max="-2" attributes="0"/>
<Component id="buttonRoiClear" min="-2" pref="25" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="buttonRoiOpen" min="-2" pref="25" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="buttonRoiSave" min="-2" pref="25" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
@@ -387,13 +394,69 @@
<Column editable="true" title="H" type="java.lang.Integer"/>
</Table>
</Property>
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
<TableColumnModel selectionModel="0">
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
<Title/>
<Editor/>
<Renderer/>
</Column>
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
<Title/>
<Editor/>
<Renderer/>
</Column>
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
<Title/>
<Editor/>
<Renderer/>
</Column>
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
<Title/>
<Editor/>
<Renderer/>
</Column>
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
<Title/>
<Editor/>
<Renderer/>
</Column>
</TableColumnModel>
</Property>
<Property name="selectionModel" type="javax.swing.ListSelectionModel" editor="org.netbeans.modules.form.editors2.JTableSelectionModelEditor">
<JTableSelectionModel selectionMode="0"/>
</Property>
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
<TableHeader reorderingAllowed="true" resizingAllowed="true"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="buttonRoiClear">
<Properties>
<Property name="text" type="java.lang.String" value="Clear"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonRoiClearActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonRoiSave">
<Properties>
<Property name="text" type="java.lang.String" value="Save"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonRoiSaveActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonRoiOpen">
<Properties>
<Property name="text" type="java.lang.String" value="Open"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonRoiOpenActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel2">
@@ -409,15 +472,35 @@
<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="panelImgControls" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="buttonImgStart" linkSize="9" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="76" max="-2" attributes="0"/>
<Component id="buttonImgAbort" linkSize="9" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="panelImgControls" alignment="0" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="35" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="buttonImgStart" linkSize="9" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="76" max="-2" attributes="0"/>
<Component id="buttonImgAbort" linkSize="9" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel32" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Component id="jLabel28" alignment="0" max="32767" attributes="0"/>
<Component id="jLabel22" alignment="0" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="deviceValuePanel11" linkSize="18" alignment="0" pref="0" max="32767" attributes="0"/>
<Component id="deviceValuePanel12" linkSize="18" pref="0" max="32767" attributes="0"/>
<Component id="deviceValuePanel2" linkSize="18" alignment="0" min="-2" pref="92" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
@@ -429,7 +512,22 @@
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
<Component id="panelImgControls" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="32767" attributes="0"/>
<EmptySpace type="separate" max="32767" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="jLabel22" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="deviceValuePanel11" linkSize="19" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="jLabel28" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="deviceValuePanel12" linkSize="19" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="jLabel32" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="deviceValuePanel2" linkSize="19" alignment="2" min="-2" pref="17" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="buttonImgStart" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonImgAbort" alignment="3" min="-2" max="-2" attributes="0"/>
@@ -461,84 +559,33 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel28" pref="99" max="32767" attributes="0"/>
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="labelSwitching" min="-2" max="-2" attributes="0"/>
<Component id="jLabel21" min="-2" max="-2" attributes="0"/>
<Component id="jLabel20" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="-2" pref="22" max="-2" attributes="0"/>
<Component id="jLabel22" pref="95" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="spinnerImgMeasurements" linkSize="10" max="32767" attributes="0"/>
<Component id="comboImgMethod" linkSize="10" max="32767" attributes="0"/>
<Component id="checkImgAutosave" linkSize="10" max="32767" attributes="0"/>
<Component id="comboSwitch" linkSize="10" alignment="0" max="32767" attributes="0"/>
<Component id="deviceValuePanel11" alignment="0" pref="0" max="32767" attributes="0"/>
<Component id="deviceValuePanel12" pref="0" max="32767" attributes="0"/>
</Group>
<Component id="jPanel5" max="32767" attributes="0"/>
<EmptySpace pref="18" max="32767" attributes="0"/>
<Component id="panelFirstImage" linkSize="23" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="32767" attributes="0"/>
<Component id="jPanel8" max="32767" attributes="0"/>
<EmptySpace type="separate" max="32767" attributes="0"/>
<Component id="jPanel10" max="32767" attributes="0"/>
<Component id="panelSecondImage" linkSize="23" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="comboImgMethod" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel21" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel20" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="spinnerImgMeasurements" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="labelSwitching" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="comboSwitch" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="checkImgAutosave" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jPanel8" alignment="0" max="32767" attributes="0"/>
<Component id="jPanel10" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="jLabel22" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="deviceValuePanel11" alignment="2" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jPanel5" linkSize="22" min="-2" max="-2" attributes="0"/>
<Component id="panelFirstImage" linkSize="22" alignment="0" max="32767" attributes="0"/>
<Component id="panelSecondImage" linkSize="22" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="jLabel28" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="deviceValuePanel12" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="34" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel8">
<Container class="javax.swing.JPanel" name="panelFirstImage">
<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">
@@ -551,11 +598,20 @@
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel11" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel9" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" alignment="1" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel9" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="filler1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="labelImgEng1" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
@@ -581,11 +637,12 @@
<Component id="spinnerImgAvg1" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel11" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="spinnerImgEng1" alignment="3" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="filler1" linkSize="24" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="labelImgEng1" linkSize="24" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="spinnerImgEng1" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<EmptySpace pref="25" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -617,7 +674,7 @@
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel11">
<Component class="javax.swing.JLabel" name="labelImgEng1">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Energy:"/>
@@ -630,9 +687,25 @@
</Property>
</Properties>
</Component>
<Component class="javax.swing.Box$Filler" name="filler1">
<Properties>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[32767, 12]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 14]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 14]"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.VerticalStrut"/>
</AuxValues>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel10">
<Container class="javax.swing.JPanel" name="panelSecondImage">
<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">
@@ -647,7 +720,7 @@
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel19" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="labelImgEng2" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel17" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel12" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
@@ -676,10 +749,10 @@
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel19" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="labelImgEng2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="spinnerImgEng2" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<EmptySpace pref="25" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -711,7 +784,7 @@
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel19">
<Component class="javax.swing.JLabel" name="labelImgEng2">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Energy:"/>
@@ -726,93 +799,155 @@
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="jLabel21">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Method:"/>
</Properties>
</Component>
<Component class="javax.swing.JSpinner" name="spinnerImgMeasurements">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="1" maximum="10000" minimum="1" numberType="java.lang.Integer" stepSize="1" type="number"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="comboImgMethod">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="4">
<StringItem index="0" value="Item 1"/>
<StringItem index="1" value="Item 2"/>
<StringItem index="2" value="Item 3"/>
<StringItem index="3" value="Item 4"/>
</StringArray>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="comboImgMethodActionPerformed"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JLabel" name="jLabel20">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Measurements:"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkImgAutosave">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Autosave"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="labelSwitching">
<Properties>
<Property name="text" type="java.lang.String" value="Switching:"/>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="comboSwitch">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="4">
<StringItem index="0" value="Item 1"/>
<StringItem index="1" value="Item 2"/>
<StringItem index="2" value="Item 3"/>
<StringItem index="3" value="Item 4"/>
</StringArray>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="deviceValuePanel11">
<Properties>
<Property name="deviceName" type="java.lang.String" value="id1_pol"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel22">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Mode ID1:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel28">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Mode ID2:"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="deviceValuePanel12">
<Properties>
<Property name="deviceName" type="java.lang.String" value="id2_pol"/>
</Properties>
</Component>
<Container class="javax.swing.JPanel" name="jPanel5">
<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="1" attributes="0">
<Component id="labelSwitching" min="-2" max="-2" attributes="0"/>
<Component id="jLabel21" min="-2" max="-2" attributes="0"/>
<Component id="jLabel20" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="spinnerImgMeasurements" linkSize="10" max="32767" attributes="0"/>
<Component id="comboImgMethod" linkSize="10" max="32767" attributes="0"/>
<Component id="checkImgAutosave" linkSize="10" max="32767" attributes="0"/>
<Component id="comboSwitch" linkSize="10" alignment="0" max="32767" attributes="0"/>
</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"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="comboImgMethod" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel21" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel20" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="spinnerImgMeasurements" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="labelSwitching" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="comboSwitch" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="checkImgAutosave" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JCheckBox" name="checkImgAutosave">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Autosave"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel20">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Measurements:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel21">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Method:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="labelSwitching">
<Properties>
<Property name="text" type="java.lang.String" value="Switching:"/>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="comboSwitch">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="4">
<StringItem index="0" value="Item 1"/>
<StringItem index="1" value="Item 2"/>
<StringItem index="2" value="Item 3"/>
<StringItem index="3" value="Item 4"/>
</StringArray>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JSpinner" name="spinnerImgMeasurements">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="1" maximum="10000" minimum="1" numberType="java.lang.Integer" stepSize="1" type="number"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="comboImgMethod">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="4">
<StringItem index="0" value="Item 1"/>
<StringItem index="1" value="Item 2"/>
<StringItem index="2" value="Item 3"/>
<StringItem index="3" value="Item 4"/>
</StringArray>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="comboImgMethodActionPerformed"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="deviceValuePanel12">
<Properties>
<Property name="deviceName" type="java.lang.String" value="id2_pol"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel32">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Energy:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel28">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Mode ID2:"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="deviceValuePanel2">
<Properties>
<Property name="deviceName" type="java.lang.String" value="energy"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="deviceValuePanel11">
<Properties>
<Property name="deviceName" type="java.lang.String" value="id1_pol"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel22">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Mode ID1:"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel3">
@@ -830,7 +965,6 @@
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="panelSpectrum" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="buttonSpecStart" linkSize="12" min="-2" max="-2" attributes="0"/>
@@ -838,9 +972,27 @@
<Component id="buttonSpecAbort" linkSize="12" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Component id="panelSpectrum" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="35" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel35" alignment="1" min="-2" max="-2" attributes="0"/>
<Group type="103" alignment="1" groupAlignment="1" max="-2" attributes="0">
<Component id="jLabel34" alignment="0" max="32767" attributes="0"/>
<Component id="jLabel33" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Component id="deviceValuePanel14" linkSize="20" alignment="0" pref="0" max="32767" attributes="0"/>
<Component id="deviceValuePanel3" linkSize="20" alignment="0" pref="92" max="32767" attributes="0"/>
<Component id="deviceValuePanel13" linkSize="20" pref="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
@@ -848,12 +1000,27 @@
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="panelSpectrum" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="76" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="jLabel33" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="deviceValuePanel13" linkSize="21" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="jLabel34" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="deviceValuePanel14" linkSize="21" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="jLabel35" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="deviceValuePanel3" linkSize="21" alignment="2" min="-2" pref="17" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="18" max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="buttonSpecStart" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonSpecAbort" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="73" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -881,7 +1048,7 @@
<Component id="spinnerSpecExp" linkSize="11" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="spinnerSpecAvg" linkSize="11" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="108" max="32767" attributes="0"/>
<EmptySpace pref="6" max="32767" attributes="0"/>
<Component id="jPanel4" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
@@ -1001,13 +1168,14 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane2" pref="0" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<Component id="buttonAdd" linkSize="13" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="88" max="32767" attributes="0"/>
<Component id="buttonRemove" linkSize="13" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jScrollPane2" min="-2" pref="255" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="buttonAdd" linkSize="13" max="32767" attributes="0"/>
<Component id="buttonRemove" linkSize="13" max="32767" attributes="0"/>
<Component id="buttonOpen" linkSize="13" alignment="0" max="32767" attributes="0"/>
<Component id="buttonSave" linkSize="13" alignment="0" max="32767" attributes="0"/>
<Component id="buttonClear" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@@ -1016,14 +1184,25 @@
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jScrollPane2" pref="0" max="32767" attributes="0"/>
<EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="buttonAdd" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonRemove" alignment="3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jScrollPane2" pref="0" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="buttonAdd" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonRemove" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="buttonClear" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonOpen" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonSave" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="21" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -1065,6 +1244,30 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonRemoveActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonOpen">
<Properties>
<Property name="text" type="java.lang.String" value="Open"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonOpenActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonSave">
<Properties>
<Property name="text" type="java.lang.String" value="Save"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonSaveActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonClear">
<Properties>
<Property name="text" type="java.lang.String" value="Clear"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonClearActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
@@ -1085,6 +1288,39 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonSpecAbortActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel33">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Mode ID1:"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="deviceValuePanel13">
<Properties>
<Property name="deviceName" type="java.lang.String" value="id1_pol"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="deviceValuePanel14">
<Properties>
<Property name="deviceName" type="java.lang.String" value="id2_pol"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel34">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Mode ID2:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel35">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Energy:"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="deviceValuePanel3">
<Properties>
<Property name="deviceName" type="java.lang.String" value="energy"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>

File diff suppressed because it is too large Load Diff

View File

@@ -28,6 +28,7 @@
</Group>
<Component id="panelDataFile" alignment="0" max="32767" attributes="0"/>
<Component id="jPanel6" alignment="0" max="32767" attributes="0"/>
<Component id="jPanel7" alignment="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
@@ -38,6 +39,8 @@
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jPanel6" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jPanel7" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jPanel1" max="32767" attributes="0"/>
<EmptySpace type="separate" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
@@ -527,5 +530,99 @@
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel7">
<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="Notification"/>
</Border>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jLabel13" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="comboNotification" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" min="-2" max="-2" attributes="0"/>
<Component id="jLabel14" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="textRecipients" max="32767" attributes="0"/>
<EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
<Component id="buttonNotificationApply" linkSize="11" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="buttonNotificationUndo" linkSize="11" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel13" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel14" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="textRecipients" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonNotificationApply" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonNotificationUndo" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="comboNotification" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel13">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Mode:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel14">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Recipients:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="textRecipients">
</Component>
<Component class="javax.swing.JComboBox" name="comboNotification">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="4">
<StringItem index="0" value="Item 1"/>
<StringItem index="1" value="Item 2"/>
<StringItem index="2" value="Item 3"/>
<StringItem index="3" value="Item 4"/>
</StringArray>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JButton" name="buttonNotificationApply">
<Properties>
<Property name="text" type="java.lang.String" value="Set"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonNotificationApplyActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonNotificationUndo">
<Properties>
<Property name="text" type="java.lang.String" value="Undo"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonNotificationUndoActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>

View File

@@ -1,7 +1,10 @@
import ch.psi.pshell.core.Configuration.NotificationLevel;
import ch.psi.pshell.ui.Panel;
import ch.psi.utils.State;
import ch.psi.utils.swing.SwingUtils;
import ch.psi.utils.swing.SwingUtils.OptionResult;
import ch.psi.utils.swing.SwingUtils.OptionType;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -18,6 +21,7 @@ public class Experiment extends Panel {
public Experiment() {
initComponents();
updateRsync();
SwingUtils.setEnumCombo(comboNotification, NotificationLevel.class);
}
//Overridable callbacks
@@ -31,7 +35,8 @@ public class Experiment extends Panel {
@Override
public void onStateChange(State state, State former) {
updateControls();
updateControls();
updateNotify();
}
@Override
@@ -93,11 +98,11 @@ public class Experiment extends Panel {
undo();
}
boolean updatingRsync;
boolean updatingControls;
void updateRsync() {
try {
updatingRsync = true;
updatingControls = true;
String user = null;
String host = null;
String path = null;
@@ -122,9 +127,21 @@ public class Experiment extends Panel {
buttonSetFolder.setEnabled(false);
} finally {
updatingRsync = false;
updatingControls = false;
}
}
void updateNotify() {
try {
updatingControls = true;
comboNotification.setSelectedItem(getContext().getConfig().notificationLevel);
textRecipients.setText(getContext().getNotificationManager().getConfig().to);
} finally {
updatingControls = false;
}
}
void updateControls() {
boolean editable = getState().isInitialized() && !getState().isProcessing();
@@ -183,6 +200,13 @@ public class Experiment extends Panel {
textRsyncHost = new javax.swing.JTextField();
checkRsyncRemove = new javax.swing.JCheckBox();
buttonUndoFolder = new javax.swing.JButton();
jPanel7 = new javax.swing.JPanel();
jLabel13 = new javax.swing.JLabel();
jLabel14 = new javax.swing.JLabel();
textRecipients = new javax.swing.JTextField();
comboNotification = new javax.swing.JComboBox<>();
buttonNotificationApply = new javax.swing.JButton();
buttonNotificationUndo = new javax.swing.JButton();
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Metadata"));
@@ -520,6 +544,66 @@ public class Experiment extends Panel {
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder("Notification"));
jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
jLabel13.setText("Mode:");
jLabel14.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
jLabel14.setText("Recipients:");
comboNotification.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
buttonNotificationApply.setText("Set");
buttonNotificationApply.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonNotificationApplyActionPerformed(evt);
}
});
buttonNotificationUndo.setText("Undo");
buttonNotificationUndo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonNotificationUndoActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
jPanel7.setLayout(jPanel7Layout);
jPanel7Layout.setHorizontalGroup(
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel7Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel13)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(comboNotification, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel14)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(textRecipients)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(buttonNotificationApply)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonNotificationUndo)
.addContainerGap())
);
jPanel7Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonNotificationApply, buttonNotificationUndo});
jPanel7Layout.setVerticalGroup(
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel7Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel13)
.addComponent(jLabel14)
.addComponent(textRecipients, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(buttonNotificationApply)
.addComponent(buttonNotificationUndo)
.addComponent(comboNotification, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
@@ -535,6 +619,7 @@ public class Experiment extends Panel {
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(panelDataFile, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonApply, buttonClear, buttonUndo});
@@ -547,6 +632,8 @@ public class Experiment extends Panel {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, 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(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
@@ -639,7 +726,13 @@ public class Experiment extends Panel {
}//GEN-LAST:event_textNamePatternKeyReleased
private void checkRsyncEnableActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkRsyncEnableActionPerformed
if (!updatingRsync) {
if (!updatingControls) {
if (!checkRsyncEnable.isSelected()) {
if (SwingUtils.showOption(getTopLevel(), "Disable Data Transfer", "Do you want to disable data transfer and remove the user authentication?", OptionType.YesNo) != OptionResult.Yes) {
updateRsync();
return;
}
}
try {
setSetting("RSYNC_USER", "");
//setSetting("RSYNC_PATH", "");
@@ -698,7 +791,7 @@ public class Experiment extends Panel {
}//GEN-LAST:event_buttonSetFolderActionPerformed
private void checkRsyncRemoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkRsyncRemoveActionPerformed
if (!updatingRsync) {
if (!updatingControls) {
try {
setSetting("RSYNC_DEL", checkRsyncRemove.isSelected());
} catch (Exception ex) {
@@ -720,10 +813,37 @@ public class Experiment extends Panel {
buttonSetFolder.setEnabled(checkRsyncEnable.isSelected());
}//GEN-LAST:event_textRsyncPathKeyReleased
private void buttonNotificationUndoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonNotificationUndoActionPerformed
try {
updateNotify();
} catch (Exception ex) {
showException(ex);
}
}//GEN-LAST:event_buttonNotificationUndoActionPerformed
private void buttonNotificationApplyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonNotificationApplyActionPerformed
try {
NotificationLevel level = (NotificationLevel) comboNotification.getSelectedItem();
String to = textRecipients.getText().trim();
if (level!=NotificationLevel.Off){
if (to.isEmpty()){
throw new Exception("To enable notifications please set the recepient list.");
}
}
getContext().getConfig().notificationLevel =level;
getContext().getNotificationManager().setRecipients(to.split(";"));
getContext().getNotificationManager().initialize(); //Remove this when fix setRecipients
} catch (Exception ex) {
showException(ex);
}
}//GEN-LAST:event_buttonNotificationApplyActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton buttonApply;
private javax.swing.JButton buttonClear;
private javax.swing.JButton buttonDefaultPath;
private javax.swing.JButton buttonNotificationApply;
private javax.swing.JButton buttonNotificationUndo;
private javax.swing.JButton buttonSetFolder;
private javax.swing.JButton buttonSetPath;
private javax.swing.JButton buttonSetSeq;
@@ -733,9 +853,12 @@ public class Experiment extends Panel {
private javax.swing.JButton buttonUndoSeq;
private javax.swing.JCheckBox checkRsyncEnable;
private javax.swing.JCheckBox checkRsyncRemove;
private javax.swing.JComboBox<String> comboNotification;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel18;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
@@ -746,6 +869,7 @@ public class Experiment extends Panel {
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel6;
private javax.swing.JPanel jPanel7;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JPanel panelDataFile;
private javax.swing.JSpinner spinnerSeq;
@@ -755,6 +879,7 @@ public class Experiment extends Panel {
private javax.swing.JTextField textPGroup;
private javax.swing.JTextField textProposal;
private javax.swing.JTextField textProposer;
private javax.swing.JTextField textRecipients;
private javax.swing.JTextField textRsyncHost;
private javax.swing.JTextField textRsyncPath;
private javax.swing.JTextField textRsyncUser;

View File

@@ -5,8 +5,9 @@ import ch.psi.pshell.imaging.Pen as Pen
import java.awt.Rectangle as Rectangle
import ch.psi.pshell.imaging.Data as Data
import ch.psi.pshell.device.Camera.DataType as DataType
import ch.psi.utils.Chrono as Chrono
CONTINOUS_MODE_MIN_TIME = 4000
###############################################################################
# ROI Integration
###############################################################################
@@ -179,31 +180,111 @@ def trigger_eiger(wait=False):
if wait:
eiger.waitNewImage(20000)
def set_exposure_time(exposure):
if exposure == eiger.getExposure():
return
def get_eiger_exposure_readback():
return caget("X11MA-ES1-SD1:cam1:AcquireTime_RBV",'f')
def set_exposure_time(value, check = True, retries=3):
if value == eiger.getExposure():
return
started = eiger.isStarted()
if started:
eiger.stop()
time.sleep(0.2)
eiger.setExposure(exposure)
stop_eiger()
for i in range(retries):
try:
eiger.setExposure(value)
if check:
readback=get_eiger_exposure_readback()
if abs(value - readback) > 0.01:
raise Exception("Error changing Eiger exposure time to %f: readback=%f" % (value, readback))
except:
if i==(retries-1):
raise
else:
print "Error changing Eiger exposure time: retrying"
time.sleep(0.3)
if started:
if eiger.grabMode==eiger.GrabMode.Continuous:
eiger.start()
def get_eiger_number_of_frames():
return caget("X11MA-ES1-SD1:cam1:NumFrames_RBV",'i')
def restore_eiger():
def set_eiger_number_of_frames(value, check = True):
if value == get_eiger_number_of_frames():
return
started = eiger.isStarted()
if started:
stop_eiger()
caput("X11MA-ES1-SD1:cam1:NumFrames",value)
if check:
readback = get_eiger_number_of_frames()
if value != readback:
raise Exception("Error changing Eiger number of frames to %d: readback=%d" % (value, readback))
if started:
if eiger.grabMode==eiger.GrabMode.Continuous:
eiger.start()
#Wait for channel to chenge
def stop_eiger():
global chrono_eiger
chrono_eiger.waitTimeout(CONTINOUS_MODE_MIN_TIME)
started = eiger.isStarted()
if started:
eiger.stop()
eiger.grabMode=eiger.GrabMode.Single
eiger.stop()
time.sleep(0.3)
if eiger.acquire.read() >0:
raise Exception("Error stopping Eiger")
chrono_eiger = Chrono()
def init_eiger(exposure=None, check=True, retries=2):
"""
Set Eiger scan mode
"""
global chrono_eiger
chrono_eiger.waitTimeout(CONTINOUS_MODE_MIN_TIME)
for i in range(retries):
try:
stop_eiger() #Set mode single
eiger.setNumImages(1)# Is it relevant?
set_eiger_number_of_frames(1)
if exposure:
set_exposure_time(exposure, check)
break
except:
if i==(retries-1):
raise
else:
print "Error initializing Eiger, retrying: " + str(sys.exc_info()[1])
def restore_eiger(check=True, retries=2):
"""
Set Eiger default mode
"""
if eiger.isStarted():
eiger.stop()
time.sleep(0.2)
eiger.grabMode=eiger.GrabMode.Continuous
eiger.setExposure(0.2)
eiger.setNumImages(1)
eiger.start()
global chrono_eiger
for i in range(retries):
try:
stop_eiger()
eiger.setNumImages(1)# Is it relevant?
set_eiger_number_of_frames(1, check)
set_exposure_time(0.2, check)
eiger.grabMode=eiger.GrabMode.Continuous
eiger.start()
chrono_eiger = Chrono()
break
except:
if i==(retries-1):
raise
else:
print "Error restoring Eiger, retrying " + str(sys.exc_info()[1])
_outliers_mask_timestamp = 0
_outliers_mask = None

View File

@@ -96,17 +96,20 @@ def put_id_pol(id, pol, alpha=None):
elif pol == 2:
mode_dev.write("CIRC -")
elif pol == 3:
mode_dev.write("LINEAR")
time.sleep(0.5)
if mode_dev.read() != "LINEAR":
mode_dev.write("LINEAR")
time.sleep(0.5)
alpha_dev.write(0)
elif pol == 4:
mode_dev.write("LINEAR")
time.sleep(0.5)
if mode_dev.read() != "LINEAR":
mode_dev.write("LINEAR")
time.sleep(0.5)
alpha_dev.write(90)
elif pol == 5:
mode_dev.write("LINEAR")
if alpha is not None:
if mode_dev.read() != "LINEAR":
mode_dev.write("LINEAR")
time.sleep(0.5)
if alpha is not None:
alpha_dev.write(alpha)
@@ -153,3 +156,90 @@ class EnOptDesc(ReadonlyRegisterBase):
add_device(EnOptDesc(), True)
energy_opt_desc.setPolling(2000)
#Polarizarion Switch Tools
_switching_type = None
_switching_active_id = None
_switching_current_pol = None
_switching_pol_id1 = None
_switching_pol_id2 = None
_switching_id = None
def init_pol_switch(switching_type, sid = None, pol_id1=None, pol_id2=None):
global _switching_type, _switching_active_id, _switching_current_pol, _switching_pol_id1, _switching_pol_id2, _switching_id
if sid is None:
sid = get_setting("ID")
if pol_id1 is None:
#pol_id1 = POL_IDS[get_setting("POL_ID_1")] #From config
pol_id1=get_id_pol(1) #Current
if pol_id2 is None:
#pol_id2 =POL_IDS[get_setting("POL_ID_2")] #From config
pol_id2 =get_id_pol(2) #Current
_switching_type = switching_type
_switching_id =sid
_switching_pol_id1=pol_id1
_switching_pol_id2=pol_id2
print "Init pol switch: %s id:%s pol_id1:%s pol_id2:%s" %(_switching_type, _switching_id, _switching_pol_id1, _switching_pol_id2)
_switching_active_id = 1
if _switching_id == "ID1":
_switching_current_pol = _switching_pol_id1
elif _switching_id == "ID2":
_switching_current_pol = _switching_pol_id2
elif _switching_id == "ID1_ID2":
_switching_current_pol=_switching_pol_id1
if switching_type == "Tune_Detune":
tune_detune(1) #Tune ID1, Detune ID2
else:
if _switching_id == "ID1_ID2":
put_id_pol(2, _switching_current_pol) #Force both IDs to same polarization
wait_channel("X11PHS:alldone", 1)
def nextpol():
global _switching_type, _switching_active_id, _switching_current_pol, _switching_pol_id1, _switching_pol_id2
if _switching_type == "Normal":
if _switching_current_pol==1: return 2 #circ+ -> circ-
elif _switching_current_pol==2: return 1 #circ+ -> circ-
elif _switching_current_pol==3: return 4 #lin hor -> lin vert
elif _switching_current_pol==4: return 3 #lin vert -> lin hor
elif _switching_current_pol==5: return5 #lin rot -> lin rot
else: raise "Invalid pol: " + str(_switching_current_pol)
elif _switching_type == "Tune_Detune":
if _switching_active_id==1: return _switching_pol_id2
elif _switching_active_id==2: return _switching_pol_id1
else: raise "Invalid ID: " + str(_switching_active_id)
else: raise "Invalid switching: " + str(_switching_type)
def switch_pol():
global _switching_type, _switching_active_id, _switching_current_pol, _switching_pol_id1, _switching_pol_id2, _switching_id
if DRY_RUN:
return
newpol=nextpol()
print "Switch pol: ", newpol
if _switching_id == "ID1":
put_id_pol(1,newpol)
elif _switching_id == "ID2":
put_id_pol(2,newpol)
elif ID == "ID1_ID2":
if _switching_type == "Normal":
put_id_pol(1, newpol)
put_id_pol(2, newpol)
elif _switching_type == "Tune_Detune":
if _switching_active_id==1:
_switching_active_id=2
else:
_switching_active_id=1
tune_detune(_switching_active_id)
if _switching_type == "Normal":
_switching_current_pol = newpol
time.sleep(1.0)
wait_channel("X11PHS:alldone", 1)
def get_cur_pol():
return _switching_current_pol

View File

@@ -409,7 +409,7 @@ def write_logfile(msg):
"""
def put_energy(v):
if DRY_RUN: return
if get_dry_run(): return
if v>91 and v<2500:
caput("X11PHS:alldone",0)
caput("X11PHS-E:GO.A",v)
@@ -423,7 +423,7 @@ def is_done():
return True if caget("X11PHS:alldone") else False
def wait_done():
if DRY_RUN: return
if get_dry_run(): return
time.sleep(1.0) #in order to reduce trafic on the IOC
wait_channel("X11PHS:alldone", 1)
"""
@@ -434,6 +434,13 @@ def put_energy(v):
wait_channel(ALL_DONE, 1, type = 'i')
def change_energy(v):
if v<91 or v>2500:
raise Exception ("Invalid energy: " + str(v))
if DRY_RUN:
return
put_energy(v)
###################################################################################################
#Image measurements
###################################################################################################
@@ -560,7 +567,80 @@ def play_sound(name):
Audio.playFile(File(get_context().setup.expandPath("{home}/sounds/" + name + ".wav")), False)
except:
log("Error playing sound " + name + ": " + str(sys.exc_info()[1]), False)
###################################################################################################
#Beamline setup
###################################################################################################
def apply_beamline_setup(ID,ENERGY,POL_ID_1,ALPHA_ID_1,HARMONIC_ID_1,OFFSET_ID_1,POL_ID_2,ALPHA_ID_2,HARMONIC_ID_2,OFFSET_ID_2):
if get_dry_run():
return
if ID=='ID1':
caput('X11PHS-E:OPT',1)
elif ID=='ID2':
caput('X11PHS-E:OPT',2)
elif ID =='ID1_ID2':
caput('X11PHS-E:OPT',3)
if ID == "ID1":
#current_pol=POL_IDS[POL_ID_1] #get_id_pol(1)
put_id_pol(1,POL_ID_1, ALPHA_ID_1 if (POL_ID_1=="Lin") else None )
caput('X11MA-ID2-GAP:SET',100) #open Gap ID2
id1_harmonic.write(int(HARMONIC_ID_1))
put_id_offset(1, float(OFFSET_ID_1)) #offset on ID1
elif ID == "ID2":
#current_pol=POL_IDS[POL_ID_2]#get_id_pol(2)
put_id_pol(2,POL_ID_2, ALPHA_ID_2 if (POL_ID_2=="Lin") else None )
caput('X11MA-ID1-GAP:SET',100) #open Gap ID1
id2_harmonic.write(int(HARMONIC_ID_2))
put_id_offset(2, float(OFFSET_ID_2)) #offset on ID2
elif ID == "ID1_ID2":
#polID1=POL_IDS[POL_ID_1]
#polID2=POL_IDS[POL_ID_2]
put_id_pol(1,POL_ID_1, ALPHA_ID_1 if (POL_ID_1=="Lin") else None )
put_id_pol(2,POL_ID_2, ALPHA_ID_2 if (POL_ID_2=="Lin") else None )
#current_pol=polID1
id1_harmonic.write(int(HARMONIC_ID_1))
id2_harmonic.write(int(HARMONIC_ID_2))
put_id_offset(1, float(OFFSET_ID_1)) #offset on ID1
put_id_offset(2, float(OFFSET_ID_2)) #offset on ID2
#wait_channel("X11PHS:alldone", 1)
energy.write(ENERGY)
wait_channel("X11PHS:alldone", 1)
def set_beamline_setup(ID,ENERGY,POL_ID_1,ALPHA_ID_1,HARMONIC_ID_1,OFFSET_ID_1,POL_ID_2,ALPHA_ID_2,HARMONIC_ID_2,OFFSET_ID_2):
set_setting("ID", ID)
set_setting("ENERGY", ENERGY)
set_setting("POL_ID_1", POL_ID_1)
set_setting("ALPHA_ID_1", ALPHA_ID_1)
set_setting("HARMONIC_ID_1", HARMONIC_ID_1)
set_setting("OFFSET_ID_1", OFFSET_ID_1)
set_setting("POL_ID_2", POL_ID_2)
set_setting("ALPHA_ID_2", ALPHA_ID_2)
set_setting("HARMONIC_ID_2", HARMONIC_ID_2)
set_setting("OFFSET_ID_2", OFFSET_ID_2)
apply_beamline_setup(ID,ENERGY,POL_ID_1,ALPHA_ID_1,HARMONIC_ID_1,OFFSET_ID_1,POL_ID_2,ALPHA_ID_2,HARMONIC_ID_2,OFFSET_ID_2)
#Restore beamline initial config
def restore_beamline_setup():
ID = get_setting("ID")
ENERGY = float(get_setting("ENERGY"))
POL_ID_1 = get_setting("POL_ID_1")
ALPHA_ID_1 = float(get_setting("ALPHA_ID_1"))
HARMONIC_ID_1 = get_setting("HARMONIC_ID_1")
OFFSET_ID_1 = float(get_setting("OFFSET_ID_1"))
POL_ID_2 = get_setting("POL_ID_2")
ALPHA_ID_2 = float(get_setting("ALPHA_ID_2"))
HARMONIC_ID_2 = get_setting("HARMONIC_ID_2")
OFFSET_ID_2 = float(get_setting("OFFSET_ID_2"))
apply_beamline_setup(ID,ENERGY,POL_ID_1,ALPHA_ID_1,HARMONIC_ID_1,OFFSET_ID_1,POL_ID_2,ALPHA_ID_2,HARMONIC_ID_2,OFFSET_ID_2)
###################################################################################################
#Settings
###################################################################################################

View File

@@ -13,11 +13,11 @@ if get_exec_pars().source == CommandSource.ui:
AVERAGE_2 = 2.0
ENERGY_2= 900.0
#POLARIZATION_2 = "Circ_Minus"
DRY_RUN = get_dry_run()
SHOW_IMAGES = True
SHOW_IMAGES = True
SAVE_DIAGS = False
ID = get_setting("ID")
@@ -98,78 +98,14 @@ def assert_status_ok():
#Initialize vartiables
if not DRY_RUN and str(get_setting("AUTO_SWITCH_VALVE")).lower() == "true":
open_vg10()
active_id = 1
current_pol=None
pol_id1=POL_IDS[get_setting("POL_ID_1")]
pol_id2=POL_IDS[get_setting("POL_ID_2")]
#rbkEnergy=energy_rbk.read()
if METHOD == "Two_Pol":
if ID == "ID1":
current_pol = pol_id1
elif ID == "ID2":
current_pol = pol_id2
elif ID == "ID1_ID2":
current_pol=pol_id1
if SWITCHING == "Tune_Detune":
tune_detune(1) #Tune ID1, Detune ID2
else:
if ID == "ID1_ID2":
put_id_pol(2, current_pol) #Force both IDs to same polarization
if METHOD == "Two_Pol":
init_pol_switch(SWITCHING)
def imageinfo(info):
pass
#Beamline setting
def nextpol():
global current_pol, pol_id1, pol_id2, active_id
if SWITCHING == "Normal":
if current_pol==1: return 2 #circ+ -> circ-
if current_pol==2: return 1 #circ+ -> circ-
if current_pol==3: return 4 #lin hor -> lin vert
if current_pol==4: return 3 #lin vert -> lin hor
if current_pol==5: return 5 #lin rot -> lin rot
elif SWITCHING == "Tune_Detune":
if active_id==1: return pol_id2
if active_id==2: return pol_id1
def switch_pol():
global active_id
if DRY_RUN:
return
newpol=nextpol()
if ID == "ID1":
put_id_pol(1,newpol)
elif ID == "ID2":
put_id_pol(2,newpol)
elif ID == "ID1_ID2":
if SWITCHING == "Normal":
put_id_pol(1, newpol)
put_id_pol(2, newpol)
elif SWITCHING == "Tune_Detune":
if active_id==1:
active_id=2
else:
active_id=1
tune_detune(active_id)
time.sleep(1.0)
wait_channel("X11PHS:alldone", 1)
def change_energy(v):
if v<91 or v>2500:
raise Exception ("Invalid energy: " + str(v))
if DRY_RUN:
return
put_energy(v)
def save_image_file(frame, cycle=-1, frame_index=0):
if SHOW_IMAGES:
@@ -181,10 +117,8 @@ def save_image_file(frame, cycle=-1, frame_index=0):
log(filename)
print filename
# log("SV:"+Format(startvoltage,"0.000")+" OB:"+Format(objective,"0.00")+" ST:"+Format(LEEMtemp,"0.0"))
eiger.stop()
eiger.grabMode=eiger.GrabMode.Single
time.sleep(0.3)
init_eiger()
#print "Startup time: " + str(time.time() - start)
try:
#Do the measurement loop
@@ -201,7 +135,9 @@ try:
if (cycle == 1) or (METHOD != "Take_Image"):
assert_status_ok()
set_exposure_time(EXPOSURE[i])
print "--- Grabing " + str(AVERAGE[i])+ " frames - cycle: " + str(cycle) + " step: " + str(i)
#s=time.time()
ret = grab_frames(image, AVERAGE[i], roi=None, wait_next=True)
#print "--- Time: " + str(time.time() - s)
frames.append(average_frames(ret) if AVERAGE[i] > 1 else ret[0])
imageinfo("I")
@@ -218,8 +154,8 @@ try:
print "--- Switching energy..."
change_energy(ENERGY_2)
#time.sleep(1)
if (METHOD == "Two_Pol") or (METHOD == "Two_Energies"):
if (METHOD == "Two_Pol") or (METHOD == "Two_Energies"):
if (METHOD == "Two_Energies") or (get_cur_pol() in (2,3)):
###??? autocontrast???
frames.append(frames[0].copy())

View File

@@ -13,6 +13,10 @@ if get_exec_pars().source == CommandSource.ui:
DRY_RUN = get_dry_run()
SAVE_DIAGS = True
if SWITCH_POL:
init_pol_switch("Normal")
log("ROIs: " + str(ROI))
if len(RANGES) == 0:
@@ -20,10 +24,7 @@ if len(RANGES) == 0:
start = time.time()
eiger.stop()
eiger.grabMode=eiger.GrabMode.Single
time.sleep(0.3)
set_exposure_time(EXPOSURE)
init_eiger(exposure=EXPOSURE)
#set_exec_pars(path="{data}/{year}_{month}/{date}/{seq}%03d_AbsortionSpectrum", format="csv", layout="table")
set_exec_pars(name="AbsortionSpectrum", format="csv", layout="table")
@@ -88,7 +89,6 @@ if not DRY_RUN and str(get_setting("AUTO_SWITCH_VALVE")).lower() == "true":
#put_id_offset(2, OFFSET_ID_2) #offset on ID2
"""
if ID == "ID1":
current_pol=POL_IDS[POL_ID_1] #get_id_pol(1)
@@ -106,10 +106,16 @@ elif ID == "ID1_ID2":
put_id_pol(2,polID2)
wait_channel("X11PHS:alldone", 1)
"""
def after_pass(pass_number, scan):
if SWITCH_POL:
if pass_number<scan.numberOfPasses:
switch_pol()
try:
#tscan(rois, 10, 0.1, format="csv", before_read=grab_image, passes = NUMBER_SCANS, tag=tag)
rscan(sync_energy, sensors, RANGES, latency = 0.0 , passes = NUMBER_SCANS, tag=tag, before_read=grab_image, save=SAVE_SPECTRUM, split=True, keep=False)
rscan(sync_energy, sensors, RANGES, latency = 0.0 , passes = NUMBER_SCANS, tag=tag, before_read=grab_image, save=SAVE_SPECTRUM, split=True, keep=False, after_pass=after_pass)
finally:
if AVERAGE>1:
for i in range(len(rois)):

View File

@@ -11,63 +11,4 @@ if get_exec_pars().source == CommandSource.ui:
HARMONIC_ID_2 = 1
OFFSET_ID_2 = 0.0
DRY_RUN = get_dry_run()
set_setting("ID", ID)
set_setting("ENERGY", ENERGY)
set_setting("POL_ID_1", POL_ID_1)
set_setting("ALPHA_ID_1", ALPHA_ID_1)
set_setting("HARMONIC_ID_1", HARMONIC_ID_1)
set_setting("OFFSET_ID_1", OFFSET_ID_1)
set_setting("POL_ID_2", POL_ID_2)
set_setting("ALPHA_ID_2", ALPHA_ID_2)
set_setting("HARMONIC_ID_2", HARMONIC_ID_2)
set_setting("OFFSET_ID_2", OFFSET_ID_2)
if DRY_RUN:
abort()
if ID=='ID1':
caput('X11PHS-E:OPT',1)
elif ID=='ID2':
caput('X11PHS-E:OPT',2)
elif ID =='ID1_ID2':
caput('X11PHS-E:OPT',3)
if ID == "ID1":
#current_pol=POL_IDS[POL_ID_1] #get_id_pol(1)
put_id_pol(1,POL_ID_1, ALPHA_ID_1 if (POL_ID_1=="Lin") else None )
caput('X11MA-ID2-GAP:SET',100) #open Gap ID2
id1_harmonic.write(int(HARMONIC_ID_1))
put_id_offset(1, float(OFFSET_ID_1)) #offset on ID1
elif ID == "ID2":
#current_pol=POL_IDS[POL_ID_2]#get_id_pol(2)
put_id_pol(2,POL_ID_2, ALPHA_ID_2 if (POL_ID_2=="Lin") else None )
caput('X11MA-ID1-GAP:SET',100) #open Gap ID1
id2_harmonic.write(int(HARMONIC_ID_2))
put_id_offset(2, float(OFFSET_ID_2)) #offset on ID2
elif ID == "ID1_ID2":
#polID1=POL_IDS[POL_ID_1]
#polID2=POL_IDS[POL_ID_2]
put_id_pol(1,POL_ID_1, ALPHA_ID_1 if (POL_ID_1=="Lin") else None )
put_id_pol(2,POL_ID_2, ALPHA_ID_2 if (POL_ID_2=="Lin") else None )
#current_pol=polID1
id1_harmonic.write(int(HARMONIC_ID_1))
id2_harmonic.write(int(HARMONIC_ID_2))
put_id_offset(1, float(OFFSET_ID_1)) #offset on ID1
put_id_offset(2, float(OFFSET_ID_2)) #offset on ID2
#wait_channel("X11PHS:alldone", 1)
energy.write(ENERGY)
wait_channel("X11PHS:alldone", 1)
set_beamline_setup(ID,ENERGY,POL_ID_1,ALPHA_ID_1,HARMONIC_ID_1,OFFSET_ID_1,POL_ID_2,ALPHA_ID_2,HARMONIC_ID_2,OFFSET_ID_2)