Tilt homing

This commit is contained in:
e19752
2022-05-24 10:16:16 +02:00
parent 065e33ad05
commit 6de2af0dca
181 changed files with 5817 additions and 1017 deletions
+1 -1
View File
@@ -53,7 +53,7 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="deviceValuePanel4" min="-2" pref="127" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonShowDetectorPanel" min="-2" pref="127" max="-2" attributes="0"/>
<Component id="buttonShowDetectorPanel" pref="127" max="32767" attributes="0"/>
</Group>
<Component id="textFOV" linkSize="1" min="-2" max="-2" attributes="0"/>
</Group>
+2 -2
View File
@@ -86,7 +86,7 @@ public class Eiger extends Panel {
new Thread(()->{
String fov="";
try {
fov = String.valueOf(eval("microscope.get_preset_label()", true));
fov = String.valueOf(eval("fov.take()", true));
} catch (Exception ex) {
}
String label =fov;
@@ -286,7 +286,7 @@ public class Eiger extends Panel {
.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.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE))
.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)))
.addGroup(layout.createSequentialGroup()
.addGap(86, 86, 86)
+95 -4
View File
@@ -61,6 +61,21 @@
<Component id="buttonAbort" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel10" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel11" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel13" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="deviceValuePanel1" alignment="0" min="-2" pref="117" max="-2" attributes="0"/>
<Component id="checkArrows" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="deviceValuePanel2" alignment="0" min="-2" pref="117" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="15" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
@@ -72,9 +87,24 @@
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel3" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="jLabel10" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="deviceValuePanel1" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="jLabel13" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="deviceValuePanel2" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="checkArrows" min="-2" max="-2" attributes="0"/>
<Component id="jLabel11" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<Component id="buttonAbort" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -92,6 +122,13 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="jLabel12" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="spinnerExpositionIntensity" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="buttonStartAutoIntensity" min="-2" max="-2" attributes="0"/>
@@ -102,6 +139,10 @@
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel12" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="spinnerExpositionIntensity" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<Component id="buttonStartAutoIntensity" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
@@ -118,6 +159,21 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonStartAutoIntensityActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel12">
<Properties>
<Property name="text" type="java.lang.String" value="Exposure:"/>
</Properties>
</Component>
<Component class="javax.swing.JSpinner" name="spinnerExpositionIntensity">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="NaN" maximum="NaN" minimum="0.01" numberType="java.lang.Double" stepSize="1.0" type="number"/>
</Property>
</Properties>
<Events>
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spinnerExpositionIntensityStateChanged"/>
</Events>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="buttonAbort">
@@ -279,7 +335,7 @@
</Group>
</Group>
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="97" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="buttonStartAutoFocus" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
@@ -317,7 +373,7 @@
</Group>
<EmptySpace max="32767" attributes="0"/>
<Component id="jPanel6" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="32767" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="buttonStartAutoFocus" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
@@ -500,7 +556,7 @@
<Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="spinnerStepStig" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -589,6 +645,41 @@
</Component>
</SubComponents>
</Container>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="deviceValuePanel1">
<Properties>
<Property name="deviceName" type="java.lang.String" value="temp_readout"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel10">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Temperature (K):"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkArrows">
<Properties>
<Property name="horizontalTextPosition" type="int" value="10"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkArrowsActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel11">
<Properties>
<Property name="text" type="java.lang.String" value="Reference arrows:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel13">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="FOV:"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="deviceValuePanel2">
<Properties>
<Property name="deviceName" type="java.lang.String" value="fov"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
+112 -8
View File
@@ -1,3 +1,4 @@
import ch.psi.pshell.core.Context;
import ch.psi.pshell.imaging.Overlay;
import ch.psi.pshell.imaging.Overlays.Rect;
import ch.psi.pshell.imaging.Renderer;
@@ -115,6 +116,16 @@ public class Imaging extends Panel {
}
};
void showArrows(boolean show) throws Exception{
if (show){
setGlobalVar("IMAGING_RENDERER", renderer);
evalAsync("start_arrows(renderer=IMAGING_RENDERER)");
} else {
setGlobalVar("IMAGING_RENDERER", renderer);
evalAsync("stop_arrows(renderer=IMAGING_RENDERER)");
}
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
@@ -125,6 +136,8 @@ public class Imaging extends Panel {
jPanel4 = new javax.swing.JPanel();
jPanel2 = new javax.swing.JPanel();
buttonStartAutoIntensity = new javax.swing.JButton();
jLabel12 = new javax.swing.JLabel();
spinnerExpositionIntensity = new javax.swing.JSpinner();
buttonAbort = new javax.swing.JButton();
jPanel1 = new javax.swing.JPanel();
buttonRoiSet = new javax.swing.JButton();
@@ -155,6 +168,12 @@ public class Imaging extends Panel {
spinnerStepStig = new javax.swing.JSpinner();
jLabel9 = new javax.swing.JLabel();
spinnerExposition = 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();
renderer.setMode(ch.psi.pshell.imaging.RendererMode.Fit);
@@ -167,10 +186,25 @@ public class Imaging extends Panel {
}
});
jLabel12.setText("Exposure:");
spinnerExpositionIntensity.setModel(new javax.swing.SpinnerNumberModel(NaNd, 0.01d, NaNd, 1.0d));
spinnerExpositionIntensity.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
spinnerExpositionIntensityStateChanged(evt);
}
});
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel12)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(spinnerExpositionIntensity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonStartAutoIntensity)
@@ -179,7 +213,10 @@ public class Imaging extends Panel {
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel12)
.addComponent(spinnerExpositionIntensity, 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(buttonStartAutoIntensity)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
@@ -447,7 +484,7 @@ public class Imaging extends Panel {
.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))
.addContainerGap())
.addGap(0, 0, 0))
);
jLabel9.setText("Exposure:");
@@ -476,7 +513,7 @@ 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()
.addGap(97, 97, 97)
.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()
@@ -508,11 +545,30 @@ public class Imaging extends Panel {
.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.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonStartAutoFocus)
.addContainerGap())
);
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:");
jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
jLabel13.setText("FOV:");
deviceValuePanel2.setDeviceName("fov");
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
@@ -528,6 +584,18 @@ public class Imaging extends Panel {
.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))
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -538,9 +606,21 @@ 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)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.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(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
@@ -636,7 +716,8 @@ public class Imaging extends Panel {
", runs=" + runs +
", renderer=IMAGING_RENDERER"+
", roi=IMAGING_ROI"+
", exposure=" + (Double.isNaN(exposure) ? "None" : exposure) + ")";
", exposure=" + (Double.isNaN(exposure) ? "None" : exposure) +
")";
this.evalAsync(cmd).handle((ret, t) -> {
if ((t != null) && (!getContext().isAborted())) {
showException((Exception) t);
@@ -650,8 +731,11 @@ public class Imaging extends Panel {
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)";
String cmd = "auto_intensity(roi=IMAGING_ROI)";
//String cmd = "scan_contrast(girder_x, 0.05, 0.005, average=3)";
Double exposure = (Double) spinnerExpositionIntensity.getValue();
String cmd = "auto_intensity(roi=IMAGING_ROI" +
", exposure=" + (Double.isNaN(exposure) ? "None" : exposure) +
")";
this.evalAsync(cmd).handle((ret, t) -> {
if ((t != null) && (!getContext().isAborted())) {
showException((Exception) t);
@@ -707,6 +791,18 @@ public class Imaging extends Panel {
// 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());
} catch (Exception ex) {
showException(ex);
}
}//GEN-LAST:event_checkArrowsActionPerformed
private void spinnerExpositionIntensityStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerExpositionIntensityStateChanged
// TODO add your handling code here:
}//GEN-LAST:event_spinnerExpositionIntensityStateChanged
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton buttonAbort;
private javax.swing.ButtonGroup buttonGroup1;
@@ -714,7 +810,14 @@ public class Imaging extends Panel {
private javax.swing.JButton buttonRoiSet;
private javax.swing.JButton buttonStartAutoFocus;
private javax.swing.JButton buttonStartAutoIntensity;
private javax.swing.JCheckBox checkArrows;
private ch.psi.pshell.swing.DeviceValuePanel deviceValuePanel1;
private ch.psi.pshell.swing.DeviceValuePanel deviceValuePanel2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
@@ -736,6 +839,7 @@ public class Imaging extends Panel {
private ch.psi.pshell.imaging.Renderer renderer;
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;
+81
View File
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="79" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="ButtonNeutralizePosition" min="-2" max="-2" attributes="0"/>
<Component id="ButtonDefaultOptics10kV" min="-2" max="-2" attributes="0"/>
<Component id="ButtonDefaultOptics15kV" min="-2" max="-2" attributes="0"/>
<Component id="ButtonDefaultXrays" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="322" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="46" max="-2" attributes="0"/>
<Component id="ButtonDefaultOptics15kV" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="36" max="-2" attributes="0"/>
<Component id="ButtonDefaultOptics10kV" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="36" max="-2" attributes="0"/>
<Component id="ButtonDefaultXrays" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="34" max="-2" attributes="0"/>
<Component id="ButtonNeutralizePosition" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="115" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="ButtonDefaultXrays">
<Properties>
<Property name="text" type="java.lang.String" value="X-rays (Default)"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="ButtonDefaultXraysActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="ButtonDefaultOptics15kV">
<Properties>
<Property name="text" type="java.lang.String" value="PEEM Optics 15 kV (Default)"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="ButtonDefaultOptics15kVActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="ButtonDefaultOptics10kV">
<Properties>
<Property name="text" type="java.lang.String" value="PEEM Optics 10 kV (Default)"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="ButtonDefaultOptics10kVActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="ButtonNeutralizePosition">
<Properties>
<Property name="text" type="java.lang.String" value="Sample Position (Neutralize)"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="ButtonNeutralizePositionActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
+171
View File
@@ -0,0 +1,171 @@
import ch.psi.pshell.ui.Panel;
import ch.psi.utils.State;
/**
*
*/
public class XPEEM_Settings extends Panel {
public XPEEM_Settings() {
initComponents();
}
//Overridable callbacks
@Override
public void onInitialize(int runCount) {
}
@Override
public void onStateChange(State state, State former) {
}
@Override
public void onExecutedFile(String fileName, Object result) {
}
@Override
protected void onTimer() {
}
@Override
protected void onLoaded() {
}
@Override
protected void onUnloaded() {
}
//Invoked by 'update()' to update components in the event thread
@Override
protected void doUpdate() {
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
ButtonDefaultXrays = new javax.swing.JButton();
ButtonDefaultOptics15kV = new javax.swing.JButton();
ButtonDefaultOptics10kV = new javax.swing.JButton();
ButtonNeutralizePosition = new javax.swing.JButton();
ButtonDefaultXrays.setText("X-rays (Default)");
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.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ButtonDefaultOptics15kVActionPerformed(evt);
}
});
ButtonDefaultOptics10kV.setText("PEEM Optics 10 kV (Default)");
ButtonDefaultOptics10kV.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ButtonDefaultOptics10kVActionPerformed(evt);
}
});
ButtonNeutralizePosition.setText("Sample Position (Neutralize)");
ButtonNeutralizePosition.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ButtonNeutralizePositionActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.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))
);
layout.setVerticalGroup(
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))
);
}// </editor-fold>//GEN-END:initComponents
private void ButtonDefaultXraysActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButtonDefaultXraysActionPerformed
try {
evalAsync("xrays_default()").handle((ret,ex)->{
if (ex!=null){
showException((Exception)ex);
}
return ret;
});
} catch (Exception ex) {
showException(ex);
}
}//GEN-LAST:event_ButtonDefaultXraysActionPerformed
private void ButtonDefaultOptics15kVActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButtonDefaultOptics15kVActionPerformed
try {
evalAsync("peem_optics_default_15kV()").handle((ret,ex)->{
if (ex!=null){
showException((Exception)ex);
}
return ret;
});
} catch (Exception ex) {
showException(ex);
}
}//GEN-LAST:event_ButtonDefaultOptics15kVActionPerformed
private void ButtonDefaultOptics10kVActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButtonDefaultOptics10kVActionPerformed
try {
evalAsync("peem_optics_default_10kV()").handle((ret,ex)->{
if (ex!=null){
showException((Exception)ex);
}
return ret;
});
} catch (Exception ex) {
showException(ex);
}
}//GEN-LAST:event_ButtonDefaultOptics10kVActionPerformed
private void ButtonNeutralizePositionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButtonNeutralizePositionActionPerformed
try {
evalAsync("neutralize_position()").handle((ret,ex)->{
if (ex!=null){
showException((Exception)ex);
}
return ret;
});
} catch (Exception ex) {
showException(ex);
}
}//GEN-LAST:event_ButtonNeutralizePositionActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton ButtonDefaultOptics10kV;
private javax.swing.JButton ButtonDefaultOptics15kV;
private javax.swing.JButton ButtonDefaultXrays;
private javax.swing.JButton ButtonNeutralizePosition;
// End of variables declaration//GEN-END:variables
}