Closedown

This commit is contained in:
boccioli_m
2015-06-23 11:59:26 +02:00
parent 9d9d0b1056
commit e269af3f63
7 changed files with 43 additions and 36 deletions
@@ -4,4 +4,4 @@ filename=Motor Test 3.xml
#optional parameters. Description is compulsory. Syntax:
#parameters=<parameter1Name>:<parameter1Value>:<Parameter 1 description>[;<parameter1Name>:<parameter1Value>:<Parameter 1 description>]
parameters=repeatTimes:3:Repeat M times;delayS:5:Pause delay [s]
parameters=repeatTimes:2:Repeat M times;delayS:5:Pause delay [s]
@@ -19,12 +19,10 @@ except:
success = False
raise Exception('Could not retrieve testing parameters - ' + traceback.format_exc())
print "a"
#TODO: Set the diplay names of positioners and detectors
#scan = ManualScan(['idX', 'idInkr'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idPotiProc', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [-0.5, 0.0], [4.0, 3000.0], [3000, 20])
scan = ManualScan(['idX'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idPotiProc', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [ 0.0], [ 3000.0], [20])
scan.start()
print "b"
#Creating channels: dimension 1
try:
#RegionPositioner idInkr
@@ -70,11 +68,10 @@ except:
success = False
raise Exception('Unable to create channel - ' + traceback.format_exc())
sys.exit()
print "c"
#remove limits
idLimitH.put(999999.9, timeout=None)
idLimitL.put(-999999.9, timeout=None)
print "d"
#Dimension 1
direction = 1.0;
startDefault = -100.0
@@ -85,11 +82,9 @@ idInkr.put(-100.0, timeout=None) # TODO: Set appropriate timeout
start = startDefault #idInkr.get()+direction
setpoint2 = end
count = 0
print "e" + str(loopTimes)
for setpoint1 in range(0, loopTimes):
print "f"
sleep( delaySeconds ) # Settling time
print "g"
#RegionPositioner idInkr
idInkr.put(setpoint2, timeout=None) # TODO: Set appropriate timeout
readback2 = idInkr.get()
@@ -127,7 +122,6 @@ for setpoint1 in range(0, loopTimes):
b = detector6
count = count + 1
idDiff01 = a-b
print "h"
if endH>0.0 :
#invert direction and swap start with end of translation
setpoint2 = start
@@ -142,7 +136,6 @@ for setpoint1 in range(0, loopTimes):
#set limits back
idLimitH.put(145.0, timeout=None)
idLimitL.put(0.0, timeout=None)
print "i"
#Closing channels
idInkr.close()
idMotorStatus.close()
@@ -153,7 +146,6 @@ idPotiRaw.close()
idPotiProc.close()
idBtvsRaw.close()
idBtvsProc.close()
print "l"
scan.end()
ret = 'Slide moved back and forth (' + str(count) + ' runs)'
status = True
@@ -4,4 +4,4 @@ filename=Motor Test 3.xml
#optional parameters. Description is compulsory. Syntax:
#parameters=<parameter1Name>:<parameter1Value>:<Parameter 1 description>[;<parameter1Name>:<parameter1Value>:<Parameter 1 description>]
parameters=repeatTimes:3:Repeat N times;midPoint:41.0:Middle point A;spanFromMidPoint:11.0:Span around middle point B
parameters=repeatTimes:2:Repeat N times;midPoint:41.0:Middle point A;spanFromMidPoint:11.0:Span around middle point B
@@ -13,9 +13,9 @@ status = False
try:
print "Running test with the following parameters:"
print parameters
middle = parameters["midPoint"]
loopTimes = parameters["repeatTimes"]
span = parameters["spanFromMidPoint"]
middle = int(parameters["midPoint"]["value"])
loopTimes = int(parameters["repeatTimes"]["value"])
span = int(parameters["spanFromMidPoint"]["value"])
except:
print "Could not retrieve testing parameters: ", sys.exc_info()[0]
ret = 'Could not retrieve testing parameters - ' + traceback.format_exc()
@@ -1,3 +1,7 @@
name=Motor Test 3
description=Moves from CCW to CW as a series of discrete translations (C times) logs after each translation. When end switch is encountered change direction. Repeat N times
filename=Motor Test 3.xml
#optional parameters. Description is compulsory. Syntax:
#parameters=<parameter1Name>:<parameter1Value>:<Parameter 1 description>[;<parameter1Name>:<parameter1Value>:<Parameter 1 description>]
parameters=repeatTimes:2:Repeat M times;translation:2:Translation with
@@ -7,6 +7,18 @@ import traceback
ret = 'Test failed'
status = False
#get parameters from the calling interface
try:
print "Running test with the following parameters:"
print parameters
loopTimes = int(parameters["repeatTimes"]["value"])
direction = int(parameters["translation"]["value"])
except:
print "Could not retrieve testing parameters: ", sys.exc_info()[0]
ret = 'Could not retrieve testing parameters - ' + traceback.format_exc()
success = False
raise Exception('Could not retrieve testing parameters - ' + traceback.format_exc())
#TODO: Set the diplay names of positioners and detectors
#scan = ManualScan(['idX', 'idInkr'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idPotiProc', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [-0.5, 0.0], [4.0, 3000.0], [3000, 20])
scan = ManualScan(['idX'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idPotiProc', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [ 0.0], [ 3000.0], [20])
@@ -62,8 +74,9 @@ except:
idLimitH.put(999999.9, timeout=None)
idLimitL.put(-999999.9, timeout=None)
#Dimension 1
direction = 1.0;
if direction == 0.0 :
direction = 1.0
startDefault = -100.0
endDefault = 1000.0
end = endDefault
@@ -71,7 +84,7 @@ end = endDefault
idInkr.put(-100.0, timeout=None) # TODO: Set appropriate timeout
start = idInkr.get()+direction
countSteps = 0
loopTimes = 2
count = 0
for setpoint1 in range(0, loopTimes):
count = count + 1