This commit is contained in:
gac-S_Changer
2018-09-20 18:07:54 +02:00
parent e82c487e33
commit 7deba9eee4
16 changed files with 3895 additions and 95 deletions

View File

@@ -1,4 +1,4 @@
#Tue Sep 11 11:02:40 CEST 2018
#Thu Sep 20 09:25:00 CEST 2018
maxValue=1.0
minValue=0.0
offset=0.0

View File

@@ -1,4 +1,4 @@
#Tue Sep 11 11:02:40 CEST 2018
#Thu Sep 20 09:25:00 CEST 2018
maxValue=1.0
minValue=0.0
offset=0.0

View File

@@ -1,4 +1,4 @@
#Tue Sep 11 11:02:40 CEST 2018
#Thu Sep 20 09:25:00 CEST 2018
maxValue=1.0
minValue=0.0
offset=0.0

View File

@@ -16,7 +16,10 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="panelCommands" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="panelCommands" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
@@ -38,40 +41,36 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="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">
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Component id="buttonRecover" max="32767" attributes="0"/>
<Component id="buttonMoveHeater" linkSize="7" alignment="1" max="32767" attributes="0"/>
<Component id="buttonMovePark" linkSize="7" alignment="1" max="32767" attributes="0"/>
<Component id="buttonGetGonio" linkSize="7" alignment="1" max="32767" attributes="0"/>
<Component id="buttonPutGonio" linkSize="7" alignment="1" max="32767" attributes="0"/>
<Component id="buttonMount" linkSize="7" alignment="1" max="32767" attributes="0"/>
<Component id="buttonUnmount" linkSize="7" alignment="1" max="32767" attributes="0"/>
<Component id="buttonGetDewar" linkSize="7" alignment="1" max="32767" attributes="0"/>
<Component id="buttonPutDewar" linkSize="7" alignment="1" max="32767" attributes="0"/>
<Component id="buttonDry" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Component id="buttonMoveCold" alignment="0" max="32767" attributes="0"/>
<Component id="buttonMoveHeater" linkSize="7" alignment="0" pref="140" max="32767" attributes="0"/>
<Component id="buttonClearSampleDb" linkSize="7" alignment="0" min="-2" pref="140" max="-2" attributes="0"/>
<Component id="buttonGetDewar" linkSize="7" alignment="0" pref="140" max="32767" attributes="0"/>
<Component id="buttonDry" linkSize="7" alignment="0" min="-2" pref="140" max="-2" attributes="0"/>
<Component id="buttonPutDewar" linkSize="7" alignment="0" pref="140" max="32767" attributes="0"/>
<Component id="buttonGetGonio" linkSize="7" alignment="0" pref="140" max="32767" attributes="0"/>
<Component id="buttonPutGonio" linkSize="7" alignment="0" pref="140" max="32767" attributes="0"/>
<Component id="buttonMovePark" linkSize="7" alignment="0" pref="140" max="32767" attributes="0"/>
<Component id="buttonRecover" linkSize="7" alignment="0" min="-2" pref="140" max="-2" attributes="0"/>
<Component id="buttonMoveCold" linkSize="7" alignment="0" min="-2" pref="140" max="-2" attributes="0"/>
<Component id="buttonMount" linkSize="7" alignment="0" pref="140" max="32767" attributes="0"/>
<Component id="buttonUnmount" linkSize="7" alignment="0" pref="140" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace type="separate" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" alignment="1" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="buttonMoveScanner" linkSize="7" max="32767" attributes="0"/>
<Component id="buttonMoveHome" linkSize="7" max="32767" attributes="0"/>
<Component id="buttonMoveDewar" linkSize="7" max="32767" attributes="0"/>
<Component id="buttonHomingHexiposi" linkSize="7" max="32767" attributes="0"/>
<Component id="buttonMoveScanner" linkSize="7" pref="140" max="32767" attributes="0"/>
<Component id="buttonMoveHome" linkSize="7" pref="140" max="32767" attributes="0"/>
<Component id="buttonMoveDewar" linkSize="7" pref="140" max="32767" attributes="0"/>
<Component id="buttonHomingHexiposi" linkSize="7" pref="140" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
</Group>
<Component id="jPanel5" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="buttonEnableAll" alignment="1" min="-2" pref="112" max="-2" attributes="0"/>
<Component id="buttonEnableAll" linkSize="7" alignment="1" min="-2" pref="140" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
@@ -84,7 +83,8 @@
</Group>
</Group>
</Group>
<Component id="buttonMoveGonio" linkSize="7" alignment="1" max="32767" attributes="0"/>
<Component id="buttonMoveGonio" linkSize="7" alignment="1" pref="140" max="32767" attributes="0"/>
<Component id="buttonResetPuckIds" linkSize="7" alignment="1" min="-2" pref="140" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@@ -133,7 +133,7 @@
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="buttonDry" min="-2" max="-2" attributes="0"/>
<Component id="spinnerDryTime" min="-2" max="-2" attributes="0"/>
@@ -143,13 +143,18 @@
<Component id="spinnerDrySpeed" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel7" 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="buttonRecover" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonEnableAll" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="buttonClearSampleDb" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonResetPuckIds" 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="buttonRecover" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonEnableAll" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
@@ -457,6 +462,22 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonMoveColdActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonClearSampleDb">
<Properties>
<Property name="text" type="java.lang.String" value="Clear Sample Db"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonClearSampleDbActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonResetPuckIds">
<Properties>
<Property name="text" type="java.lang.String" value="Reset Puck IDs"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonResetPuckIdsActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>

View File

@@ -146,6 +146,8 @@ public class Commands extends Panel {
buttonRecover = new javax.swing.JButton();
buttonEnableAll = new javax.swing.JButton();
buttonMoveCold = new javax.swing.JButton();
buttonClearSampleDb = new javax.swing.JButton();
buttonResetPuckIds = new javax.swing.JButton();
panelCommands.setBorder(javax.swing.BorderFactory.createTitledBorder("Commands"));
@@ -346,6 +348,20 @@ public class Commands extends Panel {
}
});
buttonClearSampleDb.setText("Clear Sample Db");
buttonClearSampleDb.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonClearSampleDbActionPerformed(evt);
}
});
buttonResetPuckIds.setText("Reset Puck IDs");
buttonResetPuckIds.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonResetPuckIdsActionPerformed(evt);
}
});
javax.swing.GroupLayout panelCommandsLayout = new javax.swing.GroupLayout(panelCommands);
panelCommands.setLayout(panelCommandsLayout);
panelCommandsLayout.setHorizontalGroup(
@@ -353,32 +369,30 @@ public class Commands extends Panel {
.addGroup(panelCommandsLayout.createSequentialGroup()
.addContainerGap()
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panelCommandsLayout.createSequentialGroup()
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(buttonRecover, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonMoveHeater, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonMovePark, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonGetGonio, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonPutGonio, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonMount, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonUnmount, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonGetDewar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonPutDewar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonDry, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(buttonMoveCold, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonMoveHeater, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
.addComponent(buttonClearSampleDb, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(buttonGetDewar, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
.addComponent(buttonDry, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(buttonPutDewar, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
.addComponent(buttonGetGonio, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
.addComponent(buttonPutGonio, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
.addComponent(buttonMovePark, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
.addComponent(buttonRecover, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(buttonMoveCold, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(buttonMount, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
.addComponent(buttonUnmount, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE))
.addGap(18, 18, Short.MAX_VALUE)
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelCommandsLayout.createSequentialGroup()
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(buttonMoveScanner, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonMoveHome, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonMoveDewar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonHomingHexiposi, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(buttonMoveScanner, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
.addComponent(buttonMoveHome, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
.addComponent(buttonMoveDewar, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
.addComponent(buttonHomingHexiposi, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE))
.addGap(1, 1, 1))
.addComponent(jPanel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(buttonEnableAll, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(buttonEnableAll, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(panelCommandsLayout.createSequentialGroup()
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel6)
@@ -387,11 +401,12 @@ public class Commands extends Panel {
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(spinnerDrySpeed, javax.swing.GroupLayout.DEFAULT_SIZE, 92, Short.MAX_VALUE)
.addComponent(spinnerDryTime))))
.addComponent(buttonMoveGonio, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(buttonMoveGonio, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
.addComponent(buttonResetPuckIds, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
panelCommandsLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonGetDewar, buttonGetGonio, buttonHomingHexiposi, buttonMount, buttonMoveDewar, buttonMoveGonio, buttonMoveHeater, buttonMoveHome, buttonMovePark, buttonMoveScanner, buttonPutDewar, buttonPutGonio, buttonUnmount});
panelCommandsLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonClearSampleDb, buttonDry, buttonEnableAll, buttonGetDewar, buttonGetGonio, buttonHomingHexiposi, buttonMount, buttonMoveCold, buttonMoveDewar, buttonMoveGonio, buttonMoveHeater, buttonMoveHome, buttonMovePark, buttonMoveScanner, buttonPutDewar, buttonPutGonio, buttonRecover, buttonResetPuckIds, buttonUnmount});
panelCommandsLayout.setVerticalGroup(
panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -436,12 +451,16 @@ public class Commands extends Panel {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(spinnerDrySpeed, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel7))
.addGap(18, 18, 18)
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(buttonRecover)
.addComponent(buttonEnableAll)))
.addComponent(jLabel7)))
.addComponent(jLabel6))
.addGap(18, 18, 18)
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(buttonClearSampleDb)
.addComponent(buttonResetPuckIds))
.addGap(18, 18, 18)
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(buttonRecover)
.addComponent(buttonEnableAll))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
@@ -449,7 +468,9 @@ public class Commands extends Panel {
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(panelCommands, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createSequentialGroup()
.addComponent(panelCommands, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -548,7 +569,16 @@ public class Commands extends Panel {
execute("move_cold()");
}//GEN-LAST:event_buttonMoveColdActionPerformed
private void buttonClearSampleDbActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonClearSampleDbActionPerformed
execute("clear_samples_info()", true);
}//GEN-LAST:event_buttonClearSampleDbActionPerformed
private void buttonResetPuckIdsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonResetPuckIdsActionPerformed
execute("reset_puck_datamatrix()", true);
}//GEN-LAST:event_buttonResetPuckIdsActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton buttonClearSampleDb;
private javax.swing.JButton buttonDry;
private javax.swing.JButton buttonEnableAll;
private javax.swing.JButton buttonGetDewar;
@@ -565,6 +595,7 @@ public class Commands extends Panel {
private javax.swing.JButton buttonPutDewar;
private javax.swing.JButton buttonPutGonio;
private javax.swing.JButton buttonRecover;
private javax.swing.JButton buttonResetPuckIds;
private javax.swing.JButton buttonUnmount;
private javax.swing.JCheckBox checkDatamatrix;
private javax.swing.JCheckBox checkForce;

Binary file not shown.

View File

@@ -11,4 +11,12 @@ def get_puck_info():
def get_puck_obj(address):
return BasePlate.getChild(address)
return BasePlate.getChild(address)
def get_puck_obj_by_id(puck_id):
for puck in BasePlate.pucks:
if puck.id == puck_id:
return puck
return None

View File

@@ -2,7 +2,7 @@ import json
import org.python.core.PyDictionary as PyDictionary
SAMPLE_INFO_KEYS = ["userName", "dewarName", "puckName", "puckBarcode", "puckType", "puckAddress",
"sampleName", "samplePosition", "sampleStatus", "sampleMountCount"]
"sampleName", "samplePosition", "sampleBarcode", "sampleStatus", "sampleMountCount"]
samples_info = []
@@ -103,7 +103,10 @@ def reset_puck_datamatrix(puck = None):
for si in samples_info:
if (si["puckAddress"] == puck) or (puck is None):
si["puckAddress"] = ""
save_samples_info()
save_samples_info()
for p in BasePlate.getChildren():
if (p.name == puck) or (puck is None):
p.id = None
def get_puck_datamatrix():
ret = {}
@@ -130,7 +133,8 @@ def update_puck_table():
#Sample mount/unmount
def update_samples_info_sample_mount(puck_address, sample_position, sample_detected):
def update_samples_info_sample_mount(puck_address, sample_position, sample_detected, sample_id):
print ""
try:
if (samples_info is not None) and (puck_address is not None):
for si in samples_info:
@@ -145,6 +149,10 @@ def update_samples_info_sample_mount(puck_address, sample_position, sample_detec
si["sampleMountCount"] = mount_count + 1
else:
si["sampleStatus"] = "Unknown"
if sample_id is not None:
si["sampleBarcode"] = sample_id
save_samples_info()
return
except:
@@ -172,6 +180,7 @@ test_sample_data = [ \
"puckAddress": "A1",\
"sampleName": "MySample 1", \
"samplePosition": 1,\
"sampleBarcode": "", \
"sampleStatus": "Present", \
"sampleMountCount": 0,
} , \
@@ -183,6 +192,7 @@ test_sample_data = [ \
"puckAddress": "A1",\
"sampleName": "MySample 2", \
"samplePosition": 2,\
"sampleBarcode": "", \
"sampleStatus": "Present", \
"sampleMountCount": 0,
} , \
@@ -194,6 +204,7 @@ test_sample_data = [ \
"puckAddress": "A1",\
"sampleName": "MySample 3", \
"samplePosition": 3,\
"sampleBarcode": "", \
"sampleStatus": "Present", \
"sampleMountCount": 0,
} , \
@@ -205,6 +216,7 @@ test_sample_data = [ \
"puckAddress": "A1",\
"sampleName": "MySample 4", \
"samplePosition": 4,\
"sampleBarcode": "", \
"sampleStatus": "Present", \
"sampleMountCount": 0,
} , \
@@ -215,6 +227,7 @@ test_sample_data = [ \
"puckType": "unipuck", \
"puckAddress": "A1",\
"sampleName": "MySample 5", \
"sampleBarcode": "", \
"samplePosition": 5,\
"sampleStatus": "Present", \
"sampleMountCount": 0,
@@ -228,6 +241,7 @@ test_sample_data = [ \
"puckAddress": "C2",\
"sampleName": "MySample 1", \
"samplePosition": 1,\
"sampleBarcode": "", \
"sampleStatus": "Present", \
"sampleMountCount": 0,
} , \
@@ -239,6 +253,7 @@ test_sample_data = [ \
"puckAddress": "C2",\
"sampleName": "MySample 2", \
"samplePosition": 2,\
"sampleBarcode": "", \
"sampleStatus": "Present", \
"sampleMountCount": 0,
} , \
@@ -250,6 +265,7 @@ test_sample_data = [ \
"puckAddress": "C2",\
"sampleName": "MySample 3", \
"samplePosition": 3,\
"sampleBarcode": "", \
"sampleStatus": "Present", \
"sampleMountCount": 0,
} , \
@@ -261,6 +277,7 @@ test_sample_data = [ \
"puckAddress": "C2",\
"sampleName": "MySample 4", \
"samplePosition": 4,\
"sampleBarcode": "", \
"sampleStatus": "Present", \
"sampleMountCount": 0,
} , \
@@ -272,6 +289,7 @@ test_sample_data = [ \
"puckAddress": "C2",\
"sampleName": "MySample 5", \
"samplePosition": 5,\
"sampleBarcode": "", \
"sampleStatus": "Present", \
"sampleMountCount": 0,
} , \

View File

@@ -163,7 +163,7 @@ class RobotTCP(TcpDevice, Stoppable):
def evaluate(self, cmd, timeout=None):
ret = self.execute('eval', cmd, timeout=timeout)
if type(ret) is str:
if is_string(ret):
if ret.strip() != "": raise Exception(ret)
def get_var(self, name):

View File

@@ -47,7 +47,7 @@ class SmartMagnet(DeviceBase):
def get_supress(self):
return smc_sup_det.read()
def check_mounted(self, idle_time =1.0, timeout = -1):
def check_mounted(self, idle_time =1.0, timeout = -1, interval = 0.01):
self.assert_status()
start = time.time()
last = None
@@ -66,7 +66,7 @@ class SmartMagnet(DeviceBase):
if timeout >= 0:
if (time.time() - start) > timeout:
raise Exception("Timeout waiting for Smart Magnet detection.")
time.sleep(0.01)
time.sleep(interval)
def doUpdate(self):

View File

@@ -18,7 +18,7 @@ def assert_img_in_cover_pos(pos = None):
pos = hexiposi.take()
elif type(pos) is int:
pos = chr( ord('A') + (pos-1))
elif type(pos) is str:
elif is_string(pos):
pos = pos.upper()
img_segment = get_img_cover_pos()
if img_segment != pos:

View File

@@ -1,12 +1,25 @@
mount_sample_id = None
mount_sample_detected = None
def mount(segment, puck, sample, force=False, read_dm=False):
"""
"""
global mount_sample_id, mount_sample_detected
print "mount: ", segment, puck, sample, force
start = time.time()
puck_address = get_puck_address(puck)
if puck_address is None:
puck_obj = get_puck_obj_by_id(puck)
if puck_obj is not None:
puck_address = puck_obj.name
if puck_address is not None:
print "puck address: ", puck_address
segment = puck_address[:1]
puck = int(puck_address[1:])
#Initial checks
assert_valid_address(segment, puck, sample)
assert_puck_detected(segment, puck)
robot.assert_no_task()
robot.reset_motion()
robot.wait_ready()
@@ -31,25 +44,31 @@ def mount(segment, puck, sample, force=False, read_dm=False):
robot.move_dewar()
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()
robot.move_scanner()
time.sleep(1.0)
robot.move_gonio()
if read_dm:
dm = barcode_reader.get_readout()
print "Datamatrix: " , dm
mount_sample_id = barcode_reader.get_readout()
print "Datamatrix: " , mount_sample_id
else:
mount_sample_id = None
smart_magnet.set_mount_current()
try:
robot.put_gonio()
robot.move_dewar()
sample_detected = smart_magnet.check_mounted(idle_time=0.25, timeout = 1.0)
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, sample_detected)
if sample_detected == False:
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")
return [mount_sample_detected, mount_sample_id]
finally:
smart_magnet.set_default_current()

View File

@@ -142,15 +142,17 @@ def get_puck_name(segment, puck):
try:
assert_valid_address(segment, puck, 1)
if type(segment) is int:
segment = chr( ord('A') + (pos-1))
elif type(segment) is str:
segment = pos.upper()
segment = chr( ord('A') + (segment-1))
elif is_string(segment):
segment = segment.upper()
else:
return None
return segment + str(puck)
except:
return None
def get_sample_name(segment, puck, sample):
puck_name = get_puck_name(segment, puck)
return None if (puck_name is None) else puck_name + str(sample)

View File

@@ -1,7 +1,14 @@
def unmount(segment, puck, sample, force=False):
def unmount(segment = None, puck = None, sample = None, force=False):
"""
"""
print "unmount: ", segment, puck, sample, force
if (segment is None) or (puck is None) or (sample is None):
pos = get_setting("mounted_sample_position")
if pos is None:
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
#Initial checks
assert_valid_address(segment, puck, sample)
@@ -14,7 +21,7 @@ def unmount(segment, puck, sample, force=False):
#robot.assert_in_known_point()
hexiposi.assert_homed()
if smart_magnet.check_mounted(idle_time=0.25, timeout = 1.0) == False:
if smart_magnet.check_mounted(idle_time=0.5, timeout = 3.0) == False:
raise Exception("No pin detected on gonio")
@@ -38,6 +45,7 @@ def unmount(segment, puck, sample, force=False):
update_samples_info_sample_unmount(get_puck_name(segment, puck), sample)
robot.move_dewar()
robot.put_dewar(segment, puck, sample)
set_setting("mounted_sample_position", None)
finally:
smart_magnet.set_default_current()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff