Fix hexiposi isuues
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#Tue Jan 26 15:45:35 CET 2021
|
||||
#Tue Jan 26 15:55:46 CET 2021
|
||||
autoSaveScanData=true
|
||||
simulation=false
|
||||
commandExecutionEvents=false
|
||||
@@ -19,7 +19,7 @@ hideServerMessages=true
|
||||
serverPort=8080
|
||||
versionTrackingEnabled=true
|
||||
dataPath={data}/{year}_{month}/{date}/{date}_{time}_{name}
|
||||
serverEnabled=false
|
||||
serverEnabled=true
|
||||
dataScanReleaseRecords=false
|
||||
depthDimension=0
|
||||
dataScanPreserveTypes=false
|
||||
|
||||
@@ -55,7 +55,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|||
|
||||
#th2e=ch.psi.pshell.modbus.ModbusTCP|129.129.110.:502|||
|
||||
#th2e=ch.psi.pshell.modbus.ModbusTCP|129.129.110.200:502|||
|
||||
#temperature=ch.psi.pshell.modbus.ReadonlyProcessVariable|th2e 1||10000|
|
||||
#humidity=ch.psi.pshell.modbus.ReadonlyProcessVariable|th2e 5||10000|
|
||||
#dew_point=ch.psi.pshell.modbus.ReadonlyProcessVariable|th2e 9||10000|
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#Tue Jan 26 15:46:23 CET 2021
|
||||
dry_mount_counter=4
|
||||
#Tue Jun 29 11:41:14 CEST 2021
|
||||
dry_mount_counter=0
|
||||
room_temperature_enabled=false
|
||||
pin_offset=1.0
|
||||
pin_offset=-0.0
|
||||
puck_types=true
|
||||
pin_cleaner_timer=60
|
||||
imaging_enabled=false
|
||||
dry_timestamp=1.611668783052E9
|
||||
dry_timestamp=1.624897174596E9
|
||||
roi_h=1000
|
||||
led_level=0.0
|
||||
beamline_status_enabled=false
|
||||
force_dry_mount_count=15
|
||||
force_dry_mount_count=12
|
||||
roi_y=123
|
||||
barcode_reader_scan_pucks=false
|
||||
cold_position_timeout=3600
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#Thu Jan 21 10:33:11 CET 2021
|
||||
FileSequentialNumber=207
|
||||
#Sat Jun 26 08:39:48 CEST 2021
|
||||
FileSequentialNumber=224
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#Fri Jan 31 16:58:30 CET 2020
|
||||
#Fri Mar 12 11:42:04 CET 2021
|
||||
detection=Mechanical
|
||||
disabled=false
|
||||
disabled=true
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#Thu Jan 21 09:38:30 CET 2021
|
||||
#Thu Apr 01 10:21:16 CEST 2021
|
||||
detection=Mechanical
|
||||
disabled=false
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#Thu Sep 19 08:23:43 CEST 2019
|
||||
#Sat May 01 01:32:19 CEST 2021
|
||||
detection=Mechanical
|
||||
disabled=false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#Thu Jan 21 10:56:46 CET 2021
|
||||
#Mon May 31 09:18:14 CEST 2021
|
||||
minValue=0.0
|
||||
unit=V
|
||||
offset=0.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#Thu Jan 21 10:56:46 CET 2021
|
||||
#Mon May 31 09:18:14 CEST 2021
|
||||
minValue=0.0
|
||||
unit=V
|
||||
offset=0.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#Thu Jan 21 10:56:46 CET 2021
|
||||
#Mon May 31 09:18:14 CEST 2021
|
||||
minValue=0.0
|
||||
unit=V
|
||||
offset=0.0
|
||||
|
||||
+35
-18
@@ -43,7 +43,7 @@ class Hexiposi(DiscretePositionerBase):
|
||||
if (self.homed==False):
|
||||
rback = self.UNKNOWN_POSITION
|
||||
else:
|
||||
rback = self._posIndexToName(self.dpos)
|
||||
rback = self._dicretePositionToName(self.dpos)
|
||||
if (rback == self.UNKNOWN_POSITION) or (rback != self.rback):
|
||||
self.moved = True
|
||||
self.rback = rback
|
||||
@@ -86,7 +86,11 @@ class Hexiposi(DiscretePositionerBase):
|
||||
self.stop_move()
|
||||
|
||||
def doRead(self):
|
||||
return str(self.val)
|
||||
#return str(self.val)\
|
||||
try:
|
||||
return self.getPositions()[self.val]
|
||||
except:
|
||||
self.UNKNOWN_POSITION
|
||||
|
||||
def doReadReadback(self):
|
||||
self.get_status()
|
||||
@@ -98,24 +102,40 @@ class Hexiposi(DiscretePositionerBase):
|
||||
val = ord(val) - ord('B') +1
|
||||
if val==0: val=6 #A
|
||||
return val
|
||||
|
||||
|
||||
|
||||
def _posIndexToName(self, val):
|
||||
if self.dpos == 1: return "B" # "A"
|
||||
elif self.dpos == 2:return "C" # "B"
|
||||
elif self.dpos == 4:return "D" # "C"
|
||||
elif self.dpos == 8:return "E" # "D"
|
||||
elif self.dpos == 16:return "F" # "E"
|
||||
elif self.dpos == 32:return "A" # "F"
|
||||
if val == 1: return "B" # "A"
|
||||
elif val == 2:return "C" # "B"
|
||||
elif val == 3:return "D" # "C"
|
||||
elif val == 4:return "E" # "D"
|
||||
elif val == 5:return "F" # "E"
|
||||
elif val == 6:return "A" # "F"
|
||||
else: return self.UNKNOWN_POSITION
|
||||
|
||||
def _dicretePositionToName(self, val):
|
||||
if val == 1: return "B" # "A"
|
||||
elif val == 2:return "C" # "B"
|
||||
elif val == 4:return "D" # "C"
|
||||
elif val == 8:return "E" # "D"
|
||||
elif val == 16:return "F" # "E"
|
||||
elif val == 32:return "A" # "F"
|
||||
else: return self.UNKNOWN_POSITION
|
||||
|
||||
def doWrite(self, val):
|
||||
def doWrite(self, value):
|
||||
self.assert_homed()
|
||||
#val = ord(val) - ord('A') +1
|
||||
val = self._posNameToIndex(val)
|
||||
val = self._posNameToIndex(value)
|
||||
readback = self._posNameToIndex(self.rback)
|
||||
|
||||
if (val is None) or val<1 or val>6:
|
||||
raise Exception("Invalid value: " + str(val))
|
||||
moving = val != self.val
|
||||
print "Moving hexiposi to:", val, " current:", self.val, " moving:",moving
|
||||
#moving = val != self.val or (val!=readback)
|
||||
moving = val!=readback
|
||||
log_str = "Moving hexiposi to:" + str(value) + " pos:" +str(self._posIndexToName(self.val)) + " rbk:" +str(self.rback) + " moving:" + str(moving) + " enc:" + str(self.pos)
|
||||
Controller.getInstance().logEvent(log_str); log(log_str, False) ; print log_str
|
||||
|
||||
|
||||
self.val = val
|
||||
self.move_pos(self.val)
|
||||
#Workaround as state does not changes immediatelly
|
||||
@@ -131,12 +151,9 @@ class Hexiposi(DiscretePositionerBase):
|
||||
break
|
||||
self.update()
|
||||
|
||||
def is_in_position(self, pos):
|
||||
return self.take() == pos
|
||||
|
||||
|
||||
def assert_in_position(self, pos):
|
||||
if not self.is_in_position(pos):
|
||||
if self.position != pos:
|
||||
raise Exception ("Hexiposi is not in position: " + str(pos))
|
||||
|
||||
def assert_homed(self):
|
||||
@@ -185,4 +202,4 @@ class hexiposi_position(ReadonlyRegisterBase):
|
||||
|
||||
add_device(hexiposi_position(), True)
|
||||
hexiposi_position.polling = 1000
|
||||
hexiposi.set_deadband(1.3)
|
||||
hexiposi.set_deadband(1.0)
|
||||
|
||||
+1
-1
@@ -252,7 +252,7 @@ except:
|
||||
print >> sys.stderr, traceback.format_exc()
|
||||
|
||||
try:
|
||||
hexiposi.set_offset(16.3)
|
||||
hexiposi.set_offset(16.4)
|
||||
hexiposi.polling=500
|
||||
|
||||
except:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
DEFAULT_DRY_HEAT_TIME = 40.0
|
||||
DEFAULT_DRY_SPEED = 0.35
|
||||
DEFAULT_DRY_SPEED = 0.3
|
||||
DEFAULT_DRY_WAIT_COLD = 40.0
|
||||
|
||||
def dry(heat_time=None, speed=None, wait_cold = None):
|
||||
|
||||
@@ -90,7 +90,7 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False)
|
||||
robot.get_aux(sample)
|
||||
|
||||
else:
|
||||
set_hexiposi(segment, force=True)
|
||||
set_hexiposi(segment, force=False)
|
||||
|
||||
if not force:
|
||||
visual_check_hexiposi(segment)
|
||||
|
||||
@@ -41,7 +41,7 @@ def enable_motion():
|
||||
raise Exception("Cannot enable power: robot state is " + str(robot.state))
|
||||
robot.enable()
|
||||
|
||||
def set_hexiposi(pos, force = True):
|
||||
def set_hexiposi(pos, force = False):
|
||||
"""
|
||||
Set the hexiposi position in remote mode, or wait for it to be set in manual mode
|
||||
"""
|
||||
@@ -58,14 +58,15 @@ def set_hexiposi(pos, force = True):
|
||||
set_status(None)
|
||||
else:
|
||||
hexiposi.move(pos)
|
||||
#hexiposi.assert_in_position(pos)
|
||||
|
||||
hexiposi.assert_in_position(pos)
|
||||
|
||||
#Can be used if cover has following error (no checking readback)
|
||||
def _set_hexiposi(pos):
|
||||
hexiposi.moveAsync(pos)
|
||||
time.sleep(1.0)
|
||||
hexiposi.waitReady(-1)
|
||||
|
||||
hexiposi.waitReady(-1)
|
||||
|
||||
|
||||
def visual_check_hexiposi(segment):
|
||||
if is_imaging_enabled():
|
||||
|
||||
@@ -67,7 +67,7 @@ def unmount(segment = None, puck = None, sample = None, force=False, auto_unmoun
|
||||
enable_motion()
|
||||
|
||||
if not is_aux:
|
||||
set_hexiposi(segment, force=True)
|
||||
set_hexiposi(segment, force=False)
|
||||
|
||||
if not force:
|
||||
visual_check_hexiposi(segment)
|
||||
@@ -95,6 +95,18 @@ def unmount(segment = None, puck = None, sample = None, force=False, auto_unmoun
|
||||
robot.move_aux()
|
||||
robot.put_aux( sample)
|
||||
else:
|
||||
#TODO: remove this check when issue with Hexiposi is fixed (moving to dfifferent position (B) when commanding to position where it was already)
|
||||
if hexiposi.position != segment:
|
||||
robot.move_cold() #Save the sample
|
||||
log_str = "Hexiposi detected in wrong position " + str(hexiposi.readback.take()) + " - not in " + str(segment)
|
||||
Controller.getInstance().logEvent(log_str); log(log_str, False) ; print log_str
|
||||
set_hexiposi(segment, force=False)
|
||||
if hexiposi.position != segment:
|
||||
log_str = "Cannot restore hexiposi position"
|
||||
Controller.getInstance().logEvent(log_str); log(log_str, False) ; print log_str
|
||||
raise Exception(log_str)
|
||||
|
||||
|
||||
#TODO: Should check if smart magnet detection is off?
|
||||
update_samples_info_sample_unmount(get_puck_name(segment, puck), sample)
|
||||
robot.move_dewar()
|
||||
|
||||
Reference in New Issue
Block a user