diff --git a/config/devices-modbus.properties b/config/devices-modbus.properties index d46c089..8fb5a36 100644 --- a/config/devices-modbus.properties +++ b/config/devices-modbus.properties @@ -1,50 +1,42 @@ -wago=ch.psi.pshell.modbus.ModbusTCP|wago-mxsc-1:502||| -led_ok_1=ch.psi.pshell.modbus.DigitalInput|wago 0||1000| -led_ok_2=ch.psi.pshell.modbus.DigitalInput|wago 1||1000| -led_ok_3=ch.psi.pshell.modbus.DigitalInput|wago 2||1000| -feedback_local_safety=ch.psi.pshell.modbus.DigitalInput|wago 3||1000| -feedback_psys_safety=ch.psi.pshell.modbus.DigitalInput|wago 4||1000| -filling_phase_separator=ch.psi.pshell.modbus.DigitalInput|wago 5||1000| -filling_dewar=ch.psi.pshell.modbus.DigitalInput|wago 6||1000| -dewar_level_high_alarm=ch.psi.pshell.modbus.DigitalInput|wago 7||1000| -guiding_tool_park=ch.psi.pshell.modbus.DigitalInput|wago 8||1000| -air_pressure_ok=ch.psi.pshell.modbus.DigitalInput|wago 9||1000|false -n2_pressure_ok=ch.psi.pshell.modbus.DigitalInput|wago 10||1000| -#spare_di_1=ch.psi.pshell.modbus.DigitalInput|wago 11||| -#spare_di_2=ch.psi.pshell.modbus.DigitalInput|wago 12||| -#spare_di_3=ch.psi.pshell.modbus.DigitalInput|wago 13||| -#spare_di_4=ch.psi.pshell.modbus.DigitalInput|wago 14||| -he_chamber_valve_1=ch.psi.pshell.modbus.DigitalInput|wago 15||1000| -he_chamber_valve_2=ch.psi.pshell.modbus.DigitalInput|wago 16||1000| -smc_magnet_status=ch.psi.pshell.modbus.DigitalInput|wago 17||1000| -smc_mounted_1=ch.psi.pshell.modbus.DigitalInput|wago 18||1000| -smc_mounted_2=ch.psi.pshell.modbus.DigitalInput|wago 19||1000| -relays=ch.psi.pshell.modbus.DigitalOutputArray|wago 0 16||1000| -release_local_safety=ch.psi.pshell.modbus.DigitalOutput|wago 0||| -release_psys_safety=ch.psi.pshell.modbus.DigitalOutput|wago 1||| -ln2_main_power=ch.psi.pshell.modbus.DigitalOutput|wago 2||| -rim_heater=ch.psi.pshell.modbus.DigitalOutput|wago 3||| -phase_separator_ln2=ch.psi.pshell.modbus.DigitalOutput|wago 4||| -dewar_ln2=ch.psi.pshell.modbus.DigitalOutput|wago 5|||false -valve_he_chamber=ch.psi.pshell.modbus.DigitalOutput|wago 6||| -gripper_dryer=ch.psi.pshell.modbus.DigitalOutput|wago 7||| -valve_1=ch.psi.pshell.modbus.DigitalOutput|wago 8||| -valve_2=ch.psi.pshell.modbus.DigitalOutput|wago 9||| -valve_3=ch.psi.pshell.modbus.DigitalOutput|wago 10||| -valve_4=ch.psi.pshell.modbus.DigitalOutput|wago 11||| -#spare_do_1=ch.psi.pshell.modbus.DigitalOutput|wago 12||| -smc_sup_det=ch.psi.pshell.modbus.DigitalOutput|wago 13||| -#spare_do_3=ch.psi.pshell.modbus.DigitalOutput|wago 14||| -#spare_do_4=ch.psi.pshell.modbus.DigitalOutput|wago 15||| -phase_separator_level=ch.psi.pshell.modbus.ReadonlyProcessVariable|wago 0||10000| -dewar_level=ch.psi.pshell.modbus.ReadonlyProcessVariable|wago 1||10000| -rim_heater_temp=ch.psi.pshell.modbus.ReadonlyProcessVariable|wago 2||10000| -#spare_ai_1=ch.psi.pshell.modbus.AnalogInput|wago 3|||true -smc_current_rb=ch.psi.pshell.modbus.ReadonlyProcessVariable|wago 4||1000| -#spare_ai_3=ch.psi.pshell.modbus.AnalogInput|wago 5||| -#spare_ai_4=ch.psi.pshell.modbus.AnalogInput|wago 6||| -#spare_ai_5=ch.psi.pshell.modbus.AnalogInput|wago 7||| -led_ctrl_1=ch.psi.pshell.modbus.ProcessVariable|wago 0||| -led_ctrl_2=ch.psi.pshell.modbus.ProcessVariable|wago 1||| -led_ctrl_3=ch.psi.pshell.modbus.ProcessVariable|wago 2||| -smc_current=ch.psi.pshell.modbus.ProcessVariable|wago 3||| +wago=ch.psi.pshell.modbus.ModbusTCP|tell6s-wago:502||| +led_ok_1=ch.psi.pshell.modbus.DigitalInput|wago 0||1000| +led_ok_2=ch.psi.pshell.modbus.DigitalInput|wago 1||1000| +led_ok_3=ch.psi.pshell.modbus.DigitalInput|wago 2||1000| +feedback_local_safety=ch.psi.pshell.modbus.DigitalInput|wago 3||1000| +feedback_psys_safety=ch.psi.pshell.modbus.DigitalInput|wago 4||1000| +filling_dewar=ch.psi.pshell.modbus.DigitalInput|wago 5||1000| +dewar_level_high_alarm=ch.psi.pshell.modbus.DigitalInput|wago 6||1000| +guiding_tool_park=ch.psi.pshell.modbus.DigitalInput|wago 7||1000| +air_pressure_ok=ch.psi.pshell.modbus.DigitalInput|wago 8||1000|false +n2_pressure_ok=ch.psi.pshell.modbus.DigitalInput|wago 9||1000| +smc_magnet_status=ch.psi.pshell.modbus.DigitalInput|wago 10||1000| +smc_mounted_1=ch.psi.pshell.modbus.DigitalInput|wago 11||1000| +smc_mounted_2=ch.psi.pshell.modbus.DigitalInput|wago 12||1000| +#spare_di_1=ch.psi.pshell.modbus.DigitalInput|wago 13||| +#spare_di_2=ch.psi.pshell.modbus.DigitalInput|wago 14||| +#spare_di_3=ch.psi.pshell.modbus.DigitalInput|wago 15||| +#spare_di_4=ch.psi.pshell.modbus.DigitalInput|wago 16||| +relays=ch.psi.pshell.modbus.DigitalOutputArray|wago 0 16||1000| +release_local_safety=ch.psi.pshell.modbus.DigitalOutput|wago 0||| +release_psys_safety=ch.psi.pshell.modbus.DigitalOutput|wago 1||| +#spare_do_1=ch.psi.pshell.modbus.DigitalOutput|wago 2||| +#spare_do_2=ch.psi.pshell.modbus.DigitalOutput|wago 3||| +#spare_do_3=ch.psi.pshell.modbus.DigitalOutput|wago 4||| +gripper_dryer=ch.psi.pshell.modbus.DigitalOutput|wago 5||| +smc_sup_det=ch.psi.pshell.modbus.DigitalOutput|wago 6||| +valve_1=ch.psi.pshell.modbus.DigitalOutput|wago 7||| +valve_2=ch.psi.pshell.modbus.DigitalOutput|wago 8||| +valve_3=ch.psi.pshell.modbus.DigitalOutput|wago 9||| +valve_4=ch.psi.pshell.modbus.DigitalOutput|wago 10||| +dewar_level=ch.psi.pshell.modbus.ReadonlyProcessVariable|wago 0||10000| +rim_heater_temp=ch.psi.pshell.modbus.ReadonlyProcessVariable|wago 1||10000| +#spare_ai_1=ch.psi.pshell.modbus.AnalogInput|wago 2|||false +#spare_ai_2=ch.psi.pshell.modbus.AnalogInput|wago 3||| +smc_current_rb=ch.psi.pshell.modbus.ReadonlyProcessVariable|wago 4||1000| +#spare_ai_3=ch.psi.pshell.modbus.AnalogInput|wago 5||| +#spare_ai_4=ch.psi.pshell.modbus.AnalogInput|wago 6||| +#spare_ai_5=ch.psi.pshell.modbus.AnalogInput|wago 7||| +led_ctrl_1=ch.psi.pshell.modbus.ProcessVariable|wago 0||| +led_ctrl_2=ch.psi.pshell.modbus.ProcessVariable|wago 1||| +led_ctrl_3=ch.psi.pshell.modbus.ProcessVariable|wago 2||| +smc_current=ch.psi.pshell.modbus.ProcessVariable|wago 3||| diff --git a/config/settings.properties b/config/settings.properties index 7e99936..90cadc5 100644 --- a/config/settings.properties +++ b/config/settings.properties @@ -1,10 +1,10 @@ -#Tue Jan 22 15:05:15 CET 2019 +#Wed Jan 23 17:07:28 CET 2019 barcode_reader_scan_pucks=false -dry_mount_counter=3 -dry_timestamp=1.548165108162E9 +dry_mount_counter=0 +dry_timestamp=1.548248191529E9 force_dry_mount_count=0 force_dry_timeout=0 imaging_enabled=false led_level=0.0 -mounted_sample_position=A315 +mounted_sample_position=A17 puck_types=true diff --git a/plugins/MXSC-1.10.0.jar b/plugins/MXSC-1.10.0.jar index 0cc4b96..a66b349 100644 Binary files a/plugins/MXSC-1.10.0.jar and b/plugins/MXSC-1.10.0.jar differ diff --git a/plugins/SmartMagnetPanel.java b/plugins/SmartMagnetPanel.java index 185028d..2108837 100644 --- a/plugins/SmartMagnetPanel.java +++ b/plugins/SmartMagnetPanel.java @@ -47,11 +47,11 @@ public class SmartMagnetPanel extends DevicePanel { switch(state){ case Ready: ledStatus.setColor(Color.GREEN); - ledMounted.setColor(Color.BLACK); + ledMounted.setColor(Color.GREEN); break; case Busy: ledStatus.setColor(Color.GREEN); - ledMounted.setColor(Color.GREEN); + ledMounted.setColor(Color.ORANGE); break; case Fault: ledStatus.setColor(Color.RED); diff --git a/script/data/samples.py b/script/data/samples.py index 44064a2..353cd72 100644 --- a/script/data/samples.py +++ b/script/data/samples.py @@ -36,7 +36,8 @@ def save_samples_info(): data = get_samples_info(True) output_file = open( get_context().setup.expandPath("{context}/samples_info.json") , "w") output_file.write(data) - output_file.close() + output_file.close() + get_context().sendEvent("samples_updated", True) def restore_samples_info(): try: diff --git a/script/devices/Hexiposi.py b/script/devices/Hexiposi.py index 10ea4ab..7c7c452 100644 --- a/script/devices/Hexiposi.py +++ b/script/devices/Hexiposi.py @@ -134,7 +134,9 @@ class Hexiposi(DiscretePositionerBase): # return self.moving == False def updateState(self): - if self.offline: + if self.isSimulated(): + self.setState(State.Ready) + elif self.offline: self.setState(State.Offline) elif self.homed == False: self.setState(self.homing_state) @@ -148,6 +150,9 @@ class Hexiposi(DiscretePositionerBase): #http://myriotell:8003/hexiposi/get dev = Hexiposi("hexiposi", "myriotell6s") +#If no Rotation Lid is mounted set it to simulated +#dev.setSimulated() + add_device(dev, True) hexiposi.polling=1000 #print dev.url diff --git a/script/devices/RobotSC.py b/script/devices/RobotSC.py index 5169545..7ccc2ce 100644 --- a/script/devices/RobotSC.py +++ b/script/devices/RobotSC.py @@ -63,12 +63,14 @@ class RobotSC(RobotTCP): def put_gonio(self): pin_offset = get_pin_offset() pin_angle_offset = get_pin_angle_offset() + print "Pin offset = " + str(pin_offset) self.start_task('putGonio', pin_offset) self.wait_task_finished(TASK_WAIT_ROBOT_POLLING) self.assert_gonio() def get_gonio(self): pin_offset = get_pin_offset() + print "Pin offset = " + str(pin_offset) self.start_task('getGonio', pin_offset) self.wait_task_finished(TASK_WAIT_ROBOT_POLLING) self.assert_gonio() diff --git a/script/local.py b/script/local.py index 0c95a75..6907bfe 100644 --- a/script/local.py +++ b/script/local.py @@ -143,6 +143,13 @@ def system_check(robot_move=True): raise Exception("Psys safety not released") if not guiding_tool_park.read(): raise Exception("Guiding tool not parked") + +def system_check_msg(): + try: + system_check(True) + return "Ok" + except: + return sys.exc_info()[1] def get_puck_elect_detection(segment, puck): return str(Controller.getInstance().getPuck(str(segment).upper() + str(puck)).detection) @@ -278,6 +285,14 @@ context = get_context() cover_detection_debug = False +in_mount_position = False + + +def assert_mount_position(): + print "Source: ", get_exec_pars().source + if not in_mount_position and get_exec_pars().source == CommandSource.server : + raise Exception("Not in mount position") + def is_puck_loading(): return robot.state == State.Ready and robot.take()["pos"] == 'pPark' and \ diff --git a/script/motion/mount.py b/script/motion/mount.py index 05c322d..9ce9b2c 100644 --- a/script/motion/mount.py +++ b/script/motion/mount.py @@ -10,6 +10,11 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False) start = time.time() is_aux = (segment == AUX_SEGMENT) + + #ZACH + #needs_chilling = not is_aux and (not robot.is_cold()) + #needs_drying = is_aux and robot.is_cold() + puck_address = get_puck_address(puck) if puck_address is None: puck_obj = get_puck_obj_by_id(puck) @@ -36,10 +41,16 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False) robot.wait_ready() robot.assert_cleared() #robot.assert_in_known_point() - hexiposi.assert_homed() + hexiposi.assert_homed() + assert_mount_position() try: + #ZACH + #if needs_chilling: + # robot.move_cold() + # time.sleep(30.0) + smart_magnet.enforce_sample_detection() if smart_magnet.check_mounted(idle_time=0.25, timeout = 1.0) == True: if auto_unmount and (get_setting("mounted_sample_position") is not None): @@ -53,6 +64,10 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False) #Enabling enable_motion() + #ZACH + #if needs_drying: + # dry(wait_cold=-1) + if is_aux: if not robot.is_aux(): robot.move_aux() diff --git a/script/motion/trash.py b/script/motion/trash.py index 0057a2d..8b37f2c 100644 --- a/script/motion/trash.py +++ b/script/motion/trash.py @@ -31,6 +31,6 @@ def trash(): robot.move_heater(to_bottom = False) - robot.move_home() + robot.move_cold() \ No newline at end of file diff --git a/script/motion/unmount.py b/script/motion/unmount.py index 41b0401..495c2e5 100644 --- a/script/motion/unmount.py +++ b/script/motion/unmount.py @@ -27,6 +27,7 @@ def unmount(segment = None, puck = None, sample = None, force=False): robot.assert_cleared() #robot.assert_in_known_point() hexiposi.assert_homed() + assert_mount_position() set_status("Umounting: " + str(segment) + str(puck) + str(sample)) @@ -47,7 +48,7 @@ def unmount(segment = None, puck = None, sample = None, force=False): visual_check_hexiposi(segment) #location = robot.get_current_point() - + if not robot.is_gonio(): robot.move_gonio()