diff --git a/config/config.properties b/config/config.properties index f2b87fd..bd42d04 100644 --- a/config/config.properties +++ b/config/config.properties @@ -1,4 +1,4 @@ -#Tue Feb 05 08:51:03 CET 2019 +#Wed Feb 06 11:13:25 CET 2019 autoSaveScanData=true commandExecutionEvents=false createSessionFiles=true @@ -17,6 +17,7 @@ logLevel=Fine logLevelConsole=Off logPath={logs}/{date}_{time} notificationLevel=null +saveCommandStatistics=true scanStreamerPort=-1 serverEnabled=true serverPort=8080 diff --git a/config/settings.properties b/config/settings.properties index 81386ef..84e0683 100644 --- a/config/settings.properties +++ b/config/settings.properties @@ -1,12 +1,12 @@ -#Tue Feb 05 15:50:04 CET 2019 +#Tue Feb 12 13:16:24 CET 2019 barcode_reader_scan_pucks=false -dry_mount_counter=5 -dry_timestamp=1.549363107489E9 -force_dry_mount_count=20 +dry_mount_counter=4 +dry_timestamp=1.549971958622E9 +force_dry_mount_count=15 force_dry_timeout=0 imaging_enabled=false led_level=0.0 -mounted_sample_position=E53 +mounted_sample_position=B34 pin_offset=0.0 puck_types=true room_temperature_enabled=false diff --git a/devices/A1.properties b/devices/A1.properties index ffc6cf1..a99d5c9 100644 --- a/devices/A1.properties +++ b/devices/A1.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:22:35 CET 2019 -detection=Both +#Wed Feb 06 20:39:47 CET 2019 +detection=Mechanical disabled=true diff --git a/devices/A2.properties b/devices/A2.properties index 81154ea..9a7a0f1 100644 --- a/devices/A2.properties +++ b/devices/A2.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:00:54 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/A3.properties b/devices/A3.properties index 81154ea..84706f7 100644 --- a/devices/A3.properties +++ b/devices/A3.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both -disabled=false +#Thu Feb 07 09:52:13 CET 2019 +detection=Mechanical +disabled=true diff --git a/devices/A4.properties b/devices/A4.properties index 81154ea..6a96059 100644 --- a/devices/A4.properties +++ b/devices/A4.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 13:50:08 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/A5.properties b/devices/A5.properties index 81154ea..5a80518 100644 --- a/devices/A5.properties +++ b/devices/A5.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:01:09 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/B1.properties b/devices/B1.properties index 81154ea..e336006 100644 --- a/devices/B1.properties +++ b/devices/B1.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:01:15 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/B2.properties b/devices/B2.properties index e9ea95f..7bf2d32 100644 --- a/devices/B2.properties +++ b/devices/B2.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:30:50 CET 2019 -detection=Both +#Wed Feb 06 11:01:20 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/B3.properties b/devices/B3.properties index 81154ea..d6c3b95 100644 --- a/devices/B3.properties +++ b/devices/B3.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:00:22 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/B4.properties b/devices/B4.properties index 81154ea..07972b6 100644 --- a/devices/B4.properties +++ b/devices/B4.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:01:46 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/B5.properties b/devices/B5.properties index 81154ea..1009723 100644 --- a/devices/B5.properties +++ b/devices/B5.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:01:51 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/C1.properties b/devices/C1.properties index 81154ea..cb744a3 100644 --- a/devices/C1.properties +++ b/devices/C1.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:01:55 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/C2.properties b/devices/C2.properties index 81154ea..e18400b 100644 --- a/devices/C2.properties +++ b/devices/C2.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:02:02 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/C3.properties b/devices/C3.properties index 81154ea..1f66279 100644 --- a/devices/C3.properties +++ b/devices/C3.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:02:06 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/C4.properties b/devices/C4.properties index 81154ea..37b7170 100644 --- a/devices/C4.properties +++ b/devices/C4.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:02:11 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/C5.properties b/devices/C5.properties index 81154ea..c4df46c 100644 --- a/devices/C5.properties +++ b/devices/C5.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:02:19 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/D1.properties b/devices/D1.properties index 81154ea..aa52ecf 100644 --- a/devices/D1.properties +++ b/devices/D1.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:02:24 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/D2.properties b/devices/D2.properties index 81154ea..c60b5f8 100644 --- a/devices/D2.properties +++ b/devices/D2.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:02:29 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/D3.properties b/devices/D3.properties index 81154ea..eeee766 100644 --- a/devices/D3.properties +++ b/devices/D3.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:02:33 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/D4.properties b/devices/D4.properties index 81154ea..1dfe8ba 100644 --- a/devices/D4.properties +++ b/devices/D4.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:02:38 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/D5.properties b/devices/D5.properties index 81154ea..a98fde2 100644 --- a/devices/D5.properties +++ b/devices/D5.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:02:43 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/E1.properties b/devices/E1.properties index 81154ea..4008403 100644 --- a/devices/E1.properties +++ b/devices/E1.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:03:08 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/E2.properties b/devices/E2.properties index 81154ea..dc5ee8f 100644 --- a/devices/E2.properties +++ b/devices/E2.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:03:13 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/E3.properties b/devices/E3.properties index 81154ea..e14fd6b 100644 --- a/devices/E3.properties +++ b/devices/E3.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:03:18 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/E4.properties b/devices/E4.properties index 8d60a33..2ba4cae 100644 --- a/devices/E4.properties +++ b/devices/E4.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:52:26 CET 2019 -detection=Both +#Wed Feb 06 11:03:23 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/E5.properties b/devices/E5.properties index 81154ea..0bb0b86 100644 --- a/devices/E5.properties +++ b/devices/E5.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:03:27 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/F1.properties b/devices/F1.properties index 81154ea..f3f127a 100644 --- a/devices/F1.properties +++ b/devices/F1.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:03:33 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/F2.properties b/devices/F2.properties index 81154ea..f3a471b 100644 --- a/devices/F2.properties +++ b/devices/F2.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:03:37 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/F3.properties b/devices/F3.properties index 81154ea..2762836 100644 --- a/devices/F3.properties +++ b/devices/F3.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both -disabled=false +#Sat Feb 09 21:22:22 CET 2019 +detection=Mechanical +disabled=true diff --git a/devices/F4.properties b/devices/F4.properties index 81154ea..464bca9 100644 --- a/devices/F4.properties +++ b/devices/F4.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:03:45 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/F5.properties b/devices/F5.properties index 81154ea..a7820d1 100644 --- a/devices/F5.properties +++ b/devices/F5.properties @@ -1,3 +1,3 @@ -#Tue Feb 05 15:17:58 CET 2019 -detection=Both +#Wed Feb 06 11:03:48 CET 2019 +detection=Mechanical disabled=false diff --git a/devices/smart_magnet.properties b/devices/smart_magnet.properties index b74c530..2ca48ac 100644 --- a/devices/smart_magnet.properties +++ b/devices/smart_magnet.properties @@ -1,8 +1,8 @@ -#Tue Feb 05 11:22:07 CET 2019 -holdingCurrent=50.0 +#Tue Feb 12 11:31:27 CET 2019 +holdingCurrent=60.0 mountCurrent=20.0 remanenceCurrent=-10.0 -restingCurrent=30.0 +restingCurrent=20.0 reverseCurrent=-10.0 reverseTime=0.4 unmountCurrent=20.0 diff --git a/plugins/MXSC-1.10.0.jar b/plugins/MXSC-1.10.0.jar index 992d5bb..ec1f1e9 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 2bfd831..589fb82 100644 --- a/plugins/SmartMagnetPanel.java +++ b/plugins/SmartMagnetPanel.java @@ -290,7 +290,7 @@ public class SmartMagnetPanel extends DevicePanel { }//GEN-LAST:event_buttonSupressOffActionPerformed private void buttonConfigurationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonConfigurationActionPerformed - try { + try { this.showConfigEditor(true, false); } catch (Exception ex) { Logger.getLogger(SmartMagnetPanel.class.getName()).log(Level.SEVERE, null, ex); diff --git a/script/data/samples.py b/script/data/samples.py index 353cd72..4cc45b9 100644 --- a/script/data/samples.py +++ b/script/data/samples.py @@ -134,18 +134,32 @@ def update_puck_table(): #Sample mount/unmount +def same_address(puck_add_1, sample_pos_1, puck_add_2, sample_pos_2): + if str(puck_add_1) != str(puck_add_2): + return False + try: + sample_pos_1 = int(sample_pos_1) + except: + return False + try: + sample_pos_2 = int(sample_pos_2) + except: + return False + return sample_pos_1 == sample_pos_2 + + def update_samples_info_sample_mount(puck_address, sample_position, sample_detected, sample_id): try: - if (samples_info is not None) and (puck_address is not None): + if (samples_info is not None) and (puck_address is not None): for si in samples_info: - if str(si["puckAddress"]) == str(puck_address) and str(si["samplePosition"]) == str(sample_position): + if same_address( si["puckAddress"], si["samplePosition"], puck_address, sample_position): if sample_detected: if si["sampleStatus"] != "Mounted": - si["sampleStatus"] = "Mounted" + si["sampleStatus"] = "Mounted" try: mount_count = int(si["sampleMountCount"]) except: - mount_count = 0 + mount_count = 0 si["sampleMountCount"] = mount_count + 1 else: si["sampleStatus"] = "Unknown" @@ -157,12 +171,13 @@ def update_samples_info_sample_mount(puck_address, sample_position, sample_detec return except: pass + def update_samples_info_sample_unmount(puck_address, sample_position): try: if (samples_info is not None) and (puck_address is not None): for si in samples_info: - if str(si["puckAddress"]) == str(puck_address) and str(si["samplePosition"]) == str(sample_position): + if same_address( si["puckAddress"], si["samplePosition"], puck_address, sample_position): si["sampleStatus"] = "HasBeenMounted" save_samples_info() return @@ -173,7 +188,7 @@ def update_samples_info_sample_scan(puck_address, sample_position, sample_detect try: if (samples_info is not None) and (puck_address is not None): for si in samples_info: - if str(si["puckAddress"]) == str(puck_address) and str(si["samplePosition"]) == str(sample_position): + if same_address( si["puckAddress"], si["samplePosition"], puck_address, sample_position): if sample_detected: if si["sampleStatus"] == "Unknown": si["sampleStatus"] = "Present" @@ -185,7 +200,7 @@ def update_samples_info_sample_scan(puck_address, sample_position, sample_detect save_samples_info() return except: - pass + pass diff --git a/script/devices/SmartMagnet.py b/script/devices/SmartMagnet.py index 8039798..0736fdf 100644 --- a/script/devices/SmartMagnet.py +++ b/script/devices/SmartMagnet.py @@ -104,7 +104,8 @@ class SmartMagnet(DeviceBase): self.set_resting_current() def is_resting_current(self): - return self.get_current() == self.config.getFieldValue("restingCurrent") + is_resting = 2.0 > abs( float(self.get_current()) - float(self.config.getFieldValue("restingCurrent")) ) + return is_resting def apply_reverse(self): diff --git a/script/motion/mount.py b/script/motion/mount.py index b49673f..63ec906 100644 --- a/script/motion/mount.py +++ b/script/motion/mount.py @@ -55,7 +55,8 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False) smart_magnet.set_supress(False) time.sleep(0.2) #To better dectect sample - smart_magnet.apply_resting() + smart_magnet.apply_resting() + time.sleep(0.5) 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): #auto_unmount set to true so detection remains enabled diff --git a/script/motion/recover.py b/script/motion/recover.py index 06b628e..31e22f9 100644 --- a/script/motion/recover.py +++ b/script/motion/recover.py @@ -118,7 +118,7 @@ def move_to_safest_point(segment, vicinity_tolerance = 100): #print "Recovered to point " + str(robot.get_curjoint_or_pointrent_point()) -def recover(): +def recover(move_park = True): #Initial checks robot.assert_no_task() robot.reset_motion() @@ -144,7 +144,12 @@ def recover(): location = robot.get_current_point() if location is None: raise Exception("Robot didn't reach known point") - return "Success recovering to point: " + str(location) + print "Success recovered to point: " + str(location) + if move_park: + robot.move_park() + return "Success recovered to park position" + else: + return "Success recovered to point: " + str(location) #finally: # robot.set_default_speed() if not is_on_known_segment: