This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#Thu Jan 24 14:24:44 CET 2019
|
||||
#Tue Feb 05 08:51:03 CET 2019
|
||||
autoSaveScanData=true
|
||||
commandExecutionEvents=false
|
||||
createSessionFiles=true
|
||||
@@ -13,7 +13,7 @@ depthDimension=0
|
||||
hostName=null
|
||||
instanceName=X06SA
|
||||
logDaysToLive=30
|
||||
logLevel=Finer
|
||||
logLevel=Fine
|
||||
logLevelConsole=Off
|
||||
logPath={logs}/{date}_{time}
|
||||
notificationLevel=null
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
#Thu Jan 24 14:40:47 CET 2019
|
||||
#Tue Feb 05 15:50:04 CET 2019
|
||||
barcode_reader_scan_pucks=false
|
||||
dry_mount_counter=0
|
||||
dry_timestamp=1.548326732257E9
|
||||
dry_mount_counter=5
|
||||
dry_timestamp=1.549363107489E9
|
||||
force_dry_mount_count=20
|
||||
force_dry_timeout=0
|
||||
imaging_enabled=false
|
||||
led_level=0.0
|
||||
mounted_sample_position=E53
|
||||
pin_offset=0.0
|
||||
puck_types=true
|
||||
room_temperature_enabled=false
|
||||
|
||||
3
devices/A1.properties
Normal file
3
devices/A1.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:22:35 CET 2019
|
||||
detection=Both
|
||||
disabled=true
|
||||
3
devices/A2.properties
Normal file
3
devices/A2.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/A3.properties
Normal file
3
devices/A3.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/A4.properties
Normal file
3
devices/A4.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/A5.properties
Normal file
3
devices/A5.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/B1.properties
Normal file
3
devices/B1.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/B2.properties
Normal file
3
devices/B2.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:30:50 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/B3.properties
Normal file
3
devices/B3.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/B4.properties
Normal file
3
devices/B4.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/B5.properties
Normal file
3
devices/B5.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/C1.properties
Normal file
3
devices/C1.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/C2.properties
Normal file
3
devices/C2.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/C3.properties
Normal file
3
devices/C3.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/C4.properties
Normal file
3
devices/C4.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/C5.properties
Normal file
3
devices/C5.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/D1.properties
Normal file
3
devices/D1.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/D2.properties
Normal file
3
devices/D2.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/D3.properties
Normal file
3
devices/D3.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/D4.properties
Normal file
3
devices/D4.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/D5.properties
Normal file
3
devices/D5.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/E1.properties
Normal file
3
devices/E1.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/E2.properties
Normal file
3
devices/E2.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/E3.properties
Normal file
3
devices/E3.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/E4.properties
Normal file
3
devices/E4.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:52:26 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/E5.properties
Normal file
3
devices/E5.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/F1.properties
Normal file
3
devices/F1.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/F2.properties
Normal file
3
devices/F2.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/F3.properties
Normal file
3
devices/F3.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/F4.properties
Normal file
3
devices/F4.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
3
devices/F5.properties
Normal file
3
devices/F5.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
#Tue Feb 05 15:17:58 CET 2019
|
||||
detection=Both
|
||||
disabled=false
|
||||
@@ -1,8 +1,8 @@
|
||||
#Fri Jan 18 11:16:24 CET 2019
|
||||
holdingCurrent=40.0
|
||||
#Tue Feb 05 11:22:07 CET 2019
|
||||
holdingCurrent=50.0
|
||||
mountCurrent=20.0
|
||||
remanenceCurrent=-10.0
|
||||
restingCurrent=20.0
|
||||
restingCurrent=30.0
|
||||
reverseCurrent=-10.0
|
||||
reverseTime=0.4
|
||||
unmountCurrent=20.0
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#Tue Jun 19 16:41:20 CEST 2018
|
||||
maxValue=50.0
|
||||
#Wed Jan 30 11:33:15 CET 2019
|
||||
maxValue=70.0
|
||||
minValue=-50.0
|
||||
offset=0.0
|
||||
precision=2
|
||||
|
||||
Binary file not shown.
@@ -116,12 +116,19 @@
|
||||
<Component id="jScrollPane1" pref="0" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="buttonConfigure" min="-2" 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">
|
||||
<Component id="jScrollPane1" pref="274" max="32767" attributes="0"/>
|
||||
<Component id="jScrollPane1" pref="282" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="buttonConfigure" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
@@ -173,6 +180,14 @@
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JButton" name="buttonConfigure">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Configure"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonConfigureActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="ch.psi.pshell.swing.DeviceStatePanel" name="deviceStatePanel1">
|
||||
|
||||
@@ -78,6 +78,7 @@ public class PuckDetectionPanel extends DevicePanel {
|
||||
jPanel1 = new javax.swing.JPanel();
|
||||
jScrollPane1 = new javax.swing.JScrollPane();
|
||||
table = new javax.swing.JTable();
|
||||
buttonConfigure = new javax.swing.JButton();
|
||||
deviceStatePanel1 = new ch.psi.pshell.swing.DeviceStatePanel();
|
||||
|
||||
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Raspberry Pi "));
|
||||
@@ -186,6 +187,13 @@ public class PuckDetectionPanel extends DevicePanel {
|
||||
});
|
||||
jScrollPane1.setViewportView(table);
|
||||
|
||||
buttonConfigure.setText("Configure");
|
||||
buttonConfigure.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonConfigureActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
||||
jPanel1.setLayout(jPanel1Layout);
|
||||
jPanel1Layout.setHorizontalGroup(
|
||||
@@ -194,11 +202,17 @@ public class PuckDetectionPanel extends DevicePanel {
|
||||
.addContainerGap()
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonConfigure)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
jPanel1Layout.setVerticalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 274, Short.MAX_VALUE)
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 282, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(buttonConfigure)
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
@@ -236,9 +250,24 @@ public class PuckDetectionPanel extends DevicePanel {
|
||||
execute("start_puck_detection()", false);
|
||||
}//GEN-LAST:event_buttonPuckDetStartActionPerformed
|
||||
|
||||
private void buttonConfigureActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonConfigureActionPerformed
|
||||
try {
|
||||
if (table.getSelectedRow()<0){
|
||||
throw new Exception("Select a puck");
|
||||
}
|
||||
String name = table.getModel().getValueAt(table.getSelectedRow(), 0).toString();
|
||||
Puck puck = getDevice().getPuck(name);
|
||||
DevicePanel.showConfigEditor(this, puck, true, false);
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
|
||||
}//GEN-LAST:event_buttonConfigureActionPerformed
|
||||
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton buttonConfigure;
|
||||
private javax.swing.JButton buttonPuckDetCheck;
|
||||
private javax.swing.JButton buttonPuckDetStart;
|
||||
private javax.swing.JButton buttonPuckDetStop;
|
||||
|
||||
@@ -18,10 +18,9 @@
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jPanel1" max="32767" attributes="0"/>
|
||||
<Component id="panelState" alignment="0" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="panelCurrent" max="32767" attributes="0"/>
|
||||
<Component id="jPanel2" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="panelCurrent" max="32767" attributes="0"/>
|
||||
<Component id="jPanel2" max="32767" attributes="0"/>
|
||||
<Component id="jPanel3" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
@@ -33,6 +32,8 @@
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="jPanel3" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="panelState" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
@@ -171,7 +172,7 @@
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
||||
<TitledBorder title="Gonio"/>
|
||||
<TitledBorder title="Supress"/>
|
||||
</Border>
|
||||
</Property>
|
||||
</Properties>
|
||||
@@ -183,7 +184,11 @@
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="ledMountPosition" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="ledSupressed" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="buttonSupressOn" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="buttonSupressOff" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
@@ -194,7 +199,9 @@
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="2" attributes="0">
|
||||
<Component id="jLabel2" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="ledMountPosition" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="ledSupressed" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonSupressOn" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonSupressOff" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@@ -205,16 +212,72 @@
|
||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Mount Position:"/>
|
||||
<Property name="text" type="java.lang.String" value="Supressed:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="ch.psi.pshell.swing.Led" name="ledMountPosition">
|
||||
<Component class="ch.psi.pshell.swing.Led" name="ledSupressed">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="SansSerif" size="18" style="0"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonSupressOn">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="On"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonSupressOnActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonSupressOff">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Off"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonSupressOffActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="jPanel3">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
||||
<TitledBorder title="Configuration"/>
|
||||
</Border>
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="buttonConfiguration" min="-2" 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="1" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="buttonConfiguration" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JButton" name="buttonConfiguration">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Configuration"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonConfigurationActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
|
||||
@@ -5,8 +5,12 @@ import ch.psi.pshell.swing.DevicePanel;
|
||||
import ch.psi.pshell.core.Context;
|
||||
import ch.psi.utils.State;
|
||||
import java.awt.Color;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.script.ScriptException;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -30,38 +34,37 @@ public class SmartMagnetPanel extends DevicePanel {
|
||||
this.startTimer(1000, 100);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onTimer(){
|
||||
Color color = Color.RED;
|
||||
try{
|
||||
if (Context.getInstance().evalLineBackground("in_mount_position").equals(Boolean.TRUE)){
|
||||
color = Color.GREEN;
|
||||
}
|
||||
} catch (Exception ex){
|
||||
}
|
||||
ledMountPosition.setColor(color);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDeviceStateChanged(State state, State former) {
|
||||
switch(state){
|
||||
case Paused:
|
||||
ledSupressed.setColor(Color.ORANGE);
|
||||
ledStatus.setColor(Color.GREEN);
|
||||
ledMounted.setColor(Color.RED);
|
||||
break;
|
||||
case Ready:
|
||||
ledSupressed.setColor(Color.BLACK);
|
||||
ledStatus.setColor(Color.GREEN);
|
||||
ledMounted.setColor(Color.GREEN);
|
||||
break;
|
||||
case Busy:
|
||||
ledSupressed.setColor(Color.BLACK);
|
||||
ledStatus.setColor(Color.GREEN);
|
||||
ledMounted.setColor(Color.ORANGE);
|
||||
break;
|
||||
case Fault:
|
||||
ledSupressed.setColor(Color.RED);
|
||||
ledStatus.setColor(Color.RED);
|
||||
ledMounted.setColor(Color.RED);
|
||||
break;
|
||||
default:
|
||||
ledSupressed.setColor(Color.BLACK);
|
||||
ledStatus.setColor(Color.BLACK);
|
||||
ledMounted.setColor(Color.BLACK);
|
||||
break;
|
||||
}
|
||||
buttonSupressOn.setEnabled((state==State.Ready) || (state == State.Busy));
|
||||
buttonSupressOff.setEnabled(state == State.Paused);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -89,7 +92,11 @@ public class SmartMagnetPanel extends DevicePanel {
|
||||
panelCurrent = new ch.psi.pshell.swing.ProcessVariablePanel();
|
||||
jPanel2 = new javax.swing.JPanel();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
ledMountPosition = new ch.psi.pshell.swing.Led();
|
||||
ledSupressed = new ch.psi.pshell.swing.Led();
|
||||
buttonSupressOn = new javax.swing.JButton();
|
||||
buttonSupressOff = new javax.swing.JButton();
|
||||
jPanel3 = new javax.swing.JPanel();
|
||||
buttonConfiguration = new javax.swing.JButton();
|
||||
|
||||
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Status"));
|
||||
|
||||
@@ -164,12 +171,26 @@ public class SmartMagnetPanel extends DevicePanel {
|
||||
panelCurrent.setBorder(javax.swing.BorderFactory.createTitledBorder("Current"));
|
||||
panelCurrent.setDeviceName("smc_current");
|
||||
|
||||
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Gonio"));
|
||||
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Supress"));
|
||||
|
||||
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel2.setText("Mount Position:");
|
||||
jLabel2.setText("Supressed:");
|
||||
|
||||
ledMountPosition.setFont(new java.awt.Font("SansSerif", 0, 18)); // NOI18N
|
||||
ledSupressed.setFont(new java.awt.Font("SansSerif", 0, 18)); // NOI18N
|
||||
|
||||
buttonSupressOn.setText("On");
|
||||
buttonSupressOn.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonSupressOnActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonSupressOff.setText("Off");
|
||||
buttonSupressOff.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonSupressOffActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
|
||||
jPanel2.setLayout(jPanel2Layout);
|
||||
@@ -179,16 +200,51 @@ public class SmartMagnetPanel extends DevicePanel {
|
||||
.addContainerGap()
|
||||
.addComponent(jLabel2)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(ledMountPosition, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(ledSupressed, 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)
|
||||
.addComponent(buttonSupressOn)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(buttonSupressOff)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jPanel2Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonSupressOff, buttonSupressOn});
|
||||
|
||||
jPanel2Layout.setVerticalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
||||
.addComponent(jLabel2)
|
||||
.addComponent(ledMountPosition, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(ledSupressed, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(buttonSupressOn)
|
||||
.addComponent(buttonSupressOff))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Configuration"));
|
||||
|
||||
buttonConfiguration.setText("Configuration");
|
||||
buttonConfiguration.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonConfigurationActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
|
||||
jPanel3.setLayout(jPanel3Layout);
|
||||
jPanel3Layout.setHorizontalGroup(
|
||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonConfiguration)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
jPanel3Layout.setVerticalGroup(
|
||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(buttonConfiguration)
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
@@ -198,9 +254,9 @@ public class SmartMagnetPanel extends DevicePanel {
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(panelState, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(panelCurrent, 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))
|
||||
.addComponent(panelCurrent, 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)
|
||||
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
@@ -211,21 +267,51 @@ public class SmartMagnetPanel extends DevicePanel {
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(panelState, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void buttonSupressOnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSupressOnActionPerformed
|
||||
try {
|
||||
Context.getInstance().evalLineBackground("smart_magnet.set_supress(True)");
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(SmartMagnetPanel.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}//GEN-LAST:event_buttonSupressOnActionPerformed
|
||||
|
||||
private void buttonSupressOffActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSupressOffActionPerformed
|
||||
try {
|
||||
Context.getInstance().evalLineBackground("smart_magnet.set_supress(False)");
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(SmartMagnetPanel.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}//GEN-LAST:event_buttonSupressOffActionPerformed
|
||||
|
||||
private void buttonConfigurationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonConfigurationActionPerformed
|
||||
try {
|
||||
this.showConfigEditor(true, false);
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(SmartMagnetPanel.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}//GEN-LAST:event_buttonConfigurationActionPerformed
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton buttonConfiguration;
|
||||
private javax.swing.JButton buttonSupressOff;
|
||||
private javax.swing.JButton buttonSupressOn;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel10;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JLabel jLabel5;
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JPanel jPanel2;
|
||||
private ch.psi.pshell.swing.Led ledMountPosition;
|
||||
private javax.swing.JPanel jPanel3;
|
||||
private ch.psi.pshell.swing.Led ledMounted;
|
||||
private ch.psi.pshell.swing.Led ledStatus;
|
||||
private ch.psi.pshell.swing.Led ledSupressed;
|
||||
private ch.psi.pshell.swing.ProcessVariablePanel panelCurrent;
|
||||
private ch.psi.pshell.swing.DeviceValuePanel panelCurrentRb;
|
||||
private javax.swing.JPanel panelPowerCtr;
|
||||
|
||||
@@ -117,7 +117,7 @@ class Hexiposi(DiscretePositionerBase):
|
||||
self.update()
|
||||
|
||||
def is_in_position(self, pos):
|
||||
return take() == pos
|
||||
return self.take() == pos
|
||||
|
||||
|
||||
def assert_in_position(self, pos):
|
||||
@@ -128,6 +128,10 @@ class Hexiposi(DiscretePositionerBase):
|
||||
if self.homed == False:
|
||||
raise Exception ("Hexiposi is not homed")
|
||||
|
||||
def assert_in_known_position(self):
|
||||
self.get_status()
|
||||
if self.rback == 'Unknown':
|
||||
raise Exception("Hexiposi is in an unknown position, please home.")
|
||||
|
||||
#def isReady(self):
|
||||
# self.get_status()
|
||||
|
||||
@@ -31,8 +31,9 @@ class SmartMagnet(DeviceBase):
|
||||
return smc_magnet_status.read()
|
||||
|
||||
def assert_status(self):
|
||||
if self.get_status() == False:
|
||||
raise Exception("Smart Magnet is in faulty status.")
|
||||
pass
|
||||
#if self.get_status() == False:
|
||||
# raise Exception("Smart Magnet is in faulty status.")
|
||||
|
||||
def is_mounted(self):
|
||||
self.assert_status()
|
||||
@@ -72,7 +73,9 @@ class SmartMagnet(DeviceBase):
|
||||
|
||||
def doUpdate(self):
|
||||
try:
|
||||
if self.is_mounted():
|
||||
if self.get_supress():
|
||||
self.setState(State.Paused)
|
||||
elif self.is_mounted():
|
||||
self.setState(State.Busy)
|
||||
else:
|
||||
self.setState(State.Ready)
|
||||
@@ -104,15 +107,18 @@ class SmartMagnet(DeviceBase):
|
||||
return self.get_current() == self.config.getFieldValue("restingCurrent")
|
||||
|
||||
|
||||
#Setting resting current to better detect sample
|
||||
def enforce_sample_detection(self):
|
||||
def apply_reverse(self):
|
||||
reverse_wait = float(self.config.getFieldValue("reverseTime"))
|
||||
if reverse_wait >0:
|
||||
self.set_reverse_current()
|
||||
time.sleep(reverse_wait)
|
||||
|
||||
#Setting resting current to better detect sample
|
||||
def apply_resting(self):
|
||||
if not self.is_resting_current():
|
||||
self.set_resting_current()
|
||||
time.sleep(0.2)
|
||||
|
||||
|
||||
|
||||
|
||||
add_device(SmartMagnet("smart_magnet"), force = True)
|
||||
|
||||
@@ -149,6 +149,8 @@ def system_check(robot_move=True):
|
||||
raise Exception("Air pressure is not ok")
|
||||
if not n2_pressure_ok.read():
|
||||
raise Exception("N2 pressure is not ok")
|
||||
hexiposi.assert_in_known_position()
|
||||
|
||||
if robot_move:
|
||||
if not feedback_local_safety.read():
|
||||
raise Exception("Local safety not released")
|
||||
@@ -165,9 +167,15 @@ def system_check_msg():
|
||||
return "Ok"
|
||||
except:
|
||||
return sys.exc_info()[1]
|
||||
|
||||
|
||||
def get_puck_dev(segment, puck):
|
||||
if type(segment) is int:
|
||||
segment = chr( ord('A') + (segment-1))
|
||||
|
||||
return Controller.getInstance().getPuck(str(segment).upper() + str(puck))
|
||||
|
||||
def get_puck_elect_detection(segment, puck):
|
||||
return str(Controller.getInstance().getPuck(str(segment).upper() + str(puck)).detection)
|
||||
return str(get_puck_dev(segment, puck).detection)
|
||||
|
||||
def get_puck_img_detection(segment, puck):
|
||||
return str(Controller.getInstance().getPuck(str(segment).upper() + str(puck)).imageDetection)
|
||||
@@ -198,6 +206,18 @@ def get_detected_pucks():
|
||||
ret.append(str(p.getName()))
|
||||
return ret
|
||||
|
||||
def get_pucks_info():
|
||||
ret = []
|
||||
for i in range(30):
|
||||
p = BasePlate.getPucks()[i]
|
||||
name = p.getName()
|
||||
det = str(p.getDetection())
|
||||
barcode = "" if p.getId() is None else p.getId()
|
||||
|
||||
ret.append({"puckAddress": name, "puckState": det, "puckBarcode":barcode})
|
||||
return json.dumps(ret)
|
||||
|
||||
|
||||
###################################################################################################
|
||||
# Device initialization
|
||||
###################################################################################################
|
||||
@@ -253,6 +273,12 @@ if is_imaging_enabled():
|
||||
except:
|
||||
print >> sys.stderr, traceback.format_exc()
|
||||
|
||||
#TODO: The Smart Magnet keeps moving sample if detecting is enabled
|
||||
# Detection keeps disabled unless during moount/unmount
|
||||
try:
|
||||
smart_magnet.set_supress(True)
|
||||
except:
|
||||
print >> sys.stderr, traceback.format_exc()
|
||||
|
||||
#gripper_cam.paused = True
|
||||
###################################################################################################
|
||||
|
||||
@@ -12,5 +12,7 @@ def homing_hexiposi():
|
||||
|
||||
set_status("Homing hexiposi")
|
||||
hexiposi.move_home()
|
||||
hexiposi.waitState(State.Ready,-1)
|
||||
hexiposi.waitState(State.Ready,-1)
|
||||
hexiposi.move_pos(1)
|
||||
|
||||
|
||||
@@ -7,13 +7,13 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False)
|
||||
global mount_sample_id, mount_sample_detected
|
||||
print "mount: ", segment, puck, sample, force
|
||||
|
||||
start = time.time()
|
||||
|
||||
start = time.time()
|
||||
#time.sleep(2)
|
||||
is_aux = (segment == AUX_SEGMENT)
|
||||
|
||||
#ZACH
|
||||
#needs_chilling = not is_aux and (not robot.is_cold())
|
||||
#needs_drying = is_aux and robot.is_cold()
|
||||
needs_chilling = not is_aux and (not robot.is_cold())
|
||||
needs_drying = is_aux and robot.is_cold()
|
||||
|
||||
puck_address = get_puck_address(puck)
|
||||
if puck_address is None:
|
||||
@@ -47,17 +47,21 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False)
|
||||
|
||||
try:
|
||||
#ZACH
|
||||
#if needs_chilling:
|
||||
# robot.move_cold()
|
||||
# time.sleep(30.0)
|
||||
if needs_chilling:
|
||||
robot.move_cold()
|
||||
time.sleep(30.0)
|
||||
|
||||
smart_magnet.enforce_sample_detection()
|
||||
if smart_magnet.get_supress() == True:
|
||||
smart_magnet.set_supress(False)
|
||||
time.sleep(0.2)
|
||||
#To better dectect sample
|
||||
smart_magnet.apply_resting()
|
||||
if smart_magnet.check_mounted(idle_time=0.25, timeout = 1.0) == True:
|
||||
if auto_unmount and (get_setting("mounted_sample_position") is not None):
|
||||
unmount(force = True)
|
||||
#auto_unmount set to true so detection remains enabled
|
||||
unmount(force = True, auto_unmount = True)
|
||||
else:
|
||||
raise Exception("Pin detected on gonio")
|
||||
|
||||
raise Exception("Pin detected on gonio")
|
||||
set_status("Mounting: " + str(segment) + str(puck) + str(sample))
|
||||
#location = robot.get_current_point()
|
||||
|
||||
@@ -65,8 +69,9 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False)
|
||||
enable_motion()
|
||||
|
||||
#ZACH
|
||||
#if needs_drying:
|
||||
# dry(wait_cold=-1)
|
||||
# a room temp pin is being mounted but the gripper is cold
|
||||
if needs_drying:
|
||||
dry(wait_cold=-1) # move to park after dry
|
||||
|
||||
if is_aux:
|
||||
if not robot.is_aux():
|
||||
@@ -85,9 +90,7 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False)
|
||||
|
||||
robot.get_dewar(segment, puck, sample)
|
||||
|
||||
|
||||
set_setting("mounted_sample_position", get_sample_name(segment, puck, sample))
|
||||
|
||||
|
||||
if read_dm:
|
||||
barcode_reader.start_read(10.0)
|
||||
robot.move_scanner()
|
||||
@@ -100,12 +103,11 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False)
|
||||
print "Datamatrix: " , mount_sample_id
|
||||
else:
|
||||
mount_sample_id = None
|
||||
|
||||
smart_magnet.set_mount_current()
|
||||
|
||||
|
||||
robot.put_gonio()
|
||||
|
||||
|
||||
|
||||
try:
|
||||
dry_mount_count = int(get_setting("dry_mount_counter"))
|
||||
except:
|
||||
@@ -117,18 +119,21 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False)
|
||||
else:
|
||||
robot.move_cold()
|
||||
|
||||
mount_sample_detected = smart_magnet.check_mounted(idle_time=0.25, timeout = 1.0)
|
||||
#TODO: Should do on finally?
|
||||
update_samples_info_sample_mount(get_puck_name(segment, puck), sample, mount_sample_detected, mount_sample_id)
|
||||
if mount_sample_detected == False:
|
||||
raise Exception("No pin detected on gonio")
|
||||
mount_sample_detected = smart_magnet.check_mounted(idle_time=0.25, timeout = 1.0)
|
||||
update_samples_info_sample_mount(get_puck_name(segment, puck), sample, mount_sample_detected, mount_sample_id)
|
||||
if mount_sample_detected == False:
|
||||
raise Exception("No pin detected on gonio")
|
||||
|
||||
|
||||
if is_force_dry():
|
||||
smart_magnet.set_default_current()
|
||||
print "Auto dry"
|
||||
log("Starting auto dry", False)
|
||||
dry()
|
||||
if is_force_dry():
|
||||
smart_magnet.set_default_current()
|
||||
print "Auto dry"
|
||||
log("Starting auto dry", False)
|
||||
set_exec_pars(then = "dry()")
|
||||
|
||||
set_setting("mounted_sample_position", get_sample_name(segment, puck, sample))
|
||||
return [mount_sample_detected, mount_sample_id]
|
||||
finally:
|
||||
smart_magnet.set_default_current()
|
||||
smart_magnet.set_supress(True)
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ def get_dist_to_segment(segment):
|
||||
l = Line3D(v1, v2, 0.01)
|
||||
d = l.distance(v)
|
||||
|
||||
pj = get_pojection_at_line(segment)
|
||||
pj = get_projection_at_line(segment)
|
||||
|
||||
d1, d2 = v1.distance(v), v2.distance(v)
|
||||
dp1, dp2 = v1.distance(pj), v2.distance(pj)
|
||||
@@ -61,7 +61,7 @@ def is_on_segment(segment):
|
||||
#print "Current robot position " + str(p) + " on segment " + str(segment) + " - distance=" + str(d)
|
||||
return True
|
||||
|
||||
def get_pojection_at_line(segment):
|
||||
def get_projection_at_line(segment):
|
||||
tolerance = segment[2]
|
||||
p1, p2 = robot.get_pnt(segment[0]), robot.get_pnt(segment[1])
|
||||
p = get_robot_position()
|
||||
@@ -91,7 +91,7 @@ def move_to_segment(segment):
|
||||
tolerance = segment[2]
|
||||
p = get_robot_position()
|
||||
v = Vector3D(p[0], p[1], p[2])
|
||||
lv = get_pojection_at_line(segment)
|
||||
lv = get_projection_at_line(segment)
|
||||
dlv = lv.distance(v)
|
||||
if dlv> (tolerance + 0.1):
|
||||
raise Exception( "Error moving from " + str(p) + " to segment - distance=" + str(dlv))
|
||||
|
||||
@@ -140,6 +140,8 @@ def assert_valid_address(segment, puck, sample):
|
||||
raise Exception ("Invalid puck")
|
||||
if sample<=0 or sample >16:
|
||||
raise Exception ("Invalid sample")
|
||||
if get_puck_dev(segment, puck).isDisabled():
|
||||
raise Exception ("Puck is disabled")
|
||||
|
||||
def assert_valid_sample(sample):
|
||||
if sample<=0 or sample >16:
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
def unmount(segment = None, puck = None, sample = None, force=False):
|
||||
def unmount(segment = None, puck = None, sample = None, force=False, auto_unmount = False):
|
||||
"""
|
||||
"""
|
||||
print "unmount: ", segment, puck, sample, force
|
||||
print "unmount: ", segment, puck, sample, force
|
||||
|
||||
#ZACH
|
||||
is_aux = (segment == AUX_SEGMENT)
|
||||
needs_chilling = not is_aux and (not robot.is_cold())
|
||||
needs_drying = is_aux and robot.is_cold()
|
||||
|
||||
if (segment is None) or (puck is None) or (sample is None):
|
||||
pos = get_setting("mounted_sample_position")
|
||||
@@ -9,10 +14,11 @@ def unmount(segment = None, puck = None, sample = None, force=False):
|
||||
raise Exception("Mounted sample position is not defined")
|
||||
segment, puck , sample = pos[0:1], int(pos[1]), int(pos[2:])
|
||||
print "Mounted sample position: ", segment, puck , sample
|
||||
is_aux = (segment == AUX_SEGMENT)
|
||||
|
||||
#Initial checks
|
||||
print "assert valid address"
|
||||
assert_valid_address(segment, puck, sample)
|
||||
print "asser puck detected"
|
||||
assert_puck_detected(segment, puck)
|
||||
|
||||
if robot.simulated:
|
||||
@@ -20,23 +26,33 @@ def unmount(segment = None, puck = None, sample = None, force=False):
|
||||
update_samples_info_sample_unmount(get_puck_name(segment, puck), sample)
|
||||
set_setting("mounted_sample_position", None)
|
||||
return
|
||||
|
||||
|
||||
print "assert no task"
|
||||
robot.assert_no_task()
|
||||
print "reset motion"
|
||||
robot.reset_motion()
|
||||
print "wait ready"
|
||||
robot.wait_ready()
|
||||
print "assert cleared"
|
||||
robot.assert_cleared()
|
||||
#robot.assert_in_known_point()
|
||||
print "assert homed"
|
||||
hexiposi.assert_homed()
|
||||
print "assert mount pos"
|
||||
assert_mount_position()
|
||||
|
||||
set_status("Umounting: " + str(segment) + str(puck) + str(sample))
|
||||
|
||||
try:
|
||||
if not force:
|
||||
smart_magnet.enforce_sample_detection()
|
||||
if smart_magnet.check_mounted(idle_time=0.5, timeout = 3.0) == False:
|
||||
raise Exception("No pin detected on gonio")
|
||||
if smart_magnet.get_supress() == True:
|
||||
smart_magnet.set_supress(False)
|
||||
time.sleep(0.2)
|
||||
|
||||
smart_magnet.apply_resting()
|
||||
|
||||
if not force:
|
||||
if smart_magnet.check_mounted(idle_time=0.5, timeout = 3.0) == False:
|
||||
raise Exception("No pin detected on gonio")
|
||||
|
||||
#Enabling
|
||||
enable_motion()
|
||||
@@ -46,16 +62,24 @@ def unmount(segment = None, puck = None, sample = None, force=False):
|
||||
|
||||
if not force:
|
||||
visual_check_hexiposi(segment)
|
||||
|
||||
if needs_chilling:
|
||||
robot.move_cold()
|
||||
time.sleep(30.)
|
||||
else:
|
||||
if needs_drying:
|
||||
dry(wait_cold=-1)
|
||||
#location = robot.get_current_point()
|
||||
|
||||
if not robot.is_gonio():
|
||||
robot.move_gonio()
|
||||
|
||||
smart_magnet.set_unmount_current()
|
||||
|
||||
#smart_magnet.set_unmount_current()
|
||||
|
||||
robot.get_gonio()
|
||||
|
||||
#smart_magnet.apply_reverse()
|
||||
#smart_magnet.apply_resting()
|
||||
|
||||
if is_aux:
|
||||
robot.move_aux()
|
||||
robot.put_aux( sample)
|
||||
@@ -66,5 +90,6 @@ def unmount(segment = None, puck = None, sample = None, force=False):
|
||||
robot.put_dewar(segment, puck, sample)
|
||||
set_setting("mounted_sample_position", None)
|
||||
finally:
|
||||
smart_magnet.set_default_current()
|
||||
|
||||
if not auto_unmount:
|
||||
smart_magnet.set_default_current()
|
||||
smart_magnet.set_supress(True)
|
||||
|
||||
3
script/test/then.py
Normal file
3
script/test/then.py
Normal file
@@ -0,0 +1,3 @@
|
||||
time.sleep(3.0)
|
||||
|
||||
set_exec_pars(then = "time.sleep(5.0)")
|
||||
Reference in New Issue
Block a user