Startup
This commit is contained in:
@@ -151,11 +151,13 @@ def startTest(testName, DEVICE, params):
|
||||
test.sendFeedback(ret, success)
|
||||
except (KeyboardInterrupt):
|
||||
# user stop error handler.
|
||||
import traceback
|
||||
ret = 'Test stopped by user.'
|
||||
success = False
|
||||
test.sendFeedback(ret, success)
|
||||
except:
|
||||
# generic error handler.
|
||||
import traceback
|
||||
ret = traceback.format_exc()
|
||||
success = False
|
||||
test.sendFeedback(ret, success)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#TestingList for pshell: configuration properties
|
||||
#Fri May 12 18:14:37 CEST 2017
|
||||
customPanel=
|
||||
showEnabledTestsOnly=true
|
||||
listFilter=LabTests
|
||||
#TestingList for pshell: configuration properties
|
||||
#Tue May 16 11:43:50 CEST 2017
|
||||
customPanel=
|
||||
showEnabledTestsOnly=true
|
||||
listFilter=LabTests
|
||||
|
||||
@@ -7,7 +7,7 @@ def startTest(testName, DEVICE, params):
|
||||
# by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
# plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
# plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
# put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -23,7 +23,7 @@ def startTest(testName, DEVICE, params):
|
||||
'Diameter (DIAM:2)', 'Logical Position (IST:2)',
|
||||
'Motor Pos Raw (IST3:1)','Poti Pos From Beam (IST1:2)',
|
||||
'Poti Raw (POSA:1)', 'Poti Ref1 Position (REF1:1)', 'Poti Ref2 Position (REF2:1)'])
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
|
||||
try:
|
||||
|
||||
@@ -9,7 +9,7 @@ def startTest(testName, DEVICE, params):
|
||||
# by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
# plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
# plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
# put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -25,7 +25,7 @@ def startTest(testName, DEVICE, params):
|
||||
'Diameter (DIAM:2)', 'Com (COM:2)', 'Logical Position (IST:2)',
|
||||
'Motor Pos Raw (IST3:1)','Poti Pos From Beam (IST1:2)',
|
||||
'Poti Raw (POSA:1)', 'Poti Ref1 Position (REF1:1)', 'Poti Ref2 Position (REF2:1)'])
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
|
||||
try:
|
||||
|
||||
@@ -7,7 +7,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
#put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -34,7 +34,7 @@ def startTest(testName, DEVICE, params):
|
||||
#get parameters from the calling interface
|
||||
scan = ManualScan(['time [1/'+ str(1/samplePeriod) + ' s]'],
|
||||
['Motor Pos (IST3:2)', 'Poti Position (IST2:1)', 'Motor Pos - Poti Pos'] )
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
|
||||
#Creating channels: dimension 1
|
||||
|
||||
@@ -11,7 +11,7 @@ def startTest(testName, DEVICE, params):
|
||||
# by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
# plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
# plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
# put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -51,7 +51,7 @@ def startTest(testName, DEVICE, params):
|
||||
'Poti Ref2 Position (REF2:1)'])
|
||||
|
||||
p1 = plot(None, name = "Motor Position - Btvs Poti Position", context = plotName + " pos difference")[0]
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
# Creating channels: dimension 1
|
||||
try:
|
||||
|
||||
@@ -11,7 +11,7 @@ def startTest(testName, DEVICE, params):
|
||||
# by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
# plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
# plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
# put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -42,7 +42,7 @@ def startTest(testName, DEVICE, params):
|
||||
'Btvs Raw (IST3:1)','Motor Position (IST1:2)',
|
||||
'Poti Raw (POSA:1)', 'Poti Ref1 Position (REF1:1)', 'Poti Ref2 Position (REF2:1)'])
|
||||
p1 = plot(None, name = "Poti Pos From Beam - Motor Position", context = plotName + " pos difference")[0]
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
# Creating channels: dimension 1
|
||||
try:
|
||||
|
||||
@@ -10,7 +10,7 @@ def startTest(testName, DEVICE, params):
|
||||
# by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
# plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
# plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
# put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -41,7 +41,7 @@ def startTest(testName, DEVICE, params):
|
||||
'Diameter (DIAM:2)', 'Logical Position (IST:2)',
|
||||
'Btvs Raw (IST3:1)','Motor Position (IST1:2)',
|
||||
'Poti Raw (POSA:1)', 'Poti Ref1 Position (REF1:1)', 'Poti Ref2 Position (REF2:1)'])
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
# coloured plot (one colour per scan)
|
||||
p1 = plot(None, name="Motor Position - Btvs Poti Position", context=plotName + " difference")[0]
|
||||
|
||||
@@ -10,7 +10,7 @@ def startTest(testName, DEVICE, params):
|
||||
# by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
# plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
# plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
# put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -40,7 +40,7 @@ def startTest(testName, DEVICE, params):
|
||||
'Diameter (DIAM:2)', 'Logical Position (IST:2)',
|
||||
'Motor Pos Raw (IST3:1)','Poti Pos From Beam (IST1:2)',
|
||||
'Poti Raw (POSA:1)', 'Poti Ref1 Position (REF1:1)', 'Poti Ref2 Position (REF2:1)'])
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
# coloured plot (one colour per scan)
|
||||
p1 = plot(None, name="Poti-Increment difference", context=plotName + " difference")[0]
|
||||
|
||||
@@ -9,7 +9,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
#put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -46,7 +46,7 @@ def startTest(testName, DEVICE, params):
|
||||
'Poti Raw (POSA:1)',
|
||||
'Poti Ref1 Position (REF1:1)',
|
||||
'Poti Ref2 Position (REF2:1)'])
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
p1 = plot(None, name = "Motor Position - Btvs Poti Position", context = plotName + " Motor-Poti difference")[0]
|
||||
# Creating channels
|
||||
|
||||
@@ -6,7 +6,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
###### WRITE YOUR CODE HERE BELOW #######
|
||||
#get parameters from the calling interface
|
||||
@@ -14,7 +14,7 @@ def startTest(testName, DEVICE, params):
|
||||
print_log(testName, DEVICE, 'parameters:' + str( params) )
|
||||
print_log(testName, DEVICE, 'device: ' + DEVICE )
|
||||
scan = ManualScan(['time'], ['idMotorStep', 'idPotiPosition', 'idPotiRef1Position','idMotorStep-idPotiPosition'] , [0.0], [30.0], [20])
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
|
||||
#Creating channels: dimension 1
|
||||
|
||||
@@ -10,7 +10,7 @@ def startTest(testName, DEVICE, params):
|
||||
# by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
# plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
# plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
# put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -26,7 +26,7 @@ def startTest(testName, DEVICE, params):
|
||||
'Diameter (DIAM:2)', 'Com (COM:2)', 'Logical Position (IST:2)',
|
||||
'Motor Pos Raw (IST3:1)','Poti Pos From Beam (IST1:2)',
|
||||
'Poti Raw (POSA:1)', 'Poti Ref1 Position (REF1:1)', 'Poti Ref2 Position (REF2:1)'])
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
|
||||
try:
|
||||
|
||||
@@ -10,7 +10,7 @@ def startTest(testName, DEVICE, params):
|
||||
# by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
# plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
# plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
# put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -26,7 +26,7 @@ def startTest(testName, DEVICE, params):
|
||||
'Diameter (DIAM:2)', 'Com (COM:2)', 'Logical Position (IST:2)',
|
||||
'Motor Pos Raw (IST3:1)','Poti Pos From Beam (IST1:2)',
|
||||
'Poti Raw (POSA:1)', 'Poti Ref1 Position (REF1:1)', 'Poti Ref2 Position (REF2:1)'])
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
|
||||
try:
|
||||
|
||||
@@ -10,7 +10,7 @@ def startTest(testName, DEVICE, params):
|
||||
# by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
# plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
# plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
# put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -77,7 +77,7 @@ def startTest(testName, DEVICE, params):
|
||||
# initialise plot tab with 2 plots
|
||||
scan = ManualScan(['sample'], ['Motor Status (MSTA)', 'Motor Position (VAL)'])
|
||||
# set plot name(tab title)
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
# start plots. See further below how to add points to the plots
|
||||
scan.start()
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
####### WRITE YOUR CODE HERE BELOW #######
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
|
||||
###### WRITE YOUR CODE HERE BELOW #######
|
||||
@@ -51,7 +51,7 @@ def startTest(testName, DEVICE, params):
|
||||
|
||||
#scan = ManualScan(['idX'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idEncoderPosition', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [ 0.0], [ 3000.0], [20])
|
||||
scan = ManualScan(['idX'], ['idMotorStatus', 'idMotorPosition', 'idEncoderPosition', 'idError'])
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
|
||||
#Creating channels: dimension 1
|
||||
|
||||
@@ -29,7 +29,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
|
||||
####### WRITE YOUR CODE HERE BELOW ########
|
||||
@@ -50,7 +50,7 @@ def startTest(testName, DEVICE, params):
|
||||
#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.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
#Creating channels: dimension 1
|
||||
try:
|
||||
|
||||
@@ -13,7 +13,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
####### WRITE YOUR CODE HERE BELOW #######
|
||||
|
||||
@@ -31,7 +31,7 @@ def startTest(testName, DEVICE, params):
|
||||
|
||||
#scan = ManualScan(['idX'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idPotiProc', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [ 0.0], [ 3000.0], [20])
|
||||
scan = ManualScan(['idX'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idPotiProc', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'])
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
|
||||
#Creating channels: dimension 1
|
||||
|
||||
@@ -29,7 +29,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
|
||||
###### WRITE YOUR CODE HERE BELOW #######
|
||||
@@ -49,7 +49,7 @@ def startTest(testName, DEVICE, params):
|
||||
return
|
||||
|
||||
scan = ManualScan(['idX'], ['idPositioner'] )
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
try:
|
||||
idInit = Channel(DEVICE+':DEMAND', type = 'l')
|
||||
|
||||
@@ -18,7 +18,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
|
||||
###### WRITE YOUR CODE HERE BELOW #######
|
||||
@@ -46,7 +46,7 @@ def startTest(testName, DEVICE, params):
|
||||
return
|
||||
|
||||
scan = ManualScan(['idX'], ['Motor Position (RBV)', 'Encoder Position (ENCODER)', 'Diff Motor - Encoder'] )
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
#Creating channels: dimension 1
|
||||
try:
|
||||
|
||||
@@ -29,7 +29,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
|
||||
###### WRITE YOUR CODE HERE BELOW #######
|
||||
@@ -57,7 +57,7 @@ def startTest(testName, DEVICE, params):
|
||||
return
|
||||
|
||||
scan = ManualScan(['idX'], ['Motor Position (RBV)', 'Encoder Position (ENCODER)', 'Diff Motor - Encoder'] )
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
#Creating channels: dimension 1
|
||||
try:
|
||||
|
||||
@@ -30,7 +30,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
|
||||
###### WRITE YOUR CODE HERE BELOW #######
|
||||
@@ -51,7 +51,7 @@ def startTest(testName, DEVICE, params):
|
||||
|
||||
#scan = ManualScan(['idX'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idEncoderPosition', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [ 0.0], [ 3000.0], [20])
|
||||
scan = ManualScan(['idX'], ['idMotorStatus', 'idMotorPosition', 'idEncoderPosition', 'idError'])
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
|
||||
#Creating channels: dimension 1
|
||||
|
||||
@@ -9,7 +9,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
#put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -36,7 +36,7 @@ def startTest(testName, DEVICE, params):
|
||||
|
||||
#scan = ManualScan(['idX'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idEncoderPosition', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [ 0.0], [ 3000.0], [20])
|
||||
scan = ManualScan(['idX'], ['idMotorStatus', 'idMotorPosition', 'idEncoderPosition', 'idError'])
|
||||
scan.setPlotName(plotName + " parameters")
|
||||
scan.setPlotTitle(plotName + " parameters")
|
||||
scan.start()
|
||||
|
||||
#coloured plot (one colour per scan)
|
||||
|
||||
@@ -35,7 +35,7 @@ def startTest(testName, DEVICE, params):
|
||||
test.getPath() string, path of this test file
|
||||
test.getName() string, name of this test
|
||||
test.getDeviceName() string, device for which the test must run (typically it is the beginning of a process variable name)
|
||||
test.getPlotName() string, name to be given to the plot when using setPlotName(). Example: scan.setPlotName(test.getPlotName())
|
||||
test.getPlotName() string, name to be given to the plot when using setPlotTitle(). Example: scan.setPlotTitle(test.getPlotName())
|
||||
-----------------------------------
|
||||
GETTING TEST PARAMETERS:
|
||||
-----------------------------------
|
||||
@@ -84,7 +84,7 @@ def startTest(testName, DEVICE, params):
|
||||
# initialise plot tab with 2 plots: pass here the axis names:
|
||||
scan = ManualScan(['sample'], ['Status (MSTA)', 'Position (VAL)'])
|
||||
# set plot name(tab title):
|
||||
scan.setPlotName(test.getPlotName())
|
||||
scan.setPlotTitle(test.getPlotName())
|
||||
# start plots. See further below how to add points to the plots (scan):
|
||||
scan.start()
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ def startTest(testName, DEVICE, params):
|
||||
# by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
status = False
|
||||
# plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
# plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
# put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -110,6 +110,7 @@ def startTest(testName, DEVICE, params):
|
||||
test.sendFeedback(ret, success)
|
||||
except (KeyboardInterrupt):
|
||||
# user stop error handler
|
||||
import traceback
|
||||
ret = 'Test stopped by user.'
|
||||
success = False
|
||||
test.sendFeedback(ret, success)
|
||||
|
||||
@@ -19,7 +19,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
#########################################
|
||||
###### WRITE YOUR CODE HERE BELOW #######
|
||||
@@ -29,7 +29,7 @@ def startTest(testName, DEVICE, params):
|
||||
print_log(testName, DEVICE, 'device: ' + DEVICE )
|
||||
#scan = ManualScan(['time'], ['SetV', 'ActualV', 'ActualI'] , [0.0], [30.0], [20])
|
||||
scan = ManualScan(['time'], ['SetV', 'ActualV', 'ActualI'])
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
try:
|
||||
#Creating channels: dimension 1
|
||||
|
||||
@@ -27,7 +27,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
#########################################
|
||||
###### WRITE YOUR CODE HERE BELOW #######
|
||||
@@ -37,7 +37,7 @@ def startTest(testName, DEVICE, params):
|
||||
print_log(testName, DEVICE, 'device: ' + DEVICE )
|
||||
#scan = ManualScan(['time'], ['SetV', 'ActualV', 'ActualI'] , [0.0], [30.0], [20])
|
||||
scan = ManualScan(['time'], ['SetV', 'ActualV', 'ActualI'])
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
|
||||
try:
|
||||
|
||||
@@ -7,7 +7,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
#put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -22,7 +22,7 @@ def startTest(testName, DEVICE, params):
|
||||
test.log( 'device: ' + DEVICE )
|
||||
#scan = ManualScan(['time'], ['SetV', 'ActualV', 'ActualI'] , [0.0], [30.0], [20])
|
||||
scan = ManualScan(['time'], ['SetV', 'ActualV', 'ActualI'])
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
|
||||
try:
|
||||
@@ -102,11 +102,13 @@ def startTest(testName, DEVICE, params):
|
||||
test.sendFeedback(ret, success)
|
||||
except (KeyboardInterrupt):
|
||||
#user stop error handler
|
||||
import traceback
|
||||
ret = 'Test stopped by user.'
|
||||
success = False
|
||||
test.sendFeedback(ret, success)
|
||||
except:
|
||||
#generic error handler
|
||||
import traceback
|
||||
ret = traceback.format_exc()
|
||||
success = False
|
||||
test.sendFeedback(ret, success)
|
||||
|
||||
@@ -26,7 +26,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
######### WRITE YOUR CODE HERE BELOW #############
|
||||
print_log(testName, DEVICE, 'testpath B: ' + testPath )
|
||||
@@ -34,7 +34,7 @@ def startTest(testName, DEVICE, params):
|
||||
print_log(testName, DEVICE, 'device: ' + DEVICE )
|
||||
#scan = ManualScan(['time'], ['SetVB', 'ActualVB', 'ActualIB'] , [0.0], [30.0], [20])
|
||||
scan = ManualScan(['time'], ['SetVB', 'ActualVB', 'ActualIB'] )
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
|
||||
#Creating channels: dimension 1
|
||||
|
||||
@@ -7,7 +7,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
#put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -22,7 +22,7 @@ def startTest(testName, DEVICE, params):
|
||||
test.log( 'device: ' + DEVICE )
|
||||
#scan = ManualScan(['time'], ['SetVB', 'ActualVB', 'ActualIB'] , [0.0], [30.0], [20])
|
||||
scan = ManualScan(['time'], ['SetVB', 'ActualVB', 'ActualIB'] )
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
|
||||
#Creating channels: dimension 1
|
||||
@@ -41,6 +41,7 @@ def startTest(testName, DEVICE, params):
|
||||
ActualIA = Channel(DEVICE + ':Actual-IB', type = 'd')
|
||||
#ActualIA = Channel('pw84:ai', type = 'd')
|
||||
except:
|
||||
import traceback
|
||||
test.sendFeedback( 'Unable to create channel - ' + traceback.format_exc(), False)
|
||||
return
|
||||
#Init
|
||||
@@ -97,11 +98,13 @@ def startTest(testName, DEVICE, params):
|
||||
test.sendFeedback(ret, success)
|
||||
except (KeyboardInterrupt):
|
||||
#user stop error handler
|
||||
import traceback
|
||||
ret = 'Test stopped by user.'
|
||||
success = False
|
||||
test.sendFeedback(ret, success)
|
||||
except:
|
||||
#generic error handler
|
||||
import traceback
|
||||
ret = traceback.format_exc()
|
||||
success = False
|
||||
test.sendFeedback(ret, success)
|
||||
|
||||
@@ -9,7 +9,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
#put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -74,7 +74,7 @@ def startTest(testName, DEVICE, params):
|
||||
#initialise plot tab with 2 plots
|
||||
scan = ManualScan(['sample'], ['Motor Status (MSTA)', 'Motor Position (VAL)'] )
|
||||
#set plot name(tab title)
|
||||
scan.setPlotName(plotName + "Manual Scan")
|
||||
scan.setPlotTitle(plotName + "Manual Scan")
|
||||
#start plots. See further below how to add points to the plots
|
||||
scan.start()
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
#put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -74,7 +74,7 @@ def startTest(testName, DEVICE, params):
|
||||
#initialise plot tab with 2 plots
|
||||
scan = ManualScan(['sample'], ['Motor Status (MSTA)', 'Motor Position (VAL)'] )
|
||||
#set plot name(tab title)
|
||||
scan.setPlotName(plotName + " Manual Scan")
|
||||
scan.setPlotTitle(plotName + " Manual Scan")
|
||||
#start plots. See further below how to add points to the plots
|
||||
scan.start()
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
#put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -74,7 +74,7 @@ def startTest(testName, DEVICE, params):
|
||||
#initialise plot tab with 2 plots
|
||||
scan = ManualScan(['sample'], ['Motor Status (MSTA)', 'Motor Position (VAL)'] )
|
||||
#set plot name(tab title)
|
||||
scan.setPlotName(plotName + "Manual Scan")
|
||||
scan.setPlotTitle(plotName + "Manual Scan")
|
||||
#start plots. See further below how to add points to the plots
|
||||
scan.start()
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
#put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -74,7 +74,7 @@ def startTest(testName, DEVICE, params):
|
||||
#initialise plot tab with 2 plots
|
||||
scan = ManualScan(['sample'], ['Motor Status (MSTA)', 'Motor Position (VAL)'] )
|
||||
#set plot name(tab title)
|
||||
scan.setPlotName(plotName + " Manual Scan")
|
||||
scan.setPlotTitle(plotName + " Manual Scan")
|
||||
#start plots. See further below how to add points to the plots
|
||||
scan.start()
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
#put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -74,7 +74,7 @@ def startTest(testName, DEVICE, params):
|
||||
#initialise plot tab with 2 plots
|
||||
scan = ManualScan(['sample'], ['Motor Status (MSTA)', 'Motor Position (VAL)'] )
|
||||
#set plot name(tab title)
|
||||
scan.setPlotName(plotName + "Manual Scan")
|
||||
scan.setPlotTitle(plotName + "Manual Scan")
|
||||
#start plots. See further below how to add points to the plots
|
||||
scan.start()
|
||||
|
||||
|
||||
@@ -2,18 +2,6 @@
|
||||
#test that does not use any connection to IOC. It is useful to test pure pshell graphical features.
|
||||
|
||||
|
||||
# testing environment setup (if script is launched directly without Testinglist)
|
||||
is_panel = get_exec_pars().source != CommandSource.ui
|
||||
test = ""
|
||||
device = ""
|
||||
parameters = ""
|
||||
if not is_panel:
|
||||
# set up params for testing
|
||||
test = "test without ioc"
|
||||
device = "no-device"
|
||||
parameters = "{'howManySamples': {'description': 'How many samples are plotted', 'value': '50'}, 'delayBetweenSampleS': {'description': 'delay [s] between two samples', 'value': '0.05'}, 'repeatTimes': {'description': 'how many times the test is repeated', 'value': '3'}}"
|
||||
pass
|
||||
|
||||
###### Init - DO NOT MODIFY THE CODE BELOW ######
|
||||
global sys, inspect, os, traceback
|
||||
import sys, inspect, os, traceback
|
||||
@@ -156,12 +144,24 @@ def startTest(testName, DEVICE, params):
|
||||
test.sendFeedback(ret, success)
|
||||
except:
|
||||
#generic error handler
|
||||
import traceback
|
||||
ret = traceback.format_exc()
|
||||
success = False
|
||||
test.sendFeedback(ret, success)
|
||||
|
||||
#launch the test
|
||||
startTest(test, device, parameters)
|
||||
# testing environment setup (if script is launched directly without Testinglist)
|
||||
is_panel = get_exec_pars().source != CommandSource.ui
|
||||
if not is_panel:
|
||||
#launch the test with default input
|
||||
test = "test without ioc"
|
||||
device = "no-device"
|
||||
import json
|
||||
parameters = json.loads('{"howManySamples": {"description": "How many samples are plotted", "value": "50"}, "delayBetweenSampleS": {"description": "delay [s] between two samples", "value": "0.05"}, "repeatTimes": {"description": "how many times the test is repeated", "value": "3"}}')
|
||||
startTest(test, device, parameters)
|
||||
#pass
|
||||
else:
|
||||
#launch the test with input from tsting list
|
||||
startTest(test, device, parameters)
|
||||
|
||||
################ END OF Final ####################
|
||||
#### IF NEEDED, ADD YOUR FUNCTIONS HERE BELOW ####
|
||||
|
||||
@@ -29,7 +29,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
|
||||
###### WRITE YOUR CODE HERE BELOW #######
|
||||
@@ -57,7 +57,7 @@ def startTest(testName, DEVICE, params):
|
||||
return
|
||||
|
||||
scan = ManualScan(['idX'], ['idMotorPosition', 'idEncoderPosition', 'idError'] )
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
#Creating channels: dimension 1
|
||||
try:
|
||||
|
||||
@@ -30,7 +30,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
|
||||
###### WRITE YOUR CODE HERE BELOW #######
|
||||
@@ -51,7 +51,7 @@ def startTest(testName, DEVICE, params):
|
||||
|
||||
#scan = ManualScan(['idX'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idEncoderPosition', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [ 0.0], [ 3000.0], [20])
|
||||
scan = ManualScan(['idX'], ['idMotorStatus', 'idMotorPosition', 'idEncoderPosition', 'idError'])
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
|
||||
#Creating channels: dimension 1
|
||||
|
||||
@@ -29,7 +29,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
|
||||
###### WRITE YOUR CODE HERE BELOW #######
|
||||
@@ -48,7 +48,7 @@ def startTest(testName, DEVICE, params):
|
||||
sendFeedback(testPath, testName, DEVICE, ret, success)
|
||||
return
|
||||
scan = ManualScan(['id000000'], ['Motor Status (MSTA)', 'Motor Step Count (RVAL)', 'Motor Position (VAL)', 'Motor Home Switch (ATHM)', 'Encoder Count (ENCODERraw)', 'Encoder Position (ENCODER)', 'Motor/Encoder Diff', 'Drive Ready (RDY)', 'Drive interlock (ILK)', 'CAD_VALA', 'MOTOR_ATHM', 'MOTOR_LLS', 'MOTOR_HLS', 'MOTOR_DMOV', 'CAD_ODIR', 'MOTOR_HOMF', 'MOTOR_RLV', 'MOTOR_STOP', 'MOTOR_SET', 'MOTOR_OFF', 'MOTOR_VAL', 'MOTOR_DVAL', 'MOTOR_DLLM', 'MOTOR_DHLM', 'CAD_VALB', 'CAR_IVAL', 'CAR_IERR', 'SIR_VAL', 'ENCODERraw', 'ENCODERscale', 'ENCODER_oEN', 'ENCODER_HFF', 'FIRST_INIT'] )
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
|
||||
#Creating channels: dimension 1
|
||||
|
||||
@@ -9,7 +9,7 @@ def startTest(testName, DEVICE, params):
|
||||
#by default, failed
|
||||
ret = 'Test failed'
|
||||
success = False
|
||||
#plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
#plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
try:
|
||||
#get the path of this script
|
||||
@@ -32,7 +32,7 @@ def startTest(testName, DEVICE, params):
|
||||
return
|
||||
#setup plot
|
||||
scan = ManualScan(['id000000'], ['Motor Status (MSTA)', 'Motor Step Count (RVAL)', 'Motor Position (VAL)', 'Motor Home Switch (ATHM)', 'Encoder Count (ENCODERraw)', 'Encoder Position (ENCODER)', 'Motor/Encoder Diff', 'Drive Ready (RDY)', 'Drive interlock (ILK)', 'CAD_VALA', 'MOTOR_ATHM', 'MOTOR_LLS', 'MOTOR_HLS', 'MOTOR_DMOV', 'CAD_ODIR', 'MOTOR_HOMF', 'MOTOR_RLV', 'MOTOR_STOP', 'MOTOR_SET', 'MOTOR_OFF', 'MOTOR_VAL', 'MOTOR_DVAL', 'MOTOR_DLLM', 'MOTOR_DHLM', 'CAD_VALB', 'CAR_IVAL', 'CAR_IERR', 'SIR_VAL', 'ENCODERraw', 'ENCODERscale', 'ENCODER_oEN', 'ENCODER_HFF', 'FIRST_INIT'] )
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
scan.start()
|
||||
|
||||
#Creating channels: dimension 1
|
||||
|
||||
@@ -14,7 +14,7 @@ def startTest(testName, DEVICE, params):
|
||||
# by default, assume the test failed
|
||||
ret = 'Test failed'
|
||||
status = False
|
||||
# plot name to be given to the scan. Use: scan.setPlotName(plotName)
|
||||
# plot name to be given to the scan. Use: scan.setPlotTitle(plotName)
|
||||
plotName = DEVICE + ' - ' + testName
|
||||
# put the whole custom code under try/catch
|
||||
try:
|
||||
@@ -81,7 +81,7 @@ def startTest(testName, DEVICE, params):
|
||||
# initialise plot tab with 2 plots
|
||||
scan = ManualScan(['sample'], ['Motor Status (MSTA)', 'Motor Position (VAL)'])
|
||||
# set plot name(tab title)
|
||||
scan.setPlotName(plotName)
|
||||
scan.setPlotTitle(plotName)
|
||||
# start plots. See further below how to add points to the plots
|
||||
scan.start()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user