From ccf6c60377093aa31f16be9f377c01f104bd80d1 Mon Sep 17 00:00:00 2001 From: voulot_d Date: Fri, 27 Jan 2017 16:14:21 +0100 Subject: [PATCH] Closedown --- plugins/ShottkyScan.form | 25 ++++++++++++++++++++----- plugins/ShottkyScan.java | 33 ++++++++++++++++++++++++++------- script/RFscan/ShottkyScan.py | 2 +- 3 files changed, 47 insertions(+), 13 deletions(-) diff --git a/plugins/ShottkyScan.form b/plugins/ShottkyScan.form index 30cebc6..8826c0a 100644 --- a/plugins/ShottkyScan.form +++ b/plugins/ShottkyScan.form @@ -239,11 +239,16 @@ - + - - - + + + + + + + + @@ -256,7 +261,9 @@ - + + + @@ -278,6 +285,14 @@ + + + + + + + + diff --git a/plugins/ShottkyScan.java b/plugins/ShottkyScan.java index 725f6b6..8193b48 100644 --- a/plugins/ShottkyScan.java +++ b/plugins/ShottkyScan.java @@ -111,6 +111,7 @@ public class ShottkyScan extends Panel { jPanel2 = new javax.swing.JPanel(); jLabel7 = new javax.swing.JLabel(); spinnerPhaseRef = new javax.swing.JSpinner(); + jButton1 = new javax.swing.JButton(); buttonStart.setText("Start"); buttonStart.addActionListener(new java.awt.event.ActionListener() { @@ -227,15 +228,25 @@ public class ShottkyScan extends Panel { } }); + jButton1.setText("Set Ref Phase"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(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) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() + .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)) + .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING)) .addContainerGap()) ); jPanel2Layout.setVerticalGroup( @@ -245,7 +256,9 @@ public class ShottkyScan extends Panel { .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(116, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jButton1) + .addContainerGap(79, Short.MAX_VALUE)) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); @@ -301,7 +314,6 @@ public class ShottkyScan extends Panel { parameters.add(spinnerLatency.getValue()); try { //How to get a callback on the end of execution - runAsync("RFscan/ShottkyScan", parameters).handle((ret, ex) -> { if (ex != null){ getLogger().info("Exception executing scan: " + ex); @@ -310,8 +322,6 @@ public class ShottkyScan extends Panel { } return ret; }); - - //runAsync("RFscan/ShottkyScan", parameters); } catch (Exception ex) { showException(ex); @@ -336,9 +346,18 @@ public class ShottkyScan extends Panel { } }//GEN-LAST:event_spinnerPhaseRefStateChanged + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + try { + //caput("SINEG01-RSYS:CALC-VSUM-PHASE-OFFSET", spinnerPhaseRef.value) + } catch (Exception ex) { + showException(ex); + } + }//GEN-LAST:event_jButton1ActionPerformed + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton buttonAbort; private javax.swing.JButton buttonStart; + private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; diff --git a/script/RFscan/ShottkyScan.py b/script/RFscan/ShottkyScan.py index a9cdcd6..44ee433 100644 --- a/script/RFscan/ShottkyScan.py +++ b/script/RFscan/ShottkyScan.py @@ -42,7 +42,7 @@ y = r.getReadable(0) x = r.getPositions(0) y = [v.mean for v in y] index_max = y.index(max(y)) -phase_ref = x[index_max] +phase_ref = x[index_max] - 90 phase_offset = - phase_ref caput("SINEG01-RSYS:CALC-VSUM-PHASE-OFFSET", phase_offset)