diff --git a/config/devices.properties b/config/devices.properties
index 12fdff9..aa4cb58 100644
--- a/config/devices.properties
+++ b/config/devices.properties
@@ -54,11 +54,18 @@ FillingPattern=ch.psi.pshell.epics.ChannelDoubleArray|ACORF-FILL:UnsortComp|Read
#MCPArray2=ch.psi.pshell.epics.ChannelIntegerArray|X11MA-ES4:PHC-CTRWF2|Read||true
#NrCounters=ch.psi.pshell.epics.ChannelInteger|X11MA-ES4:NCTR|Read||true
energy_rbk=ch.psi.pshell.epics.ChannelDouble|X11MA-PGM:rbkenergy|Read||true
-energy_done=ch.psi.pshell.epics.ChannelDouble|X11MA-PHS:ALL-DONE|Read||true
+#energy_done=ch.psi.pshell.epics.ChannelDouble|X11MA-PHS:ALL-DONE|Read||true
keithley_1a=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1:CADC1|Read||true
keithley_2a=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1:CADC2|Read||true
keithley_3a=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1:CADC3|Read||true
otf_start=ch.psi.pshell.epics.ChannelInteger|X11MA-OTF:GO|||true
eiger=ch.psi.pshell.epics.AreaDetector|X11MA-ES1-SD1|||true
+eiger_bit_depth_rbv=ch.psi.pshell.epics.ChannelInteger|X11MA-ES1-SD1:cam1:BitDepth_RBV|Read||true
+eiger_mode_rbv=ch.psi.pshell.epics.ChannelString|X11MA-ES1-SD1:cam1:ImageMode_RBV|Read||true
+eiger_exposure_rbv=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1-SD1:cam1:AcquireTime_RBV 2|Read||true
+eiger_status=ch.psi.pshell.epics.ChannelString|X11MA-ES1-SD1:cam1:Acquire|||true
+eiger_bit_depth=ch.psi.pshell.epics.ChannelInteger|X11MA-ES1-SD1:cam1:BitDepth|||true
+eiger_mode=ch.psi.pshell.epics.ChannelInteger|X11MA-ES1-SD1:cam1:ImageMode|||true
+eiger_exposure=ch.psi.pshell.epics.ChannelDouble|X11MA-ES1-SD1:cam1:AcquireTime 2|||true
image=ch.psi.pshell.imaging.CameraSource|eiger|||true
axis=ch.psi.pshell.imaging.MjpegSource|http://axis-x11ma.psi.ch/axis-cgi/mjpg/video.cgi?id=176 true||-200|false
diff --git a/config/plugins.properties b/config/plugins.properties
index a690305..59b23fe 100644
--- a/config/plugins.properties
+++ b/config/plugins.properties
@@ -5,6 +5,7 @@ EnergyScan_TBT.java=enabled
DelayScan.java=enabled
EnergyScan.java=enabled
DataAcquisition.java=enabled
+Eiger.java=enabled
Beamline.java=enabled
Settings.java=enabled
Test.java=disabled
diff --git a/config/settings.properties b/config/settings.properties
index 18def0c..df3914b 100644
--- a/config/settings.properties
+++ b/config/settings.properties
@@ -1,4 +1,4 @@
-#Thu Dec 17 10:02:51 CET 2020
+#Fri Dec 18 11:36:05 CET 2020
HARMONIC_ID_1=1
RSYNC_USER=
OUTLIERS_THRESHOLD=1000000000
diff --git a/devices/image.properties b/devices/image.properties
index 4144a4f..fe1f813 100644
--- a/devices/image.properties
+++ b/devices/image.properties
@@ -1,4 +1,4 @@
-#Wed Dec 16 18:09:54 CET 2020
+#Fri Dec 18 09:55:11 CET 2020
spatialCalOffsetY=NaN
spatialCalOffsetX=NaN
colormapLogarithmic=false
diff --git a/plugins/DataAcquisition.form b/plugins/DataAcquisition.form
index d3f9476..51defc3 100644
--- a/plugins/DataAcquisition.form
+++ b/plugins/DataAcquisition.form
@@ -54,15 +54,6 @@
-
-
-
-
-
-
-
-
-
@@ -78,13 +69,7 @@
-
-
-
-
-
-
-
+
@@ -192,7 +177,7 @@
-
+
@@ -269,30 +254,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugins/DataAcquisition.java b/plugins/DataAcquisition.java
index f4c05e7..3baeda8 100644
--- a/plugins/DataAcquisition.java
+++ b/plugins/DataAcquisition.java
@@ -431,9 +431,6 @@ public class DataAcquisition extends Panel {
jLabel31 = new javax.swing.JLabel();
textClearOutliersMask = new javax.swing.JButton();
spinnerOutliersThreshold = new javax.swing.JSpinner();
- buttonTriggerDetector = new javax.swing.JButton();
- buttonShowDetectorPanel = new javax.swing.JButton();
- buttonMeasurements = new javax.swing.JToggleButton();
panelNorm2 = new javax.swing.JPanel();
radioAvDetector = new javax.swing.JRadioButton();
radioAvPshell = new javax.swing.JRadioButton();
@@ -641,7 +638,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, 0, Short.MAX_VALUE)))
+ .addGap(0, 330, Short.MAX_VALUE)))
.addContainerGap())
);
@@ -663,27 +660,6 @@ public class DataAcquisition extends Panel {
.addContainerGap())
);
- buttonTriggerDetector.setText("Trigger Detector");
- buttonTriggerDetector.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- buttonTriggerDetectorActionPerformed(evt);
- }
- });
-
- buttonShowDetectorPanel.setText("Show Detector Panel");
- buttonShowDetectorPanel.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- buttonShowDetectorPanelActionPerformed(evt);
- }
- });
-
- buttonMeasurements.setText("Image Measurements");
- buttonMeasurements.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- buttonMeasurementsActionPerformed(evt);
- }
- });
-
panelNorm2.setBorder(javax.swing.BorderFactory.createTitledBorder("Averaging"));
buttonGroup1.add(radioAvDetector);
@@ -733,19 +709,9 @@ public class DataAcquisition extends Panel {
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(panelNorm, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(panelNorm1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
- .addGap(0, 0, Short.MAX_VALUE)
- .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(buttonTriggerDetector, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(buttonShowDetectorPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 201, Short.MAX_VALUE)
- .addComponent(buttonMeasurements, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addGap(0, 0, Short.MAX_VALUE))
.addComponent(panelNorm2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
-
- jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonMeasurements, buttonShowDetectorPanel, buttonTriggerDetector});
-
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
@@ -755,13 +721,7 @@ public class DataAcquisition extends Panel {
.addComponent(panelNorm2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(panelNorm1, 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)
- .addComponent(buttonMeasurements)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(buttonShowDetectorPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(buttonTriggerDetector)
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addContainerGap(123, Short.MAX_VALUE))
);
jTabbedPane1.addTab("Detector", jPanel1);
@@ -1583,14 +1543,6 @@ public class DataAcquisition extends Panel {
}
}//GEN-LAST:event_buttonSpecAbortActionPerformed
- private void buttonTriggerDetectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonTriggerDetectorActionPerformed
- try {
- this.evalAsync("trigger_eiger()");
- } catch (Exception ex) {
- showException(ex);
- }
- }//GEN-LAST:event_buttonTriggerDetectorActionPerformed
-
private void buttonAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAddActionPerformed
try {
modelRegions.addRow(new Object[]{Double.NaN, Double.NaN, Double.NaN});
@@ -1635,14 +1587,6 @@ public class DataAcquisition extends Panel {
// TODO add your handling code here:
}//GEN-LAST:event_textNormKeyTyped
- private void buttonShowDetectorPanelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonShowDetectorPanelActionPerformed
- try {
- this.showDevicePanel("eiger");
- } catch (Exception ex) {
- showException(ex);
- }
- }//GEN-LAST:event_buttonShowDetectorPanelActionPerformed
-
private void buttonShowNormActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonShowNormActionPerformed
try {
this.enableNorm(buttonShowNorm.isSelected());
@@ -1694,14 +1638,6 @@ public class DataAcquisition extends Panel {
}
}//GEN-LAST:event_spinnerOutliersThresholdStateChanged
- private void buttonMeasurementsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonMeasurementsActionPerformed
- try {
- evalAsync(buttonMeasurements.isSelected() ? "start_measurements()" : "stop_measurements()");
- } catch (Exception ex) {
- showException(ex);
- }
- }//GEN-LAST:event_buttonMeasurementsActionPerformed
-
private void buttonOpenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonOpenActionPerformed
try {
JFileChooser chooser = new JFileChooser(ABSORTION_SPECTRUM_PATH);
@@ -1817,7 +1753,6 @@ public class DataAcquisition extends Panel {
private javax.swing.ButtonGroup buttonGroup1;
private javax.swing.JButton buttonImgAbort;
private javax.swing.JButton buttonImgStart;
- private javax.swing.JToggleButton buttonMeasurements;
private javax.swing.JButton buttonOpen;
private javax.swing.JButton buttonRemove;
private javax.swing.JButton buttonRoiAdd;
@@ -1827,11 +1762,9 @@ public class DataAcquisition extends Panel {
private javax.swing.JButton buttonRoiSave;
private javax.swing.JButton buttonSave;
private javax.swing.JButton buttonSetNorm;
- private javax.swing.JButton buttonShowDetectorPanel;
private javax.swing.JToggleButton buttonShowNorm;
private javax.swing.JButton buttonSpecAbort;
private javax.swing.JButton buttonSpecStart;
- private javax.swing.JButton buttonTriggerDetector;
private javax.swing.JCheckBox checkImgAutosave;
private javax.swing.JCheckBox checkSpecSaveImages;
private javax.swing.JCheckBox checkSpecSaveSpectrum;
diff --git a/plugins/Eiger.form b/plugins/Eiger.form
new file mode 100644
index 0000000..83526ce
--- /dev/null
+++ b/plugins/Eiger.form
@@ -0,0 +1,221 @@
+
+
+
diff --git a/plugins/Eiger.java b/plugins/Eiger.java
new file mode 100644
index 0000000..e0c587f
--- /dev/null
+++ b/plugins/Eiger.java
@@ -0,0 +1,335 @@
+import ch.psi.pshell.epics.ChannelDouble;
+import ch.psi.pshell.epics.ChannelInteger;
+import ch.psi.pshell.ui.Panel;
+import ch.psi.utils.State;
+import java.io.IOException;
+
+/**
+ *
+ */
+public class Eiger extends Panel {
+ boolean updatingControls=true;
+ ChannelInteger bitDepth;
+ ChannelInteger mode;
+ ChannelDouble exposure;
+
+ public Eiger() {
+ initComponents();
+ }
+
+ void initializeDevices() throws IOException, InterruptedException{
+ }
+
+ //Overridable callbacks
+ @Override
+ public void onInitialize(int runCount) {
+ try {
+ this.stopTimer();
+ renderer.clearOverlays();
+ bitDepth = ((ChannelInteger)getDevice("eiger_bit_depth"));
+ mode = ((ChannelInteger) getDevice("eiger_mode"));
+ exposure = ((ChannelDouble) getDevice("eiger_exposure"));
+ startTimer(1000,10);
+ } catch (Exception ex) {
+ showException(ex);
+ }
+ }
+
+ @Override
+ public void onStateChange(State state, State former) {
+ if (former==State.Initializing){
+ if (checkMeasurements.isSelected()){
+ checkMeasurementsActionPerformed(null);
+ }
+ }
+ }
+
+ @Override
+ public void onExecutedFile(String fileName, Object result) {
+ }
+
+ @Override
+ public void onTimer() {
+ updatingControls=true;
+ //initializeDevices();
+ try{
+ try{
+ String value = String.valueOf(bitDepth.take());
+ comboDepth.setSelectedItem(value);
+ } catch (Exception ex){
+ comboDepth.setSelectedIndex(comboDepth.getItemCount()-1); //Set "Unknown"
+ }
+ try{
+ comboMode.setSelectedIndex(mode.take());
+ } catch (Exception ex){
+ }
+ try{
+ spinnerExpusure.setValue(exposure.take());
+ } catch (Exception ex){
+ }
+ comboDepth.setEnabled(bitDepth.isInitialized());
+ comboMode.setEnabled(mode.isInitialized());
+ spinnerExpusure.setEnabled(exposure.isInitialized());
+
+ } finally{
+ updatingControls=false;
+ }
+ }
+
+
+ //Callback to perform update - in event thread
+ @Override
+ protected void doUpdate() {
+ }
+
+ @SuppressWarnings("unchecked")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ renderer = new ch.psi.pshell.imaging.Renderer();
+ jLabel1 = new javax.swing.JLabel();
+ comboDepth = new javax.swing.JComboBox<>();
+ buttonTriggerDetector = new javax.swing.JButton();
+ jLabel2 = new javax.swing.JLabel();
+ comboMode = new javax.swing.JComboBox<>();
+ jLabel3 = new javax.swing.JLabel();
+ spinnerExpusure = new javax.swing.JSpinner();
+ deviceValuePanel1 = new ch.psi.pshell.swing.DeviceValuePanel();
+ deviceValuePanel2 = new ch.psi.pshell.swing.DeviceValuePanel();
+ deviceValuePanel3 = new ch.psi.pshell.swing.DeviceValuePanel();
+ buttonStopDetector = new javax.swing.JButton();
+ deviceValuePanel4 = new ch.psi.pshell.swing.DeviceValuePanel();
+ buttonShowDetectorPanel = new javax.swing.JButton();
+ checkMeasurements = new javax.swing.JCheckBox();
+
+ renderer.setDeviceName("image");
+ renderer.setMode(ch.psi.pshell.imaging.RendererMode.Fit);
+
+ jLabel1.setText("Bit Depth:");
+
+ comboDepth.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "4", "8", "16", "32", "Unknown" }));
+ comboDepth.setEnabled(false);
+ comboDepth.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ comboDepthActionPerformed(evt);
+ }
+ });
+
+ buttonTriggerDetector.setText("Start");
+ buttonTriggerDetector.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ buttonTriggerDetectorActionPerformed(evt);
+ }
+ });
+
+ jLabel2.setText("Mode:");
+
+ comboMode.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Single", "Multiple", "Continuous" }));
+ comboMode.setEnabled(false);
+ comboMode.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ comboModeActionPerformed(evt);
+ }
+ });
+
+ jLabel3.setText("Exposure:");
+
+ spinnerExpusure.setModel(new javax.swing.SpinnerNumberModel(1.0d, 0.001d, 300.0d, 1.0d));
+ spinnerExpusure.setEnabled(false);
+ spinnerExpusure.addChangeListener(new javax.swing.event.ChangeListener() {
+ public void stateChanged(javax.swing.event.ChangeEvent evt) {
+ spinnerExpusureStateChanged(evt);
+ }
+ });
+
+ deviceValuePanel1.setDeviceName("eiger_mode_rbv");
+
+ deviceValuePanel2.setDeviceName("eiger_bit_depth_rbv");
+
+ deviceValuePanel3.setDeviceName("eiger_exposure_rbv");
+
+ buttonStopDetector.setText("Stop");
+ buttonStopDetector.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ buttonStopDetectorActionPerformed(evt);
+ }
+ });
+
+ deviceValuePanel4.setDeviceName("eiger_status");
+
+ buttonShowDetectorPanel.setText("Control Panel");
+ buttonShowDetectorPanel.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ buttonShowDetectorPanelActionPerformed(evt);
+ }
+ });
+
+ checkMeasurements.setText("Measurements");
+ checkMeasurements.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ checkMeasurementsActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+ this.setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING))
+ .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)
+ .addGap(18, 18, 18)
+ .addComponent(buttonShowDetectorPanel))
+ .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))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(spinnerExpusure, 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)
+ .addGap(18, 18, 18)
+ .addComponent(checkMeasurements)))
+ .addGap(18, 18, Short.MAX_VALUE)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(deviceValuePanel4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
+ .addComponent(buttonStopDetector, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(buttonTriggerDetector, javax.swing.GroupLayout.Alignment.TRAILING)))
+ .addComponent(renderer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addGap(4, 4, 4))
+ );
+
+ layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonStopDetector, buttonTriggerDetector, comboDepth, comboMode, deviceValuePanel1, deviceValuePanel2, deviceValuePanel3, deviceValuePanel4, spinnerExpusure});
+
+ layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonShowDetectorPanel, checkMeasurements});
+
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
+ .addComponent(jLabel2)
+ .addComponent(comboMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(deviceValuePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(buttonShowDetectorPanel)
+ .addComponent(buttonTriggerDetector))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
+ .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)
+ .addComponent(buttonStopDetector))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
+ .addComponent(jLabel3)
+ .addComponent(spinnerExpusure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(deviceValuePanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(checkMeasurements)
+ .addComponent(deviceValuePanel4, 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, 343, Short.MAX_VALUE))
+ );
+
+ layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {buttonShowDetectorPanel, buttonStopDetector, buttonTriggerDetector, comboDepth, comboMode, deviceValuePanel1, deviceValuePanel2, deviceValuePanel3, deviceValuePanel4, spinnerExpusure});
+
+ }// //GEN-END:initComponents
+
+ private void comboDepthActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboDepthActionPerformed
+ try{
+ if (!updatingControls){
+ if (comboDepth.getSelectedIndex()!=comboDepth.getItemCount()-1) {
+ Integer value = Integer.valueOf((String)comboDepth.getSelectedItem());
+ bitDepth.write(value);
+ }
+ }
+ } catch (Exception ex){
+
+ }
+ }//GEN-LAST:event_comboDepthActionPerformed
+
+ private void buttonTriggerDetectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonTriggerDetectorActionPerformed
+ try {
+ evalAsync("eiger.start()");
+ } catch (Exception ex) {
+ showException(ex);
+ }
+ }//GEN-LAST:event_buttonTriggerDetectorActionPerformed
+
+ private void comboModeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboModeActionPerformed
+ try{
+ if (!updatingControls){
+ Integer value = comboMode.getSelectedIndex();
+ mode.write(value);
+ }
+ } catch (Exception ex){
+ }
+ }//GEN-LAST:event_comboModeActionPerformed
+
+ private void spinnerExpusureStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerExpusureStateChanged
+ try{
+ if (!updatingControls){
+ exposure.write((Double)spinnerExpusure.getValue());
+ }
+ } catch (Exception ex){
+
+ }
+ }//GEN-LAST:event_spinnerExpusureStateChanged
+
+ private void buttonStopDetectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStopDetectorActionPerformed
+ try {
+ evalAsync("eiger.stop()");
+ } catch (Exception ex) {
+ showException(ex);
+ }
+ }//GEN-LAST:event_buttonStopDetectorActionPerformed
+
+ private void buttonShowDetectorPanelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonShowDetectorPanelActionPerformed
+ try {
+ showDevicePanel("eiger");
+ } catch (Exception ex) {
+ showException(ex);
+ }
+ }//GEN-LAST:event_buttonShowDetectorPanelActionPerformed
+
+ 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 buttonShowDetectorPanel;
+ private javax.swing.JButton buttonStopDetector;
+ private javax.swing.JButton buttonTriggerDetector;
+ private javax.swing.JCheckBox checkMeasurements;
+ private javax.swing.JComboBox comboDepth;
+ private javax.swing.JComboBox comboMode;
+ private ch.psi.pshell.swing.DeviceValuePanel deviceValuePanel1;
+ private ch.psi.pshell.swing.DeviceValuePanel deviceValuePanel2;
+ private ch.psi.pshell.swing.DeviceValuePanel deviceValuePanel3;
+ private ch.psi.pshell.swing.DeviceValuePanel deviceValuePanel4;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JLabel jLabel3;
+ private ch.psi.pshell.imaging.Renderer renderer;
+ private javax.swing.JSpinner spinnerExpusure;
+ // End of variables declaration//GEN-END:variables
+}
diff --git a/script/devices/eiger.py b/script/devices/eiger.py
index 3107443..49bb161 100644
--- a/script/devices/eiger.py
+++ b/script/devices/eiger.py
@@ -12,6 +12,22 @@ CONTINOUS_MODE_MIN_TIME = 4000
# ROI Integration
###############################################################################
+
+def start_eiger_ioc():
+ cmd= "cd /sls/X11MA/data/X11MA/SW/Eiger/;launch"
+ return run("sshutils", {"USR": "gac-x11ma", "PWD": "", "HOST": "x11ma-softioc","PORT": 22, "CMD": cmd})
+
+
+def stop_eiger_ioc():
+ try:
+ caputq("X11MA-ES1-SD1:SYSRESET", 1);
+ print "IOC stopped"
+ except:
+ print "IOC not running"
+ cmd= "proc=$(ps aux | grep 'Eiger Receiver' | awk -F ' ' '{print $2}' | xargs); kill $proc"
+ return run("sshutils", {"USR": "gac-x11ma", "PWD": "", "HOST": "x11ma-softioc","PORT": 22, "CMD": cmd})
+
+
def integrate_roi(source, x,y, w, h):
if source.data is None:
source.update()
@@ -346,6 +362,8 @@ def get_outliers_mask(data_type='f'):
eiger.setDataType(DataType.Float32)
eiger.getDataArray().monitored=True
+
+
if False:
integrate_roi(image, 10, 5, 20, 10)
@@ -366,5 +384,4 @@ if False:
-
diff --git a/script/tasks/CheckEiger.py b/script/tasks/CheckEiger.py
index 759b0a0..ea6efad 100644
--- a/script/tasks/CheckEiger.py
+++ b/script/tasks/CheckEiger.py
@@ -2,7 +2,13 @@ try:
if not eiger.isInitialized():
eiger.initialize()
run("devices/eiger")
+
+ eiger_channels = eiger_bit_depth_rbv, eiger_mode_rbv, \
+ eiger_exposure_rbv,eiger_status,eiger_bit_depth,eiger_mode, \
+ eiger_exposure
+ for ch in eiger_channels:
+ ch.initialize()
log("Eiger initialized", False)
- stop_task("tasks/CheckEiger")
+ stop_task("tasks/CheckEiger")
except:
log("Error initializing Eiger: " + str(sys.exc_info()[1]), False)