diff --git a/script/End-to-End.py b/script/End-to-End.py index 838ba09..7b87464 100644 --- a/script/End-to-End.py +++ b/script/End-to-End.py @@ -71,57 +71,57 @@ idInkr.put(-100.0, timeout=None) # TODO: Set appropriate timeout start = idInkr.get()+direction for setpoint1 in range(0, 6): - sleep( 2 ) # Settling time - #RegionPositioner idInkr - setpoint2 = end - idInkr.put(setpoint2, timeout=None) # TODO: Set appropriate timeout - readback2 = idInkr.get() - if abs(readback2 - setpoint2) > 1 : # TODO: Check accuracy - ret = 'Actor idInkr could not be set to the value ' + str(setpoint2) + ' (current value: ' + str(readback2) + ')' - success = False - raise Exception(ret) - #Detector idMotorStatus - detector1 = idMotorStatus.get() - #Detector idLogicalPosition - detector2 = idLogicalPosition.get() - #Detector idDiameter - detector3 = idDiameter.get() - #Detector idMotorPosition - detector4 = idMotorPosition.get() - #Detector idPotiRaw - detector5 = idPotiRaw.get() - #Detector idPotiProc - detector6 = idPotiProc.get() - #Detector idBtvsRaw - detector7 = idBtvsRaw.get() - #Detector idBtvsProc - detector8 = idBtvsProc.get() - #end switches - endH = idEndSwitchH.get() - endL = idEndSwitchL.get() - #Manipulation idDiff02 - #Variable Mappings - a = detector4 - b = detector8 - idDiff02 = a-b - #Manipulation idDiff01 - #Variable Mappings - a = detector4 - b = detector6 - count = setpoint1 - idDiff01 = a-b - if endH>0.0 : - #invert direction and swap start with end of translation - setpoint2 = start - print 'End H switch, changing direction to ' + str(direction) - scan.append ([setpoint2], [readback2], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, idDiff02, idDiff01]) - break - if endL>0.0 : - #invert direction and swap start with end of translation - setpoint2 = end - print 'End L switch, changing direction to ' + str(direction) - scan.append ([setpoint2], [readback2], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, idDiff02, idDiff01]) - break + sleep( 2 ) # Settling time + #RegionPositioner idInkr + setpoint2 = end + idInkr.put(setpoint2, timeout=None) # TODO: Set appropriate timeout + readback2 = idInkr.get() + if abs(readback2 - setpoint2) > 1 : # TODO: Check accuracy + ret = 'Actor idInkr could not be set to the value ' + str(setpoint2) + ' (current value: ' + str(readback2) + ')' + success = False + raise Exception(ret) + #Detector idMotorStatus + detector1 = idMotorStatus.get() + #Detector idLogicalPosition + detector2 = idLogicalPosition.get() + #Detector idDiameter + detector3 = idDiameter.get() + #Detector idMotorPosition + detector4 = idMotorPosition.get() + #Detector idPotiRaw + detector5 = idPotiRaw.get() + #Detector idPotiProc + detector6 = idPotiProc.get() + #Detector idBtvsRaw + detector7 = idBtvsRaw.get() + #Detector idBtvsProc + detector8 = idBtvsProc.get() + #end switches + endH = idEndSwitchH.get() + endL = idEndSwitchL.get() + #Manipulation idDiff02 + #Variable Mappings + a = detector4 + b = detector8 + idDiff02 = a-b + #Manipulation idDiff01 + #Variable Mappings + a = detector4 + b = detector6 + count = setpoint1 + idDiff01 = a-b + if endH>0.0 : + #invert direction and swap start with end of translation + setpoint2 = start + print 'End H switch, changing direction to ' + str(direction) + scan.append ([setpoint2], [readback2], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, idDiff02, idDiff01]) + break + if endL>0.0 : + #invert direction and swap start with end of translation + setpoint2 = end + print 'End L switch, changing direction to ' + str(direction) + scan.append ([setpoint2], [readback2], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, idDiff02, idDiff01]) + break #set limits back idLimitH.put(145.0, timeout=None)