diff --git a/config/settings.properties b/config/settings.properties index 3414cd1..8ba5585 100644 --- a/config/settings.properties +++ b/config/settings.properties @@ -1,4 +1,4 @@ -#Fri May 05 13:39:50 CEST 2023 +#Wed May 10 09:09:49 CEST 2023 dry_mount_counter=0 room_temperature_enabled=true pin_offset=0.0 diff --git a/devices/smart_magnet.properties b/devices/smart_magnet.properties index 85c8d78..9210795 100644 --- a/devices/smart_magnet.properties +++ b/devices/smart_magnet.properties @@ -1,8 +1,8 @@ -#Thu Mar 14 16:45:07 CET 2019 -holdingCurrent=40.0 -mountCurrent=40.0 -remanenceCurrent=-10.0 -restingCurrent=20.0 -reverseCurrent=-10.0 +#Wed May 10 09:15:17 CEST 2023 reverseTime=0.4 unmountCurrent=20.0 +holdingCurrent=20.0 +restingCurrent=20.0 +reverseCurrent=-10.0 +remanenceCurrent=-10.0 +mountCurrent=20.0 diff --git a/plugins/Recovery.java b/plugins/Recovery.java index 844c3c1..ec3cade 100644 --- a/plugins/Recovery.java +++ b/plugins/Recovery.java @@ -23,7 +23,6 @@ public class Recovery extends Panel { //Overridable callbacks @Override public void onInitialize(int runCount) { - } @Override @@ -59,7 +58,7 @@ public class Recovery extends Panel { ledKnownPosition.setColor(Color.BLACK); textPosition.setText(""); } else { - if (getState()==State.Ready){ + if (getState().isNormal()){ String point = null; try{ point = (String) eval("robot.get_current_point()", true); diff --git a/script/devices/Hexiposi.py b/script/devices/Hexiposi.py index 3679e01..0443a0e 100644 --- a/script/devices/Hexiposi.py +++ b/script/devices/Hexiposi.py @@ -172,3 +172,4 @@ class hexiposi_position(ReadonlyRegisterBase): add_device(hexiposi_position(), True) hexiposi_position.polling = 1000 hexiposi.set_deadband(1.0) +hexiposi.set_offset(53.489) \ No newline at end of file diff --git a/script/motion_rt/mount.py b/script/motion_rt/mount.py index 67579fb..301fabe 100644 --- a/script/motion_rt/mount.py +++ b/script/motion_rt/mount.py @@ -8,6 +8,8 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False) print "mount: ", segment, puck, sample start = time.time() + + is_aux = (segment == AUX_SEGMENT) puck_address = get_puck_address(puck) if puck_address is None: @@ -64,22 +66,32 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False) #Enabling enable_motion() + if is_aux: + if lid_open_by_unmount: + lid_open_by_unmount = False + robot.close_lid(segment) + if not robot.is_aux(): + robot.move_aux() + robot.get_aux(sample) - if not robot.is_home(): - if (not lid_open_by_unmount) or (segment != previous_segment): - robot.move_home() - - set_hexiposi(segment) + else: - if not force: - visual_check_hexiposi(segment) - - if not lid_open_by_unmount: - robot.open_lid(segment) - lid_open_by_unmount = False - - robot.get_rt(segment, puck, sample) #Should we close lid if this command raise exception? - robot.close_lid(segment) + if not robot.is_home(): + if (not lid_open_by_unmount) or (segment != previous_segment): + robot.move_home() + + set_hexiposi(segment) + + if not force: + visual_check_hexiposi(segment) + + if not lid_open_by_unmount: + robot.open_lid(segment) + lid_open_by_unmount = False + + robot.get_rt(segment, puck, sample) #Should we close lid if this command raise exception? + robot.close_lid(segment) + robot.move_gonio() if read_dm: diff --git a/script/motion_rt/tools.py b/script/motion_rt/tools.py index bd4d90e..00db852 100644 --- a/script/motion_rt/tools.py +++ b/script/motion_rt/tools.py @@ -130,6 +130,8 @@ def update_tool(tool=None, x_offset=0.0, y_offset=0.0, z_offset=0.0): def assert_valid_address(segment, puck, sample): rt_tool = robot.get_tool() in ("tRTsmall",) if (segment == AUX_SEGMENT) and (puck == 1): + if sample not in (6, 10,13): + raise Exception ("Invalid auxiliary sample: " + str(sample)) return if is_room_temperature_enabled(): if (segment == RT_SEGMENT): diff --git a/script/motion_rt/unmount.py b/script/motion_rt/unmount.py index 85e49dc..682a3f2 100644 --- a/script/motion_rt/unmount.py +++ b/script/motion_rt/unmount.py @@ -11,6 +11,7 @@ def unmount(segment = None, puck = None, sample = None, force=False, auto_unmoun 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 assert_valid_address(segment, puck, sample) @@ -59,11 +60,15 @@ def unmount(segment = None, puck = None, sample = None, force=False, auto_unmoun robot.get_gonio() - #TODO: Shuld check if smart magnet detection is off? - update_samples_info_sample_unmount(get_puck_name(segment, puck), sample) - robot.move_home() - robot.open_lid(segment) - robot.put_rt(segment, puck, sample) + if is_aux: + robot.move_aux() + robot.put_aux( sample) + else: + #TODO: Shuld check if smart magnet detection is off? + update_samples_info_sample_unmount(get_puck_name(segment, puck), sample) + robot.move_home() + robot.open_lid(segment) + robot.put_rt(segment, puck, sample) set_setting("mounted_sample_position", None) #imporant to be the very last command for the logic on chained mount