From 37e183bd307d8eaf2b32699acd0e90d89b0483ed Mon Sep 17 00:00:00 2001 From: gac-S_Changer Date: Fri, 28 Sep 2018 11:13:37 +0200 Subject: [PATCH] --- script/devices/RobotSC.py | 3 ++- script/motion/dry.py | 3 +++ script/motion/homing_hexiposi.py | 3 ++- script/motion/mount.py | 13 ++++++++++--- script/motion/recover.py | 4 +++- script/motion/robot_recover.py | 2 ++ script/motion/scan_pin.py | 2 +- script/motion/unmount.py | 2 ++ 8 files changed, 25 insertions(+), 7 deletions(-) diff --git a/script/devices/RobotSC.py b/script/devices/RobotSC.py index 020cd02..0d8c592 100644 --- a/script/devices/RobotSC.py +++ b/script/devices/RobotSC.py @@ -52,7 +52,8 @@ class RobotSC(RobotTCP): self.assert_dewar() self.start_task('putDewar',segment, puck, sample, is_room_temp()) self.wait_task_finished(TASK_WAIT_ROBOT_POLLING) - self.assert_dewar() + #self.assert_dewar() + self.assert_cold def put_gonio(self): pin_offset = get_pin_offset() diff --git a/script/motion/dry.py b/script/motion/dry.py index 5619238..edaae41 100644 --- a/script/motion/dry.py +++ b/script/motion/dry.py @@ -8,6 +8,7 @@ def dry(heat_time=30.0, speed=0.5, wait_cold = 30.0): Else move to cold and wait (in seconds) before returning. """ print "dry" + #Initial checks robot.assert_no_task() robot.reset_motion() @@ -15,6 +16,8 @@ def dry(heat_time=30.0, speed=0.5, wait_cold = 30.0): robot.assert_cleared() #robot.assert_in_known_point() + set_status("Drying") + #Enabling enable_motion() diff --git a/script/motion/homing_hexiposi.py b/script/motion/homing_hexiposi.py index 62944b4..3b91519 100644 --- a/script/motion/homing_hexiposi.py +++ b/script/motion/homing_hexiposi.py @@ -9,7 +9,8 @@ def homing_hexiposi(): robot.assert_cleared() #robot.assert_in_known_point() #location = robot.get_current_point() - + + set_status("Homing hexiposi") hexiposi.move_home() hexiposi.waitState(State.Ready,-1) \ No newline at end of file diff --git a/script/motion/mount.py b/script/motion/mount.py index 44e3e78..ec460db 100644 --- a/script/motion/mount.py +++ b/script/motion/mount.py @@ -6,6 +6,7 @@ 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) @@ -27,6 +28,8 @@ def mount(segment, puck, sample, force=False, read_dm=False): #robot.assert_in_known_point() hexiposi.assert_homed() + set_status("Mounting: " + str(segment) + str(puck) + str(sample)) + try: smart_magnet.enforce_sample_detection() if smart_magnet.check_mounted(idle_time=0.25, timeout = 1.0) == True: @@ -74,15 +77,19 @@ def mount(segment, puck, sample, force=False, read_dm=False): dry_mount_count = 0 set_setting("dry_mount_counter", dry_mount_count+1) #TODO: Auto-dry procedure - if is_force_dry(): - pass - robot.move_dewar() + 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") + + if is_force_dry(): + print "Auto dry" + log("Starting auto dry", False) + dry() return [mount_sample_detected, mount_sample_id] finally: smart_magnet.set_default_current() + diff --git a/script/motion/recover.py b/script/motion/recover.py index b15aaad..9a5e347 100644 --- a/script/motion/recover.py +++ b/script/motion/recover.py @@ -123,7 +123,9 @@ def recover(): if robot.get_current_point() is not None: raise Exception("Robot is in known location") - + + set_status("Recovering") + #Enabling enable_motion() diff --git a/script/motion/robot_recover.py b/script/motion/robot_recover.py index 145e592..c25d712 100644 --- a/script/motion/robot_recover.py +++ b/script/motion/robot_recover.py @@ -8,6 +8,8 @@ def robot_recover(): robot.reset_motion() robot.wait_ready() + set_status("Recovering robot") + #Enabling enable_motion() diff --git a/script/motion/scan_pin.py b/script/motion/scan_pin.py index 06e51e8..9824652 100644 --- a/script/motion/scan_pin.py +++ b/script/motion/scan_pin.py @@ -12,6 +12,7 @@ robot.assert_cleared() #Enabling +set_status("Scanning pin: " + str(pin_name)) enable_motion() set_hexiposi(segment) @@ -44,5 +45,4 @@ print "Datamatrix: " , mount_sample_id robot.move_dewar() robot.put_dewar(segment, puck, sample) - \ No newline at end of file diff --git a/script/motion/unmount.py b/script/motion/unmount.py index 029a939..548887a 100644 --- a/script/motion/unmount.py +++ b/script/motion/unmount.py @@ -21,6 +21,8 @@ def unmount(segment = None, puck = None, sample = None, force=False): #robot.assert_in_known_point() hexiposi.assert_homed() + set_status("Umounting: " + str(segment) + str(puck) + str(sample)) + try: smart_magnet.enforce_sample_detection() if smart_magnet.check_mounted(idle_time=0.5, timeout = 3.0) == False: