def mount(segment, puck, sample, force=False): """ """ print "mount: ", segment, puck, sample, force start = time.time() #Initial checks assertValidAddress(segment, puck, sample) robot.assert_no_task() robot.reset_motion() robot.state.assertReady() robot.assert_cleared() #robot.assert_in_known_point() hexiposi.assert_homed() if smart_magnet.check_mounted(idle_time=0.25, timeout = 1.0) == True: raise Exception("Pin detected on gonio") #location = robot.get_current_point() #Enabling enable_motion() set_hexiposi(segment) if not force: visual_check_hexiposi(segment) if not robot.is_dewar(): robot.move_dewar() robot.get_dewar(segment, puck, sample) robot.move_gonio() smart_magnet.set_mount_current() try: robot.put_gonio() robot.move_dewar() if smart_magnet.check_mounted(idle_time=0.25, timeout = 1.0) == False: raise Exception("No pin detected on gonio") finally: smart_magnet.set_default_current()