diff --git a/config/AbsortionSpectrum/Fe_L32_24112022.abs b/config/AbsortionSpectrum/Fe_L32_24112022.abs new file mode 100644 index 0000000..55b0fd2 Binary files /dev/null and b/config/AbsortionSpectrum/Fe_L32_24112022.abs differ diff --git a/config/AbsortionSpectrum/Ru_M23_fine_5eVshift_dec_22.abs b/config/AbsortionSpectrum/Ru_M23_fine_5eVshift_dec_22.abs new file mode 100644 index 0000000..a993a44 Binary files /dev/null and b/config/AbsortionSpectrum/Ru_M23_fine_5eVshift_dec_22.abs differ diff --git a/config/AbsortionSpectrum/Ru_M23_fine_5eVshift_dec_22_adj.abs b/config/AbsortionSpectrum/Ru_M23_fine_5eVshift_dec_22_adj.abs new file mode 100644 index 0000000..ce79b9c Binary files /dev/null and b/config/AbsortionSpectrum/Ru_M23_fine_5eVshift_dec_22_adj.abs differ diff --git a/config/AbsortionSpectrum/Ru_and_O_combined.abs b/config/AbsortionSpectrum/Ru_and_O_combined.abs new file mode 100644 index 0000000..054ff3b Binary files /dev/null and b/config/AbsortionSpectrum/Ru_and_O_combined.abs differ diff --git a/config/ROIs/ROI1.roi b/config/ROIs/ROI1.roi new file mode 100644 index 0000000..8edc631 Binary files /dev/null and b/config/ROIs/ROI1.roi differ diff --git a/config/preferences.json b/config/preferences.json index 74195d2..741a063 100644 --- a/config/preferences.json +++ b/config/preferences.json @@ -52,6 +52,7 @@ "noVariableEvaluationPropagation" : false, "processingScripts" : [ ], "asyncViewersUpdate" : false, + "asyncHistoryPlotsUpdate" : true, "scanPlotDisabled" : false, "scanTableDisabled" : false, "cachedDataPanel" : false, diff --git a/config/session_metadata.properties b/config/session_metadata.properties index a542036..81bdf9e 100755 --- a/config/session_metadata.properties +++ b/config/session_metadata.properties @@ -1,5 +1,5 @@ -#Wed Nov 02 13:46:17 CET 2022 +#Wed Dec 14 17:01:44 CET 2022 keywords=List;[] -ownerEmail=String;joanna.olszowka@jh-inst.cas.cz +ownerEmail=String;armin.kleibert@psi.ch contactEmail=String;armin.kleibert@psi.ch -owner=String;Joanna Olszowka +owner=String;Armin Kleibert diff --git a/config/sessions.properties b/config/sessions.properties index f0c7cc7..0e65b0c 100644 --- a/config/sessions.properties +++ b/config/sessions.properties @@ -1,2 +1,2 @@ -#Sun Nov 20 14:52:28 CET 2022 -SessionCounter=79 +#Thu Dec 15 01:10:54 CET 2022 +SessionCounter=80 diff --git a/config/settings.properties b/config/settings.properties index 17ef9ed..77eca13 100644 --- a/config/settings.properties +++ b/config/settings.properties @@ -1,28 +1,28 @@ -#Tue Nov 22 15:07:09 CET 2022 +#Thu Dec 22 16:41:53 CET 2022 HARMONIC_ID_1=1 RSYNC_USER= -CFF=2 +CFF=2.25 OUTLIERS_THRESHOLD=1000000000 NORM_FILE=/sls/X11MA/data/e18927/Data1/2022_10/20221017/20221017_Take_Image/i221017_042/i221017_042\#001.tif AUTO_SWITCH_VALVE=false DRY_RUN=true -POL_ID_2=Lin +POL_ID_2=Lin_Hor OFFSET_ID_1=0.0 ID=PGM_ID2 -OFFSET_ID_2=0.0 +OFFSET_ID_2=-2.0 proposal=proposal -ENERGY=715.0 +ENERGY=800.0 proposer=proposer GRATING=G3_600 image_shift_angle=1.0963912950426833 -POL_ID_1=Circ_Plus +POL_ID_1=Lin_Hor RSYNC_HOST= sample=sample RSYNC_PATH= pgroup=pgroup AUTO_SWITCH_BEAMLINE=false -AUTO_SWITCH_SHUTTER=true -ALPHA_ID_2=90.0 +AUTO_SWITCH_SHUTTER=false +ALPHA_ID_2=0.0 ALPHA_ID_1=0.0 RSYNC_DEL=true DIFF_ORD=1 diff --git a/config/variables.properties b/config/variables.properties index 75cd617..c84caa6 100644 --- a/config/variables.properties +++ b/config/variables.properties @@ -1,4 +1,4 @@ -#Tue Nov 22 16:33:39 CET 2022 -LastRunDate=221122 -FileSequentialNumber=18002 -DaySequentialNumber=88 +#Thu Dec 22 17:00:25 CET 2022 +LastRunDate=221222 +FileSequentialNumber=18358 +DaySequentialNumber=43 diff --git a/devices/image.properties b/devices/image.properties index aa39c76..22b3d86 100644 --- a/devices/image.properties +++ b/devices/image.properties @@ -1,4 +1,4 @@ -#Thu Nov 10 20:50:06 CET 2022 +#Thu Dec 22 10:11:40 CET 2022 spatialCalOffsetY=NaN spatialCalOffsetX=NaN colormapLogarithmic=false @@ -6,10 +6,10 @@ scale=1.0 grayscale=false spatialCalScaleX=NaN spatialCalScaleY=NaN -colormapMax=140.171 +colormapMax=50.0 rescaleOffset=0.0 roiWidth=-1 -colormap=Flame +colormap=Grayscale invert=false colormapMin=0.0 rotationCrop=false @@ -19,7 +19,7 @@ spatialCalUnits=null flipVertically=false roiHeight=-1 flipHorizontally=false -colormapAutomatic=false +colormapAutomatic=true roiY=0 roiX=0 transpose=false diff --git a/plugins/Beamline.form b/plugins/Beamline.form index a4d5abf..2b4c614 100755 --- a/plugins/Beamline.form +++ b/plugins/Beamline.form @@ -25,10 +25,10 @@ - - - - + + + + @@ -39,9 +39,9 @@ - + - + @@ -500,11 +500,11 @@ - + - - - + + + @@ -520,11 +520,11 @@ - + - + @@ -564,8 +564,6 @@ - - @@ -576,6 +574,13 @@ + + + + + + + @@ -623,7 +628,7 @@ - + diff --git a/plugins/Beamline.java b/plugins/Beamline.java index 73c6226..1dca81c 100755 --- a/plugins/Beamline.java +++ b/plugins/Beamline.java @@ -237,9 +237,9 @@ public class Beamline extends Panel { comboGrating = new javax.swing.JComboBox<>(); jLabel2 = new javax.swing.JLabel(); comboDiffOrder = new javax.swing.JComboBox<>(); - spinnerCff = new javax.swing.JSpinner(); jLabel4 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); + spinnerCff = new javax.swing.JSpinner(); checkAutoBeamline = new javax.swing.JCheckBox(); checkDryMode = new javax.swing.JCheckBox(); jLabel1 = new javax.swing.JLabel(); @@ -476,6 +476,8 @@ public class Beamline extends Panel { jLabel9.setText("Diff. order:"); + spinnerCff.setModel(new javax.swing.SpinnerNumberModel(2.25d, null, null, 0.01d)); + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( @@ -485,11 +487,11 @@ public class Beamline extends Panel { .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(comboGrating, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(21, 21, 21) + .addGap(15, 15, 15) .addComponent(jLabel4) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(spinnerCff, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(spinnerCff) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel9) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(comboDiffOrder, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) @@ -503,10 +505,10 @@ public class Beamline extends Panel { .addComponent(jLabel2) .addComponent(comboGrating, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4) - .addComponent(spinnerCff, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel9) - .addComponent(comboDiffOrder, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(comboDiffOrder, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(spinnerCff, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(7, Short.MAX_VALUE)) ); checkAutoBeamline.setText("Auto Beamline"); @@ -807,7 +809,7 @@ public class Beamline extends Panel { .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(41, 41, 41) .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap(185, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -834,17 +836,17 @@ public class Beamline extends Panel { .addComponent(jLabel1) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) - .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(panelBeamline, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(panelBeamline, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(0, 12, Short.MAX_VALUE)))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addGap(21, 21, 21) + .addGap(15, 15, 15) .addComponent(panelBeamline, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGap(18, 18, 18) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 326, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) @@ -915,7 +917,7 @@ public class Beamline extends Panel { private void checkAutoBeamlineActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkAutoBeamlineActionPerformed if (!updatingControls){ try{ - this.eval("beamline_auto("+ (checkAutoBeamline.isSelected() ? "On" : "Off") + ")",true); + this.eval("beamline_auto('"+ (checkAutoBeamline.isSelected() ? "On" : "Off") + "')",true); } catch (Exception ex){ showException (ex); } diff --git a/plugins/DataAcquisition.form b/plugins/DataAcquisition.form index a938f00..8638854 100755 --- a/plugins/DataAcquisition.form +++ b/plugins/DataAcquisition.form @@ -93,7 +93,7 @@ - + @@ -177,7 +177,7 @@ - + @@ -330,7 +330,7 @@ - + @@ -618,7 +618,7 @@ - + @@ -640,7 +640,7 @@ - + @@ -653,7 +653,7 @@ - + @@ -906,7 +906,7 @@ - + @@ -948,9 +948,9 @@ - + - + @@ -1242,80 +1242,86 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - + + + + + + + + - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - @@ -1410,6 +1416,16 @@ + + + + + + + + + + diff --git a/plugins/DataAcquisition.java b/plugins/DataAcquisition.java index e5b374a..b1bd036 100755 --- a/plugins/DataAcquisition.java +++ b/plugins/DataAcquisition.java @@ -448,7 +448,15 @@ public class DataAcquisition extends Panel { } } + void assertIOCReady() throws Exception { + if (getDevice("data").getState()!=State.Ready){ + throw new Exception("OTF IOC is not running! Go to Launcher -> XMCD -> OTF new."); + } + + } + void runImageOTF() throws Exception { + assertIOCReady(); HashMap args = new HashMap(); Double e1 = (Double) spinnerE1.getValue(); Double e2 = (Double) spinnerE2.getValue(); @@ -580,6 +588,7 @@ public class DataAcquisition extends Panel { spinnerImgOTFExp = new javax.swing.JSpinner(); buttonImgOTFStart = new javax.swing.JButton(); buttonImgOTFAbort = new javax.swing.JButton(); + deviceStatePanel1 = new ch.psi.pshell.swing.DeviceStatePanel(); panelNorm.setBorder(javax.swing.BorderFactory.createTitledBorder("Normalization")); @@ -620,7 +629,7 @@ public class DataAcquisition extends Panel { .addGap(18, 18, 18) .addComponent(jLabel29) .addGap(0, 0, 0) - .addComponent(textNorm, javax.swing.GroupLayout.DEFAULT_SIZE, 554, Short.MAX_VALUE) + .addComponent(textNorm, javax.swing.GroupLayout.DEFAULT_SIZE, 600, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(buttonSetNorm) .addContainerGap()) @@ -695,7 +704,7 @@ public class DataAcquisition extends Panel { .addComponent(jLabel31) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(spinnerOutliersThreshold, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 444, Short.MAX_VALUE))) + .addGap(0, 490, Short.MAX_VALUE))) .addContainerGap()) ); @@ -863,7 +872,7 @@ public class DataAcquisition extends Panel { panelRoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelRoiLayout.createSequentialGroup() .addGap(17, 17, 17) - .addComponent(rendererRoi, javax.swing.GroupLayout.DEFAULT_SIZE, 539, Short.MAX_VALUE) + .addComponent(rendererRoi, javax.swing.GroupLayout.DEFAULT_SIZE, 585, Short.MAX_VALUE) .addGap(18, 18, 18) .addGroup(panelRoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelRoiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) @@ -998,7 +1007,7 @@ public class DataAcquisition extends Panel { .addComponent(comboSwitch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(comboSeq, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(checkImgAutosave, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(18, 76, Short.MAX_VALUE) + .addGap(18, 88, Short.MAX_VALUE) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel20, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING) @@ -1015,7 +1024,7 @@ public class DataAcquisition extends Panel { .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(spinnerImgExp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(spinnerImgMeasurements, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(18, 76, Short.MAX_VALUE) + .addGap(18, 88, Short.MAX_VALUE) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(labelImgEng1, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(labelImgEng2, javax.swing.GroupLayout.Alignment.TRAILING)) @@ -1024,7 +1033,7 @@ public class DataAcquisition extends Panel { .addComponent(spinnerImgEng1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(spinnerImgEng2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(spinnerScans, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(67, Short.MAX_VALUE)) + .addContainerGap(79, Short.MAX_VALUE)) ); jPanel5Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {spinnerImgAvg, spinnerImgEng1, spinnerImgEng2, spinnerImgExp, spinnerImgMeasurements, spinnerScans}); @@ -1283,9 +1292,9 @@ public class DataAcquisition extends Panel { .addComponent(buttonSpecStart) .addGap(18, 18, 18) .addComponent(buttonSpecAbort))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 43, Short.MAX_VALUE) .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(91, Short.MAX_VALUE)) + .addContainerGap(128, Short.MAX_VALUE)) .addGroup(panelSpectrumLayout.createSequentialGroup() .addGap(99, 99, 99) .addGroup(panelSpectrumLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -1394,6 +1403,9 @@ public class DataAcquisition extends Panel { } }); + deviceStatePanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("OTF IOC Status")); + deviceStatePanel1.setDeviceName("data"); + javax.swing.GroupLayout panelParameters1Layout = new javax.swing.GroupLayout(panelParameters1); panelParameters1.setLayout(panelParameters1Layout); panelParameters1Layout.setHorizontalGroup( @@ -1402,36 +1414,35 @@ public class DataAcquisition extends Panel { .addContainerGap() .addGroup(panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(panelParameters1Layout.createSequentialGroup() - .addGap(0, 0, Short.MAX_VALUE) + .addComponent(buttonImgOTFStart) + .addGap(18, 18, 18) + .addComponent(buttonImgOTFAbort)) + .addGroup(panelParameters1Layout.createSequentialGroup() + .addGroup(panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel10) + .addComponent(jLabel6)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(spinnerE1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(spinnerTime, javax.swing.GroupLayout.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(deviceStatePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 70, Short.MAX_VALUE) + .addGroup(panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelParameters1Layout.createSequentialGroup() .addComponent(jLabel28) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(spinnerImgOTFExp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(javax.swing.GroupLayout.Alignment.LEADING, panelParameters1Layout.createSequentialGroup() - .addGroup(panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(panelParameters1Layout.createSequentialGroup() - .addComponent(buttonImgOTFStart) - .addGap(18, 18, 18) - .addComponent(buttonImgOTFAbort)) - .addGroup(panelParameters1Layout.createSequentialGroup() - .addGroup(panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(jLabel10) - .addComponent(jLabel6)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(spinnerE1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(spinnerTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 217, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelParameters1Layout.createSequentialGroup() .addGroup(panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelParameters1Layout.createSequentialGroup() - .addGroup(panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel11, javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.TRAILING)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(spinnerE2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(spinnerDelay, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addComponent(checkImgOTFSaveImages, javax.swing.GroupLayout.Alignment.TRAILING)))) - .addContainerGap(218, Short.MAX_VALUE)) + .addComponent(jLabel11, javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.TRAILING)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(spinnerE2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(spinnerDelay, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addComponent(checkImgOTFSaveImages, javax.swing.GroupLayout.Alignment.TRAILING)) + .addGap(161, 161, 161)) ); panelParameters1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonImgOTFAbort, buttonImgOTFStart}); @@ -1439,27 +1450,33 @@ public class DataAcquisition extends Panel { panelParameters1Layout.setVerticalGroup( panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelParameters1Layout.createSequentialGroup() - .addGroup(panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel6) - .addComponent(spinnerE1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel8) - .addComponent(spinnerE2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel10) - .addComponent(spinnerTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel11) - .addComponent(spinnerDelay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel28) - .addComponent(spinnerImgOTFExp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(7, 7, 7) - .addGroup(panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(buttonImgOTFStart) - .addComponent(buttonImgOTFAbort) - .addComponent(checkImgOTFSaveImages)) - .addContainerGap(12, Short.MAX_VALUE)) + .addGroup(panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(panelParameters1Layout.createSequentialGroup() + .addGroup(panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel6) + .addComponent(spinnerE1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel8) + .addComponent(spinnerE2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel10) + .addComponent(spinnerTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel11) + .addComponent(spinnerDelay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel28) + .addComponent(spinnerImgOTFExp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(7, 7, 7) + .addGroup(panelParameters1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(buttonImgOTFStart) + .addComponent(buttonImgOTFAbort) + .addComponent(checkImgOTFSaveImages)) + .addGap(0, 5, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelParameters1Layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(deviceStatePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap()) ); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); @@ -1484,7 +1501,7 @@ public class DataAcquisition extends Panel { .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(panelParameters1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(0, 55, Short.MAX_VALUE)) + .addGap(0, 56, Short.MAX_VALUE)) ); jTabbedPane1.addTab("Absorption Spectrum", jPanel3); @@ -1807,6 +1824,7 @@ public class DataAcquisition extends Panel { private javax.swing.JComboBox comboImgMethod; private javax.swing.JComboBox comboSeq; private javax.swing.JComboBox comboSwitch; + private ch.psi.pshell.swing.DeviceStatePanel deviceStatePanel1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel20; diff --git a/plugins/Eiger.form b/plugins/Eiger.form index ecea691..59bd2bc 100755 --- a/plugins/Eiger.form +++ b/plugins/Eiger.form @@ -20,10 +20,9 @@ - + - @@ -32,59 +31,61 @@ + - - - - - - - - - + + + + + + + + + + - - - + + - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + - - - - - - - - - - - + @@ -107,13 +108,11 @@ + + - - - - - + diff --git a/plugins/Eiger.java b/plugins/Eiger.java index 01fe9d9..4fa270c 100755 --- a/plugins/Eiger.java +++ b/plugins/Eiger.java @@ -257,58 +257,57 @@ public class Eiger extends Panel { .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addComponent(renderer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(renderer, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(checkMeasurements) .addComponent(comboScale, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4) .addComponent(jLabel6) .addComponent(jLabel5) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(spinnerMax, javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(spinnerMin, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE))) + .addComponent(spinnerMin, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE)) + .addComponent(checkMeasurements)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1) + .addComponent(jLabel2) + .addComponent(jLabel3) + .addComponent(jLabel7)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel1) - .addComponent(jLabel2) - .addComponent(jLabel3) - .addComponent(jLabel7)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(textFOV, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup() .addComponent(spinnerExposure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(deviceValuePanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(deviceValuePanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(buttonShowDetectorPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE)) - .addComponent(textFOV, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addComponent(deviceValuePanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(buttonShowDetectorPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() - .addGap(86, 86, 86) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(comboMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(deviceValuePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addComponent(comboDepth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(deviceValuePanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(buttonAquire, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(buttonDone, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(comboMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(deviceValuePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addComponent(comboDepth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(deviceValuePanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(buttonAquire, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(buttonOpenVG10, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addGap(310, 310, 310) - .addComponent(buttonDone, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(buttonCloseVG10, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addContainerGap(118, Short.MAX_VALUE)))) + .addComponent(buttonCloseVG10, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(buttonOpenVG10, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGap(39, 39, 39)))) ); layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {comboDepth, comboMode, deviceValuePanel1, deviceValuePanel2, deviceValuePanel3, spinnerExposure, textFOV}); @@ -328,10 +327,9 @@ public class Eiger extends Panel { .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER, false) .addComponent(jLabel1) .addComponent(comboDepth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(deviceValuePanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(buttonDone, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(buttonCloseVG10, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addComponent(buttonCloseVG10, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(buttonDone, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(deviceValuePanel2, 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.CENTER) .addComponent(jLabel3) diff --git a/plugins/Imaging.form b/plugins/Imaging.form index 3805fdd..014a24f 100644 --- a/plugins/Imaging.form +++ b/plugins/Imaging.form @@ -23,17 +23,37 @@ - - + + + + + + + + + + + + + + - + + - + + + + + + + + @@ -43,7 +63,7 @@ - + @@ -52,34 +72,29 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - @@ -92,24 +107,19 @@ - - - - - - - - - - - - + + + + + + + + + - - @@ -119,7 +129,7 @@ - + @@ -152,11 +162,11 @@ - + - + - + @@ -164,7 +174,7 @@ - + @@ -178,7 +188,7 @@ - + @@ -220,14 +230,6 @@ - - - - - - - - @@ -242,23 +244,13 @@ - - - - - - - - - - - - - - - - - + + + + + + + @@ -270,14 +262,9 @@ - + - - - - - - + @@ -301,10 +288,10 @@ - + - + @@ -321,32 +308,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -365,7 +327,7 @@ - + @@ -378,14 +340,44 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -415,11 +407,24 @@ - - - - + + + + + + + + + + + + + + + + + @@ -544,134 +549,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -680,13 +557,89 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -697,20 +650,7 @@ - - - - - - - - - - - - - - + @@ -726,5 +666,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/Imaging.java b/plugins/Imaging.java index 204bb31..538bb26 100644 --- a/plugins/Imaging.java +++ b/plugins/Imaging.java @@ -140,14 +140,11 @@ public class Imaging extends Panel { spinnerExpositionIntensity = new javax.swing.JSpinner(); processVariablePanel1 = new ch.psi.pshell.swing.ProcessVariablePanel(); processVariablePanel2 = new ch.psi.pshell.swing.ProcessVariablePanel(); - buttonAbort = new javax.swing.JButton(); jPanel1 = new javax.swing.JPanel(); buttonRoiSet = new javax.swing.JButton(); buttonRoiClear = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); - spinnerWidth = new javax.swing.JSpinner(); - jLabel2 = new javax.swing.JLabel(); - spinnerHeight = new javax.swing.JSpinner(); + spinnerSize = new javax.swing.JSpinner(); jPanel3 = new javax.swing.JPanel(); buttonStartAutoFocus = new javax.swing.JButton(); jLabel3 = new javax.swing.JLabel(); @@ -159,29 +156,32 @@ public class Imaging extends Panel { radioStigA = new javax.swing.JRadioButton(); radioStigB = new javax.swing.JRadioButton(); radioAll = new javax.swing.JRadioButton(); - jPanel6 = new javax.swing.JPanel(); - spinnerRangeObj = new javax.swing.JSpinner(); - jLabel5 = new javax.swing.JLabel(); - jLabel6 = new javax.swing.JLabel(); - spinnerStepObj = new javax.swing.JSpinner(); - jLabel7 = new javax.swing.JLabel(); - spinnerRangeStig = new javax.swing.JSpinner(); - jLabel8 = new javax.swing.JLabel(); - spinnerStepStig = new javax.swing.JSpinner(); jLabel9 = new javax.swing.JLabel(); spinnerExposition = new javax.swing.JSpinner(); + jLabel5 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + jLabel14 = new javax.swing.JLabel(); + jLabel15 = new javax.swing.JLabel(); + spinnerRangeObj = new javax.swing.JSpinner(); + spinnerStepObj = new javax.swing.JSpinner(); + jLabel7 = new javax.swing.JLabel(); + jLabel8 = new javax.swing.JLabel(); + spinnerRangeStig = new javax.swing.JSpinner(); + spinnerStepStig = new javax.swing.JSpinner(); deviceValuePanel1 = new ch.psi.pshell.swing.DeviceValuePanel(); jLabel10 = new javax.swing.JLabel(); - checkArrows = new javax.swing.JCheckBox(); - jLabel11 = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel(); deviceValuePanel2 = new ch.psi.pshell.swing.DeviceValuePanel(); + checkMeasurements = new javax.swing.JCheckBox(); + jLabel11 = new javax.swing.JLabel(); + checkArrows = new javax.swing.JCheckBox(); + buttonAbort = new javax.swing.JButton(); - renderer.setMode(ch.psi.pshell.imaging.RendererMode.Fit); + renderer.setMode(ch.psi.pshell.imaging.RendererMode.Stretch); - jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Auto-Intensity")); + jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("X-ray illumination")); - buttonStartAutoIntensity.setText("Start"); + buttonStartAutoIntensity.setText("Auto"); buttonStartAutoIntensity.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonStartAutoIntensityActionPerformed(evt); @@ -190,7 +190,7 @@ public class Imaging extends Panel { jLabel12.setText("Exposure:"); - spinnerExpositionIntensity.setModel(new javax.swing.SpinnerNumberModel(NaNd, 0.01d, NaNd, 1.0d)); + spinnerExpositionIntensity.setModel(new javax.swing.SpinnerNumberModel(1.0d, 0.01d, 100.0d, 1.0d)); spinnerExpositionIntensity.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { spinnerExpositionIntensityStateChanged(evt); @@ -238,20 +238,13 @@ public class Imaging extends Panel { .addComponent(jLabel12) .addComponent(spinnerExpositionIntensity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(buttonStartAutoIntensity)) - .addGap(32, 32, 32) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(processVariablePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, 18) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(processVariablePanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(14, Short.MAX_VALUE)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); - buttonAbort.setText("Abort"); - buttonAbort.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - buttonAbortActionPerformed(evt); - } - }); - jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("ROI")); buttonRoiSet.setText("Set"); @@ -268,23 +261,13 @@ public class Imaging extends Panel { } }); - jLabel1.setText("Width:"); + jLabel1.setText("Size:"); - spinnerWidth.setModel(new javax.swing.SpinnerListModel(new String[] {"16", "32", "64", "128", "256", "512"})); - spinnerWidth.setValue("256"); - spinnerWidth.addChangeListener(new javax.swing.event.ChangeListener() { + spinnerSize.setModel(new javax.swing.SpinnerListModel(new String[] {"16", "32", "64", "128", "256", "512"})); + spinnerSize.setValue("256"); + spinnerSize.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { - spinnerWidthStateChanged(evt); - } - }); - - jLabel2.setText("Height"); - - spinnerHeight.setModel(new javax.swing.SpinnerListModel(new String[] {"16", "32", "64", "128", "256", "512"})); - spinnerHeight.setValue("256"); - spinnerHeight.addChangeListener(new javax.swing.event.ChangeListener() { - public void stateChanged(javax.swing.event.ChangeEvent evt) { - spinnerHeightStateChanged(evt); + spinnerSizeStateChanged(evt); } }); @@ -294,26 +277,15 @@ public class Imaging extends Panel { jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(buttonRoiClear) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(buttonRoiSet, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, Short.MAX_VALUE) - .addComponent(jLabel1) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spinnerWidth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addGap(0, 0, Short.MAX_VALUE) - .addComponent(jLabel2) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spinnerHeight, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addComponent(buttonRoiClear) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(buttonRoiSet, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, Short.MAX_VALUE) + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(spinnerSize, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) ); - jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel1, jLabel2}); - - jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {spinnerHeight, spinnerWidth}); - jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonRoiClear, buttonRoiSet}); jPanel1Layout.setVerticalGroup( @@ -324,11 +296,7 @@ public class Imaging extends Panel { .addComponent(buttonRoiClear) .addComponent(buttonRoiSet) .addComponent(jLabel1) - .addComponent(spinnerWidth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel2) - .addComponent(spinnerHeight, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(spinnerSize, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); @@ -419,6 +387,27 @@ public class Imaging extends Panel { .addGap(0, 0, 0)) ); + jLabel9.setText("Exposure:"); + + spinnerExposition.setModel(new javax.swing.SpinnerNumberModel(1.0d, 0.01d, 100.0d, 1.0d)); + spinnerExposition.addChangeListener(new javax.swing.event.ChangeListener() { + public void stateChanged(javax.swing.event.ChangeEvent evt) { + spinnerExpositionStateChanged(evt); + } + }); + + jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); + jLabel5.setText("Range:"); + + jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); + jLabel6.setText("Step:"); + + jLabel14.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); + jLabel14.setText("Obj."); + + jLabel15.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); + jLabel15.setText("Obj."); + spinnerRangeObj.setModel(new javax.swing.SpinnerNumberModel(4.0d, 1.0d, 10.0d, 1.0d)); spinnerRangeObj.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { @@ -426,12 +415,6 @@ public class Imaging extends Panel { } }); - jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); - jLabel5.setText("Range Objective:"); - - jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); - jLabel6.setText("Step Objective:"); - spinnerStepObj.setModel(new javax.swing.SpinnerNumberModel(0.2d, 0.1d, 1.0d, 0.1d)); spinnerStepObj.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { @@ -440,7 +423,10 @@ public class Imaging extends Panel { }); jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); - jLabel7.setText("Range Stigmator:"); + jLabel7.setText("Stig."); + + jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); + jLabel8.setText("Stig."); spinnerRangeStig.setModel(new javax.swing.SpinnerNumberModel(20.0d, 1.0d, 40.0d, 1.0d)); spinnerRangeStig.addChangeListener(new javax.swing.event.ChangeListener() { @@ -449,9 +435,6 @@ public class Imaging extends Panel { } }); - jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); - jLabel8.setText("Step Stigmator:"); - spinnerStepStig.setModel(new javax.swing.SpinnerNumberModel(2.0d, 1.0d, 10.0d, 1.0d)); spinnerStepStig.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { @@ -459,74 +442,13 @@ public class Imaging extends Panel { } }); - javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6); - jPanel6.setLayout(jPanel6Layout); - jPanel6Layout.setHorizontalGroup( - jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel6Layout.createSequentialGroup() - .addContainerGap() - .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel6Layout.createSequentialGroup() - .addComponent(jLabel5) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spinnerRangeObj, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel6Layout.createSequentialGroup() - .addComponent(jLabel6) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spinnerStepObj, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel6Layout.createSequentialGroup() - .addComponent(jLabel7) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spinnerRangeStig, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel6Layout.createSequentialGroup() - .addComponent(jLabel8) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spinnerStepStig, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGap(0, 0, 0)) - ); - - jPanel6Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel5, jLabel6, jLabel7, jLabel8}); - - jPanel6Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {spinnerRangeObj, spinnerRangeStig, spinnerStepObj, spinnerStepStig}); - - jPanel6Layout.setVerticalGroup( - jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel6Layout.createSequentialGroup() - .addGap(0, 0, 0) - .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel5) - .addComponent(spinnerRangeObj, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(0, 0, 0) - .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel6) - .addComponent(spinnerStepObj, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel7) - .addComponent(spinnerRangeStig, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(0, 0, 0) - .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel8) - .addComponent(spinnerStepStig, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(0, 0, 0)) - ); - - jLabel9.setText("Exposure:"); - - spinnerExposition.setModel(new javax.swing.SpinnerNumberModel(NaNd, 0.01d, NaNd, 1.0d)); - spinnerExposition.addChangeListener(new javax.swing.event.ChangeListener() { - public void stateChanged(javax.swing.event.ChangeEvent evt) { - spinnerExpositionStateChanged(evt); - } - }); - javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, Short.MAX_VALUE) + .addGap(18, 18, 18) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING) @@ -537,16 +459,42 @@ public class Imaging extends Panel { .addComponent(spinnerRuns, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(spinnerExposition, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel3Layout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(buttonStartAutoFocus) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() - .addGap(0, 0, Short.MAX_VALUE) - .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jLabel5) + .addGap(18, 18, 18) + .addComponent(jLabel14)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jLabel6) + .addGap(18, 18, 18) + .addComponent(jLabel15))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(buttonStartAutoFocus) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(spinnerRangeObj, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(spinnerStepObj, 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) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel7) + .addComponent(jLabel8)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(spinnerRangeStig, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(spinnerStepStig, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(12, Short.MAX_VALUE)))) ); jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {spinnerAverage, spinnerExposition, spinnerRuns}); + jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel5, jLabel6, jLabel7, jLabel8}); + + jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {spinnerRangeObj, spinnerRangeStig, spinnerStepObj, spinnerStepStig}); + jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() @@ -567,26 +515,28 @@ public class Imaging extends Panel { .addGroup(jPanel3Layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel5, 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(jPanel6, 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(buttonStartAutoFocus) - .addContainerGap()) + .addGap(12, 12, 12) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel5) + .addComponent(jLabel14) + .addComponent(spinnerRangeObj, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel7) + .addComponent(spinnerRangeStig, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel6) + .addComponent(jLabel15) + .addComponent(spinnerStepObj, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel8) + .addComponent(spinnerStepStig, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE) + .addComponent(buttonStartAutoFocus)) ); deviceValuePanel1.setDeviceName("temp_readout"); jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); - jLabel10.setText("Temperature (K):"); - - checkArrows.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING); - checkArrows.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - checkArrowsActionPerformed(evt); - } - }); - - jLabel11.setText("Reference arrows:"); + jLabel10.setText("T (K):"); jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel13.setText("FOV:"); @@ -597,29 +547,25 @@ public class Imaging extends Panel { jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(buttonAbort) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel10, javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(jLabel11, javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(jLabel13, javax.swing.GroupLayout.Alignment.TRAILING)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(deviceValuePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(checkArrows) - .addComponent(deviceValuePanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(15, 15, 15)) .addGroup(jPanel4Layout.createSequentialGroup() .addContainerGap() - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel4Layout.createSequentialGroup() + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap(19, Short.MAX_VALUE)) + .addGroup(jPanel4Layout.createSequentialGroup() + .addGap(6, 6, 6) + .addComponent(jLabel10) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(deviceValuePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(deviceValuePanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) + .addContainerGap()))) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -630,23 +576,41 @@ public class Imaging extends Panel { .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(164, 164, 164) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(jLabel10) - .addComponent(deviceValuePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(jLabel13) - .addComponent(deviceValuePanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(checkArrows) - .addComponent(jLabel11)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(buttonAbort) - .addContainerGap()) + .addComponent(deviceValuePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(deviceValuePanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel4Layout.createSequentialGroup() + .addGap(9, 9, 9) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel10) + .addComponent(jLabel13)))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); + checkMeasurements.setText("measurements"); + checkMeasurements.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + checkMeasurementsActionPerformed(evt); + } + }); + + jLabel11.setText("Reference arrows:"); + + checkArrows.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING); + checkArrows.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + checkArrowsActionPerformed(evt); + } + }); + + buttonAbort.setText("Abort"); + buttonAbort.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + buttonAbortActionPerformed(evt); + } + }); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( @@ -654,15 +618,31 @@ public class Imaging extends Panel { .addGroup(layout.createSequentialGroup() .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(renderer, javax.swing.GroupLayout.DEFAULT_SIZE, 592, Short.MAX_VALUE) - .addGap(18, 18, 18)) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(71, 71, 71) + .addComponent(checkMeasurements) + .addGap(34, 34, 34) + .addComponent(jLabel11) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(checkArrows) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(buttonAbort)) + .addComponent(renderer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap(17, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(renderer, javax.swing.GroupLayout.PREFERRED_SIZE, 768, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(renderer, javax.swing.GroupLayout.PREFERRED_SIZE, 638, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(checkMeasurements) + .addComponent(jLabel11)) + .addComponent(checkArrows) + .addComponent(buttonAbort)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); }// //GEN-END:initComponents @@ -677,38 +657,26 @@ public class Imaging extends Panel { private void buttonRoiSetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRoiSetActionPerformed try { - Rectangle roi = new Rectangle(0,0,Integer.valueOf(spinnerWidth.getValue().toString()),Integer.valueOf(spinnerHeight.getValue().toString())); + Rectangle roi = new Rectangle(0,0,Integer.valueOf(spinnerSize.getValue().toString()),Integer.valueOf(spinnerSize.getValue().toString())); setRoi(roi); } catch (Exception ex) { showException(ex); } }//GEN-LAST:event_buttonRoiSetActionPerformed - private void spinnerWidthStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerWidthStateChanged + private void spinnerSizeStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerSizeStateChanged try { Rectangle roi = getRoi(); if (roi!=null){ - roi.width = Integer.valueOf(spinnerWidth.getValue().toString()); + roi.width = Integer.valueOf(spinnerSize.getValue().toString()); + roi.height = Integer.valueOf(spinnerSize.getValue().toString()); setRoi(roi); } } catch (Exception ex) { showException(ex); } - }//GEN-LAST:event_spinnerWidthStateChanged - - private void spinnerHeightStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerHeightStateChanged - try { - Rectangle roi = getRoi(); - if (roi!=null){ - roi.height = Integer.valueOf(spinnerHeight.getValue().toString()); - setRoi(roi); - } - - } catch (Exception ex) { - showException(ex); - } - }//GEN-LAST:event_spinnerHeightStateChanged + }//GEN-LAST:event_spinnerSizeStateChanged private void buttonAbortActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAbortActionPerformed try { @@ -718,45 +686,6 @@ public class Imaging extends Panel { } }//GEN-LAST:event_buttonAbortActionPerformed - private void buttonStartAutoFocusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStartAutoFocusActionPerformed - try { - HashMap args = new HashMap(); - String scan_type = "all"; - if (radioObjective.isSelected()){ - scan_type = "obj"; - } else if (radioStigA.isSelected()){ - scan_type = "stiga"; - } else if (radioStigB.isSelected()){ - scan_type = "stigb"; - } - int average = (Integer)spinnerAverage.getValue(); - int runs = (Integer)spinnerRuns.getValue(); - Double exposure = (Double) spinnerExposition.getValue(); - - //runAsync("templates/AutoFocus", args).handle((ret, t) -> { - //auto_focus(range_obj=4.0, step_obj=0.2, range_stig=20.0, step_stig=2.0, average=1, runs=2, roi=None): - String cmd = "auto_focus(scan_type='" + scan_type + "'" + - ", range_obj=" + spinnerRangeObj.getValue() + - ", step_obj=" + spinnerStepObj.getValue() + - ", range_stig=" + spinnerRangeStig.getValue() + - ", step_stig=" + spinnerStepStig.getValue() + - ", average=" + average + - ", runs=" + runs + - ", renderer=IMAGING_RENDERER"+ - ", roi=IMAGING_ROI"+ - ", exposure=" + (Double.isNaN(exposure) ? "None" : exposure) + - ")"; - this.evalAsync(cmd).handle((ret, t) -> { - if ((t != null) && (!getContext().isAborted())) { - showException((Exception) t); - } - return t; - }); - } catch (Exception ex) { - showException(ex); - } - }//GEN-LAST:event_buttonStartAutoFocusActionPerformed - private void buttonStartAutoIntensityActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStartAutoIntensityActionPerformed try { //String cmd = "scan_contrast(girder_x, 0.05, 0.005, average=3)"; @@ -775,50 +704,6 @@ public class Imaging extends Panel { } }//GEN-LAST:event_buttonStartAutoIntensityActionPerformed - private void spinnerAverageStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerAverageStateChanged - // TODO add your handling code here: - }//GEN-LAST:event_spinnerAverageStateChanged - - private void spinnerRunsStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerRunsStateChanged - // TODO add your handling code here: - }//GEN-LAST:event_spinnerRunsStateChanged - - private void radioStigAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioStigAActionPerformed - updateButtons(); - }//GEN-LAST:event_radioStigAActionPerformed - - private void spinnerRangeObjStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerRangeObjStateChanged - // TODO add your handling code here: - }//GEN-LAST:event_spinnerRangeObjStateChanged - - private void spinnerStepObjStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerStepObjStateChanged - // TODO add your handling code here: - }//GEN-LAST:event_spinnerStepObjStateChanged - - private void spinnerRangeStigStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerRangeStigStateChanged - // TODO add your handling code here: - }//GEN-LAST:event_spinnerRangeStigStateChanged - - private void spinnerStepStigStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerStepStigStateChanged - // TODO add your handling code here: - }//GEN-LAST:event_spinnerStepStigStateChanged - - private void radioAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioAllActionPerformed - updateButtons(); - }//GEN-LAST:event_radioAllActionPerformed - - private void radioObjectiveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioObjectiveActionPerformed - updateButtons(); - }//GEN-LAST:event_radioObjectiveActionPerformed - - private void radioStigBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioStigBActionPerformed - updateButtons(); - }//GEN-LAST:event_radioStigBActionPerformed - - private void spinnerExpositionStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerExpositionStateChanged - // TODO add your handling code here: - }//GEN-LAST:event_spinnerExpositionStateChanged - private void checkArrowsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkArrowsActionPerformed try{ showArrows(checkArrows.isSelected()); @@ -831,6 +716,102 @@ public class Imaging extends Panel { // TODO add your handling code here: }//GEN-LAST:event_spinnerExpositionIntensityStateChanged + private void spinnerStepStigStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerStepStigStateChanged + // TODO add your handling code here: + }//GEN-LAST:event_spinnerStepStigStateChanged + + private void spinnerRangeStigStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerRangeStigStateChanged + // TODO add your handling code here: + }//GEN-LAST:event_spinnerRangeStigStateChanged + + private void spinnerStepObjStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerStepObjStateChanged + // TODO add your handling code here: + }//GEN-LAST:event_spinnerStepObjStateChanged + + private void spinnerRangeObjStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerRangeObjStateChanged + // TODO add your handling code here: + }//GEN-LAST:event_spinnerRangeObjStateChanged + + private void spinnerExpositionStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerExpositionStateChanged + // TODO add your handling code here: + }//GEN-LAST:event_spinnerExpositionStateChanged + + private void radioAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioAllActionPerformed + updateButtons(); + }//GEN-LAST:event_radioAllActionPerformed + + private void radioStigBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioStigBActionPerformed + updateButtons(); + }//GEN-LAST:event_radioStigBActionPerformed + + private void radioStigAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioStigAActionPerformed + updateButtons(); + }//GEN-LAST:event_radioStigAActionPerformed + + private void radioObjectiveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioObjectiveActionPerformed + updateButtons(); + }//GEN-LAST:event_radioObjectiveActionPerformed + + private void spinnerRunsStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerRunsStateChanged + // TODO add your handling code here: + }//GEN-LAST:event_spinnerRunsStateChanged + + private void spinnerAverageStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerAverageStateChanged + // TODO add your handling code here: + }//GEN-LAST:event_spinnerAverageStateChanged + + private void buttonStartAutoFocusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStartAutoFocusActionPerformed + try { + HashMap args = new HashMap(); + String scan_type = "all"; + if (radioObjective.isSelected()){ + scan_type = "obj"; + } else if (radioStigA.isSelected()){ + scan_type = "stiga"; + } else if (radioStigB.isSelected()){ + scan_type = "stigb"; + } + int average = (Integer)spinnerAverage.getValue(); + int runs = (Integer)spinnerRuns.getValue(); + Double exposure = (Double) spinnerExposition.getValue(); + + //runAsync("templates/AutoFocus", args).handle((ret, t) -> { + //auto_focus(range_obj=4.0, step_obj=0.2, range_stig=20.0, step_stig=2.0, average=1, runs=2, roi=None): + String cmd = "auto_focus(scan_type='" + scan_type + "'" + + ", range_obj=" + spinnerRangeObj.getValue() + + ", step_obj=" + spinnerStepObj.getValue() + + ", range_stig=" + spinnerRangeStig.getValue() + + ", step_stig=" + spinnerStepStig.getValue() + + ", average=" + average + + ", runs=" + runs + + ", renderer=IMAGING_RENDERER"+ + ", roi=IMAGING_ROI"+ + ", exposure=" + (Double.isNaN(exposure) ? "None" : exposure) + + ")"; + this.evalAsync(cmd).handle((ret, t) -> { + if ((t != null) && (!getContext().isAborted())) { + showException((Exception) t); + } + return t; + }); + } catch (Exception ex) { + showException(ex); + } + }//GEN-LAST:event_buttonStartAutoFocusActionPerformed + + private void checkMeasurementsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkMeasurementsActionPerformed + try { + if (checkMeasurements.isSelected()){ + setGlobalVar("PLUGIN_RENDERER", renderer); + evalAsync("start_measurements(renderer=PLUGIN_RENDERER)"); + } else { + evalAsync("stop_measurements()"); + } + } catch (Exception ex) { + showException(ex); + } + }//GEN-LAST:event_checkMeasurementsActionPerformed + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton buttonAbort; private javax.swing.ButtonGroup buttonGroup1; @@ -839,6 +820,7 @@ public class Imaging extends Panel { private javax.swing.JButton buttonStartAutoFocus; private javax.swing.JButton buttonStartAutoIntensity; private javax.swing.JCheckBox checkArrows; + private javax.swing.JCheckBox checkMeasurements; private ch.psi.pshell.swing.DeviceValuePanel deviceValuePanel1; private ch.psi.pshell.swing.DeviceValuePanel deviceValuePanel2; private javax.swing.JLabel jLabel1; @@ -846,7 +828,8 @@ public class Imaging extends Panel { private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel12; private javax.swing.JLabel jLabel13; - private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel14; + private javax.swing.JLabel jLabel15; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; @@ -859,7 +842,6 @@ public class Imaging extends Panel { private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel4; private javax.swing.JPanel jPanel5; - private javax.swing.JPanel jPanel6; private ch.psi.pshell.swing.ProcessVariablePanel processVariablePanel1; private ch.psi.pshell.swing.ProcessVariablePanel processVariablePanel2; private javax.swing.JRadioButton radioAll; @@ -870,12 +852,11 @@ public class Imaging extends Panel { private javax.swing.JSpinner spinnerAverage; private javax.swing.JSpinner spinnerExposition; private javax.swing.JSpinner spinnerExpositionIntensity; - private javax.swing.JSpinner spinnerHeight; private javax.swing.JSpinner spinnerRangeObj; private javax.swing.JSpinner spinnerRangeStig; private javax.swing.JSpinner spinnerRuns; + private javax.swing.JSpinner spinnerSize; private javax.swing.JSpinner spinnerStepObj; private javax.swing.JSpinner spinnerStepStig; - private javax.swing.JSpinner spinnerWidth; // End of variables declaration//GEN-END:variables } diff --git a/plugins/XPEEM_Settings.form b/plugins/XPEEM_Settings.form index 67b52cf..f5a329d 100644 --- a/plugins/XPEEM_Settings.form +++ b/plugins/XPEEM_Settings.form @@ -19,12 +19,37 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -32,14 +57,41 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -47,7 +99,7 @@ - + @@ -55,7 +107,7 @@ - + @@ -63,7 +115,8 @@ - + + @@ -77,5 +130,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/XPEEM_Settings.java b/plugins/XPEEM_Settings.java index c172733..c7b6b62 100644 --- a/plugins/XPEEM_Settings.java +++ b/plugins/XPEEM_Settings.java @@ -58,22 +58,30 @@ public class XPEEM_Settings extends Panel { ButtonDefaultOptics15kV = new javax.swing.JButton(); ButtonDefaultOptics10kV = new javax.swing.JButton(); ButtonNeutralizePosition = new javax.swing.JButton(); + label1 = new java.awt.Label(); + label2 = new java.awt.Label(); + label3 = new java.awt.Label(); + label4 = new java.awt.Label(); + label5 = new java.awt.Label(); + label6 = new java.awt.Label(); + label7 = new java.awt.Label(); - ButtonDefaultXrays.setText("X-rays (Default)"); + ButtonDefaultXrays.setText("X-rays (Standard)"); ButtonDefaultXrays.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ButtonDefaultXraysActionPerformed(evt); } }); - ButtonDefaultOptics15kV.setText("PEEM Optics 15 kV (Default)"); + ButtonDefaultOptics15kV.setText("PEEM Optics 15 kV (Standard)"); ButtonDefaultOptics15kV.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ButtonDefaultOptics15kVActionPerformed(evt); } }); - ButtonDefaultOptics10kV.setText("PEEM Optics 10 kV (Default)"); + ButtonDefaultOptics10kV.setText("PEEM Optics 10 kV (Standard)"); + ButtonDefaultOptics10kV.setToolTipText(""); ButtonDefaultOptics10kV.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ButtonDefaultOptics10kVActionPerformed(evt); @@ -87,6 +95,20 @@ public class XPEEM_Settings extends Panel { } }); + label1.setText("ID2 only, lin. hor., harm.=1, offset = -2.0, G3, 800 eV,"); + + label2.setText("diff. order = 1, cff = 2.25, energy slit = 300, FE = closed, "); + + label3.setText("Obj. = 1220.0 mA, Stig. A,B = 0.0, Obj. Align. x,y = 0.0, Start voltage = 0.0,"); + + label4.setText("Obj. = 1475.0 mA, Stig. A,B = 0.0, Obj. Align. x,y = 0.0, Start voltage = 0.0,"); + + label5.setText(" FOV = 100 um, CA = open, Slit = open."); + + label6.setText(" FOV = 100 um, CA = open, Slit = open."); + + label7.setText("x,y = 0.0, tilt = 0.0"); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( @@ -94,11 +116,29 @@ public class XPEEM_Settings extends Panel { .addGroup(layout.createSequentialGroup() .addGap(79, 79, 79) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(ButtonNeutralizePosition) - .addComponent(ButtonDefaultOptics10kV) - .addComponent(ButtonDefaultOptics15kV) - .addComponent(ButtonDefaultXrays)) - .addContainerGap(322, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addComponent(ButtonNeutralizePosition) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(label7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addComponent(ButtonDefaultOptics10kV) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(label3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(label5, javax.swing.GroupLayout.PREFERRED_SIZE, 340, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(layout.createSequentialGroup() + .addComponent(ButtonDefaultOptics15kV) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(label4, javax.swing.GroupLayout.PREFERRED_SIZE, 481, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(label6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(layout.createSequentialGroup() + .addComponent(ButtonDefaultXrays) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(label2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(label1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addContainerGap(68, Short.MAX_VALUE)) ); layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {ButtonDefaultOptics10kV, ButtonDefaultOptics15kV, ButtonDefaultXrays, ButtonNeutralizePosition}); @@ -107,15 +147,36 @@ public class XPEEM_Settings extends Panel { layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(46, 46, 46) - .addComponent(ButtonDefaultOptics15kV) - .addGap(36, 36, 36) - .addComponent(ButtonDefaultOptics10kV) - .addGap(36, 36, 36) - .addComponent(ButtonDefaultXrays) - .addGap(34, 34, 34) - .addComponent(ButtonNeutralizePosition) - .addContainerGap(115, Short.MAX_VALUE)) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(ButtonDefaultOptics15kV) + .addGroup(layout.createSequentialGroup() + .addComponent(label4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(label6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(39, 39, 39) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(ButtonDefaultOptics10kV) + .addGap(36, 36, 36) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(layout.createSequentialGroup() + .addComponent(ButtonDefaultXrays) + .addGap(42, 42, 42) + .addComponent(ButtonNeutralizePosition)) + .addGroup(layout.createSequentialGroup() + .addComponent(label1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(label2, 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(label7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGroup(layout.createSequentialGroup() + .addComponent(label3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(1, 1, 1) + .addComponent(label5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap(83, Short.MAX_VALUE)) ); + + label1.getAccessibleContext().setAccessibleName("ID2 only, lin. hor., G3, 800 eV, energy slit = 300,"); }// //GEN-END:initComponents private void ButtonDefaultXraysActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButtonDefaultXraysActionPerformed @@ -175,5 +236,12 @@ public class XPEEM_Settings extends Panel { private javax.swing.JButton ButtonDefaultOptics15kV; private javax.swing.JButton ButtonDefaultXrays; private javax.swing.JButton ButtonNeutralizePosition; + private java.awt.Label label1; + private java.awt.Label label2; + private java.awt.Label label3; + private java.awt.Label label4; + private java.awt.Label label5; + private java.awt.Label label6; + private java.awt.Label label7; // End of variables declaration//GEN-END:variables } diff --git a/script/devices/LEEM2000.py b/script/devices/LEEM2000.py index 8a73fe9..5315bf0 100644 --- a/script/devices/LEEM2000.py +++ b/script/devices/LEEM2000.py @@ -7,7 +7,10 @@ class LEEM2000(TcpDevice): self.NUMBER_MNEMONICS = 100 self._mnemonics = None self._names = None - self.high_voltage = Channel("X11MA-ES1-PEEM:UMON", alias = "PEEM high voltage", monitored=True) + try: + self.high_voltage = Channel("X11MA-ES1-PEEM:UMON", alias = "PEEM high voltage", monitored=True) + except: + self.high_voltage = None self.debug = False self.retries = 1 self.timeout = 1000 @@ -119,10 +122,10 @@ class LEEM2000(TcpDevice): def get_high_voltage(self): return self.high_voltage.get(False) - def get_child(self, var, name=None): + def get_child(self, var, name=None, scale=None): if name is None: name=var - ret = LEEM2000Child(name, var, self) + ret = LEEM2000Child(name, var, self, scale) ret.initialize() return ret @@ -203,15 +206,23 @@ class LEEM2000(TcpDevice): class LEEM2000Child(RegisterBase): - def __init__(self,name, var, microscope): + def __init__(self,name, var, microscope, scale=None): RegisterBase.__init__(self,name) self.var = var + self.scale = scale self.microscope = microscope def doRead(self): - return self.microscope.get_value(self.var) + ret = self.microscope.get_value(self.var) + if ret is not None: + if self.scale is not None: + ret = float(ret)*self.scale + return ret def doWrite(self, val): + if val is not None: + if self.scale is not None: + val = float(val)/self.scale self.microscope.set_value(self.var, val) class LEEM2000Positioner (PositionerBase): @@ -283,7 +294,7 @@ add_device (microscope.get_tilt('D','U', "tilt_v"), True) add_device (microscope.get_child("MOBJ","objective"), True) add_device (microscope.get_child("OSTIGA","obj_stig_a"), True) add_device (microscope.get_child("OSTIGB","obj_stig_b"), True) -add_device (microscope.get_child("MDRIVE","azimuth_rot"), True) +add_device (microscope.get_child("MDRIVE","azimuth_rot", 0.01794), True) add_device (microscope.get_child("BOMBV","bv"), True) add_device (microscope.get_child("FIL","fil"), True) add_device (microscope.get_child("STV","start_voltage"), True) @@ -321,8 +332,11 @@ class Fov(ReadonlyRegisterBase): self.position = 0 def doRead(self): - return self.mic.get_preset_label() - + ret = self.mic.get_preset_label() + if ret is not None: + if ":" in ret: + ret = ret[0:ret.rindex(":")] + return ret def init_tilt(): @@ -337,6 +351,8 @@ tilt_horizontal.polling=500 manip_x.polling=500 manip_y.polling=500 fov.polling=5000 +azimuth_rot.precision=2 +azimuth_rot.polling=5000 bv.polling=1000 fil.polling=1000 diff --git a/script/imaging/shifts.py b/script/imaging/shifts.py index 87c2eba..492a63e 100644 --- a/script/imaging/shifts.py +++ b/script/imaging/shifts.py @@ -36,10 +36,15 @@ def load_corr_stack(title="Corr", show=False): file_list.append("{images}/TestObjAligner_corr/i210517_0" + str(index) + "#001.tif") return load_stack(title, file_list, show) +def instantiate_dynamic_class(name): + if get_context().getPluginManager().getDynamicClass(name) is None: + get_context().getPluginManager().loadInitializePlugin(name + ".java") + return get_context().getClassByName(name).newInstance() + + def complex_edge_filtering(imp, complex=True, g_sigma=3.0, g_resolution=1e-4, show=False, java_code=False): if java_code: - get_context().getPluginManager().loadInitializePlugin("Align_ComplexEdgeFiltering.java") - complex_edge_filter = get_context().getClassByName("Align_ComplexEdgeFiltering").newInstance() + complex_edge_filter = instantiate_dynamic_class("Align_ComplexEdgeFiltering") complex_edge_filter.setup(str(g_sigma)+","+str(complex)+","+str(show), imp) #Gaussian blur radius, Complex (True) or Real (False), show dialog = False complex_edge_filter.run(imp.getProcessor()) return complex_edge_filter.output @@ -151,8 +156,7 @@ class TranslationFilter(ExtendedPlugInFilter): def translate(stack, shifts, show=False, java_code=False): WindowManager.setTempCurrentImage(stack) if java_code: - get_context().getPluginManager().loadInitializePlugin("Align_TranslationFilter.java") - translation_filter = get_context().getClassByName("Align_TranslationFilter").newInstance() + translation_filter = instantiate_dynamic_class("Align_TranslationFilter") translation_filter.imp = imp translation_filter.shifts = shifts pfr = PlugInFilterRunner(translation_filter, "", "" ) @@ -170,13 +174,11 @@ def translate(stack, shifts, show=False, java_code=False): def load_shifts(filename): - get_context().getPluginManager().loadInitializePlugin("ShiftsIO.java") - sio = get_context().getClassByName("ShiftsIO").newInstance() + sio = instantiate_dynamic_class("ShiftsIO") return sio.load(expand_path(filename), "directshifts") def save_shifts(filename, shifts): - get_context().getPluginManager().loadInitializePlugin("ShiftsIO.java") - sio = get_context().getClassByName("ShiftsIO").newInstance() + sio = instantiate_dynamic_class("ShiftsIO") sio.save(expand_path(filename), shifts, "directshifts") @@ -588,8 +590,7 @@ def calculate_shifts(imp_r, imp_i, roi, upscale_factor=100, reference_slide=1, j if roi is None or roi.bounds.minX <0 or roi.bounds.minY<0 or roi.bounds.maxX>=imp_r.width or roi.bounds.maxY>=imp_r.height: raise Exception("Invalid roi: " + str(roi)) if java_code: - get_context().getPluginManager().loadInitializePlugin("Align_ComputeShifts.java") - compute_shifts_filter = get_context().getClassByName("Align_ComputeShifts").newInstance() + compute_shifts_filter = instantiate_dynamic_class("Align_ComputeShifts") compute_shifts_filter.setup(upscale_factor, False, imp_r, imp_i, 1, roi) compute_shifts_filter.run(None) return compute_shifts_filter.shifts diff --git a/script/local.py b/script/local.py index fd22b73..a4f45da 100644 --- a/script/local.py +++ b/script/local.py @@ -834,6 +834,10 @@ def peem_optics_default_15kV(): obj_align_y.write(0) start_voltage.write(0) # fov.write(100) + microscope.send_receive("sep 100um") + microscope.send_receive("mmp 7 -9044.7", 60000) + microscope.send_receive("mmp 2 -5998.6", 60000) + microscope.send_receive("mmp 1 0.0", 60000) def peem_optics_default_10kV(): objective.write(1220) @@ -842,12 +846,18 @@ def peem_optics_default_10kV(): obj_align_x.write(0) obj_align_y.write(0) start_voltage.write(0) + microscope.send_receive("sep 100um") + microscope.send_receive("mmp 7 -9044.7", 60000) + microscope.send_receive("mmp 2 -5998.6", 60000) + microscope.send_receive("mmp 1 0.0", 60000) + + # x-rays default setup def xrays_default(): exit_slit.write(300.0) caput ('X11MA-FE-DSAPER', 0) # close FE-slits - set_beamline_setup(id ="ID2", en=800, pol2="Lin_Hor", grat="G3_600", order=1, Cff=2.25) + set_beamline_setup(id ="PGM_ID2",en=800, pol2="Lin_Hor", har2 = "1", off2 = "-2.0", grat="G3_600", order="1", Cff=2.25) def neutralize_position(retries = 3): for i in range(retries): diff --git a/script/templates/FocusScan.py b/script/templates/FocusScan.py index 5e1a493..274c674 100644 --- a/script/templates/FocusScan.py +++ b/script/templates/FocusScan.py @@ -102,16 +102,16 @@ def scan_contrast(positioner, pos_range, pos_step, roi = None, average = 1, upda positioner.write(mn) else: print "Invalid fit for ", positioner.name, mn, range_scan - time.sleep(1.0) # Wait restoring positions + time.sleep(SETTLING_TIME) # Wait restoring positions return r def update_roi_pos(cur_data, former_data): - roi=get_focus_scan_roi() - calc_roi = Roi(roi.x,roi.y,roi.width, roi.height) try: + roi=get_focus_scan_roi() + calc_roi = Roi(roi.x,roi.y,roi.width, roi.height) xoff, yoff, error, diffphase, _ = calculate_shift(former_data,cur_data, calc_roi) - print "Calculated shift: ", xoff, yoff, error, diffphase + print "Calculated shift: ", xoff, yoff, error, diffphase, if (abs(xoff) <= MAX_SHIFT) and (abs(yoff) <= MAX_SHIFT): x,y=int(roi.x - xoff), int(roi.y - yoff) print "Updating ROI location to ", x, y @@ -144,10 +144,11 @@ def scan_focus(positioner, pos_range, pos_step, average = 1, update_position = T def before_read(pos,scan): global former_data - if str(eiger.grabMode)=="Single": - eiger.start() - image.waitNext(20000) - + if str(eiger.grabMode)=="Single": + eiger.start() + else: + time.sleep(eiger.exposure) + image.waitNext(20000) cur_data = image.data try: print "----- Pos: ", pos @@ -178,7 +179,7 @@ def scan_focus(positioner, pos_range, pos_step, average = 1, update_position = T r = lscan( positioner, [sensor,], -pos_range, pos_range, pos_step, \ - latency=eiger.exposure+SETTLING_TIME, relative=True, initial_move=False, restore_position=False, \ + latency=SETTLING_TIME, relative=True, initial_move=False, restore_position=False, \ before_read=before_read, after_read=after_read, before_pass=before_pass) ydata, xdata = r[sensor], r[positioner] @@ -206,5 +207,5 @@ def scan_focus(positioner, pos_range, pos_step, average = 1, update_position = T print "Invalid fit for ", positioner.name, mn, range_scan apply_focus_scan_pos(initial_state) if initial_roi_location: roi.location=initial_roi_location - time.sleep(1.0) # Wait restoring positions + time.sleep(0.) # Wait restoring positions return r