Closedown

This commit is contained in:
boccioli_m
2015-06-02 10:45:06 +02:00
parent 8b75d346ad
commit 730ee2304d
4 changed files with 69 additions and 82 deletions

View File

@@ -41,7 +41,7 @@
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jButton3" min="-2" max="-2" attributes="0"/>
<Component id="cmTestPS" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtTestPSRes" pref="57" max="32767" attributes="0"/>
</Group>
@@ -82,7 +82,7 @@
<Component id="jCheckBox1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jButton3" min="-2" max="-2" attributes="0"/>
<Component id="cmTestPS" min="-2" max="-2" attributes="0"/>
<Component id="txtTestPSRes" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
@@ -156,12 +156,12 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="jButton3">
<Component class="javax.swing.JButton" name="cmTestPS">
<Properties>
<Property name="text" type="java.lang.String" value="Test PS"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cmTestPSActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="jCheckBox1">

View File

@@ -86,7 +86,7 @@ public class TestingPanel extends Panel {
panel = new javax.swing.JPanel();
panelPlot = new javax.swing.JPanel();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
cmTestPS = new javax.swing.JButton();
jCheckBox1 = new javax.swing.JCheckBox();
jButton4 = new javax.swing.JButton();
txtTestPSRes = new javax.swing.JTextField();
@@ -127,10 +127,10 @@ public class TestingPanel extends Panel {
}
});
jButton3.setText("Test PS");
jButton3.addActionListener(new java.awt.event.ActionListener() {
cmTestPS.setText("Test PS");
cmTestPS.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
cmTestPSActionPerformed(evt);
}
});
@@ -176,7 +176,7 @@ public class TestingPanel extends Panel {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jButton3)
.addComponent(cmTestPS)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtTestPSRes, javax.swing.GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE))
.addComponent(jCheckBox1)
@@ -205,7 +205,7 @@ public class TestingPanel extends Panel {
.addComponent(jCheckBox1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton3)
.addComponent(cmTestPS)
.addComponent(txtTestPSRes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton4)))
@@ -232,7 +232,7 @@ public class TestingPanel extends Panel {
eval("start = 22.0");
eval("end = 32.0");
eval("step = 10");
run("test11");
run("args");
/*
@@ -303,11 +303,12 @@ public class TestingPanel extends Panel {
}//GEN-LAST:event_jButton2ActionPerformed
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
private void cmTestPSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmTestPSActionPerformed
try {
boolean var1 = jCheckBox1.isSelected();
int var2 = 2;// (Integer)spinner.getValue();
int result;
HashMap args = new HashMap();
args.put("relative", var1);
args.put("steps", var2);
@@ -322,7 +323,7 @@ public class TestingPanel extends Panel {
} catch (Exception ex) {
SwingUtils.showException(this, ex);
} // TODO add your handling code here:
}//GEN-LAST:event_jButton3ActionPerformed
}//GEN-LAST:event_cmTestPSActionPerformed
private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed
// TODO add your handling code here:
@@ -350,9 +351,9 @@ public class TestingPanel extends Panel {
private javax.swing.JButton buttonAbort;
private javax.swing.JButton buttonExecute;
private javax.swing.JCheckBox check;
private javax.swing.JButton cmTestPS;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JCheckBox jCheckBox1;
private javax.swing.JPanel panel;

View File

@@ -1,67 +1,64 @@
def main():
#Pre-actions
caput('PO2DV-NCS-VHQ1:Set-RampA', '10')
sleep(0.1)
#Pre-actions
caput('PO2DV-NCS-VHQ1:Set-RampA', '10')
sleep(0.1)
#TODO: Set the diplay names of positioners and detectors
#ManualScan(writables, readables, start = None, end = None, steps = None, relative = False)
scan = ManualScan(['time'], ['SetVA', 'ActualVA', 'ActualIA'] , [0.0], [20.0], [10])
scan.start()
#TODO: Set the diplay names of positioners and detectors
#ManualScan(writables, readables, start = None, end = None, steps = None, relative = False)
scan = ManualScan(['time'], ['SetVA', 'ActualVA', 'ActualIA'] , [0.0], [20.0], [10])
scan.start()
#Creating channels: dimension 1
#LinearPositioner SetVA
SetVA = Channel('PO2DV-NCS-VHQ1:Set-VA', type = 'd')
#Timestamp time
#ScalarDetector ActualVA
ActualVA = Channel('PO2DV-NCS-VHQ1:Actual-VA', type = 'd')
#ScalarDetector ActualIA
ActualIA = Channel('PO2DV-NCS-VHQ1:Actual-IA', type = 'd')
#Creating channels: dimension 1
#LinearPositioner SetVA
SetVA = Channel('PO2DV-NCS-VHQ1:Set-VA', type = 'd')
#Timestamp time
#ScalarDetector ActualVA
ActualVA = Channel('PO2DV-NCS-VHQ1:Actual-VA', type = 'd')
#ScalarDetector ActualIA
ActualIA = Channel('PO2DV-NCS-VHQ1:Actual-IA', type = 'd')
#set voltage to 0
print 'Ramping down power supply to 0V'
SetVA.put(0.0, timeout=None)
#set voltage to 0
print 'Ramping down power supply to 0V'
SetVA.put(0.0, timeout=None)
#wait up to 2 minutes for voltage to be ~0
for setpoint1 in frange(0.0, 120.0, 1.0, True):
detector2 = ActualVA.get()
if detector2 <= 1.0:
break
sleep(0.5)
#wait up to 2 minutes for voltage to be ~0
for setpoint1 in frange(0.0, 120.0, 1.0, True):
detector2 = ActualVA.get()
if detector2 <= 1.0:
break
sleep(0.5)
#Dimension 1
#LinearPositioner SetVA
print 'Ramping up power supply'
for setpoint1 in frange(0.0, 20.0, 10.0, True):
if setpoint1 > 50.0 or setpoint1 < 0.0:
break
SetVA.put(setpoint1, timeout=None) # TODO: Set appropriate timeout
readback1 = SetVA.get()
if abs(readback1 - setpoint1) > 0.5 : # TODO: Check accuracy
raise Exception('Actor SetVA could not be set to the value ' + str(setpoint1))
#scan quickly the output during some seconds
for setpoint2 in range(0, 20):
#Detector time
detector1 = float(java.lang.System.currentTimeMillis())
#Detector ActualVA
detector2 = ActualVA.get()
detector3 = ActualIA.get()
#scan.append ([setpoint1], [readback1], [detector1, detector2])
#Dimension 1
#LinearPositioner SetVA
print 'Ramping up power supply'
for setpoint1 in frange(0.0, 20.0, 10.0, True):
if setpoint1 > 50.0 or setpoint1 < 0.0:
break
SetVA.put(setpoint1, timeout=None) # TODO: Set appropriate timeout
readback1 = SetVA.get()
if abs(readback1 - setpoint1) > 0.5 : # TODO: Check accuracy
raise Exception('Actor SetVA could not be set to the value ' + str(setpoint1))
#scan quickly the output during some seconds
for setpoint2 in range(0, 20):
#Detector time
detector1 = float(java.lang.System.currentTimeMillis())
#Detector ActualVA
detector2 = ActualVA.get()
detector3 = ActualIA.get()
#scan.append ([setpoint1], [readback1], [detector1, detector2])
#append(setpoints, positions, values)
scan.append ([detector1], [detector1], [readback1, detector2, detector3])
sleep( 0.1 ) # Settling time
#append(setpoints, positions, values)
scan.append ([detector1], [detector1], [readback1, detector2, detector3])
sleep( 0.1 ) # Settling time
#reset output to 0V
SetVA.put(0.0, timeout=None)
#Closing channels
SetVA.close()
ActualVA.close()
ActualIA.close()
#reset output to 0V
SetVA.put(0.0, timeout=None)
#Closing channels
SetVA.close()
ActualVA.close()
ActualIA.close()
scan.end()
scan.end()
return 1
main()
sys.exit(0)

View File

@@ -1,11 +0,0 @@
"""
Parameters
"""
start = float(args[0])
end = float(args[1])
step = int(args[2])
a= lscan(inp, sin, start, end, step, 0.1)