diff --git a/devices/CurrentCamera.properties b/devices/CurrentCamera.properties index 944e53e..824b2d6 100644 --- a/devices/CurrentCamera.properties +++ b/devices/CurrentCamera.properties @@ -1,4 +1,4 @@ -#Mon Apr 03 09:15:50 CEST 2017 +#Mon Apr 03 11:46:51 CEST 2017 colormap=Flame colormapAutomatic=false colormapMax=1000.0 diff --git a/plugins/ReturnBug.form b/plugins/ReturnBug.form deleted file mode 100644 index 81528fe..0000000 --- a/plugins/ReturnBug.form +++ /dev/null @@ -1,282 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/plugins/ReturnBug.java b/plugins/ReturnBug.java deleted file mode 100644 index 4ee30b4..0000000 --- a/plugins/ReturnBug.java +++ /dev/null @@ -1,356 +0,0 @@ -/* - * Copyright (c) 2014-2017 Paul Scherrer Institute. All rights reserved. - */ - -import ch.psi.pshell.plot.LinePlotSeries; -import ch.psi.pshell.plot.Plot; -import ch.psi.pshell.scan.Scan; -import ch.psi.pshell.scan.ScanListener; -import ch.psi.pshell.scan.ScanRecord; -import ch.psi.pshell.ui.Panel; -import ch.psi.utils.State; -import java.awt.Color; -import java.util.ArrayList; - -/** - * - */ -public class ReturnBug extends Panel { - LinePlotSeries series = new LinePlotSeries("Values"); - - public ReturnBug() { - initComponents(); - plot.addSeries(series); - plot.getAxis(Plot.AxisId.X).setLabel("Phase"); - plot.getAxis(Plot.AxisId.Y).setLabel("Charge"); - } - - //Overridable callbacks - @Override - public void onInitialize(int runCount) { - - } - - @Override - public void onStateChange(State state, State former) { - buttonAbort.setEnabled(state.isProcessing()); - buttonStart.setEnabled(state == State.Ready); - - spinnerStart.setEnabled(buttonStart.isEnabled()); - spinnerStop.setEnabled(buttonStart.isEnabled()); - spinnerStep.setEnabled(buttonStart.isEnabled()); - spinnerSamples.setEnabled(buttonStart.isEnabled()); - spinnerLatency.setEnabled(buttonStart.isEnabled()); - - } - - @Override - public void onExecutedFile(String fileName, Object result) { - } - - - //Callback to perform update - in event thread - @Override - protected void doUpdate() { - } - - @Override - public void onStart() { - super.onStart(); - getContext().addScanListener(scanListener); - } - - @Override - public void onStop() { - getContext().removeScanListener(scanListener); - super.onStop(); - - } - - - ScanListener scanListener = new ScanListener() { - @Override - public void onScanStarted(Scan scan, String plotTitle) { - if ("ReturnBug".equals(getContext().getExecutionPars().getName())){ - series.clear(); - } - } - - @Override - public void onNewRecord(Scan scan, ScanRecord record) { - if ("ReturnBug".equals(getContext().getExecutionPars().getName())){ - series.appendData((Double)record.getPositions()[0], ((Number)record.getValues()[0]).doubleValue()); - } - } - - @Override - public void onScanEnded(Scan scan, Exception ex) { - } - }; - - - - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - - buttonStart = new javax.swing.JButton(); - buttonAbort = new javax.swing.JButton(); - jPanel1 = new javax.swing.JPanel(); - spinnerStep = new javax.swing.JSpinner(); - jLabel5 = new javax.swing.JLabel(); - jLabel1 = new javax.swing.JLabel(); - spinnerStop = new javax.swing.JSpinner(); - jLabel3 = new javax.swing.JLabel(); - jLabel2 = new javax.swing.JLabel(); - spinnerLatency = new javax.swing.JSpinner(); - spinnerSamples = new javax.swing.JSpinner(); - jLabel4 = new javax.swing.JLabel(); - spinnerStart = new javax.swing.JSpinner(); - plot = new ch.psi.pshell.plot.LinePlotJFree(); - jPanel2 = new javax.swing.JPanel(); - jLabel7 = new javax.swing.JLabel(); - spinnerPhaseRef = new javax.swing.JSpinner(); - - buttonStart.setText("Start"); - buttonStart.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - buttonStartActionPerformed(evt); - } - }); - - 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("Parameters")); - - spinnerStep.setModel(new javax.swing.SpinnerNumberModel(10.0d, 0.1d, 90.0d, 1.0d)); - - jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); - jLabel5.setText("Latency:"); - - jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); - jLabel1.setText("Start:"); - - spinnerStop.setModel(new javax.swing.SpinnerNumberModel(360.0d, -45.0d, 360.0d, 1.0d)); - - jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); - jLabel3.setText("Step:"); - - jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); - jLabel2.setText("Stop:"); - - spinnerLatency.setModel(new javax.swing.SpinnerNumberModel(0.1d, 0.0d, 1.0d, 0.01d)); - - spinnerSamples.setModel(new javax.swing.SpinnerNumberModel(1, 1, 50, 1)); - - jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); - jLabel4.setText("Nb Samples:"); - - spinnerStart.setModel(new javax.swing.SpinnerNumberModel(0.0d, -45.0d, 360.0d, 1.0d)); - - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); - jPanel1.setLayout(jPanel1Layout); - jPanel1Layout.setHorizontalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addContainerGap() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel1) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spinnerStart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel2) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spinnerStop, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel3) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spinnerStep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel4) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spinnerSamples, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel5) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spinnerLatency, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - - jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel1, jLabel2, jLabel3, jLabel4, jLabel5}); - - jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {spinnerLatency, spinnerSamples, spinnerStart, spinnerStep, spinnerStop}); - - jPanel1Layout.setVerticalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addContainerGap() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel1) - .addComponent(spinnerStart, 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(spinnerStop, 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(jLabel3) - .addComponent(spinnerStep, 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(jLabel4) - .addComponent(spinnerSamples, 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(jLabel5) - .addComponent(spinnerLatency, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - - plot.setTitle(""); - - jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Output")); - - jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); - jLabel7.setText("Ref Phase:"); - - spinnerPhaseRef.setModel(new javax.swing.SpinnerNumberModel(0.0d, -45.0d, 360.0d, 1.0d)); - spinnerPhaseRef.addChangeListener(new javax.swing.event.ChangeListener() { - public void stateChanged(javax.swing.event.ChangeEvent evt) { - spinnerPhaseRefStateChanged(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(jLabel7) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spinnerPhaseRef, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap()) - ); - jPanel2Layout.setVerticalGroup( - jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel2Layout.createSequentialGroup() - .addContainerGap() - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel7) - .addComponent(spinnerPhaseRef, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(80, Short.MAX_VALUE)) - ); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(buttonStart) - .addGap(27, 27, 27) - .addComponent(buttonAbort)) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(jPanel1, 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))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(plot, javax.swing.GroupLayout.DEFAULT_SIZE, 393, Short.MAX_VALUE) - .addContainerGap()) - ); - - layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonAbort, buttonStart}); - - 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.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jPanel2, 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(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(buttonStart) - .addComponent(buttonAbort)) - .addGap(17, 17, 17)) - .addComponent(plot, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) - ); - }// //GEN-END:initComponents - - private void buttonStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStartActionPerformed -//((Plugin)this). - plot.removeMarker(null); - spinnerPhaseRef.setValue(0.0); - ArrayList parameters = new ArrayList(); - parameters.add(spinnerStart.getValue()); - parameters.add(spinnerStop.getValue()); - parameters.add(spinnerStep.getValue()); - parameters.add(spinnerSamples.getValue()); - parameters.add(spinnerLatency.getValue()); - try { - //How to get a callback on the end of execution - - runAsync("test/ReturnBug", parameters).handle((ret, ex) -> { - if (ex != null){ - getLogger().info("Exception executing scan: " + ex); - } else { - spinnerPhaseRef.setValue(ret); - } - return ret; - }); - - - //runAsync("RFscan/ReturnBug", parameters); - } catch (Exception ex) { - showException(ex); - } - - }//GEN-LAST:event_buttonStartActionPerformed - - private void buttonAbortActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAbortActionPerformed - try { - abort(); - } catch (Exception ex) { - showException(ex); - } - }//GEN-LAST:event_buttonAbortActionPerformed - - private void spinnerPhaseRefStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerPhaseRefStateChanged - try { - plot.removeMarker(null); - plot.addMarker((Double)spinnerPhaseRef.getValue(), Plot.AxisId.X, "Ref Phase",Color.BLUE); - } catch (Exception ex) { - showException(ex); - } - }//GEN-LAST:event_spinnerPhaseRefStateChanged - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton buttonAbort; - private javax.swing.JButton buttonStart; - private javax.swing.JLabel jLabel1; - private javax.swing.JLabel jLabel2; - private javax.swing.JLabel jLabel3; - private javax.swing.JLabel jLabel4; - private javax.swing.JLabel jLabel5; - private javax.swing.JLabel jLabel7; - private javax.swing.JPanel jPanel1; - private javax.swing.JPanel jPanel2; - private ch.psi.pshell.plot.LinePlotJFree plot; - private javax.swing.JSpinner spinnerLatency; - private javax.swing.JSpinner spinnerPhaseRef; - private javax.swing.JSpinner spinnerSamples; - private javax.swing.JSpinner spinnerStart; - private javax.swing.JSpinner spinnerStep; - private javax.swing.JSpinner spinnerStop; - // End of variables declaration//GEN-END:variables -} diff --git a/plugins/SchottkyScan.java b/plugins/SchottkyScan.java index ecf15b4..878923e 100644 --- a/plugins/SchottkyScan.java +++ b/plugins/SchottkyScan.java @@ -27,8 +27,8 @@ public class SchottkyScan extends Panel { initComponents(); plot.setStyle(LinePlotJFree.Style.ErrorY); plot.addSeries(series); - plot.getAxis(Plot.AxisId.X).setLabel("Phase"); - plot.getAxis(Plot.AxisId.Y).setLabel("Charge"); + plot.getAxis(Plot.AxisId.X).setLabel("Gun Phase"); + plot.getAxis(Plot.AxisId.Y).setLabel("SINEG01-DICT215:B1_CHARGE"); } //Overridable callbacks diff --git a/plugins/SchottkyScanSim.form b/plugins/SchottkyScanSim.form deleted file mode 100644 index 4eb19e4..0000000 --- a/plugins/SchottkyScanSim.form +++ /dev/null @@ -1,46 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/plugins/SchottkyScanSim.java b/plugins/SchottkyScanSim.java deleted file mode 100644 index b934d08..0000000 --- a/plugins/SchottkyScanSim.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2014-2017 Paul Scherrer Institute. All rights reserved. - */ -import ch.psi.pshell.core.Context; -import ch.psi.pshell.device.Averager; -import ch.psi.pshell.device.DescStatsDouble; -import ch.psi.pshell.plot.LinePlotErrorSeries; -import ch.psi.pshell.plot.LinePlotJFree; -import ch.psi.pshell.plot.LinePlotSeries; -import ch.psi.pshell.plot.Plot; -import ch.psi.pshell.scan.Scan; -import ch.psi.pshell.scan.ScanListener; -import ch.psi.pshell.scan.ScanRecord; -import ch.psi.pshell.ui.Panel; -import ch.psi.utils.State; -import ch.psi.utils.swing.SwingUtils; -import java.awt.Color; -import java.io.IOException; -import java.util.ArrayList; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.script.ScriptException; - -/** - * - */ -public class SchottkyScanSim extends Panel { - - public SchottkyScanSim() { - 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) { - } - - - //Callback to perform update - in event thread - @Override - protected void doUpdate() { - } - - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - - jButton1 = new javax.swing.JButton(); - - jButton1.setText("jButton1"); - jButton1.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - jButton1ActionPerformed(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(38, 38, 38) - .addComponent(jButton1) - .addContainerGap(323, Short.MAX_VALUE)) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(28, 28, 28) - .addComponent(jButton1) - .addContainerGap(248, Short.MAX_VALUE)) - ); - }// //GEN-END:initComponents - - private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed - try { - this.runAsync("test/toto"); - } catch (Exception ex) { - Logger.getLogger(SchottkyScanSim.class.getName()).log(Level.SEVERE, null, ex); - } - }//GEN-LAST:event_jButton1ActionPerformed - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton jButton1; - // End of variables declaration//GEN-END:variables -} diff --git a/plugins/test.form b/plugins/test.form deleted file mode 100644 index ff9cfab..0000000 --- a/plugins/test.form +++ /dev/null @@ -1,28 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/plugins/test.java b/plugins/test.java deleted file mode 100644 index b3ee633..0000000 --- a/plugins/test.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2014 Paul Scherrer Institute. All rights reserved. - */ - -import ch.psi.pshell.ui.Panel; -import ch.psi.utils.State; - -/** - * - */ -public class test extends Panel { - - public test() { - 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) { - } - - - //Callback to perform update - in event thread - @Override - protected void doUpdate() { - } - - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 449, Short.MAX_VALUE) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 137, Short.MAX_VALUE) - ); - }// //GEN-END:initComponents - - // Variables declaration - do not modify//GEN-BEGIN:variables - // End of variables declaration//GEN-END:variables -} diff --git a/plugins/test2.form b/plugins/test2.form deleted file mode 100644 index da6284c..0000000 --- a/plugins/test2.form +++ /dev/null @@ -1,312 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/plugins/test2.java b/plugins/test2.java deleted file mode 100644 index 0ebf9e5..0000000 --- a/plugins/test2.java +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Copyright (c) 2014 Paul Scherrer Institute. All rights reserved. - */ - -import ch.psi.pshell.ui.Panel; -import ch.psi.utils.State; - -/** - * - */ -public class test2 extends Panel { - - public test2() { - 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) { - } - - - //Callback to perform update - in event thread - @Override - protected void doUpdate() { - } - - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - - linePlotJFree1 = new ch.psi.pshell.plot.LinePlotJFree(); - buttonRun = new javax.swing.JButton(); - buttonAbort = new javax.swing.JButton(); - jPanel1 = new javax.swing.JPanel(); - jLabel1 = new javax.swing.JLabel(); - spinnerphi1 = new javax.swing.JSpinner(); - jLabel2 = new javax.swing.JLabel(); - spinnerphi2 = new javax.swing.JSpinner(); - jLabel3 = new javax.swing.JLabel(); - spinnerStep = new javax.swing.JSpinner(); - jLabel4 = new javax.swing.JLabel(); - spinnerSettlingTime = new javax.swing.JSpinner(); - checkSaveImages = new javax.swing.JCheckBox(); - spinnerNumBackgrounds = new javax.swing.JSpinner(); - jLabel5 = new javax.swing.JLabel(); - checkBackground = new javax.swing.JCheckBox(); - radioBackSimple = new javax.swing.JRadioButton(); - radioBackMultiple = new javax.swing.JRadioButton(); - jLabel6 = new javax.swing.JLabel(); - spinnerNumImages = new javax.swing.JSpinner(); - Plot = new ch.psi.pshell.plot.LinePlotJFree(); - - setBackground(new java.awt.Color(235, 237, 237)); - - buttonRun.setText("Run"); - buttonRun.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - buttonRunActionPerformed(evt); - } - }); - - 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("Parameters")); - - jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); - jLabel1.setText("Starting phase:"); - - spinnerphi1.setModel(new javax.swing.SpinnerNumberModel(100.0d, 50.0d, 150.0d, 1.0d)); - spinnerphi1.setName("spinnerphi1"); // NOI18N - - jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); - jLabel2.setText("Final phase:"); - - spinnerphi2.setModel(new javax.swing.SpinnerNumberModel(100.0d, 50.0d, 150.0d, 1.0d)); - spinnerphi2.setName("spinnerphi2"); // NOI18N - - jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); - jLabel3.setText("Step size:"); - - spinnerStep.setModel(new javax.swing.SpinnerNumberModel(1.0d, 0.1d, 10.0d, 1.0d)); - - jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); - jLabel4.setText("Settling time:"); - - spinnerSettlingTime.setModel(new javax.swing.SpinnerNumberModel(0.1d, 0.0d, 10.0d, 1.0d)); - - checkSaveImages.setText("Save images"); - - spinnerNumBackgrounds.setModel(new javax.swing.SpinnerNumberModel(5, 1, 10, 1)); - - jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); - jLabel5.setText("Number of backgrounds:"); - - checkBackground.setSelected(true); - checkBackground.setText("Background:"); - checkBackground.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - checkBackgroundActionPerformed(evt); - } - }); - - radioBackSimple.setText("Simple"); - - radioBackMultiple.setSelected(true); - radioBackMultiple.setText("Multiple"); - - jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); - jLabel6.setText("Number of images:"); - - spinnerNumImages.setModel(new javax.swing.SpinnerNumberModel(0, 0, 10, 1)); - - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); - jPanel1.setLayout(jPanel1Layout); - jPanel1Layout.setHorizontalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addContainerGap() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(spinnerphi1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(spinnerphi2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(spinnerStep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(spinnerSettlingTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addComponent(jLabel5) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(spinnerNumBackgrounds, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(spinnerNumImages, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(radioBackSimple) - .addComponent(checkBackground)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(36, 36, 36) - .addComponent(radioBackMultiple)) - .addComponent(checkSaveImages)) - .addGap(0, 0, Short.MAX_VALUE))) - .addContainerGap()) - ); - jPanel1Layout.setVerticalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(18, 18, 18) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel1) - .addComponent(spinnerphi1, 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(spinnerphi2, 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(jLabel3) - .addComponent(spinnerStep, 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(jLabel4) - .addComponent(spinnerSettlingTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(4, 4, 4) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel6) - .addComponent(spinnerNumImages, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(18, 18, 18) - .addComponent(checkBackground) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(radioBackSimple) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(radioBackMultiple) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel5) - .addComponent(spinnerNumBackgrounds, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(57, 57, 57) - .addComponent(checkSaveImages) - .addContainerGap(302, Short.MAX_VALUE)) - ); - - Plot.setLegendVisible(true); - Plot.setName("Plot"); // NOI18N - Plot.setOpaque(false); - Plot.setTitle("Measurement"); - - 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() - .addContainerGap() - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 326, Short.MAX_VALUE) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(buttonRun, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(buttonAbort, javax.swing.GroupLayout.DEFAULT_SIZE, 92, Short.MAX_VALUE)) - .addGap(100, 100, 100)) - .addGroup(layout.createSequentialGroup() - .addGap(42, 42, 42) - .addComponent(Plot, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) - .addContainerGap()))) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addContainerGap()) - .addGroup(layout.createSequentialGroup() - .addGap(41, 41, 41) - .addComponent(buttonRun) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(buttonAbort) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(Plot, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGap(50, 50, 50)) - ); - }// //GEN-END:initComponents - - private void buttonRunActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRunActionPerformed - try { - HashMap args = new HashMap(); - args.put("phi1", spinnerphi1.getValue()); - args.put("phi2", spinnerphi2.getValue()); - args.put("dphi", spinnerStep.getValue()); - args.put("settling_time", spinnerSettlingTime.getValue()); - args.put("plot_image", checkSaveImages.isSelected()); - args.put("number_images", spinnerNumImages.getValue()); - args.put("number_backgrounds", spinnerNumBackgrounds.getValue()); - args.put("use_background", checkBackground.isSelected()); - args.put("multiple_background", radioBackMultiple.isSelected()); - ((Plugin)this).runAsync("Alignment/Laser_gun_alignment",args); - } catch (Exception ex) { - showException(ex); - } - }//GEN-LAST:event_buttonRunActionPerformed - - private void buttonAbortActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAbortActionPerformed - try { - abort(); - } catch (Exception ex) { - showException(ex); - } - }//GEN-LAST:event_buttonAbortActionPerformed - - private void checkBackgroundActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkBackgroundActionPerformed - radioBackMultiple.setEnabled(checkBackground.isSelected()); - radioBackSimple.setEnabled(checkBackground.isSelected()); - spinnerNumBackgrounds.setEnabled(checkBackground.isSelected()); - }//GEN-LAST:event_checkBackgroundActionPerformed - - // Variables declaration - do not modify//GEN-BEGIN:variables - private ch.psi.pshell.plot.LinePlotJFree Plot; - private javax.swing.JButton buttonAbort; - private javax.swing.JButton buttonRun; - private javax.swing.JCheckBox checkBackground; - private javax.swing.JCheckBox checkSaveImages; - private javax.swing.JLabel jLabel1; - private javax.swing.JLabel jLabel2; - private javax.swing.JLabel jLabel3; - private javax.swing.JLabel jLabel4; - private javax.swing.JLabel jLabel5; - private javax.swing.JLabel jLabel6; - private javax.swing.JPanel jPanel1; - private ch.psi.pshell.plot.LinePlotJFree linePlotJFree1; - private javax.swing.JRadioButton radioBackMultiple; - private javax.swing.JRadioButton radioBackSimple; - private javax.swing.JSpinner spinnerNumBackgrounds; - private javax.swing.JSpinner spinnerNumImages; - private javax.swing.JSpinner spinnerSettlingTime; - private javax.swing.JSpinner spinnerStep; - private javax.swing.JSpinner spinnerphi1; - private javax.swing.JSpinner spinnerphi2; - // End of variables declaration//GEN-END:variables -} diff --git a/script/test/CamtoolPseudoDevice.py b/script/test/CamtoolPseudoDevice.py index 5a7cdac..9034f15 100644 --- a/script/test/CamtoolPseudoDevice.py +++ b/script/test/CamtoolPseudoDevice.py @@ -1,6 +1,7 @@ class PseudoDevice(ReadonlyRegisterBase): def doRead(self): return gun_solenoid.take()/gun_phase.take() + +add_device(PseudoDevice("pseudo_device"), True) +pseudo_device.triggers = [gun_solenoid, gun_phase] - -add_device(PseudoDevice(), True) \ No newline at end of file