This commit is contained in:
boccioli_m
2017-05-16 11:44:07 +02:00
parent e77d7fc626
commit ee7698ccdc
41 changed files with 101 additions and 93 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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:

View File

@@ -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:

View File

@@ -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

View File

@@ -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:

View File

@@ -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:

View File

@@ -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]

View File

@@ -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]

View File

@@ -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

View File

@@ -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

View File

@@ -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:

View File

@@ -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:

View File

@@ -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()

View File

@@ -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 #######

View File

@@ -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

View File

@@ -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:

View File

@@ -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

View File

@@ -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')

View File

@@ -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:

View File

@@ -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:

View File

@@ -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

View File

@@ -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)

View File

@@ -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()

View File

@@ -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)

View File

@@ -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

View File

@@ -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:

View File

@@ -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)

View File

@@ -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

View File

@@ -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)

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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 ####

View File

@@ -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:

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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()