Files
X06SA/script/motion/trash.py
EPanepucci (x06sa-cons-701) 609a87a986 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
2023-04-26 09:29:10 +02:00

50 lines
1.1 KiB
Python

def trash_sample():
"""
"""
evlog = Controller.getInstance().logEvent
evlog("trash_sample")
if robot.simulated:
time.sleep(3.0)
return
#Initial checks
robot.assert_no_task()
robot.reset_motion()
robot.wait_ready()
robot.assert_cleared()
#robot.assert_in_known_point()
was_cold = robot.is_cold()
#Enabling
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)
try:
for i in range(3):
robot.open_tool()
time.sleep(0.5)
robot.close_tool()
time.sleep(0.5)
finally:
robot.open_tool()
robot.move_heater(to_bottom = False)
if was_cold:
robot.move_cold()
else:
robot.move_home()