diff --git a/config/config.properties b/config/config.properties index 28bab1e..93defb5 100644 --- a/config/config.properties +++ b/config/config.properties @@ -1,4 +1,4 @@ -#Thu Feb 14 10:49:44 CET 2019 +#Thu Feb 21 14:00:54 CET 2019 autoSaveScanData=true commandExecutionEvents=false createSessionFiles=true @@ -11,7 +11,7 @@ dataScanReleaseRecords=false dataServerPort=-1 depthDimension=0 hostName=null -instanceName=MXSC +instanceName=TellSwissMX logDaysToLive=30 logLevel=Fine logLevelConsole=Off diff --git a/config/settings.properties b/config/settings.properties index 67c8b1d..872c4ea 100644 --- a/config/settings.properties +++ b/config/settings.properties @@ -1,12 +1,12 @@ -#Thu Feb 14 11:23:32 CET 2019 +#Thu Feb 21 14:01:13 CET 2019 barcode_reader_scan_pucks=true -dry_mount_counter=0 +beamline_status_enabled=false +dry_mount_counter=6 dry_timestamp=1.543854393748E9 force_dry_mount_count=0 force_dry_timeout=0 imaging_enabled=false led_level=0.0 -mounted_sample_position= pin_angle_offset=0.0 pin_offset=0.0 puck_types=true @@ -14,4 +14,4 @@ roi_h=1000 roi_w=1000 roi_x=337 roi_y=139 -room_temperature_enabled=false +room_temperature_enabled=true diff --git a/devices/A1.properties b/devices/A1.properties index 7bb91cd..467cbf5 100644 --- a/devices/A1.properties +++ b/devices/A1.properties @@ -1,3 +1,3 @@ -#Thu Feb 14 10:34:24 CET 2019 +#Fri Feb 15 15:28:35 CET 2019 detection=Both disabled=false diff --git a/devices/R1.properties b/devices/R1.properties new file mode 100644 index 0000000..bba9b4f --- /dev/null +++ b/devices/R1.properties @@ -0,0 +1,3 @@ +#Thu Feb 14 14:21:01 CET 2019 +detection=Both +disabled=false diff --git a/devices/R2.properties b/devices/R2.properties new file mode 100644 index 0000000..bba9b4f --- /dev/null +++ b/devices/R2.properties @@ -0,0 +1,3 @@ +#Thu Feb 14 14:21:01 CET 2019 +detection=Both +disabled=false diff --git a/devices/R3.properties b/devices/R3.properties new file mode 100644 index 0000000..bba9b4f --- /dev/null +++ b/devices/R3.properties @@ -0,0 +1,3 @@ +#Thu Feb 14 14:21:01 CET 2019 +detection=Both +disabled=false diff --git a/devices/R4.properties b/devices/R4.properties new file mode 100644 index 0000000..bba9b4f --- /dev/null +++ b/devices/R4.properties @@ -0,0 +1,3 @@ +#Thu Feb 14 14:21:01 CET 2019 +detection=Both +disabled=false diff --git a/devices/R5.properties b/devices/R5.properties new file mode 100644 index 0000000..bba9b4f --- /dev/null +++ b/devices/R5.properties @@ -0,0 +1,3 @@ +#Thu Feb 14 14:21:01 CET 2019 +detection=Both +disabled=false diff --git a/devices/RoomTemperatureBasePlate.properties b/devices/RoomTemperatureBasePlate.properties new file mode 100644 index 0000000..35f9344 --- /dev/null +++ b/devices/RoomTemperatureBasePlate.properties @@ -0,0 +1 @@ +#Thu Feb 14 14:21:01 CET 2019 diff --git a/devices/smart_magnet.properties b/devices/smart_magnet.properties index 012c86e..0111e5f 100644 --- a/devices/smart_magnet.properties +++ b/devices/smart_magnet.properties @@ -1,8 +1,8 @@ -#Thu Oct 25 16:47:21 CEST 2018 -holdingCurrent=30.0 -mountCurrent=10.0 +#Fri Feb 15 12:53:07 CET 2019 +holdingCurrent=40.0 +mountCurrent=20.0 remanenceCurrent=-10.0 -restingCurrent=10.0 +restingCurrent=20.0 reverseCurrent=-10.0 reverseTime=0.4 -unmountCurrent=10.0 +unmountCurrent=20.0 diff --git a/plugins/Commands.form b/plugins/Commands.form index add3c8a..39bee00 100644 --- a/plugins/Commands.form +++ b/plugins/Commands.form @@ -181,17 +181,25 @@ - + - - - - - + + + + + + + + + + + + + + + - - @@ -215,6 +223,8 @@ + + @@ -399,6 +409,14 @@ + + + + + + + + diff --git a/plugins/Commands.java b/plugins/Commands.java index c1f41b5..8d4e0ac 100644 --- a/plugins/Commands.java +++ b/plugins/Commands.java @@ -54,9 +54,9 @@ public class Commands extends Panel { for (Component c: SwingUtils.getComponentsByType(this, JComponent.class)){ c.setEnabled(enabled); } - spinnerSegment.setEnabled(enabled && !checkAuxiliary.isSelected()); + spinnerSegment.setEnabled(enabled && !checkAuxiliary.isSelected() && !checkRoomTemp.isSelected()); spinnerPuck.setEnabled(enabled && !checkAuxiliary.isSelected()); - buttonScanPuck.setEnabled(enabled && !checkAuxiliary.isSelected()); + buttonScanPuck.setEnabled(enabled && !checkAuxiliary.isSelected()&& !checkRoomTemp.isSelected()); } @Override @@ -110,7 +110,15 @@ public class Commands extends Panel { } } - + String getSegment(){ + if (checkAuxiliary.isSelected()){ + return "X"; + } + if (checkRoomTemp.isSelected()){ + return "R"; + } + return (String) spinnerSegment.getValue(); + } @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents @@ -142,6 +150,7 @@ public class Commands extends Panel { buttonScanPin = new javax.swing.JButton(); buttonScanPuck = new javax.swing.JButton(); checkAuxiliary = new javax.swing.JCheckBox(); + checkRoomTemp = new javax.swing.JCheckBox(); jPanel1 = new javax.swing.JPanel(); buttonGripperScan = new javax.swing.JButton(); buttonTrash = new javax.swing.JButton(); @@ -341,6 +350,13 @@ public class Commands extends Panel { } }); + checkRoomTemp.setText("Room Temperature"); + checkRoomTemp.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + checkRoomTempActionPerformed(evt); + } + }); + javax.swing.GroupLayout pnTransferLayout = new javax.swing.GroupLayout(pnTransfer); pnTransfer.setLayout(pnTransferLayout); pnTransferLayout.setHorizontalGroup( @@ -348,13 +364,18 @@ public class Commands extends Panel { .addGroup(pnTransferLayout.createSequentialGroup() .addContainerGap() .addGroup(pnTransferLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(buttonMount, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(buttonUnmount, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(buttonScanPin, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(buttonScanPuck, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(checkAuxiliary)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(pnTransferLayout.createSequentialGroup() + .addComponent(checkRoomTemp) + .addGap(0, 0, Short.MAX_VALUE)) + .addGroup(pnTransferLayout.createSequentialGroup() + .addGroup(pnTransferLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(buttonMount, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(buttonUnmount, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(buttonScanPin, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(buttonScanPuck, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(checkAuxiliary)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE) + .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); @@ -376,7 +397,9 @@ public class Commands extends Panel { .addComponent(buttonScanPuck) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(checkAuxiliary))) - .addContainerGap()) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(checkRoomTemp) + .addContainerGap(13, Short.MAX_VALUE)) ); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Gripper")); @@ -726,7 +749,7 @@ public class Commands extends Panel { }//GEN-LAST:event_buttonEnableAllActionPerformed private void buttonMountActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonMountActionPerformed - String segment = checkAuxiliary.isSelected() ? "X" : (String) spinnerSegment.getValue(); + String segment = getSegment(); int puck = checkAuxiliary.isSelected() ? 1 :(Integer) spinnerPuck.getValue(); int sample = (Integer) spinnerSample.getValue(); String force = checkForce.isSelected() ? "True" : "False"; @@ -740,7 +763,7 @@ public class Commands extends Panel { }//GEN-LAST:event_buttonMoveAuxActionPerformed private void buttonUnmountActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonUnmountActionPerformed - String segment = checkAuxiliary.isSelected() ? "X" : (String) spinnerSegment.getValue(); + String segment = getSegment(); int puck = checkAuxiliary.isSelected() ? 1 :(Integer) spinnerPuck.getValue(); int sample = (Integer) spinnerSample.getValue(); String force = checkForce.isSelected() ? "True" : "False"; @@ -822,7 +845,7 @@ public class Commands extends Panel { }//GEN-LAST:event_buttonResetPuckIdsActionPerformed private void buttonScanPinActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonScanPinActionPerformed - String segment = checkAuxiliary.isSelected() ? "X" : (String) spinnerSegment.getValue(); + String segment = getSegment(); int puck = checkAuxiliary.isSelected() ? 1 :(Integer) spinnerPuck.getValue(); int sample = (Integer) spinnerSample.getValue(); String force = checkForce.isSelected() ? "True" : "False"; @@ -830,7 +853,7 @@ public class Commands extends Panel { }//GEN-LAST:event_buttonScanPinActionPerformed private void buttonScanPuckActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonScanPuckActionPerformed - String segment = checkAuxiliary.isSelected() ? "X" : (String) spinnerSegment.getValue(); + String segment = getSegment(); int puck = checkAuxiliary.isSelected() ? 1 :(Integer) spinnerPuck.getValue(); String force = checkForce.isSelected() ? "True" : "False"; execute("scan_puck('" + segment + "'," + puck + ", force=" + force + ")", false, true); @@ -858,6 +881,10 @@ public class Commands extends Panel { execute("trash()"); }//GEN-LAST:event_buttonTrashActionPerformed + private void checkRoomTempActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkRoomTempActionPerformed + onStateChange(getState(), null); + }//GEN-LAST:event_checkRoomTempActionPerformed + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton buttonClearSampleDb; private javax.swing.JButton buttonDry; @@ -887,6 +914,7 @@ public class Commands extends Panel { private javax.swing.JCheckBox checkAuxiliary; private javax.swing.JCheckBox checkDatamatrix; private javax.swing.JCheckBox checkForce; + private javax.swing.JCheckBox checkRoomTemp; private javax.swing.JCheckBox ckeckParkOnDry; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; diff --git a/plugins/MXSC-1.10.0.jar b/plugins/MXSC-1.10.0.jar index af678da..67b5faf 100644 Binary files a/plugins/MXSC-1.10.0.jar and b/plugins/MXSC-1.10.0.jar differ diff --git a/script/devices/Hexiposi.py b/script/devices/Hexiposi.py index 5359532..6f3d51c 100644 --- a/script/devices/Hexiposi.py +++ b/script/devices/Hexiposi.py @@ -125,13 +125,15 @@ class Hexiposi(DiscretePositionerBase): raise Exception ("Hexiposi is not in position") def assert_homed(self): - if self.homed == False: - raise Exception ("Hexiposi is not homed") + if not self.simulated: + 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.") + if not self.simulated: + self.get_status() + if self.rback == 'Unknown': + raise Exception("Hexiposi is in an unknown position, please home.") #def isReady(self): # self.get_status() diff --git a/script/devices/RobotSC.py b/script/devices/RobotSC.py index ffa35b1..422642b 100644 --- a/script/devices/RobotSC.py +++ b/script/devices/RobotSC.py @@ -10,6 +10,7 @@ DESC_SCAN = "mScan" DESC_DEFAULT = DESC_FAST AUX_SEGMENT = "X" +RT_SEGMENT = "R" DEFAULT_ROBOT_POLLING = 500 @@ -26,8 +27,8 @@ joint_forces = False class RobotSC(RobotTCP): def __init__(self, name, server, timeout = 1000, retries = 1): RobotTCP.__init__(self, name, server, timeout, retries) - self.set_tasks(["getDewar", "putDewar", "putGonio", "getGonio", "recover", "moveDewar", "moveCold", "movePark", "moveGonio","moveHeater", "moveScanner","moveHome", "moveAux"]) - self.set_known_points(["pPark", "pGonio", "pDewar", "pGonioG", "pScan", "pHeater", "pHeat", "pHeatB", "pScanStop","pHelium", "pHome", "pCold", "pAux"]) + self.set_tasks(["getDewar", "putDewar", "putGonio", "getGonio", "recover", "moveDewar", "moveCold", "movePark", "moveGonio","moveHeater", "moveScanner","moveHome", "moveAux","moveRT"]) + self.set_known_points(["pPark", "pGonio", "pDewar", "pGonioG", "pScan", "pHeater", "pHeat", "pHeatB","pHe", "pHome", "pCold", "pAux", "pRT"]) self.setPolling(DEFAULT_ROBOT_POLLING) #self.setSimulated() @@ -87,6 +88,18 @@ class RobotSC(RobotTCP): self.wait_task_finished(TASK_WAIT_ROBOT_POLLING) self.assert_aux() + def get_rt(self, puck, sample): + self.assert_rt() + self.start_task('getRT', puck, sample) + self.wait_task_finished(TASK_WAIT_ROBOT_POLLING) + self.assert_rt() + + def put_rt(self, puck, sample): + self.assert_rt() + self.start_task('putRT',puck, sample) + self.wait_task_finished(TASK_WAIT_ROBOT_POLLING) + self.assert_rt() + def move_scanner(self): self.start_task('moveScanner') self.wait_task_finished(TASK_WAIT_ROBOT_POLLING) @@ -127,6 +140,11 @@ class RobotSC(RobotTCP): self.wait_task_finished(TASK_WAIT_ROBOT_POLLING) self.assert_aux() + def move_rt(self): + self.start_task('moveRT') + self.wait_task_finished(TASK_WAIT_ROBOT_POLLING) + self.assert_rt() + def get_calibration_tool(self): self.start_task('getCalTool') self.wait_task_finished(TASK_WAIT_ROBOT_POLLING) @@ -204,13 +222,16 @@ class RobotSC(RobotTCP): return self.is_in_point("pGonio") def is_helium(self): - return self.is_in_point("pHelium") + return self.is_in_point("pHe") def is_scanner(self): return self.is_in_point("pScan") def is_aux(self): - return self.is_in_point("pAux") + return self.is_in_point("pAux") + + def is_rt(self): + return self.is_in_point("pRT") #def is_scan_stop(self): # return self.is_in_point("pScanStop") @@ -244,7 +265,7 @@ class RobotSC(RobotTCP): self.assert_in_point("pGonio") def assert_helium(self): - self.assert_in_point("pHelium") + self.assert_in_point("pHe") def assert_scanner(self): self.assert_in_point("pScan") @@ -252,6 +273,9 @@ class RobotSC(RobotTCP): def assert_aux(self): self.assert_in_point("pAux") + def assert_rt(self): + self.assert_in_point("pRT") + #def assert_scan_stop(self): # self.assert_in_point("pScanStop") @@ -271,11 +295,23 @@ else: add_device(RobotSC("robot", "129.129.243.90:1000"), force = True) +def update_robot_tool(): + id = gripperID_MSB.read() << 1 + id = (id + gripperID_.read()) << 1 + id = id + gripperID_LSB.read() + print "Rodot tool ID: ", id + + if id == 1: + robot.set_tool("tRTsmall") + else: + robot.set_tool(TOOL_DEFAULT) + + robot.set_default_desc(DESC_DEFAULT) robot.default_speed = 20 robot.set_frame(FRAME_DEFAULT) -robot.set_tool(TOOL_DEFAULT) robot.setPolling(DEFAULT_ROBOT_POLLING) +update_robot_tool() robot.get_current_point() #TODO: REMOVE WHEN CURRENT POINT REPORTED BY POLLING MESSAGE diff --git a/script/local.py b/script/local.py index 02cae42..ff02fa7 100644 --- a/script/local.py +++ b/script/local.py @@ -91,7 +91,7 @@ def is_beamline_status_enabled(): setting = get_setting(BEAMLINE_STATUS_ENABLED_PREFERENCE) return str(setting).lower() == 'true' -set_setting(ROOM_TEMPERATURE_ENABLED_PREFERENCE, is_beamline_status_enabled()) +set_setting(BEAMLINE_STATUS_ENABLED_PREFERENCE, is_beamline_status_enabled()) ################################################################################################### # Scripted devices and pseudo-devices @@ -133,6 +133,9 @@ run("motion/move_scanner") run("motion/move_aux") run("motion/get_aux") run("motion/put_aux") +run("motion/move_rt") +run("motion/get_rt") +run("motion/put_rt") run("motion/dry") run("motion/trash") run("motion/homing_hexiposi") @@ -149,7 +152,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 not hexiposi.simulated: + hexiposi.assert_in_known_position() if robot_move: if not feedback_local_safety.read(): @@ -183,6 +187,9 @@ def get_puck_img_detection(segment, puck): def assert_puck_detected(segment, puck): if (segment == AUX_SEGMENT) and (puck == 1): return + if is_room_temperature_enabled(): + if (segment == RT_SEGMENT) and (1<= puck <= 5): + return if get_puck_elect_detection(segment, puck) != "Present": raise Exception ("Puck " + str(segment).upper() + str(puck) + " not present") @@ -242,7 +249,7 @@ except: try: robot.setPolling(DEFAULT_ROBOT_POLLING) - robot.set_tool(TOOL_DEFAULT) + update_robot_tool() robot.set_frame(FRAME_DEFAULT) robot.set_motors_enabled(True) robot.set_joint_motors_enabled(True) diff --git a/script/motion/get_rt.py b/script/motion/get_rt.py new file mode 100644 index 0000000..3655754 --- /dev/null +++ b/script/motion/get_rt.py @@ -0,0 +1,20 @@ +def get_rt(puck, sample): + """ + """ + print "get_rt: ",puck, sample + + #Initial checks + assert_valid_address('R', puck, sample) + + robot.assert_no_task() + robot.reset_motion() + robot.wait_ready() + robot.assert_cleared() + + #Enabling + enable_motion() + + if not robot.is_rt(): + robot.move_rt() + + robot.get_rt(sample) diff --git a/script/motion/mount.py b/script/motion/mount.py index bf1056f..0efad3e 100644 --- a/script/motion/mount.py +++ b/script/motion/mount.py @@ -10,8 +10,10 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False) start = time.time() is_aux = (segment == AUX_SEGMENT) - needs_chilling = not is_aux and (not robot.is_cold()) - needs_drying = is_aux and robot.is_cold() + is_rt = (segment ==RT_SEGMENT) + + needs_chilling = not is_aux and (not is_rt) and (not robot.is_cold()) + needs_drying = (is_aux or is_rt) and robot.is_cold() puck_address = get_puck_address(puck) if puck_address is None: @@ -73,7 +75,11 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False) robot.move_aux() robot.get_aux(sample) - + elif is_rt: + if not robot.is_rt(): + robot.move_rt() + + robot.get_rt(puck, sample) else: set_hexiposi(segment) @@ -109,7 +115,7 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False) dry_mount_count = 0 set_setting("dry_mount_counter", dry_mount_count+1) - if is_aux: + if is_aux or is_rt: robot.move_home() else: robot.move_cold() diff --git a/script/motion/move_rt.py b/script/motion/move_rt.py new file mode 100644 index 0000000..193a931 --- /dev/null +++ b/script/motion/move_rt.py @@ -0,0 +1,18 @@ +def move_rt(): + """ + """ + print "move rt" + + #Initial checks + robot.assert_no_task() + robot.reset_motion() + robot.wait_ready() + robot.assert_cleared() + #robot.assert_in_known_point() + + #Enabling + enable_motion() + + + if not robot.is_rt(): + robot.move_rt() \ No newline at end of file diff --git a/script/motion/put_rt.py b/script/motion/put_rt.py new file mode 100644 index 0000000..ed84f4f --- /dev/null +++ b/script/motion/put_rt.py @@ -0,0 +1,20 @@ +def put_rt(puck, sample): + """ + """ + print "put_rt: ",puck, sample + + #Initial checks + assert_valid_address('R', puck, sample) + + robot.assert_no_task() + robot.reset_motion() + robot.wait_ready() + robot.assert_cleared() + + #Enabling + enable_motion() + + if not robot.is_rt(): + robot.move_rt() + + robot.put_rt(puck, sample) diff --git a/script/motion/scan_pin.py b/script/motion/scan_pin.py index 7683694..d6f18c2 100644 --- a/script/motion/scan_pin.py +++ b/script/motion/scan_pin.py @@ -6,6 +6,7 @@ def scan_pin(segment, puck, sample, force=False): assert_valid_address(segment, puck, sample) assert_puck_detected(segment, puck) is_aux = (segment == AUX_SEGMENT) + is_rt = (segment == RT_SEGMENT) if robot.simulated: time.sleep(0.5) @@ -27,7 +28,12 @@ def scan_pin(segment, puck, sample, force=False): if not robot.is_aux(): robot.move_aux() - robot.get_aux(sample) + robot.get_aux(sample) + elif is_rt: + if not robot.is_rt(): + robot.move_rt() + + robot.get_rt(puck, sample) else: set_hexiposi(segment) if not force: @@ -44,6 +50,9 @@ def scan_pin(segment, puck, sample, force=False): if is_aux: robot.move_aux() robot.put_aux( sample) + elif is_rt: + robot.move_rt() + robot.put_rt( puck, sample) else: robot.move_dewar() robot.put_dewar(segment, puck, sample) diff --git a/script/motion/tools.py b/script/motion/tools.py index 3cb76ef..b5d40a4 100644 --- a/script/motion/tools.py +++ b/script/motion/tools.py @@ -132,6 +132,9 @@ def update_tool(tool=None, x_offset=0.0, y_offset=0.0, z_offset=0.0): def assert_valid_address(segment, puck, sample): if (segment == AUX_SEGMENT) and (puck == 1): return + if is_room_temperature_enabled(): + if (segment == RT_SEGMENT) and (1<= puck <= 5): + return if is_string(segment): segment = ord(segment.upper()) - ord('A') +1 if segment<=0 or segment >6: diff --git a/script/motion/unmount.py b/script/motion/unmount.py index 546a5fd..76eb2a7 100644 --- a/script/motion/unmount.py +++ b/script/motion/unmount.py @@ -3,9 +3,6 @@ def unmount(segment = None, puck = None, sample = None, force=False, auto_unmoun """ print "unmount: ", segment, puck, sample, force - 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") @@ -13,7 +10,12 @@ def unmount(segment = None, puck = None, sample = None, force=False, auto_unmoun 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) + is_rt = (segment ==RT_SEGMENT) + + needs_chilling = not is_aux and (not is_rt) and (not robot.is_cold()) + needs_drying = (is_aux or is_rt) and robot.is_cold() #Initial checks assert_valid_address(segment, puck, sample) @@ -49,7 +51,10 @@ def unmount(segment = None, puck = None, sample = None, force=False, auto_unmoun #Enabling enable_motion() - if not is_aux: + if is_aux or is_rt: + if needs_drying: + dry(wait_cold=-1) + else: set_hexiposi(segment) if not force: @@ -57,9 +62,7 @@ def unmount(segment = None, puck = None, sample = None, force=False, auto_unmoun 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(): @@ -75,6 +78,9 @@ def unmount(segment = None, puck = None, sample = None, force=False, auto_unmoun if is_aux: robot.move_aux() robot.put_aux( sample) + elif is_rt: + robot.move_rt() + robot.put_rt( puck, sample) else: #TODO: Shuld check if smart magnet detection is off? update_samples_info_sample_unmount(get_puck_name(segment, puck), sample)