From 0871ae0decabfadf516e6509b983de47425b0a54 Mon Sep 17 00:00:00 2001 From: gac-S_Changer Date: Mon, 21 Jan 2019 14:36:44 +0100 Subject: [PATCH] --- config/config.properties | 4 ++-- config/devices.properties | 2 +- config/settings.properties | 6 +++--- context/Preferences.dat | Bin 2913 -> 2913 bytes devices/dewar_level.properties | 6 +++--- devices/led_ctrl_1.properties | 2 +- devices/led_ctrl_2.properties | 2 +- devices/led_ctrl_3.properties | 2 +- devices/smart_magnet.properties | 10 +++++----- plugins/Commands.form | 4 ++-- plugins/Commands.java | 4 ++-- script/devices/RobotSC.py | 8 ++------ script/devices/RobotTCP.py | 23 +++++++++++++++++++---- script/devices/Wago.py | 2 +- script/motion/dry.py | 2 +- script/motion/recover.py | 6 +++--- 16 files changed, 47 insertions(+), 36 deletions(-) diff --git a/config/config.properties b/config/config.properties index 5d22e9c..a9f1c22 100644 --- a/config/config.properties +++ b/config/config.properties @@ -1,4 +1,4 @@ -#Wed Dec 12 09:19:49 CET 2018 +#Tue Jan 15 11:47:52 CET 2019 autoSaveScanData=true commandExecutionEvents=false createSessionFiles=true @@ -13,7 +13,7 @@ depthDimension=0 hostName=null instanceName=X06SA logDaysToLive=30 -logLevel=Fine +logLevel=Finer logLevelConsole=Off logPath={logs}/{date}_{time} notificationLevel=null diff --git a/config/devices.properties b/config/devices.properties index b00572c..d3f0723 100644 --- a/config/devices.properties +++ b/config/devices.properties @@ -1,6 +1,6 @@ img=ch.psi.pshell.prosilica.Prosilica|204464 "PacketSize=1504;PixelFormat=Mono8;BinningX=1;BinningY=1;RegionX=300;RegionY=200;Width=1000;Height=1000;MulticastEnable=Off"||-200|false gripper_cam=ch.psi.pshell.imaging.MjpegSource|http://axis-accc8ea5e463.psi.ch/axis-cgi/mjpg/video.cgi?camera=1 reopen||-200|false -#monitoring_cam=ch.psi.pshell.imaging.MjpegSource|http://axis-accc8ea5e463.psi.ch/axis-cgi/mjpg/video.cgi?camera=2 reopen||-200| +monitoring_cam=ch.psi.pshell.imaging.MjpegSource|http://axis-accc8ea5e463.psi.ch/axis-cgi/mjpg/video.cgi?camera=2 reopen||-200| #top_cam=ch.psi.pshell.imaging.MjpegSource|http://axis-accc8ea5e463.psi.ch/axis-cgi/mjpg/video.cgi?camera=3 true||-200| #cam=ch.psi.pshell.epics.AreaDetector|MX-SAMCAM||| mscan_pin=ch.psi.pshell.serial.TcpDevice|mscan-tell6s-pin:2001||| diff --git a/config/settings.properties b/config/settings.properties index f14eede..8b29ea7 100644 --- a/config/settings.properties +++ b/config/settings.properties @@ -1,8 +1,8 @@ -#Mon Jan 14 18:14:03 CET 2019 +#Mon Jan 21 13:16:38 CET 2019 barcode_reader_scan_pucks=false dry_mount_counter=0 -dry_timestamp=1.547481588887E9 +dry_timestamp=1.547823177733E9 imaging_enabled=false led_level=0.0 -mounted_sample_position=F57 +mounted_sample_position=F31 puck_types=true diff --git a/context/Preferences.dat b/context/Preferences.dat index 2892ee81cc07e7068a5d4d674daa4cead683658c..5aabc0005f91b61dee437ed7ff46fedc023c264d 100644 GIT binary patch delta 27 jcmaDT_E2oY7M965Y>Jz=uuNiPw4UtFrn - + @@ -150,7 +150,7 @@ - + diff --git a/plugins/Commands.java b/plugins/Commands.java index f861b06..c1f41b5 100644 --- a/plugins/Commands.java +++ b/plugins/Commands.java @@ -172,7 +172,7 @@ public class Commands extends Panel { jLabel6.setText("Heat time(s):"); - spinnerDryTime.setModel(new javax.swing.SpinnerNumberModel(30.0d, 1.0d, 30.0d, 1.0d)); + spinnerDryTime.setModel(new javax.swing.SpinnerNumberModel(30.0d, 1.0d, 50.0d, 1.0d)); buttonDry.setText("Dry"); buttonDry.addActionListener(new java.awt.event.ActionListener() { @@ -181,7 +181,7 @@ public class Commands extends Panel { } }); - spinnerDrySpeed.setModel(new javax.swing.SpinnerNumberModel(0.5d, 0.1d, 10.0d, 1.0d)); + spinnerDrySpeed.setModel(new javax.swing.SpinnerNumberModel(0.4d, 0.1d, 1.0d, 0.1d)); jLabel7.setText("Speed(%):"); diff --git a/script/devices/RobotSC.py b/script/devices/RobotSC.py index 4a2ad5c..5169545 100644 --- a/script/devices/RobotSC.py +++ b/script/devices/RobotSC.py @@ -90,11 +90,6 @@ class RobotSC(RobotTCP): self.wait_task_finished(TASK_WAIT_ROBOT_POLLING) self.assert_scanner() - def move_scanner(self): - self.start_task('moveScanner') - self.wait_task_finished(TASK_WAIT_ROBOT_POLLING) - self.assert_scanner() - #def do_scan(self): # self.start_task('doScan') # self.wait_task_finished(TASK_WAIT_ROBOT_POLLING) @@ -271,11 +266,12 @@ else: add_device(RobotSC("robot", "TellRobot6S:1000"), force = True) +#robot.latency = 0.005 robot.set_default_desc(DESC_DEFAULT) robot.default_speed = 20 robot.set_frame(FRAME_DEFAULT) robot.set_tool(TOOL_DEFAULT) -robot.setPolling(DEFAULT_ROBOT_POLLING) +robot.setPolling(DEFAULT_ROBOT_POLLING) robot.get_current_point() #TODO: REMOVE WHEN CURRENT POINT REPORTED BY POLLING MESSAGE diff --git a/script/devices/RobotTCP.py b/script/devices/RobotTCP.py index a34da81..313f592 100644 --- a/script/devices/RobotTCP.py +++ b/script/devices/RobotTCP.py @@ -47,7 +47,9 @@ class RobotTCP(TcpDevice, Stoppable): self.polling_interval = 0.01 self.reset = True self.default_tolerance = 5 - self.default_speed = 100 + self.default_speed = 100 + self.latency = 0 + self.last_msg_timestamp = 0 self.task_start_retries = 3 self.exception_on_task_start_failure = True #Tasks may start and be finished when checked @@ -135,6 +137,10 @@ class RobotTCP(TcpDevice, Stoppable): raise Exception ("Robot not in known point") def _sendReceive(self, msg_id, msg = "", timeout = None): + if self.latency >0: + timespan = time.time() - self.last_msg_timestamp + if timespan150): @@ -144,6 +150,7 @@ class RobotTCP(TcpDevice, Stoppable): if self.isSimulated(): return "" rx = self.sendReceive(tx, msg_id, self.trailer , 0, self.timeout if timeout is None else timeout, self.retries) + self.last_msg_timestamp = time.time() rx=rx[:-1] #Remove 0A self.getLogger().finer("RX = '" + str(rx) + "'") if rx[:3] != msg_id: @@ -547,8 +554,10 @@ class RobotTCP(TcpDevice, Stoppable): if self.get_task_status(name)[0] != -1: raise Exception("Task already exists: " + name) - #taskCreate "t1", 10, read(sMessage) - cmd = 'taskCreate "' + name + '", ' + str(priority) + ', ' + program + '(' + if priority<1 or priority > 100: + raise Exception("Invalid priority: " + str(priority)) + + cmd = program + '(' for i in range(len(args)): val = args[i] if type(val) == bool: @@ -556,7 +565,13 @@ class RobotTCP(TcpDevice, Stoppable): elif val == False: val = "false" cmd += str(val) + (',' if (i<(len(args)-1)) else '') cmd+=')' - self.evaluate(cmd) + + #TODO: in new robot exec taskCreate is freezing controller + #REMOVE if bug is fixed + self.execute('task_create',name, str(priority), program, *args) + #self.evaluate('taskCreate "' + name + '", ' + str(priority) + ', ' + cmd) + + def task_suspend(self, name): self.evaluate('taskSuspend("' + str(name)+ '")') diff --git a/script/devices/Wago.py b/script/devices/Wago.py index d76a5b0..9c76bec 100644 --- a/script/devices/Wago.py +++ b/script/devices/Wago.py @@ -93,7 +93,7 @@ def release_psys(): ################################################################################################### # Drier ################################################################################################### -MAX_HEATER_TIME = 60000 +MAX_HEATER_TIME = 70000 def set_air_stream(state): """ diff --git a/script/motion/dry.py b/script/motion/dry.py index c7877da..137a384 100644 --- a/script/motion/dry.py +++ b/script/motion/dry.py @@ -1,6 +1,6 @@ -def dry(heat_time=30.0, speed=0.5, wait_cold = 30.0): +def dry(heat_time=40.0, speed=0.4, wait_cold = 30.0): """ heat_time (float): in seconds speed (float): % of nominal speed diff --git a/script/motion/recover.py b/script/motion/recover.py index b3a5244..2d3eeb2 100644 --- a/script/motion/recover.py +++ b/script/motion/recover.py @@ -5,10 +5,10 @@ import org.apache.commons.math3.geometry.euclidean.threed.Line as Line3D RECOVER_DESC = "mRecovery" RECOVER_TOOL = TOOL_DEFAULT -known_segments = [ ("pHome", "pPark", 100), \ - ("pScan", "pGonioA", 80), \ +known_segments = [ ("pHome", "pPark", 60), \ + ("pScan", "pGonioA", 100), \ ("pPark", "pScan", 25), \ - ("pScan", "pHeater", 75), \ + ("pScan", "pHeater", 50), \ ("pHome", "pDewar", 10), \ ("pGonioA", "pGonioG", 10), \ ("pHeater", "pHeatB", 10), \