Startup
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#Tue Jan 24 12:58:55 CET 2017
|
||||
#Tue Apr 11 13:46:53 CEST 2017
|
||||
autoSaveScanData=true
|
||||
createSessionFiles=false
|
||||
dataLayout=default
|
||||
|
||||
8
devices/Time.properties
Normal file
8
devices/Time.properties
Normal file
@@ -0,0 +1,8 @@
|
||||
#Tue Apr 11 10:12:57 CEST 2017
|
||||
maxValue=NaN
|
||||
minValue=NaN
|
||||
offset=0.0
|
||||
precision=-1
|
||||
resolution=NaN
|
||||
scale=1.0
|
||||
unit=null
|
||||
14
devices/WireScanner motor.properties
Normal file
14
devices/WireScanner motor.properties
Normal file
@@ -0,0 +1,14 @@
|
||||
#Mon Apr 10 12:04:04 CEST 2017
|
||||
defaultSpeed=2000.0
|
||||
estbilizationDelay=0
|
||||
hasEnable=false
|
||||
homingType=None
|
||||
maxSpeed=8000.0
|
||||
maxValue=51500.0
|
||||
minSpeed=50.0
|
||||
minValue=-56903.0
|
||||
offset=0.0
|
||||
precision=1
|
||||
resolution=0.1
|
||||
scale=1.0
|
||||
unit=um
|
||||
244
plugins/WireScan.form
Normal file
244
plugins/WireScan.form
Normal file
@@ -0,0 +1,244 @@
|
||||
<?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" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="jLabel1" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="comboWireScan" min="-2" pref="332" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="jLabel2" linkSize="1" alignment="1" max="32767" attributes="0"/>
|
||||
<Component id="jLabel3" linkSize="1" alignment="1" max="32767" attributes="0"/>
|
||||
<Component id="jLabel4" linkSize="1" alignment="1" max="32767" attributes="0"/>
|
||||
<Component id="jLabel5" linkSize="1" alignment="1" max="32767" attributes="0"/>
|
||||
<Component id="jLabel6" linkSize="1" alignment="1" max="32767" attributes="0"/>
|
||||
<Component id="jLabel10" linkSize="1" alignment="1" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="comboSelection" pref="332" max="32767" attributes="0"/>
|
||||
<Component id="textBpm1" max="32767" attributes="0"/>
|
||||
<Component id="textBpm2" max="32767" attributes="0"/>
|
||||
<Component id="comboBpm3" alignment="0" pref="332" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="textStart" min="-2" pref="100" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jLabel7" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="textEnd" min="-2" pref="100" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jLabel9" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="textCycles" min="-2" pref="100" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="stateWireScan" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="jLabel8" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="textVel" min="-2" pref="100" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace pref="20" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="jToggleButton1" min="-2" pref="120" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="63" max="-2" attributes="0"/>
|
||||
<Component id="jToggleButton2" min="-2" pref="120" max="-2" attributes="0"/>
|
||||
<EmptySpace 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 max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="comboWireScan" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="comboSelection" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="textStart" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="textEnd" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="textVel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="textCycles" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="textBpm1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="textBpm2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="comboBpm3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="jLabel10" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="stateWireScan" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="34" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jToggleButton1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jToggleButton2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="50" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JComboBox" name="comboWireScan">
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="comboWireScanActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Wire Scan:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Selection:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="comboSelection">
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="comboSelectionActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="BPM 1:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="textBpm1">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="textBpm2">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel4">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="BPM 2:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel5">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="BPM 3:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="comboBpm3">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel6">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Start (µm):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="textStart">
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="textEnd">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel7">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="End (µm):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel8">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Vel (µm/s):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="textVel">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel9">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Cycles:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="textCycles">
|
||||
</Component>
|
||||
<Component class="javax.swing.JToggleButton" name="jToggleButton1">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Scan"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JToggleButton" name="jToggleButton2">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Abort"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="ch.psi.pshell.swing.DeviceStatePanel" name="stateWireScan">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="null"/>
|
||||
</Property>
|
||||
</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="Scan status:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
315
plugins/WireScan.java
Normal file
315
plugins/WireScan.java
Normal file
@@ -0,0 +1,315 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2017 Paul Scherrer Institute. All rights reserved.
|
||||
*/
|
||||
|
||||
import ch.psi.pshell.core.Context;
|
||||
import ch.psi.pshell.device.Device;
|
||||
import ch.psi.pshell.epics.Epics;
|
||||
import ch.psi.pshell.ui.Panel;
|
||||
import ch.psi.pshell.ui.Plugin;
|
||||
import ch.psi.utils.IO;
|
||||
import ch.psi.utils.State;
|
||||
import ch.psi.utils.swing.SwingUtils;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.script.ScriptException;
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class WireScan extends Panel {
|
||||
|
||||
public WireScan() {
|
||||
initComponents();
|
||||
}
|
||||
|
||||
//Overridable callbacks
|
||||
@Override
|
||||
public void onInitialize(int runCount) {
|
||||
try {
|
||||
DefaultComboBoxModel model = new DefaultComboBoxModel();
|
||||
eval("run('Devices/Elements')", true);
|
||||
List<String> ret = (List<String>) ((Plugin)this).eval("get_wire_scans()", true);
|
||||
for (String scan: ret){
|
||||
model.addElement(scan);
|
||||
}
|
||||
comboWireScan.setModel(model);
|
||||
eval("run('Devices/WireScanner')", true);
|
||||
model = new DefaultComboBoxModel();
|
||||
ret = (List<String>) ((Plugin)this).eval("WireScanner.Selection", true);
|
||||
for (String scan: ret){
|
||||
model.addElement(scan);
|
||||
}
|
||||
comboSelection.setModel(model);
|
||||
comboWireScanActionPerformed(null);
|
||||
|
||||
model = new DefaultComboBoxModel();
|
||||
ret = (List<String>) ((Plugin)this).eval("get_bpms()", true);
|
||||
model.addElement("");
|
||||
for (String scan: ret){
|
||||
model.addElement(scan);
|
||||
}
|
||||
comboBpm3.setModel(model);
|
||||
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@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")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
comboWireScan = new javax.swing.JComboBox();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
comboSelection = new javax.swing.JComboBox();
|
||||
jLabel3 = new javax.swing.JLabel();
|
||||
textBpm1 = new javax.swing.JTextField();
|
||||
textBpm2 = new javax.swing.JTextField();
|
||||
jLabel4 = new javax.swing.JLabel();
|
||||
jLabel5 = new javax.swing.JLabel();
|
||||
comboBpm3 = new javax.swing.JComboBox();
|
||||
jLabel6 = new javax.swing.JLabel();
|
||||
textStart = new javax.swing.JTextField();
|
||||
textEnd = new javax.swing.JTextField();
|
||||
jLabel7 = new javax.swing.JLabel();
|
||||
jLabel8 = new javax.swing.JLabel();
|
||||
textVel = new javax.swing.JTextField();
|
||||
jLabel9 = new javax.swing.JLabel();
|
||||
textCycles = new javax.swing.JTextField();
|
||||
jToggleButton1 = new javax.swing.JToggleButton();
|
||||
jToggleButton2 = new javax.swing.JToggleButton();
|
||||
stateWireScan = new ch.psi.pshell.swing.DeviceStatePanel();
|
||||
jLabel10 = new javax.swing.JLabel();
|
||||
|
||||
comboWireScan.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
comboWireScanActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel1.setText("Wire Scan:");
|
||||
|
||||
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel2.setText("Selection:");
|
||||
|
||||
comboSelection.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
comboSelectionActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel3.setText("BPM 1:");
|
||||
|
||||
textBpm1.setEditable(false);
|
||||
|
||||
textBpm2.setEditable(false);
|
||||
|
||||
jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel4.setText("BPM 2:");
|
||||
|
||||
jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel5.setText("BPM 3:");
|
||||
|
||||
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel6.setText("Start (µm):");
|
||||
|
||||
jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel7.setText("End (µm):");
|
||||
|
||||
jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel8.setText("Vel (µm/s):");
|
||||
|
||||
jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel9.setText("Cycles:");
|
||||
|
||||
jToggleButton1.setText("Scan");
|
||||
|
||||
jToggleButton2.setText("Abort");
|
||||
|
||||
stateWireScan.setBorder(null);
|
||||
|
||||
jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel10.setText("Scan status:");
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(jLabel1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(comboWireScan, javax.swing.GroupLayout.PREFERRED_SIZE, 332, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jLabel6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jLabel10, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(comboSelection, 0, 332, Short.MAX_VALUE)
|
||||
.addComponent(textBpm1)
|
||||
.addComponent(textBpm2)
|
||||
.addComponent(comboBpm3, 0, 332, Short.MAX_VALUE)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(textStart, javax.swing.GroupLayout.PREFERRED_SIZE, 100, 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.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(jLabel7)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(textEnd, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(jLabel9)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(textCycles, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))))
|
||||
.addComponent(stateWireScan, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(jLabel8)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(textVel, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addContainerGap(20, Short.MAX_VALUE))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jToggleButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(63, 63, 63)
|
||||
.addComponent(jToggleButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel1, jLabel10, jLabel2, jLabel3, jLabel4, jLabel5, jLabel6, jLabel7, jLabel8, jLabel9});
|
||||
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(comboWireScan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel1))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(comboSelection, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel2))
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel6)
|
||||
.addComponent(textStart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel7)
|
||||
.addComponent(textEnd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel8)
|
||||
.addComponent(textVel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel9)
|
||||
.addComponent(textCycles, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel3)
|
||||
.addComponent(textBpm1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel4)
|
||||
.addComponent(textBpm2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel5)
|
||||
.addComponent(comboBpm3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jLabel10)
|
||||
.addComponent(stateWireScan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 34, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jToggleButton1)
|
||||
.addComponent(jToggleButton2))
|
||||
.addContainerGap(50, Short.MAX_VALUE))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void comboWireScanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboWireScanActionPerformed
|
||||
try {
|
||||
List<String> ret = (List<String>) ((Plugin)this).eval("get_wire_scans_bpms('" + comboWireScan.getSelectedItem().toString()+ "')", true);
|
||||
textBpm1.setText((ret==null) ? "" : ret.get(0));
|
||||
textBpm2.setText((ret==null) ? "" : ret.get(1));
|
||||
|
||||
comboSelection.setSelectedIndex(Epics.get(comboWireScan.getSelectedItem().toString() + ":WIRE_SP", Integer.class));
|
||||
textVel.setText(Epics.get(comboWireScan.getSelectedItem().toString() + ":SCAN_VELO_SP", String.class));
|
||||
textCycles.setText(Epics.get(comboWireScan.getSelectedItem().toString() + ":NB_CYCL_SP", String.class));
|
||||
if (stateWireScan.getDevice()!=null){
|
||||
stateWireScan.getDevice().close();
|
||||
}
|
||||
Device dev= (Device)eval("newScanInfoDevice('Wire scan state', '" + comboWireScan.getSelectedItem().toString()+ "')", true);
|
||||
stateWireScan.setDevice(dev);
|
||||
|
||||
} catch (Exception ex) {
|
||||
stateWireScan.setDevice(null);
|
||||
showException(ex);
|
||||
}
|
||||
}//GEN-LAST:event_comboWireScanActionPerformed
|
||||
|
||||
private void comboSelectionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboSelectionActionPerformed
|
||||
try {
|
||||
textStart.setText(Epics.get(comboWireScan.getSelectedItem().toString()+ ":" + comboSelection.getSelectedItem().toString() + "_START_SP", String.class));
|
||||
textEnd.setText(Epics.get(comboWireScan.getSelectedItem().toString() + ":" + comboSelection.getSelectedItem().toString() + "_END_SP", String.class));
|
||||
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
}//GEN-LAST:event_comboSelectionActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JComboBox comboBpm3;
|
||||
private javax.swing.JComboBox comboSelection;
|
||||
private javax.swing.JComboBox comboWireScan;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel10;
|
||||
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.JLabel jLabel7;
|
||||
private javax.swing.JLabel jLabel8;
|
||||
private javax.swing.JLabel jLabel9;
|
||||
private javax.swing.JToggleButton jToggleButton1;
|
||||
private javax.swing.JToggleButton jToggleButton2;
|
||||
private ch.psi.pshell.swing.DeviceStatePanel stateWireScan;
|
||||
private javax.swing.JTextField textBpm1;
|
||||
private javax.swing.JTextField textBpm2;
|
||||
private javax.swing.JTextField textCycles;
|
||||
private javax.swing.JTextField textEnd;
|
||||
private javax.swing.JTextField textStart;
|
||||
private javax.swing.JTextField textVel;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
@@ -1,169 +1,170 @@
|
||||
DBPM = 1
|
||||
DWSC = 2
|
||||
|
||||
elements = ((DBPM, "SINEG01-DBPM340", 3.0149),
|
||||
(DBPM, "SINSB01-DBPM150", 7.9459),
|
||||
(DBPM, "SINSB02-DBPM150", 12.9489),
|
||||
(DBPM, "SINLH01-DBPM060", 14.5560),
|
||||
(DBPM, "SINLH02-DBPM210", 16.4806),
|
||||
(DBPM, "SINLH02-DBPM240", 17.4826),
|
||||
(DBPM, "SINLH03-DBPM010", 19.2172),
|
||||
(DBPM, "SINLH03-DBPM050", 20.4632),
|
||||
(DBPM, "SINLH03-DBPM090", 21.6002),
|
||||
(DBPM, "SINSB03-DBPM120", 26.9202),
|
||||
(DBPM, "SINSB03-DBPM220", 32.4202),
|
||||
(DBPM, "SINSB04-DBPM120", 37.9202),
|
||||
(DBPM, "SINSB04-DBPM220", 43.4202),
|
||||
(DBPM, "SINSB05-DBPM120", 48.9202),
|
||||
(DBPM, "SINSB05-DBPM220", 54.4202),
|
||||
(DBPM, "SINXB01-DBPM120", 56.2420),
|
||||
(DBPM, "SINBC01-DBPM010", 60.2912),
|
||||
(DBPM, "SINBC01-DBPM030", 61.0912),
|
||||
(DBPM, "SINBC01-DBPM080", 64.4172),
|
||||
(DBPM, "SINBC01-DBPM100", 65.9432),
|
||||
(DBPM, "SINBC02-DBPM140", 69.3739),
|
||||
(DBPM, "SINBC02-DBPM320", 77.5610),
|
||||
(DBPM, "SINDI01-DBPM010", 82.0967),
|
||||
(DBPM, "SINDI01-DBPM060", 83.5117),
|
||||
(DWSC, "SINDI01-DWSC090", 84.2537),
|
||||
(DBPM, "SINDI02-DBPM010", 86.0767),
|
||||
(DBPM, "SINDI02-DBPM040", 88.3857),
|
||||
(DBPM, "SINDI02-DBPM080", 90.6297),
|
||||
(DBPM, "S10CB01-DBPM220", 95.3947),
|
||||
(DBPM, "S10CB01-DBPM420", 100.2947),
|
||||
(DBPM, "S10CB02-DBPM220", 105.1947),
|
||||
(DBPM, "S10CB02-DBPM420", 110.0947),
|
||||
(DWSC, "S10DI01-DWSC010", 110.8237),
|
||||
(DBPM, "S10BD01-DBPM020", 114.6628),
|
||||
(DBPM, "S10DI01-DBPM110", 114.9947),
|
||||
(DBPM, "S10CB03-DBPM220", 119.8947),
|
||||
(DBPM, "S10CB03-DBPM420", 124.7947),
|
||||
(DWSC, "S10CB03-DWSC440", 125.2127),
|
||||
(DBPM, "S10CB04-DBPM220", 129.6947),
|
||||
(DBPM, "S10CB04-DBPM420", 134.5947),
|
||||
(DBPM, "S10CB05-DBPM220", 139.4947),
|
||||
(DBPM, "S10CB05-DBPM420", 144.3947),
|
||||
(DWSC, "S10CB05-DWSC440", 144.8127),
|
||||
(DBPM, "S10CB06-DBPM220", 149.2947),
|
||||
(DBPM, "S10CB06-DBPM420", 154.1947),
|
||||
(DBPM, "S10CB07-DBPM220", 159.0947),
|
||||
(DBPM, "S10CB07-DBPM420", 163.9947),
|
||||
(DWSC, "S10CB07-DWSC440", 164.4127),
|
||||
(DBPM, "S10CB08-DBPM220", 168.8947),
|
||||
(DBPM, "S10CB08-DBPM420", 173.7947),
|
||||
(DBPM, "S10CB09-DBPM220", 178.6947),
|
||||
(DBPM, "S10BC01-DBPM010", 183.5947),
|
||||
(DWSC, "S10BC01-DWSC030", 184.0127),
|
||||
(DBPM, "S10BC01-DBPM050", 187.8307),
|
||||
(DBPM, "S10BC01-DBPM090", 192.2847),
|
||||
(DBPM, "S10BC02-DBPM140", 196.7798),
|
||||
(DBPM, "S10BC02-DBPM320", 206.5399),
|
||||
(DBPM, "S10MA01-DBPM010", 211.2940),
|
||||
(DBPM, "S10MA01-DBPM060", 215.6600),
|
||||
(DBPM, "S10MA01-DBPM120", 220.1200),
|
||||
(DBPM, "S20CB01-DBPM420", 229.0850),
|
||||
(DWSC, "S20CB01-DWSC440", 229.5030),
|
||||
(DBPM, "S20CB02-DBPM420", 238.1850),
|
||||
(DBPM, "S20CB03-DBPM420", 247.2850),
|
||||
(DBPM, "S20SY01-DBPM010", 256.3850),
|
||||
(DBPM, "S20SY01-DBPM040", 262.5020),
|
||||
(DBPM, "S20SY01-DBPM060", 263.6280),
|
||||
(DWSC, "S20SY01-DWSC070", 263.8280),
|
||||
(DBPM, "S20SY02-DBPM080", 269.1300),
|
||||
(DBPM, "S20SY02-DBPM120", 271.0800),
|
||||
(DBPM, "S20SY02-DBPM150", 272.7600),
|
||||
(DWSC, "S20SY02-DWSC160", 273.1350),
|
||||
(DBPM, "SATSY01-DBPM010", 279.1202),
|
||||
(DBPM, "S20SY03-DBPM010", 280.6200),
|
||||
(DBPM, "SATSY01-DBPM060", 284.6202),
|
||||
(DBPM, "S20SY03-DBPM040", 286.9200),
|
||||
(DBPM, "SATSY01-DBPM100", 288.9352),
|
||||
(DBPM, "S20SY03-DBPM080", 294.3800),
|
||||
(DWSC, "S20SY03-DWSC090", 294.5800),
|
||||
(DBPM, "SATSY01-DBPM240", 296.1202),
|
||||
(DBPM, "SATSY01-DBPM290", 302.8202),
|
||||
(DBPM, "S30CB01-DBPM420", 303.8150),
|
||||
(DWSC, "S30CB01-DWSC440", 304.2330),
|
||||
(DBPM, "SATSY02-DBPM020", 306.8663),
|
||||
(DBPM, "SATSY02-DBPM210", 312.6833),
|
||||
(DBPM, "S30CB02-DBPM420", 312.9150),
|
||||
(DBPM, "SATSY03-DBPM030", 317.2003),
|
||||
(DBPM, "SATSY03-DBPM060", 320.0003),
|
||||
(DBPM, "S30CB03-DBPM420", 322.0150),
|
||||
(DBPM, "SATSY03-DBPM090", 322.8003),
|
||||
(DWSC, "SATSY03-DWSC110", 325.1663),
|
||||
(DBPM, "SATSY03-DBPM120", 325.6003),
|
||||
(DBPM, "S30CB04-DBPM420", 331.1150),
|
||||
(DBPM, "SATCL01-DBPM140", 331.9185),
|
||||
(DBPM, "S30CB05-DBPM420", 340.2150),
|
||||
(DWSC, "S30CB05-DWSC440", 340.6330),
|
||||
(DBPM, "SATDI01-DBPM030", 340.8637),
|
||||
(DBPM, "SATDI01-DBPM060", 342.7637),
|
||||
(DWSC, "SATDI01-DWSC065", 342.9837),
|
||||
(DBPM, "SATDI01-DBPM210", 349.2197),
|
||||
(DBPM, "S30CB06-DBPM420", 349.3150),
|
||||
(DBPM, "SATDI01-DBPM240", 352.1997),
|
||||
(DBPM, "SATDI01-DBPM270", 355.1797),
|
||||
(DWSC, "SATDI01-DWSC290", 356.4797),
|
||||
(DBPM, "SATDI01-DBPM320", 357.0907),
|
||||
(DBPM, "S30CB07-DBPM420", 358.4150),
|
||||
(DBPM, "SATCB01-DBPM220", 361.5357),
|
||||
(DBPM, "SATCB01-DBPM420", 366.4357),
|
||||
(DBPM, "S30CB08-DBPM420", 367.5150),
|
||||
(DBPM, "S30CB09-DBPM420", 376.6150),
|
||||
(DWSC, "S30CB09-DWSC440", 377.0330),
|
||||
(DBPM, "SATMA01-DBPM010", 377.2657),
|
||||
(DBPM, "SATMA01-DBPM020", 379.3147),
|
||||
(DBPM, "SATMA01-DBPM040", 381.3637),
|
||||
(DBPM, "S30CB10-DBPM420", 385.7150),
|
||||
(DBPM, "S30CB11-DBPM420", 394.8150),
|
||||
(DBPM, "S30CB12-DBPM420", 403.9150),
|
||||
(DBPM, "S30CB13-DBPM420", 413.0150),
|
||||
(DWSC, "S30CB13-DWSC440", 413.4330),
|
||||
(DBPM, "S30CB14-DBPM420", 422.1150),
|
||||
(DBPM, "S30CB15-DBPM420", 431.2150),
|
||||
(DBPM, "SARCL01-DBPM010", 440.3150),
|
||||
(DBPM, "SARCL01-DBPM060", 444.6750),
|
||||
(DBPM, "SARCL01-DBPM120", 450.7750),
|
||||
(DBPM, "SARCL01-DBPM150", 452.1510),
|
||||
(DWSC, "SARCL01-DWSC160", 452.3510),
|
||||
(DBPM, "SARCL02-DBPM110", 456.9100),
|
||||
(DBPM, "SARCL02-DBPM220", 460.9609),
|
||||
(DBPM, "SARCL02-DBPM260", 462.7569),
|
||||
(DWSC, "SARCL02-DWSC270", 462.9769),
|
||||
(DBPM, "SARCL02-DBPM330", 466.6909),
|
||||
(DBPM, "SARCL02-DBPM470", 471.1067),
|
||||
(DBPM, "SARMA01-DBPM040", 476.4267),
|
||||
(DBPM, "SARMA01-DBPM100", 483.2767),
|
||||
(DBPM, "SARMA02-DBPM010", 487.9617),
|
||||
(DBPM, "SARMA02-DBPM020", 490.0107),
|
||||
(DBPM, "SARMA02-DBPM040", 492.0597),
|
||||
(DWSC, "SARMA02-DWSC060", 492.3767),
|
||||
(DBPM, "SARMA02-DBPM110", 496.8097),
|
||||
(DBPM, "SARUN01-DBPM070", 501.5597),
|
||||
(DBPM, "SARUN02-DBPM070", 506.3097),
|
||||
(DBPM, "SARUN03-DBPM070", 511.0597),
|
||||
(DBPM, "SARUN04-DBPM070", 515.8097),
|
||||
(DBPM, "SARUN05-DBPM070", 520.5597),
|
||||
(DBPM, "SARUN06-DBPM070", 525.3097),
|
||||
(DBPM, "SARUN07-DBPM070", 530.0597),
|
||||
(DBPM, "SARUN08-DBPM070", 534.8097),
|
||||
(DBPM, "SARUN09-DBPM070", 539.5597),
|
||||
(DBPM, "SARUN10-DBPM070", 544.3097),
|
||||
(DBPM, "SARUN11-DBPM070", 549.0597),
|
||||
(DBPM, "SARUN12-DBPM070", 553.8097),
|
||||
(DBPM, "SARUN13-DBPM070", 558.5597),
|
||||
(DBPM, "SARUN14-DBPM070", 563.3097),
|
||||
(DBPM, "SARUN15-DBPM070", 568.0597),
|
||||
(DBPM, "SARUN16-DBPM070", 572.8097),
|
||||
(DBPM, "SARUN17-DBPM070", 577.5597),
|
||||
(DBPM, "SARUN18-DBPM070", 582.3097),
|
||||
(DBPM, "SARUN19-DBPM070", 587.0597),
|
||||
(DWSC, "SARUN20-DWSC010", 587.3767),
|
||||
(DBPM, "SARUN20-DBPM070", 591.8097),
|
||||
(DBPM, "SARBD01-DBPM040", 593.9132),
|
||||
(DBPM, "SARBD02-DBPM010", 596.9584),
|
||||
(DBPM, "SARBD02-DBPM040", 598.3943),
|
||||
elements = (
|
||||
(DBPM, "SINEG01-DBPM340", 3.0149),
|
||||
(DBPM, "SINSB01-DBPM150", 7.9459),
|
||||
(DBPM, "SINSB02-DBPM150", 12.9489),
|
||||
(DBPM, "SINLH01-DBPM060", 14.5560),
|
||||
(DBPM, "SINLH02-DBPM210", 16.4806),
|
||||
(DBPM, "SINLH02-DBPM240", 17.4826),
|
||||
(DBPM, "SINLH03-DBPM010", 19.2172),
|
||||
(DBPM, "SINLH03-DBPM050", 20.4632),
|
||||
(DBPM, "SINLH03-DBPM090", 21.6002),
|
||||
(DBPM, "SINSB03-DBPM120", 26.9202),
|
||||
(DBPM, "SINSB03-DBPM220", 32.4202),
|
||||
(DBPM, "SINSB04-DBPM120", 37.9202),
|
||||
(DBPM, "SINSB04-DBPM220", 43.4202),
|
||||
(DBPM, "SINSB05-DBPM120", 48.9202),
|
||||
(DBPM, "SINSB05-DBPM220", 54.4202),
|
||||
(DBPM, "SINXB01-DBPM120", 56.2420),
|
||||
(DBPM, "SINBC01-DBPM010", 60.2912),
|
||||
(DBPM, "SINBC01-DBPM030", 61.0912),
|
||||
(DBPM, "SINBC01-DBPM080", 64.4172),
|
||||
(DBPM, "SINBC01-DBPM100", 65.9432),
|
||||
(DBPM, "SINBC02-DBPM140", 69.3739),
|
||||
(DBPM, "SINBC02-DBPM320", 77.5610),
|
||||
(DBPM, "SINDI01-DBPM010", 82.0967),
|
||||
(DBPM, "SINDI01-DBPM060", 83.5117),
|
||||
(DWSC, "SINDI01-DWSC090", 84.2537),
|
||||
(DBPM, "SINDI02-DBPM010", 86.0767),
|
||||
(DBPM, "SINDI02-DBPM040", 88.3857),
|
||||
(DBPM, "SINDI02-DBPM080", 90.6297),
|
||||
(DBPM, "S10CB01-DBPM220", 95.3947),
|
||||
(DBPM, "S10CB01-DBPM420", 100.2947),
|
||||
(DBPM, "S10CB02-DBPM220", 105.1947),
|
||||
(DBPM, "S10CB02-DBPM420", 110.0947),
|
||||
(DWSC, "S10DI01-DWSC010", 110.8237),
|
||||
(DBPM, "S10BD01-DBPM020", 114.6628),
|
||||
(DBPM, "S10DI01-DBPM110", 114.9947),
|
||||
(DBPM, "S10CB03-DBPM220", 119.8947),
|
||||
(DBPM, "S10CB03-DBPM420", 124.7947),
|
||||
(DWSC, "S10CB03-DWSC440", 125.2127),
|
||||
(DBPM, "S10CB04-DBPM220", 129.6947),
|
||||
(DBPM, "S10CB04-DBPM420", 134.5947),
|
||||
(DBPM, "S10CB05-DBPM220", 139.4947),
|
||||
(DBPM, "S10CB05-DBPM420", 144.3947),
|
||||
(DWSC, "S10CB05-DWSC440", 144.8127),
|
||||
(DBPM, "S10CB06-DBPM220", 149.2947),
|
||||
(DBPM, "S10CB06-DBPM420", 154.1947),
|
||||
(DBPM, "S10CB07-DBPM220", 159.0947),
|
||||
(DBPM, "S10CB07-DBPM420", 163.9947),
|
||||
(DWSC, "S10CB07-DWSC440", 164.4127),
|
||||
(DBPM, "S10CB08-DBPM220", 168.8947),
|
||||
(DBPM, "S10CB08-DBPM420", 173.7947),
|
||||
(DBPM, "S10CB09-DBPM220", 178.6947),
|
||||
(DBPM, "S10BC01-DBPM010", 183.5947),
|
||||
(DWSC, "S10BC01-DWSC030", 184.0127),
|
||||
(DBPM, "S10BC01-DBPM050", 187.8307),
|
||||
(DBPM, "S10BC01-DBPM090", 192.2847),
|
||||
(DBPM, "S10BC02-DBPM140", 196.7798),
|
||||
(DBPM, "S10BC02-DBPM320", 206.5399),
|
||||
(DBPM, "S10MA01-DBPM010", 211.2940),
|
||||
(DBPM, "S10MA01-DBPM060", 215.6600),
|
||||
(DBPM, "S10MA01-DBPM120", 220.1200),
|
||||
(DBPM, "S20CB01-DBPM420", 229.0850),
|
||||
(DWSC, "S20CB01-DWSC440", 229.5030),
|
||||
(DBPM, "S20CB02-DBPM420", 238.1850),
|
||||
(DBPM, "S20CB03-DBPM420", 247.2850),
|
||||
(DBPM, "S20SY01-DBPM010", 256.3850),
|
||||
(DBPM, "S20SY01-DBPM040", 262.5020),
|
||||
(DBPM, "S20SY01-DBPM060", 263.6280),
|
||||
(DWSC, "S20SY01-DWSC070", 263.8280),
|
||||
(DBPM, "S20SY02-DBPM080", 269.1300),
|
||||
(DBPM, "S20SY02-DBPM120", 271.0800),
|
||||
(DBPM, "S20SY02-DBPM150", 272.7600),
|
||||
(DWSC, "S20SY02-DWSC160", 273.1350),
|
||||
(DBPM, "SATSY01-DBPM010", 279.1202),
|
||||
(DBPM, "S20SY03-DBPM010", 280.6200),
|
||||
(DBPM, "SATSY01-DBPM060", 284.6202),
|
||||
(DBPM, "S20SY03-DBPM040", 286.9200),
|
||||
(DBPM, "SATSY01-DBPM100", 288.9352),
|
||||
(DBPM, "S20SY03-DBPM080", 294.3800),
|
||||
(DWSC, "S20SY03-DWSC090", 294.5800),
|
||||
(DBPM, "SATSY01-DBPM240", 296.1202),
|
||||
(DBPM, "SATSY01-DBPM290", 302.8202),
|
||||
(DBPM, "S30CB01-DBPM420", 303.8150),
|
||||
(DWSC, "S30CB01-DWSC440", 304.2330),
|
||||
(DBPM, "SATSY02-DBPM020", 306.8663),
|
||||
(DBPM, "SATSY02-DBPM210", 312.6833),
|
||||
(DBPM, "S30CB02-DBPM420", 312.9150),
|
||||
(DBPM, "SATSY03-DBPM030", 317.2003),
|
||||
(DBPM, "SATSY03-DBPM060", 320.0003),
|
||||
(DBPM, "S30CB03-DBPM420", 322.0150),
|
||||
(DBPM, "SATSY03-DBPM090", 322.8003),
|
||||
(DWSC, "SATSY03-DWSC110", 325.1663),
|
||||
(DBPM, "SATSY03-DBPM120", 325.6003),
|
||||
(DBPM, "S30CB04-DBPM420", 331.1150),
|
||||
(DBPM, "SATCL01-DBPM140", 331.9185),
|
||||
(DBPM, "S30CB05-DBPM420", 340.2150),
|
||||
(DWSC, "S30CB05-DWSC440", 340.6330),
|
||||
(DBPM, "SATDI01-DBPM030", 340.8637),
|
||||
(DBPM, "SATDI01-DBPM060", 342.7637),
|
||||
(DWSC, "SATDI01-DWSC065", 342.9837),
|
||||
(DBPM, "SATDI01-DBPM210", 349.2197),
|
||||
(DBPM, "S30CB06-DBPM420", 349.3150),
|
||||
(DBPM, "SATDI01-DBPM240", 352.1997),
|
||||
(DBPM, "SATDI01-DBPM270", 355.1797),
|
||||
(DWSC, "SATDI01-DWSC290", 356.4797),
|
||||
(DBPM, "SATDI01-DBPM320", 357.0907),
|
||||
(DBPM, "S30CB07-DBPM420", 358.4150),
|
||||
(DBPM, "SATCB01-DBPM220", 361.5357),
|
||||
(DBPM, "SATCB01-DBPM420", 366.4357),
|
||||
(DBPM, "S30CB08-DBPM420", 367.5150),
|
||||
(DBPM, "S30CB09-DBPM420", 376.6150),
|
||||
(DWSC, "S30CB09-DWSC440", 377.0330),
|
||||
(DBPM, "SATMA01-DBPM010", 377.2657),
|
||||
(DBPM, "SATMA01-DBPM020", 379.3147),
|
||||
(DBPM, "SATMA01-DBPM040", 381.3637),
|
||||
(DBPM, "S30CB10-DBPM420", 385.7150),
|
||||
(DBPM, "S30CB11-DBPM420", 394.8150),
|
||||
(DBPM, "S30CB12-DBPM420", 403.9150),
|
||||
(DBPM, "S30CB13-DBPM420", 413.0150),
|
||||
(DWSC, "S30CB13-DWSC440", 413.4330),
|
||||
(DBPM, "S30CB14-DBPM420", 422.1150),
|
||||
(DBPM, "S30CB15-DBPM420", 431.2150),
|
||||
(DBPM, "SARCL01-DBPM010", 440.3150),
|
||||
(DBPM, "SARCL01-DBPM060", 444.6750),
|
||||
(DBPM, "SARCL01-DBPM120", 450.7750),
|
||||
(DBPM, "SARCL01-DBPM150", 452.1510),
|
||||
(DWSC, "SARCL01-DWSC160", 452.3510),
|
||||
(DBPM, "SARCL02-DBPM110", 456.9100),
|
||||
(DBPM, "SARCL02-DBPM220", 460.9609),
|
||||
(DBPM, "SARCL02-DBPM260", 462.7569),
|
||||
(DWSC, "SARCL02-DWSC270", 462.9769),
|
||||
(DBPM, "SARCL02-DBPM330", 466.6909),
|
||||
(DBPM, "SARCL02-DBPM470", 471.1067),
|
||||
(DBPM, "SARMA01-DBPM040", 476.4267),
|
||||
(DBPM, "SARMA01-DBPM100", 483.2767),
|
||||
(DBPM, "SARMA02-DBPM010", 487.9617),
|
||||
(DBPM, "SARMA02-DBPM020", 490.0107),
|
||||
(DBPM, "SARMA02-DBPM040", 492.0597),
|
||||
(DWSC, "SARMA02-DWSC060", 492.3767),
|
||||
(DBPM, "SARMA02-DBPM110", 496.8097),
|
||||
(DBPM, "SARUN01-DBPM070", 501.5597),
|
||||
(DBPM, "SARUN02-DBPM070", 506.3097),
|
||||
(DBPM, "SARUN03-DBPM070", 511.0597),
|
||||
(DBPM, "SARUN04-DBPM070", 515.8097),
|
||||
(DBPM, "SARUN05-DBPM070", 520.5597),
|
||||
(DBPM, "SARUN06-DBPM070", 525.3097),
|
||||
(DBPM, "SARUN07-DBPM070", 530.0597),
|
||||
(DBPM, "SARUN08-DBPM070", 534.8097),
|
||||
(DBPM, "SARUN09-DBPM070", 539.5597),
|
||||
(DBPM, "SARUN10-DBPM070", 544.3097),
|
||||
(DBPM, "SARUN11-DBPM070", 549.0597),
|
||||
(DBPM, "SARUN12-DBPM070", 553.8097),
|
||||
(DBPM, "SARUN13-DBPM070", 558.5597),
|
||||
(DBPM, "SARUN14-DBPM070", 563.3097),
|
||||
(DBPM, "SARUN15-DBPM070", 568.0597),
|
||||
(DBPM, "SARUN16-DBPM070", 572.8097),
|
||||
(DBPM, "SARUN17-DBPM070", 577.5597),
|
||||
(DBPM, "SARUN18-DBPM070", 582.3097),
|
||||
(DBPM, "SARUN19-DBPM070", 587.0597),
|
||||
(DWSC, "SARUN20-DWSC010", 587.3767),
|
||||
(DBPM, "SARUN20-DBPM070", 591.8097),
|
||||
(DBPM, "SARBD01-DBPM040", 593.9132),
|
||||
(DBPM, "SARBD02-DBPM010", 596.9584),
|
||||
(DBPM, "SARBD02-DBPM040", 598.3943),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
class WireScan:
|
||||
Garage, W1X, W1Y, W2X, W2Y, Foil = "GARAGE", "W1X", "W1Y", "W2X", "W2Y", "Foil"
|
||||
|
||||
def __init__(self, prefix, sel = None):
|
||||
self.prefix = prefix
|
||||
self.velocity = Channel(self.prefix + ":SCAN_VELO_SP")
|
||||
self.cycles = Channel(self.prefix + ":NB_CYCL_SP")
|
||||
self.currCycl = Channel(self.prefix + ":CURR_CYCL", callback = self.on_cycle_change)
|
||||
self.currCycl.set_monitored(True)
|
||||
#self.current_cycle = self.currCycl.get()
|
||||
self.selection = None
|
||||
self.u0 = None
|
||||
self.offset = None
|
||||
self.range = None
|
||||
self.start = None
|
||||
self.end = None
|
||||
if sel is not None:
|
||||
self.set_selection(sel)
|
||||
|
||||
def on_cycle_change(self, val):
|
||||
print "On cycle chenge: ", val
|
||||
self.current_cycle = val
|
||||
|
||||
def set_selection(self, sel):
|
||||
if not sel in [WireScan.Garage, WireScan.W1X, WireScan.W1Y, WireScan.W2X, WireScan.W2Y, WireScan.Foil]:
|
||||
raise Exception("Invalid Wire Scan selection: " + str(sel))
|
||||
self.selection = sel
|
||||
self.u0 = Channel(self.prefix + ":" + self.selection + "_U0_SP")
|
||||
self.offset = Channel(self.prefix + ":" + self.selection + "_OFF_SP")
|
||||
self.range = Channel(self.prefix + ":" + self.selection + "_RANGE_SP")
|
||||
self.start = Channel(self.prefix + ":" + self.selection + "_START_SP")
|
||||
self.end = Channel(self.prefix + ":" + self.selection + "_END_SP")
|
||||
|
||||
def close(self):
|
||||
self.velocity.close()
|
||||
self.cycles.close()
|
||||
self.currCycl.close()
|
||||
if self.u0 is not None: self.u0.close()
|
||||
if self.offset is not None: self.offset.close()
|
||||
if self.range is not None: self.range.close()
|
||||
if self.start is not None: self.start.close()
|
||||
if self.end is not None: self.end.close()
|
||||
|
||||
|
||||
|
||||
|
||||
148
script/Devices/WireScanner.py
Normal file
148
script/Devices/WireScanner.py
Normal file
@@ -0,0 +1,148 @@
|
||||
import ch.psi.pshell.epics.Motor
|
||||
|
||||
|
||||
class WireScanInfo(DeviceBase):
|
||||
def __init__(self, name, prefix):
|
||||
self.prefix = prefix
|
||||
self.status_channels=[]
|
||||
for s in ("SCANNING", "SCAN_DONE", "INITIALIZING", "INIT_DONE", "ABORTED", "ERROR"):
|
||||
c = Channel(self.prefix + ":" + s, 'i', callback = self.on_status_change);
|
||||
c.set_monitored(True)
|
||||
self.status_channels.append(c)
|
||||
self.on_status_change(None)
|
||||
self.initialize()
|
||||
|
||||
def on_status_change(self, val):
|
||||
try:
|
||||
if self.status_channels[0].get() == 1:
|
||||
self.setCache("scanning", None)
|
||||
self.setState(State.Busy)
|
||||
elif self.status_channels[1].get() == 1:
|
||||
self.setCache( "scan done", None)
|
||||
self.setState(State.Ready)
|
||||
elif self.status_channels[2].get() == 1:
|
||||
self.setCache("traveling", None)
|
||||
self.setState(State.Initializing)
|
||||
elif self.status_channels[3].get() == 1:
|
||||
self.setCache("at start", None)
|
||||
self.setState(State.Ready)
|
||||
elif self.status_channels[4].get() == 1:
|
||||
self.setCache("abort", None)
|
||||
self.setState(State.Ready)
|
||||
elif self.status_channels[5].get() == 1:
|
||||
self.setCache("error", None)
|
||||
self.setState(State.Fault)
|
||||
else:
|
||||
pass #All zero, a transition
|
||||
except:
|
||||
self.setCache("offline", None)
|
||||
self.setState(State.Offline)
|
||||
|
||||
def doClose(self):
|
||||
for c in self.status_channels:
|
||||
c.close()
|
||||
|
||||
def newScanInfoDevice(name, prefix):
|
||||
return WireScanInfo(name, prefix)
|
||||
|
||||
|
||||
class WireScanner(WireScanInfo):
|
||||
Selection = [Garage, W1X, W1Y, W2X, W2Y, Foil] = "GARAGE", "W1X", "W1Y", "W2X", "W2Y", "FOIL"
|
||||
|
||||
def __init__(self, prefix, sel = None, start=None , end=None, cycles=None, velocity=None, continuous = None):
|
||||
WireScanInfo.__init__(self, "Wire Scan " + prefix, prefix)
|
||||
self.motor = ch.psi.pshell.epics.Motor("WireScanner motor", self.prefix + ":MOTOR_1")
|
||||
self.motor.initialize()
|
||||
self.motor_bs_readback = Channel(self.prefix + ":ENC_1_BS")
|
||||
self.wire_velocity = Channel(self.prefix + ":SCAN_VELO_SP") #wire coordinates
|
||||
self.motor_velocity = Channel(self.prefix + ":SCAN_M_VELO") #motor coordinates
|
||||
self.travel_velocity = Channel(self.prefix + ":TRAVEL_VELO_SP") #motor coordinates
|
||||
self.nb_cycles = Channel(self.prefix + ":NB_CYCL_SP", 'l')
|
||||
self.curr_cycl = Channel(self.prefix + ":CURR_CYCL", 'l', callback = self.on_cycle_change)
|
||||
self.curr_cycl.set_monitored(True)
|
||||
set_device_alias(self.curr_cycl, "current_cycle")
|
||||
self.wire_sel = Channel(self.prefix + ":WIRE_SP", 'l')
|
||||
self.current_cycle = self.curr_cycl.get()
|
||||
self.selection = None
|
||||
self.u0 = None
|
||||
self.offset = None
|
||||
self.range = None
|
||||
self.start = None
|
||||
self.end = None
|
||||
if sel is not None:
|
||||
self.set_selection(sel)
|
||||
|
||||
#Setting parameters
|
||||
if start is not None:
|
||||
self.start.write(float(start))
|
||||
if end is not None:
|
||||
self.end.write(float(end))
|
||||
if cycles is not None:
|
||||
self.nb_cycles.write(int(cycles))
|
||||
if velocity is not None:
|
||||
self.wire_velocity.write(float(velocity))
|
||||
if continuous is not None:
|
||||
caputq(self.prefix + ":SCAN_MODE_SP", 0 if continuous else 1)
|
||||
|
||||
self.cycles = self.nb_cycles.get()
|
||||
self.velocity = self.wire_velocity.get()
|
||||
self.scan_range = [self.start.get(), self.end.get()]
|
||||
self.initialize()
|
||||
|
||||
def on_cycle_change(self, val):
|
||||
#print "Wire scan cycle change: ", val
|
||||
self.current_cycle = val
|
||||
|
||||
def set_selection(self, sel):
|
||||
if not sel in WireScanner.Selection:
|
||||
raise Exception("Invalid Wire Scan selection: " + str(sel))
|
||||
self.selection = sel
|
||||
self.u0 = Channel(self.prefix + ":" + self.selection + "_U0_SP")
|
||||
self.offset = Channel(self.prefix + ":" + self.selection + "_OFF_SP")
|
||||
self.range = Channel(self.prefix + ":" + self.selection + "_RANGE_SP")
|
||||
self.start = Channel(self.prefix + ":" + self.selection + "_START_SP")
|
||||
self.end = Channel(self.prefix + ":" + self.selection + "_END_SP")
|
||||
self.wire_sel.put(WireScanner.Selection.index(sel))
|
||||
|
||||
def doClose(self):
|
||||
WireScanState.doClose(self)
|
||||
self.motor.close()
|
||||
self.motor_bs_readback.close()
|
||||
self.wire_velocity.close()
|
||||
self.motor_velocity.close()
|
||||
self.travel_velocity.close()
|
||||
self.nb_cycles.close()
|
||||
self.curr_cycl.close()
|
||||
self.wire_sel.close()
|
||||
if self.u0 is not None: self.u0.close()
|
||||
if self.offset is not None: self.offset.close()
|
||||
if self.range is not None: self.range.close()
|
||||
if self.start is not None: self.start.close()
|
||||
if self.end is not None: self.end.close()
|
||||
|
||||
def get_cicle_time(self):
|
||||
range = abs(self.start.get() -self.end.get())
|
||||
speed = self.motor_velocity.get()
|
||||
return (range / speed)
|
||||
|
||||
def get_total_time(self):
|
||||
return self.get_cicle_time() * self.cycles
|
||||
|
||||
def abort(self):
|
||||
caputq("SINDI01-DWSC090:ABORT.PROC", 1)
|
||||
|
||||
def init(self):
|
||||
caputq("SINDI01-DWSC090:INIT.PROC", 1)
|
||||
|
||||
def park(self):
|
||||
caputq("SINDI01-DWSC090:GARAGE_SEL.PROC", 1)
|
||||
|
||||
def scan(self):
|
||||
self.cycles = self.nb_cycles.get()
|
||||
caputq("SINDI01-DWSC090:SCAN_WIRE", 1)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
88
script/Diagnostics/WireScan.py
Normal file
88
script/Diagnostics/WireScan.py
Normal file
@@ -0,0 +1,88 @@
|
||||
is_panel = get_exec_pars().source != CommandSource.ui #Must be checked before callin "run"
|
||||
run("Devices/Elements")
|
||||
run("Devices/WireScanner")
|
||||
|
||||
if is_panel:
|
||||
prefix = args[0]
|
||||
sel = args[1]
|
||||
start = args[2]
|
||||
end = args[3]
|
||||
cycles = args[4]
|
||||
velocity = args[5]
|
||||
bpm3 = args[6]
|
||||
else:
|
||||
prefix = "SINDI01-DWSC090" #"SARCL02-DWSC270"
|
||||
sel = WireScanner.W1X
|
||||
start = -200
|
||||
end = 200
|
||||
cycles = 5
|
||||
velocity = 200
|
||||
bpm3 = None
|
||||
|
||||
#Creating WireScanner object
|
||||
if prefix not in get_wire_scans():
|
||||
raise Exception("Invalid wire scan: " + prefix)
|
||||
scanner = WireScanner(prefix, sel, start, end, cycles, velocity, True)
|
||||
|
||||
#Stream channels
|
||||
bs_position = scanner.motor_bs_readback.get_name()
|
||||
bpms = get_wire_scans_bpms(prefix)
|
||||
if bpms is None:
|
||||
raise Exception("Cannot determine wire scan bpms: " + prefix)
|
||||
channels = [("w_pos", bs_position)]
|
||||
if bpm3 is not None:
|
||||
bpms.append(bpm3)
|
||||
|
||||
for i in range (len(bpms)):
|
||||
channels.append (("bpm" + str(i+1) + "_x", bpms[i] + ":X1"))
|
||||
channels.append (("bpm" + str(i) + "_y", bpms[i] + ":Y1"))
|
||||
channels.append (("bpm" + str(i) + "_q", bpms[i] + ":Q1"))
|
||||
|
||||
#Stream creation
|
||||
st = Stream("pulse_id", dispatcher)
|
||||
for c in channels:
|
||||
st.addScalar(c[0], c[1], 10, 0)
|
||||
st.initialize()
|
||||
st.start()
|
||||
st.waitCacheChange(10000)
|
||||
scanner.scan()
|
||||
scanner.waitState(State.Busy, 60000)
|
||||
|
||||
#End of scan checking
|
||||
scan_complete=False
|
||||
def check_end_scan(record, scan):
|
||||
global scan_complete
|
||||
if scanner.isReady():
|
||||
print "Abort Scan"
|
||||
scan_complete=True
|
||||
scan.abort()
|
||||
|
||||
#Metadata
|
||||
def write_metadata(path):
|
||||
try:
|
||||
set_attribute(path, "Wire Scan", prefix)
|
||||
set_attribute(path, "Selection", sel)
|
||||
set_attribute(path, "Range", scaner.scan_range)
|
||||
set_attribute(path, "Cycles", scanner.cycles )
|
||||
set_attribute(path, "Velocity", scanner.velocity )
|
||||
except:
|
||||
pass
|
||||
|
||||
#Scan
|
||||
try:
|
||||
mscan (st, st.getReadables() +[scanner.curr_cycl] , -1, scanner.get_total_time() * 2.0, after_read =check_end_scan) # *2.0 to account for accelerations an dother delays
|
||||
except:
|
||||
if not scanner.isReady():
|
||||
print "Aborting Wire Scan"
|
||||
scanner.abort()
|
||||
if not scan_complete:
|
||||
raise
|
||||
finally:
|
||||
write_metadata(get_exec_pars().scanPath)
|
||||
print "Closing scanner"
|
||||
scanner.close()
|
||||
st.close()
|
||||
|
||||
|
||||
|
||||
|
||||
4
script/test/MultipleTestAlignmentScan.py
Normal file
4
script/test/MultipleTestAlignmentScan.py
Normal file
@@ -0,0 +1,4 @@
|
||||
for i in range (100):
|
||||
print "------------------------------------------------------------------------------------"
|
||||
print i
|
||||
run("test/TestAlignmentScan")
|
||||
@@ -1,25 +1,74 @@
|
||||
if get_exec_pars().source == CommandSource.ui:
|
||||
prefix = "SARCL02-DWSC270"
|
||||
sel = WireScan.W1X
|
||||
else:
|
||||
|
||||
is_panel = get_exec_pars().source != CommandSource.ui #Must be checked before callin "run"
|
||||
run("Devices/Elements")
|
||||
run("Devices/WireScanner")
|
||||
|
||||
if is_panel:
|
||||
prefix = args[0]
|
||||
sel = args[1]
|
||||
start = args[2]
|
||||
end = args[3]
|
||||
cycles = args[4]
|
||||
velocity = args[5]
|
||||
bpm3 = args[6]
|
||||
else:
|
||||
prefix = "SINDI01-DWSC090" #"SARCL02-DWSC270"
|
||||
sel = WireScanner.W1X
|
||||
start = -200
|
||||
end = 200
|
||||
cycles = 5
|
||||
velocity = 200
|
||||
bpm3 = None
|
||||
|
||||
run("Devices/Elements")
|
||||
run("Devices/WireScan")
|
||||
#Creating WireScanner object
|
||||
if prefix not in get_wire_scans():
|
||||
raise Exception("Invalid wire scan: " + prefix)
|
||||
scanner = WireScanner(prefix, sel, start, end, cycles, velocity, True)
|
||||
|
||||
print get_wire_scans()
|
||||
#Stream channels
|
||||
bs_position = scanner.motor_bs_readback.get_name()
|
||||
bpms = get_wire_scans_bpms(prefix)
|
||||
if bpms is None:
|
||||
raise Exception("Cannot determine wire scan bpms: " + prefix)
|
||||
channels = [("w_pos", bs_position)]
|
||||
if bpm3 is not None:
|
||||
bpms.append(bpm3)
|
||||
|
||||
for i in range (len(bpms)):
|
||||
channels.append (("bpm" + str(i+1) + "_x", bpms[i] + ":X1"))
|
||||
channels.append (("bpm" + str(i) + "_y", bpms[i] + ":Y1"))
|
||||
channels.append (("bpm" + str(i) + "_q", bpms[i] + ":Q1"))
|
||||
|
||||
wire_scan = WireScan(prefix, sel)
|
||||
#Stream creation
|
||||
st = Stream("pulse_id", dispatcher)
|
||||
for c in channels:
|
||||
st.addScalar(c[0], c[1], 10, 0)
|
||||
st.initialize()
|
||||
st.start()
|
||||
|
||||
scanner.scan()
|
||||
scanner.waitState(State.Busy, 60000)
|
||||
|
||||
print wire_scan.start.read()
|
||||
print wire_scan.end.read()
|
||||
time.sleep(1.0)
|
||||
print wire_scan.current_cycle
|
||||
|
||||
wire_scan.close()
|
||||
#Scan
|
||||
def check_end_scan(record, scan):
|
||||
if scanner.isReady():
|
||||
print "Abort Scan"
|
||||
scan.abort()
|
||||
|
||||
try:
|
||||
#tscan (st.getReadables(), int(scanner.get_total_time() * 2.0 / 0.1), 0.1, after_read =check_end_scan)
|
||||
#bscan (st, int(scanner.get_total_time() * 2.0 / 0.1), after_read =check_end_scan) #Sampling 10 elements
|
||||
mscan (st, st.getReadables() +[scanner.curr_cycl] , -1, scanner.get_total_time() * 2.0, after_read =check_end_scan) # *2.0 to account for accelerations an dother delays
|
||||
|
||||
except:
|
||||
if not scanner.isReady():
|
||||
print "Aborting Wire Scan"
|
||||
scanner.abort()
|
||||
raise
|
||||
finally:
|
||||
print "Closing"
|
||||
scanner.close()
|
||||
st.close()
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user