From 609a87a986e7c09a683417e7cd4c9cfd462a0023 Mon Sep 17 00:00:00 2001 From: "EPanepucci (x06sa-cons-701)" Date: Wed, 26 Apr 2023 09:29:10 +0200 Subject: [PATCH] pulling some changes from x10sa - bugfix: hexiposi missing "self." for method call - pretend dry for development - bugfix: ensure cryojet retracted in trash sample - typos and whitespace --- script/devices/Hexiposi.py | 2 +- script/local.py | 1 - script/motion/tools.py | 4 ++-- script/motion/trash.py | 7 +++++++ script/pretend_dry.py | 21 +++++++++++++++++++++ 5 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 script/pretend_dry.py diff --git a/script/devices/Hexiposi.py b/script/devices/Hexiposi.py index ff30a57..282733f 100644 --- a/script/devices/Hexiposi.py +++ b/script/devices/Hexiposi.py @@ -120,7 +120,7 @@ class Hexiposi(DiscretePositionerBase): def assert_in_position(self, pos): - if not is_in_position(pos): + if not self.is_in_position(pos): raise Exception ("Hexiposi is not in position") def assert_homed(self): diff --git a/script/local.py b/script/local.py index f7662d6..75796db 100644 --- a/script/local.py +++ b/script/local.py @@ -115,7 +115,6 @@ def is_gripper_really_empty(timeout=2.0): timeout = timeout + time.time() while time.time() < timeout: if robot.eval_bool("diToolHasSample"): - print "test" time.sleep(0.10) else: return True diff --git a/script/motion/tools.py b/script/motion/tools.py index 58bb7fc..aa6f730 100644 --- a/script/motion/tools.py +++ b/script/motion/tools.py @@ -14,7 +14,7 @@ def release_safety(): if air_pressure_ok.take() != True: raise Exception("Cannot release safety: air preassure not ok") if n2_pressure_ok.take() != True: - raise Exception("Cannot release safety: n2 pressure not ok") + raise Exception("Cannot release safety: N2 pressure not ok") auto = not is_manual_mode() if auto: if feedback_psys_safety.read() == False: @@ -177,4 +177,4 @@ def is_pin_detected_in_scanner(): return False if abs(s-av) > 0.1: return False - return True \ No newline at end of file + return True diff --git a/script/motion/trash.py b/script/motion/trash.py index f1ebd25..2864836 100644 --- a/script/motion/trash.py +++ b/script/motion/trash.py @@ -21,6 +21,13 @@ def trash_sample(): enable_motion() robot.move_gonio() + + curpos = cryopos.getPosition() + speed = cryopos.getSpeed() / 1000.0 + movetime = int(round(3000 + (15. - curpos) / speed)) + cryopos.move(15.0, movetime) + cryopos.waitValueInRange(15.0, 1.0, movetime) + robot.get_gonio() robot.move_heater(to_bottom = False) robot.move_heater(to_bottom = True) diff --git a/script/pretend_dry.py b/script/pretend_dry.py new file mode 100644 index 0000000..bc4215e --- /dev/null +++ b/script/pretend_dry.py @@ -0,0 +1,21 @@ +### +### run this file to replace the real dry() function +### with this fake version when TESTING ONLY!!!!!! +### + +def dry(heat_time=None, speed=None, wait_cold = None): + """run this file to replace the real dry() function + with this fake version when TESTING ONLY!!!!!! + """ + print "#################################" + print "## PRETENDING to DRY real fast ##" + print "#################################" + + + +def _test_update_mount_counts(count=0): + global samples_info + for _s in samples_info: + _s["sampleMountCount"] = count + print "sample %s mounted %d times" % (_s["puckAddress"], _s["sampleMountCount"]) +