From 3a6a9d8c17c53740c28b31c67420676ac0e66c91 Mon Sep 17 00:00:00 2001 From: boccioli_m Date: Thu, 3 Sep 2015 09:58:30 +0200 Subject: [PATCH] Startup --- plugins/NewTest.java | 2 +- script/tests/templates/testTemplate.py | 114 +++++++++-------- .../PS Tests/power-supply-A/power-supply-A.py | 2 +- .../PS Tests/power-supply-B/power-supply-B.py | 2 +- .../Monitor All/Monitor All.py | 14 +-- script/tests/tests/dsfdsd/feffeefe/.config | 4 - .../tests/tests/dsfdsd/feffeefe/feffeefe.py | 119 ------------------ script/tests/tests/dsfdsd/feffeefe/help.html | 15 --- script/tests/tests/fewfewfw/ef/.config | 4 - script/tests/tests/fewfewfw/ef/ef.py | 119 ------------------ script/tests/tests/fewfewfw/ef/help.html | 15 --- script/tests/tests/ghyug/huihi/.config | 4 - script/tests/tests/ghyug/huihi/help.html | 13 -- script/tests/tests/ghyug/huihi/huihi.py | 119 ------------------ script/tests/tests/jaja/blabla/.config | 4 - script/tests/tests/jaja/blabla/blabla.py | 119 ------------------ script/tests/tests/jaja/blabla/help.html | 15 --- script/tests/tests/jojo/aaaaaaaaaaa/.config | 4 - .../tests/jojo/aaaaaaaaaaa/aaaaaaaaaaa.py | 119 ------------------ script/tests/tests/jojo/aaaaaaaaaaa/help.html | 14 --- script/tests/tests/jojo/aha/.config | 4 - script/tests/tests/jojo/aha/aha.py | 119 ------------------ script/tests/tests/jojo/aha/help.html | 16 --- script/tests/tests/sdfsd/dfsdf/.config | 4 - script/tests/tests/sdfsd/dfsdf/dfsdf.py | 119 ------------------ script/tests/tests/sdfsd/dfsdf/help.html | 15 --- 26 files changed, 74 insertions(+), 1024 deletions(-) delete mode 100644 script/tests/tests/dsfdsd/feffeefe/.config delete mode 100644 script/tests/tests/dsfdsd/feffeefe/feffeefe.py delete mode 100644 script/tests/tests/dsfdsd/feffeefe/help.html delete mode 100644 script/tests/tests/fewfewfw/ef/.config delete mode 100644 script/tests/tests/fewfewfw/ef/ef.py delete mode 100644 script/tests/tests/fewfewfw/ef/help.html delete mode 100644 script/tests/tests/ghyug/huihi/.config delete mode 100644 script/tests/tests/ghyug/huihi/help.html delete mode 100644 script/tests/tests/ghyug/huihi/huihi.py delete mode 100644 script/tests/tests/jaja/blabla/.config delete mode 100644 script/tests/tests/jaja/blabla/blabla.py delete mode 100644 script/tests/tests/jaja/blabla/help.html delete mode 100644 script/tests/tests/jojo/aaaaaaaaaaa/.config delete mode 100644 script/tests/tests/jojo/aaaaaaaaaaa/aaaaaaaaaaa.py delete mode 100644 script/tests/tests/jojo/aaaaaaaaaaa/help.html delete mode 100644 script/tests/tests/jojo/aha/.config delete mode 100644 script/tests/tests/jojo/aha/aha.py delete mode 100644 script/tests/tests/jojo/aha/help.html delete mode 100644 script/tests/tests/sdfsd/dfsdf/.config delete mode 100644 script/tests/tests/sdfsd/dfsdf/dfsdf.py delete mode 100644 script/tests/tests/sdfsd/dfsdf/help.html diff --git a/plugins/NewTest.java b/plugins/NewTest.java index e60cd0f..0aba44f 100644 --- a/plugins/NewTest.java +++ b/plugins/NewTest.java @@ -700,7 +700,7 @@ public class NewTest extends javax.swing.JPanel { value = (String) attributes.get("value"); description = (String) attributes.get("description"); //build the python code for getting the test parameter - sSyntaxGetTestParameters = sSyntaxGetTestParameters + name + " = float(params[\""+name+"\"][\"value\"]) ; "; + sSyntaxGetTestParameters = sSyntaxGetTestParameters + name + " = float(test.getParam('"+name+"')) ; "; } } replaceParameters(path, diff --git a/script/tests/templates/testTemplate.py b/script/tests/templates/testTemplate.py index 292057e..892a8b6 100644 --- a/script/tests/templates/testTemplate.py +++ b/script/tests/templates/testTemplate.py @@ -2,67 +2,74 @@ #$testDescription ###### Init - DO NOT MODIFY THE CODE BELOW ###### -global print_log, sendFeedback, inspect, log, sys, inspect, os, traceback +global sys, inspect, os, traceback import sys, inspect, os, traceback - -def print_log(testName, DEVICE, text): - time.ctime() - now = time.strftime('%Y.%m.%d %H:%M:%S') - print now + ' ' + DEVICE + ' - ' + testName + ': ' + str(text) - log (now + ' ' + DEVICE + ' - ' + testName + ': ' + text ) -#prepare and send feedback to calling tool -def sendFeedback(testPath, testName, DEVICE, returnString, testPassed): - print_log(testName, DEVICE, 'End of test. Result:') - print_log(testName, DEVICE, 'Device: ' + DEVICE) - print_log(testName, DEVICE, 'Test name: ' + testName) - print_log(testName, DEVICE, 'Test path: ' + testPath) - print_log(testName, DEVICE, 'Test passed: ' + str(testPassed)) - print_log(testName, DEVICE, 'Return string: ' + returnString) - ret = [testPath, DEVICE, returnString, testPassed] - set_return(ret) - 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) + plotName = DEVICE + ' - ' + testName + #put the whole custom code under try/catch try: - import traceback #get the path of this script testPath = inspect.getfile(inspect.currentframe()) - #by default, failed - ret = 'Test failed' - success = False - #plot name to be given to the scan. Use: scan.setPlotName(plotName) - plotName = DEVICE + ' - ' + testName + #init the testing tool class. It can be sued in the following ways: + test = TestingTool(testName, testPath, DEVICE, params) + ######### WRITE YOUR CODE HERE BELOW ############# - #All the code here in this section ## ..YOUR CODE.. ## can be modified/deleted. - # INPUTS: + #All the code in this section ## ..YOUR CODE.. ## can be modified/deleted. + #It must be indented at the same level as this comment + #----------------------------------- + # GETTING INPUTS: #If needed, the following variables are available: #testPath string, path of this test file #testName string, name of this test #DEVICE string, device for which the test must run (typically it is the beginning of a process variable name) - #params dictionary, a set of key-value parameters specific to the test. - # Syntax: params[""]["value"] - # Example: access the parameter called midPoint and store it in a new variable: - # middlePoint = params["midPoint"]["value"] - # OUTPUTS: + #----------------------------------- + # GETTING TEST PARAMETERS: + #if you need to get parameters for the test, use (casting may be necessary): + #myParamValue = test.getParam('myParamName') + #see the test config for the list of parameters specific to the test. + #----------------------------------- + # SETTING OUTPUTS: #ret string, a text summarizing the result of the test. It must be set before the end of your code. #success bool, True = test successful. It must be set before the end of your code. - - #Example (can be removed): print the list of parameters passed. If any error, stop and send feedback - print_log(testName, DEVICE, "Example - Test name: "+testName): - print_log(testName, DEVICE, "Example - Device name: "+DEVICE): + #test.sendFeedback(ret,success) method that ends the testing script and gives the report to the calling application. + #Examples: + # + #whenever the code must quit (i.e. after an error), you must end with: + #ret = 'here is some info on what failed on the test' + #success = false + #test.sendFeedback(ret, success) + # + #whenever the code is finished successfully, you must end with: + #ret = 'here is some info on the success of the test' + #success = true + #test.sendFeedback(ret, success) + #----------------------------------- + # LOG INFO: + #when some information must be shown on the log, use: + #test.log('test to log') + + ########## Example (can be removed) ###### + #print the list of parameters passed. If any error, stop and send feedback + test.log("Example - Test name: "+testName): + test.log("Example - Device name: "+DEVICE): try: - print_log(testName, DEVICE, "Running test Initialise with the following parameters:") - print_log(testName, DEVICE, params ) + test.log("Running test Initialise with the following parameters:") + test.log(params ) #If present, use the parameters here below for your test script #$testParameters except: ret = 'Could not retrieve testing parameters - ' + traceback.format_exc() success = False - sendFeedback(testPath, testName, DEVICE, ret, success) + test.sendFeedback( ret, success) return - #example: loop to read channels for a while and plot the channels values. + #loop to read channels for a while and plot the channels values. #initialise plot tab with 2 plots scan = ManualScan(['sample'], ['Motor Status (MSTA)', 'Motor Position (VAL)'] ) @@ -71,12 +78,10 @@ def startTest(testName, DEVICE, params): #start plots. See further below how to add points to the plots scan.start() - #IMPORTANT: if the test resulted with an error, write the following: + #IMPORTANT: if the test failed, write the report into the variables ret and success. + #for example, write the following: ret = "Example - Error, the test failed because...." success = False - #IMPORTANT: if the test was successful, write the following: - ret = "Example - Test successful, here some detail: ..." - success = True #set up connection to channels. "type" of data can be "d" (= double), "l" (= long) try: pv_motor_msta = Channel(DEVICE+':MOTOR.MSTA', type = 'd') @@ -87,7 +92,7 @@ def startTest(testName, DEVICE, params): #prepare return information: return success success = False #send return information - sendFeedback(testPath, testName, DEVICE, ret, success) + test.sendFeedback( ret, success) return #take 100 samples of the channels for sample in range(0, 100): @@ -98,21 +103,30 @@ def startTest(testName, DEVICE, params): #get value motor_val = pv_motor_val.get() #add values to plot - scan.append ([sample], [readback1], [detmotor_msta, motor_val] ) + scan.append ([sample], [readback1], [motor_msta, motor_val] ) #Closing channels pv_motor_msta.close() pv_motor_val.close() - #once the test is finished, no need to do anything. The code below yours will do the rest. + #IMPORTANT: if the test was successful, write the report into the variables ret and success. + #for example, write the following: + ret = "Example - Test successful, here some detail: ..." + success = True + test.sendFeedback(ret, success) + #once the test is finished, no need to do anything. The code below yours will do the rest. + ################ End of Example ########## + ################ END OF YOUR CODE ################ -###### Final - DO NOT MODIFY THE CODE BELOW ###### - sendFeedback(testPath, testName, DEVICE, ret, success) +###### Final - DO NOT MODIFY THE CODE BELOW ###### + + #just in case the feedback was forgotten + test.sendFeedback(ret, success) except: + #generic error handler ret = traceback.format_exc() success = False - sendFeedback(testPath, testName, DEVICE, ret, success) - return + test.sendFeedback(ret, success) #launch the test startTest(test, device, parameters) diff --git a/script/tests/tests/PS Tests/power-supply-A/power-supply-A.py b/script/tests/tests/PS Tests/power-supply-A/power-supply-A.py index a3f7733..39a6095 100644 --- a/script/tests/tests/PS Tests/power-supply-A/power-supply-A.py +++ b/script/tests/tests/PS Tests/power-supply-A/power-supply-A.py @@ -8,7 +8,7 @@ def startTest(testName, DEVICE, params): #get the path of this script testPath = inspect.getfile(inspect.currentframe()) #init the testing tool class - test = TestingTool(testName, testPath, DEVICE) + test = TestingTool(testName, testPath, DEVICE, params) #by default, failed ret = 'Test failed' status = False diff --git a/script/tests/tests/PS Tests/power-supply-B/power-supply-B.py b/script/tests/tests/PS Tests/power-supply-B/power-supply-B.py index 09b00c6..d107868 100644 --- a/script/tests/tests/PS Tests/power-supply-B/power-supply-B.py +++ b/script/tests/tests/PS Tests/power-supply-B/power-supply-B.py @@ -6,7 +6,7 @@ def startTest(testName, DEVICE, params): #get the path of this script testPath = inspect.getfile(inspect.currentframe()) #init the testing tool class - test = TestingTool(testName, testPath, DEVICE) + test = TestingTool(testName, testPath, DEVICE, params) #by default, failed ret = 'Test failed' status = False diff --git a/script/tests/tests/Range Shifter Tests/Monitor All/Monitor All.py b/script/tests/tests/Range Shifter Tests/Monitor All/Monitor All.py index 610217a..0324623 100644 --- a/script/tests/tests/Range Shifter Tests/Monitor All/Monitor All.py +++ b/script/tests/tests/Range Shifter Tests/Monitor All/Monitor All.py @@ -6,23 +6,22 @@ global sys, inspect, os, traceback import sys, inspect, os, traceback def startTest(testName, DEVICE, params): - #get the path of this script - testPath = inspect.getfile(inspect.currentframe()) - #init the testing tool class - test = TestingTool(testName, testPath, DEVICE, params) #by default, failed ret = 'Test failed' status = False #plot name to be given to the scan. Use: scan.setPlotName(plotName) plotName = DEVICE + ' - ' + testName -###### WRITE YOUR CODE HERE BELOW ####### try: + #get the path of this script + testPath = inspect.getfile(inspect.currentframe()) + #init the testing tool class. It can be sued in the following ways: + test = TestingTool(testName, testPath, DEVICE, params) + +###### WRITE YOUR CODE HERE BELOW ####### #get parameters from the calling interface try: test.log("Running test Initialise with the following parameters:") test.log(params) -# samplingTimeWindow = int(params["timeWindowS"]["value"]) -# samplingTime = float(params["samplingTimeS"]["value"]) samplingTimeWindow = int(test.getParam('timeWindowS')) ; samplingTime = float(test.getParam("samplingTimeS")) ; if samplingTime<0.001: samplingTime=0.001 @@ -31,6 +30,7 @@ def startTest(testName, DEVICE, params): success = False test.sendFeedback( ret, success) 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.start() diff --git a/script/tests/tests/dsfdsd/feffeefe/.config b/script/tests/tests/dsfdsd/feffeefe/.config deleted file mode 100644 index b6fb132..0000000 --- a/script/tests/tests/dsfdsd/feffeefe/.config +++ /dev/null @@ -1,4 +0,0 @@ -#Tue Sep 01 11:44:04 CEST 2015 -name=feffeefe -parameters=examplePar1\:2\:This is the parameter n.1 with unit [unit];examplePar2\:4.5\:This is the parameter n.2 with unit [unit]; -description=dvfsdf diff --git a/script/tests/tests/dsfdsd/feffeefe/feffeefe.py b/script/tests/tests/dsfdsd/feffeefe/feffeefe.py deleted file mode 100644 index 3e2c6c5..0000000 --- a/script/tests/tests/dsfdsd/feffeefe/feffeefe.py +++ /dev/null @@ -1,119 +0,0 @@ -#feffeefe -#dvfsdf - -###### Init - DO NOT MODIFY THE CODE BELOW ###### -global print_log, sendFeedback, inspect, log, sys, inspect, os, traceback -import sys, inspect, os, traceback - -def print_log(testName, DEVICE, text): - time.ctime() - now = time.strftime('%Y.%m.%d %H:%M:%S') - print now + ' ' + DEVICE + ' - ' + testName + ': ' + str(text) - log (now + ' ' + DEVICE + ' - ' + testName + ': ' + text ) - -#prepare and send feedback to calling tool -def sendFeedback(testPath, testName, DEVICE, returnString, testPassed): - print_log(testName, DEVICE, 'End of test. Result:') - print_log(testName, DEVICE, 'Device: ' + DEVICE) - print_log(testName, DEVICE, 'Test name: ' + testName) - print_log(testName, DEVICE, 'Test path: ' + testPath) - print_log(testName, DEVICE, 'Test passed: ' + str(testPassed)) - print_log(testName, DEVICE, 'Return string: ' + returnString) - ret = [testPath, DEVICE, returnString, testPassed] - set_return(ret) - -def startTest(testName, DEVICE, params): - try: - import traceback - #get the path of this script - testPath = inspect.getfile(inspect.currentframe()) - #by default, failed - ret = 'Test failed' - success = False - #plot name to be given to the scan. Use: scan.setPlotName(plotName) - plotName = DEVICE + ' - ' + testName -######### WRITE YOUR CODE HERE BELOW ############# - - #All the code here in this section ## ..YOUR CODE.. ## can be modified/deleted. - # INPUTS: - #If needed, the following variables are available: - #testPath string, path of this test file - #testName string, name of this test - #DEVICE string, device for which the test must run (typically it is the beginning of a process variable name) - #params dictionary, a set of key-value parameters specific to the test. - # Syntax: params[""]["value"] - # Example: access the parameter called midPoint and store it in a new variable: - # middlePoint = params["midPoint"]["value"] - # OUTPUTS: - #ret string, a text summarizing the result of the test. It must be set before the end of your code. - #success bool, True = test successful. It must be set before the end of your code. - - #Example (can be removed): print the list of parameters passed. If any error, stop and send feedback - print_log(testName, DEVICE, "Example - Test name: "+testName): - print_log(testName, DEVICE, "Example - Device name: "+DEVICE): - try: - print_log(testName, DEVICE, "Running test Initialise with the following parameters:") - print_log(testName, DEVICE, params ) - #If present, use the parameters here below for your test script - examplePar1 = float(params["examplePar1"]["value"]) ; examplePar2 = float(params["examplePar2"]["value"]) ; - except: - ret = 'Could not retrieve testing parameters - ' + traceback.format_exc() - success = False - sendFeedback(testPath, testName, DEVICE, ret, success) - return - - #example: loop to read channels for a while and plot the channels values. - - #initialise plot tab with 2 plots - scan = ManualScan(['sample'], ['Motor Status (MSTA)', 'Motor Position (VAL)'] ) - #set plot name(tab title) - scan.setPlotName(plotName) - #start plots. See further below how to add points to the plots - scan.start() - - #IMPORTANT: if the test resulted with an error, write the following: - ret = "Example - Error, the test failed because...." - success = False - #IMPORTANT: if the test was successful, write the following: - ret = "Example - Test successful, here some detail: ..." - success = True - #set up connection to channels. "type" of data can be "d" (= double), "l" (= long) - try: - pv_motor_msta = Channel(DEVICE+':MOTOR.MSTA', type = 'd') - pv_motor_val = Channel(DEVICE+':MOTOR.VAL' , type = 'd') - except: - #prepare return information: return text - ret = 'Unable to create channel - ' + traceback.format_exc() - #prepare return information: return success - success = False - #send return information - sendFeedback(testPath, testName, DEVICE, ret, success) - return - #take 100 samples of the channels - for sample in range(0, 100): - readback1 = sample - sleep( 0.1 ) # Settling time - #get value - motor_msta = pv_motor_msta.get() - #get value - motor_val = pv_motor_val.get() - #add values to plot - scan.append ([sample], [readback1], [detmotor_msta, motor_val] ) - - #Closing channels - pv_motor_msta.close() - pv_motor_val.close() - - #once the test is finished, no need to do anything. The code below yours will do the rest. -################ END OF YOUR CODE ################ -###### Final - DO NOT MODIFY THE CODE BELOW ###### - sendFeedback(testPath, testName, DEVICE, ret, success) - except: - ret = traceback.format_exc() - success = False - sendFeedback(testPath, testName, DEVICE, ret, success) - return - -#launch the test -startTest(test, device, parameters) - \ No newline at end of file diff --git a/script/tests/tests/dsfdsd/feffeefe/help.html b/script/tests/tests/dsfdsd/feffeefe/help.html deleted file mode 100644 index 8481ddc..0000000 --- a/script/tests/tests/dsfdsd/feffeefe/help.html +++ /dev/null @@ -1,15 +0,0 @@ - - -

Short Description

-dvfsdf -

Details

-Add here the detailed description of the test, with reference to the parameters (if any). -

Parameters

-examplePar1 This is the parameter n.1 with unit [unit]
-examplePar2 This is the parameter n.2 with unit [unit]
- -

Contact

-dfsdfd - - - diff --git a/script/tests/tests/fewfewfw/ef/.config b/script/tests/tests/fewfewfw/ef/.config deleted file mode 100644 index 60f68e1..0000000 --- a/script/tests/tests/fewfewfw/ef/.config +++ /dev/null @@ -1,4 +0,0 @@ -#Tue Sep 01 11:58:14 CEST 2015 -name=ef -parameters=examplePar1\:2\:This is the parameter n.1 with unit [unit];examplePar2\:4.5\:This is the parameter n.2 with unit [unit]; -description=wedwee diff --git a/script/tests/tests/fewfewfw/ef/ef.py b/script/tests/tests/fewfewfw/ef/ef.py deleted file mode 100644 index 5b86986..0000000 --- a/script/tests/tests/fewfewfw/ef/ef.py +++ /dev/null @@ -1,119 +0,0 @@ -#ef -#wedwee - -###### Init - DO NOT MODIFY THE CODE BELOW ###### -global print_log, sendFeedback, inspect, log, sys, inspect, os, traceback -import sys, inspect, os, traceback - -def print_log(testName, DEVICE, text): - time.ctime() - now = time.strftime('%Y.%m.%d %H:%M:%S') - print now + ' ' + DEVICE + ' - ' + testName + ': ' + str(text) - log (now + ' ' + DEVICE + ' - ' + testName + ': ' + text ) - -#prepare and send feedback to calling tool -def sendFeedback(testPath, testName, DEVICE, returnString, testPassed): - print_log(testName, DEVICE, 'End of test. Result:') - print_log(testName, DEVICE, 'Device: ' + DEVICE) - print_log(testName, DEVICE, 'Test name: ' + testName) - print_log(testName, DEVICE, 'Test path: ' + testPath) - print_log(testName, DEVICE, 'Test passed: ' + str(testPassed)) - print_log(testName, DEVICE, 'Return string: ' + returnString) - ret = [testPath, DEVICE, returnString, testPassed] - set_return(ret) - -def startTest(testName, DEVICE, params): - try: - import traceback - #get the path of this script - testPath = inspect.getfile(inspect.currentframe()) - #by default, failed - ret = 'Test failed' - success = False - #plot name to be given to the scan. Use: scan.setPlotName(plotName) - plotName = DEVICE + ' - ' + testName -######### WRITE YOUR CODE HERE BELOW ############# - - #All the code here in this section ## ..YOUR CODE.. ## can be modified/deleted. - # INPUTS: - #If needed, the following variables are available: - #testPath string, path of this test file - #testName string, name of this test - #DEVICE string, device for which the test must run (typically it is the beginning of a process variable name) - #params dictionary, a set of key-value parameters specific to the test. - # Syntax: params[""]["value"] - # Example: access the parameter called midPoint and store it in a new variable: - # middlePoint = params["midPoint"]["value"] - # OUTPUTS: - #ret string, a text summarizing the result of the test. It must be set before the end of your code. - #success bool, True = test successful. It must be set before the end of your code. - - #Example (can be removed): print the list of parameters passed. If any error, stop and send feedback - print_log(testName, DEVICE, "Example - Test name: "+testName): - print_log(testName, DEVICE, "Example - Device name: "+DEVICE): - try: - print_log(testName, DEVICE, "Running test Initialise with the following parameters:") - print_log(testName, DEVICE, params ) - #If present, use the parameters here below for your test script - examplePar1 = float(params["examplePar1"]["value"]) ; examplePar2 = float(params["examplePar2"]["value"]) ; - except: - ret = 'Could not retrieve testing parameters - ' + traceback.format_exc() - success = False - sendFeedback(testPath, testName, DEVICE, ret, success) - return - - #example: loop to read channels for a while and plot the channels values. - - #initialise plot tab with 2 plots - scan = ManualScan(['sample'], ['Motor Status (MSTA)', 'Motor Position (VAL)'] ) - #set plot name(tab title) - scan.setPlotName(plotName) - #start plots. See further below how to add points to the plots - scan.start() - - #IMPORTANT: if the test resulted with an error, write the following: - ret = "Example - Error, the test failed because...." - success = False - #IMPORTANT: if the test was successful, write the following: - ret = "Example - Test successful, here some detail: ..." - success = True - #set up connection to channels. "type" of data can be "d" (= double), "l" (= long) - try: - pv_motor_msta = Channel(DEVICE+':MOTOR.MSTA', type = 'd') - pv_motor_val = Channel(DEVICE+':MOTOR.VAL' , type = 'd') - except: - #prepare return information: return text - ret = 'Unable to create channel - ' + traceback.format_exc() - #prepare return information: return success - success = False - #send return information - sendFeedback(testPath, testName, DEVICE, ret, success) - return - #take 100 samples of the channels - for sample in range(0, 100): - readback1 = sample - sleep( 0.1 ) # Settling time - #get value - motor_msta = pv_motor_msta.get() - #get value - motor_val = pv_motor_val.get() - #add values to plot - scan.append ([sample], [readback1], [detmotor_msta, motor_val] ) - - #Closing channels - pv_motor_msta.close() - pv_motor_val.close() - - #once the test is finished, no need to do anything. The code below yours will do the rest. -################ END OF YOUR CODE ################ -###### Final - DO NOT MODIFY THE CODE BELOW ###### - sendFeedback(testPath, testName, DEVICE, ret, success) - except: - ret = traceback.format_exc() - success = False - sendFeedback(testPath, testName, DEVICE, ret, success) - return - -#launch the test -startTest(test, device, parameters) - \ No newline at end of file diff --git a/script/tests/tests/fewfewfw/ef/help.html b/script/tests/tests/fewfewfw/ef/help.html deleted file mode 100644 index acbfb3b..0000000 --- a/script/tests/tests/fewfewfw/ef/help.html +++ /dev/null @@ -1,15 +0,0 @@ - - -

Short Description

-wedwee -

Details

-Add here the detailed description of the test, with reference to the parameters (if any). -

Parameters

-examplePar1 This is the parameter n.1 with unit [unit]
-examplePar2 This is the parameter n.2 with unit [unit]
- -

Contact

-deefe - - - diff --git a/script/tests/tests/ghyug/huihi/.config b/script/tests/tests/ghyug/huihi/.config deleted file mode 100644 index 5438ecc..0000000 --- a/script/tests/tests/ghyug/huihi/.config +++ /dev/null @@ -1,4 +0,0 @@ -#Wed Sep 02 09:25:34 CEST 2015 -name=huihi -parameters=examplePar1\:2\:This is the parameter n.1 with unit [unit];examplePar2\:4.5\:This is the parameter n.2 with unit [unit]; -description=ghjkg diff --git a/script/tests/tests/ghyug/huihi/help.html b/script/tests/tests/ghyug/huihi/help.html deleted file mode 100644 index c199617..0000000 --- a/script/tests/tests/ghyug/huihi/help.html +++ /dev/null @@ -1,13 +0,0 @@ - - -

Description

-ghjkg -

Parameters

-examplePar1 This is the parameter n.1 with unit [unit]
-examplePar2 This is the parameter n.2 with unit [unit]
- -

Contact

-jlkljlkj - - - diff --git a/script/tests/tests/ghyug/huihi/huihi.py b/script/tests/tests/ghyug/huihi/huihi.py deleted file mode 100644 index 127216a..0000000 --- a/script/tests/tests/ghyug/huihi/huihi.py +++ /dev/null @@ -1,119 +0,0 @@ -#Test name: huihi -#ghjkg - -###### Init - DO NOT MODIFY THE CODE BELOW ###### -global print_log, sendFeedback, inspect, log, sys, inspect, os, traceback -import sys, inspect, os, traceback - -def print_log(testName, DEVICE, text): - time.ctime() - now = time.strftime('%Y.%m.%d %H:%M:%S') - print now + ' ' + DEVICE + ' - ' + testName + ': ' + str(text) - log (now + ' ' + DEVICE + ' - ' + testName + ': ' + text ) - -#prepare and send feedback to calling tool -def sendFeedback(testPath, testName, DEVICE, returnString, testPassed): - print_log(testName, DEVICE, 'End of test. Result:') - print_log(testName, DEVICE, 'Device: ' + DEVICE) - print_log(testName, DEVICE, 'Test name: ' + testName) - print_log(testName, DEVICE, 'Test path: ' + testPath) - print_log(testName, DEVICE, 'Test passed: ' + str(testPassed)) - print_log(testName, DEVICE, 'Return string: ' + returnString) - ret = [testPath, DEVICE, returnString, testPassed] - set_return(ret) - -def startTest(testName, DEVICE, params): - try: - import traceback - #get the path of this script - testPath = inspect.getfile(inspect.currentframe()) - #by default, failed - ret = 'Test failed' - success = False - #plot name to be given to the scan. Use: scan.setPlotName(plotName) - plotName = DEVICE + ' - ' + testName -######### WRITE YOUR CODE HERE BELOW ############# - - #All the code here in this section ## ..YOUR CODE.. ## can be modified/deleted. - # INPUTS: - #If needed, the following variables are available: - #testPath string, path of this test file - #testName string, name of this test - #DEVICE string, device for which the test must run (typically it is the beginning of a process variable name) - #params dictionary, a set of key-value parameters specific to the test. - # Syntax: params[""]["value"] - # Example: access the parameter called midPoint and store it in a new variable: - # middlePoint = params["midPoint"]["value"] - # OUTPUTS: - #ret string, a text summarizing the result of the test. It must be set before the end of your code. - #success bool, True = test successful. It must be set before the end of your code. - - #Example (can be removed): print the list of parameters passed. If any error, stop and send feedback - print_log(testName, DEVICE, "Example - Test name: "+testName): - print_log(testName, DEVICE, "Example - Device name: "+DEVICE): - try: - print_log(testName, DEVICE, "Running test Initialise with the following parameters:") - print_log(testName, DEVICE, params ) - #If present, use the parameters here below for your test script - examplePar1 = float(params["examplePar1"]["value"]) ; examplePar2 = float(params["examplePar2"]["value"]) ; - except: - ret = 'Could not retrieve testing parameters - ' + traceback.format_exc() - success = False - sendFeedback(testPath, testName, DEVICE, ret, success) - return - - #example: loop to read channels for a while and plot the channels values. - - #initialise plot tab with 2 plots - scan = ManualScan(['sample'], ['Motor Status (MSTA)', 'Motor Position (VAL)'] ) - #set plot name(tab title) - scan.setPlotName(plotName) - #start plots. See further below how to add points to the plots - scan.start() - - #IMPORTANT: if the test resulted with an error, write the following: - ret = "Example - Error, the test failed because...." - success = False - #IMPORTANT: if the test was successful, write the following: - ret = "Example - Test successful, here some detail: ..." - success = True - #set up connection to channels. "type" of data can be "d" (= double), "l" (= long) - try: - pv_motor_msta = Channel(DEVICE+':MOTOR.MSTA', type = 'd') - pv_motor_val = Channel(DEVICE+':MOTOR.VAL' , type = 'd') - except: - #prepare return information: return text - ret = 'Unable to create channel - ' + traceback.format_exc() - #prepare return information: return success - success = False - #send return information - sendFeedback(testPath, testName, DEVICE, ret, success) - return - #take 100 samples of the channels - for sample in range(0, 100): - readback1 = sample - sleep( 0.1 ) # Settling time - #get value - motor_msta = pv_motor_msta.get() - #get value - motor_val = pv_motor_val.get() - #add values to plot - scan.append ([sample], [readback1], [detmotor_msta, motor_val] ) - - #Closing channels - pv_motor_msta.close() - pv_motor_val.close() - - #once the test is finished, no need to do anything. The code below yours will do the rest. -################ END OF YOUR CODE ################ -###### Final - DO NOT MODIFY THE CODE BELOW ###### - sendFeedback(testPath, testName, DEVICE, ret, success) - except: - ret = traceback.format_exc() - success = False - sendFeedback(testPath, testName, DEVICE, ret, success) - return - -#launch the test -startTest(test, device, parameters) - \ No newline at end of file diff --git a/script/tests/tests/jaja/blabla/.config b/script/tests/tests/jaja/blabla/.config deleted file mode 100644 index b78bedc..0000000 --- a/script/tests/tests/jaja/blabla/.config +++ /dev/null @@ -1,4 +0,0 @@ -#Tue Sep 01 13:58:29 CEST 2015 -name=blabla -parameters=examplePar1\:2\:This is the parameter n.1 with unit [unit];examplePar2\:4.5\:This is the parameter n.2 with unit [unit]; -description=zaza diff --git a/script/tests/tests/jaja/blabla/blabla.py b/script/tests/tests/jaja/blabla/blabla.py deleted file mode 100644 index 3bcadf5..0000000 --- a/script/tests/tests/jaja/blabla/blabla.py +++ /dev/null @@ -1,119 +0,0 @@ -#Test name: blabla -#zaza - -###### Init - DO NOT MODIFY THE CODE BELOW ###### -global print_log, sendFeedback, inspect, log, sys, inspect, os, traceback -import sys, inspect, os, traceback - -def print_log(testName, DEVICE, text): - time.ctime() - now = time.strftime('%Y.%m.%d %H:%M:%S') - print now + ' ' + DEVICE + ' - ' + testName + ': ' + str(text) - log (now + ' ' + DEVICE + ' - ' + testName + ': ' + text ) - -#prepare and send feedback to calling tool -def sendFeedback(testPath, testName, DEVICE, returnString, testPassed): - print_log(testName, DEVICE, 'End of test. Result:') - print_log(testName, DEVICE, 'Device: ' + DEVICE) - print_log(testName, DEVICE, 'Test name: ' + testName) - print_log(testName, DEVICE, 'Test path: ' + testPath) - print_log(testName, DEVICE, 'Test passed: ' + str(testPassed)) - print_log(testName, DEVICE, 'Return string: ' + returnString) - ret = [testPath, DEVICE, returnString, testPassed] - set_return(ret) - -def startTest(testName, DEVICE, params): - try: - import traceback - #get the path of this script - testPath = inspect.getfile(inspect.currentframe()) - #by default, failed - ret = 'Test failed' - success = False - #plot name to be given to the scan. Use: scan.setPlotName(plotName) - plotName = DEVICE + ' - ' + testName -######### WRITE YOUR CODE HERE BELOW ############# - - #All the code here in this section ## ..YOUR CODE.. ## can be modified/deleted. - # INPUTS: - #If needed, the following variables are available: - #testPath string, path of this test file - #testName string, name of this test - #DEVICE string, device for which the test must run (typically it is the beginning of a process variable name) - #params dictionary, a set of key-value parameters specific to the test. - # Syntax: params[""]["value"] - # Example: access the parameter called midPoint and store it in a new variable: - # middlePoint = params["midPoint"]["value"] - # OUTPUTS: - #ret string, a text summarizing the result of the test. It must be set before the end of your code. - #success bool, True = test successful. It must be set before the end of your code. - - #Example (can be removed): print the list of parameters passed. If any error, stop and send feedback - print_log(testName, DEVICE, "Example - Test name: "+testName): - print_log(testName, DEVICE, "Example - Device name: "+DEVICE): - try: - print_log(testName, DEVICE, "Running test Initialise with the following parameters:") - print_log(testName, DEVICE, params ) - #If present, use the parameters here below for your test script - examplePar1 = float(params["examplePar1"]["value"]) ; examplePar2 = float(params["examplePar2"]["value"]) ; - except: - ret = 'Could not retrieve testing parameters - ' + traceback.format_exc() - success = False - sendFeedback(testPath, testName, DEVICE, ret, success) - return - - #example: loop to read channels for a while and plot the channels values. - - #initialise plot tab with 2 plots - scan = ManualScan(['sample'], ['Motor Status (MSTA)', 'Motor Position (VAL)'] ) - #set plot name(tab title) - scan.setPlotName(plotName) - #start plots. See further below how to add points to the plots - scan.start() - - #IMPORTANT: if the test resulted with an error, write the following: - ret = "Example - Error, the test failed because...." - success = False - #IMPORTANT: if the test was successful, write the following: - ret = "Example - Test successful, here some detail: ..." - success = True - #set up connection to channels. "type" of data can be "d" (= double), "l" (= long) - try: - pv_motor_msta = Channel(DEVICE+':MOTOR.MSTA', type = 'd') - pv_motor_val = Channel(DEVICE+':MOTOR.VAL' , type = 'd') - except: - #prepare return information: return text - ret = 'Unable to create channel - ' + traceback.format_exc() - #prepare return information: return success - success = False - #send return information - sendFeedback(testPath, testName, DEVICE, ret, success) - return - #take 100 samples of the channels - for sample in range(0, 100): - readback1 = sample - sleep( 0.1 ) # Settling time - #get value - motor_msta = pv_motor_msta.get() - #get value - motor_val = pv_motor_val.get() - #add values to plot - scan.append ([sample], [readback1], [detmotor_msta, motor_val] ) - - #Closing channels - pv_motor_msta.close() - pv_motor_val.close() - - #once the test is finished, no need to do anything. The code below yours will do the rest. -################ END OF YOUR CODE ################ -###### Final - DO NOT MODIFY THE CODE BELOW ###### - sendFeedback(testPath, testName, DEVICE, ret, success) - except: - ret = traceback.format_exc() - success = False - sendFeedback(testPath, testName, DEVICE, ret, success) - return - -#launch the test -startTest(test, device, parameters) - \ No newline at end of file diff --git a/script/tests/tests/jaja/blabla/help.html b/script/tests/tests/jaja/blabla/help.html deleted file mode 100644 index 0ff5dd9..0000000 --- a/script/tests/tests/jaja/blabla/help.html +++ /dev/null @@ -1,15 +0,0 @@ - - -

Short Description

-zaza -

Details

-Add here the detailed description of the test, with reference to the parameters (if any). -

Parameters

-examplePar1 This is the parameter n.1 with unit [unit]
-examplePar2 This is the parameter n.2 with unit [unit]
- -

Contact

-boccioli_m - - - diff --git a/script/tests/tests/jojo/aaaaaaaaaaa/.config b/script/tests/tests/jojo/aaaaaaaaaaa/.config deleted file mode 100644 index b092dc8..0000000 --- a/script/tests/tests/jojo/aaaaaaaaaaa/.config +++ /dev/null @@ -1,4 +0,0 @@ -#Tue Sep 01 14:16:37 CEST 2015 -name=aaaaaaaaaaa -parameters=examplePar1\:2\:This is the parameter n.1 with unit [unit];awa\:5\:wawawwaa;examplePar2\:4.5\:This is the parameter n.2 with unit [unit]; -description=asdewe fre rgg tr hyhyhyj jyjyj jkujyu u \: yj yj . thth h<3434 thth \=45 >tt5 [s] diff --git a/script/tests/tests/jojo/aaaaaaaaaaa/aaaaaaaaaaa.py b/script/tests/tests/jojo/aaaaaaaaaaa/aaaaaaaaaaa.py deleted file mode 100644 index 6b4ea53..0000000 --- a/script/tests/tests/jojo/aaaaaaaaaaa/aaaaaaaaaaa.py +++ /dev/null @@ -1,119 +0,0 @@ -#Test name: aaaaaaaaaaa -#asdewe fre rgg tr hyhyhyj jyjyj jkujyu u : yj yj . thth h<3434 thth =45 >tt5 [s] - -###### Init - DO NOT MODIFY THE CODE BELOW ###### -global print_log, sendFeedback, inspect, log, sys, inspect, os, traceback -import sys, inspect, os, traceback - -def print_log(testName, DEVICE, text): - time.ctime() - now = time.strftime('%Y.%m.%d %H:%M:%S') - print now + ' ' + DEVICE + ' - ' + testName + ': ' + str(text) - log (now + ' ' + DEVICE + ' - ' + testName + ': ' + text ) - -#prepare and send feedback to calling tool -def sendFeedback(testPath, testName, DEVICE, returnString, testPassed): - print_log(testName, DEVICE, 'End of test. Result:') - print_log(testName, DEVICE, 'Device: ' + DEVICE) - print_log(testName, DEVICE, 'Test name: ' + testName) - print_log(testName, DEVICE, 'Test path: ' + testPath) - print_log(testName, DEVICE, 'Test passed: ' + str(testPassed)) - print_log(testName, DEVICE, 'Return string: ' + returnString) - ret = [testPath, DEVICE, returnString, testPassed] - set_return(ret) - -def startTest(testName, DEVICE, params): - try: - import traceback - #get the path of this script - testPath = inspect.getfile(inspect.currentframe()) - #by default, failed - ret = 'Test failed' - success = False - #plot name to be given to the scan. Use: scan.setPlotName(plotName) - plotName = DEVICE + ' - ' + testName -######### WRITE YOUR CODE HERE BELOW ############# - - #All the code here in this section ## ..YOUR CODE.. ## can be modified/deleted. - # INPUTS: - #If needed, the following variables are available: - #testPath string, path of this test file - #testName string, name of this test - #DEVICE string, device for which the test must run (typically it is the beginning of a process variable name) - #params dictionary, a set of key-value parameters specific to the test. - # Syntax: params[""]["value"] - # Example: access the parameter called midPoint and store it in a new variable: - # middlePoint = params["midPoint"]["value"] - # OUTPUTS: - #ret string, a text summarizing the result of the test. It must be set before the end of your code. - #success bool, True = test successful. It must be set before the end of your code. - - #Example (can be removed): print the list of parameters passed. If any error, stop and send feedback - print_log(testName, DEVICE, "Example - Test name: "+testName): - print_log(testName, DEVICE, "Example - Device name: "+DEVICE): - try: - print_log(testName, DEVICE, "Running test Initialise with the following parameters:") - print_log(testName, DEVICE, params ) - #If present, use the parameters here below for your test script - examplePar1 = float(params["examplePar1"]["value"]) ; awa = float(params["awa"]["value"]) ; examplePar2 = float(params["examplePar2"]["value"]) ; - except: - ret = 'Could not retrieve testing parameters - ' + traceback.format_exc() - success = False - sendFeedback(testPath, testName, DEVICE, ret, success) - return - - #example: loop to read channels for a while and plot the channels values. - - #initialise plot tab with 2 plots - scan = ManualScan(['sample'], ['Motor Status (MSTA)', 'Motor Position (VAL)'] ) - #set plot name(tab title) - scan.setPlotName(plotName) - #start plots. See further below how to add points to the plots - scan.start() - - #IMPORTANT: if the test resulted with an error, write the following: - ret = "Example - Error, the test failed because...." - success = False - #IMPORTANT: if the test was successful, write the following: - ret = "Example - Test successful, here some detail: ..." - success = True - #set up connection to channels. "type" of data can be "d" (= double), "l" (= long) - try: - pv_motor_msta = Channel(DEVICE+':MOTOR.MSTA', type = 'd') - pv_motor_val = Channel(DEVICE+':MOTOR.VAL' , type = 'd') - except: - #prepare return information: return text - ret = 'Unable to create channel - ' + traceback.format_exc() - #prepare return information: return success - success = False - #send return information - sendFeedback(testPath, testName, DEVICE, ret, success) - return - #take 100 samples of the channels - for sample in range(0, 100): - readback1 = sample - sleep( 0.1 ) # Settling time - #get value - motor_msta = pv_motor_msta.get() - #get value - motor_val = pv_motor_val.get() - #add values to plot - scan.append ([sample], [readback1], [detmotor_msta, motor_val] ) - - #Closing channels - pv_motor_msta.close() - pv_motor_val.close() - - #once the test is finished, no need to do anything. The code below yours will do the rest. -################ END OF YOUR CODE ################ -###### Final - DO NOT MODIFY THE CODE BELOW ###### - sendFeedback(testPath, testName, DEVICE, ret, success) - except: - ret = traceback.format_exc() - success = False - sendFeedback(testPath, testName, DEVICE, ret, success) - return - -#launch the test -startTest(test, device, parameters) - \ No newline at end of file diff --git a/script/tests/tests/jojo/aaaaaaaaaaa/help.html b/script/tests/tests/jojo/aaaaaaaaaaa/help.html deleted file mode 100644 index 5d7f1c2..0000000 --- a/script/tests/tests/jojo/aaaaaaaaaaa/help.html +++ /dev/null @@ -1,14 +0,0 @@ - - -

Description

-asdewe fre rgg tr hyhyhyj jyjyj jkujyu u : yj yj . thth h<3434 thth =45 >tt5 [s] -

Parameters

-examplePar1 This is the parameter n.1 with unit [unit]
-awa wawawwaa
-examplePar2 This is the parameter n.2 with unit [unit]
- -

Contact

-boccioli_m - - - diff --git a/script/tests/tests/jojo/aha/.config b/script/tests/tests/jojo/aha/.config deleted file mode 100644 index 6a1dfb8..0000000 --- a/script/tests/tests/jojo/aha/.config +++ /dev/null @@ -1,4 +0,0 @@ -#Tue Sep 01 14:04:43 CEST 2015 -name=aha -parameters=ef\:2\:feeerfs;examplePar1\:2\:This is the parameter n.1 with unit [unit];examplePar2\:4.5\:This is the parameter n.2 with unit [unit]; -description=pppoo diff --git a/script/tests/tests/jojo/aha/aha.py b/script/tests/tests/jojo/aha/aha.py deleted file mode 100644 index aa40fc3..0000000 --- a/script/tests/tests/jojo/aha/aha.py +++ /dev/null @@ -1,119 +0,0 @@ -#Test name: aha -#pppoo - -###### Init - DO NOT MODIFY THE CODE BELOW ###### -global print_log, sendFeedback, inspect, log, sys, inspect, os, traceback -import sys, inspect, os, traceback - -def print_log(testName, DEVICE, text): - time.ctime() - now = time.strftime('%Y.%m.%d %H:%M:%S') - print now + ' ' + DEVICE + ' - ' + testName + ': ' + str(text) - log (now + ' ' + DEVICE + ' - ' + testName + ': ' + text ) - -#prepare and send feedback to calling tool -def sendFeedback(testPath, testName, DEVICE, returnString, testPassed): - print_log(testName, DEVICE, 'End of test. Result:') - print_log(testName, DEVICE, 'Device: ' + DEVICE) - print_log(testName, DEVICE, 'Test name: ' + testName) - print_log(testName, DEVICE, 'Test path: ' + testPath) - print_log(testName, DEVICE, 'Test passed: ' + str(testPassed)) - print_log(testName, DEVICE, 'Return string: ' + returnString) - ret = [testPath, DEVICE, returnString, testPassed] - set_return(ret) - -def startTest(testName, DEVICE, params): - try: - import traceback - #get the path of this script - testPath = inspect.getfile(inspect.currentframe()) - #by default, failed - ret = 'Test failed' - success = False - #plot name to be given to the scan. Use: scan.setPlotName(plotName) - plotName = DEVICE + ' - ' + testName -######### WRITE YOUR CODE HERE BELOW ############# - - #All the code here in this section ## ..YOUR CODE.. ## can be modified/deleted. - # INPUTS: - #If needed, the following variables are available: - #testPath string, path of this test file - #testName string, name of this test - #DEVICE string, device for which the test must run (typically it is the beginning of a process variable name) - #params dictionary, a set of key-value parameters specific to the test. - # Syntax: params[""]["value"] - # Example: access the parameter called midPoint and store it in a new variable: - # middlePoint = params["midPoint"]["value"] - # OUTPUTS: - #ret string, a text summarizing the result of the test. It must be set before the end of your code. - #success bool, True = test successful. It must be set before the end of your code. - - #Example (can be removed): print the list of parameters passed. If any error, stop and send feedback - print_log(testName, DEVICE, "Example - Test name: "+testName): - print_log(testName, DEVICE, "Example - Device name: "+DEVICE): - try: - print_log(testName, DEVICE, "Running test Initialise with the following parameters:") - print_log(testName, DEVICE, params ) - #If present, use the parameters here below for your test script - ef = float(params["ef"]["value"]) ; examplePar1 = float(params["examplePar1"]["value"]) ; examplePar2 = float(params["examplePar2"]["value"]) ; - except: - ret = 'Could not retrieve testing parameters - ' + traceback.format_exc() - success = False - sendFeedback(testPath, testName, DEVICE, ret, success) - return - - #example: loop to read channels for a while and plot the channels values. - - #initialise plot tab with 2 plots - scan = ManualScan(['sample'], ['Motor Status (MSTA)', 'Motor Position (VAL)'] ) - #set plot name(tab title) - scan.setPlotName(plotName) - #start plots. See further below how to add points to the plots - scan.start() - - #IMPORTANT: if the test resulted with an error, write the following: - ret = "Example - Error, the test failed because...." - success = False - #IMPORTANT: if the test was successful, write the following: - ret = "Example - Test successful, here some detail: ..." - success = True - #set up connection to channels. "type" of data can be "d" (= double), "l" (= long) - try: - pv_motor_msta = Channel(DEVICE+':MOTOR.MSTA', type = 'd') - pv_motor_val = Channel(DEVICE+':MOTOR.VAL' , type = 'd') - except: - #prepare return information: return text - ret = 'Unable to create channel - ' + traceback.format_exc() - #prepare return information: return success - success = False - #send return information - sendFeedback(testPath, testName, DEVICE, ret, success) - return - #take 100 samples of the channels - for sample in range(0, 100): - readback1 = sample - sleep( 0.1 ) # Settling time - #get value - motor_msta = pv_motor_msta.get() - #get value - motor_val = pv_motor_val.get() - #add values to plot - scan.append ([sample], [readback1], [detmotor_msta, motor_val] ) - - #Closing channels - pv_motor_msta.close() - pv_motor_val.close() - - #once the test is finished, no need to do anything. The code below yours will do the rest. -################ END OF YOUR CODE ################ -###### Final - DO NOT MODIFY THE CODE BELOW ###### - sendFeedback(testPath, testName, DEVICE, ret, success) - except: - ret = traceback.format_exc() - success = False - sendFeedback(testPath, testName, DEVICE, ret, success) - return - -#launch the test -startTest(test, device, parameters) - \ No newline at end of file diff --git a/script/tests/tests/jojo/aha/help.html b/script/tests/tests/jojo/aha/help.html deleted file mode 100644 index a2923fe..0000000 --- a/script/tests/tests/jojo/aha/help.html +++ /dev/null @@ -1,16 +0,0 @@ - - -

Short Description

-pppoo -

Details

-Add here the detailed description of the test, with reference to the parameters (if any). -

Parameters

-ef feeerfs
-examplePar1 This is the parameter n.1 with unit [unit]
-examplePar2 This is the parameter n.2 with unit [unit]
- -

Contact

-boccioli_m - - - diff --git a/script/tests/tests/sdfsd/dfsdf/.config b/script/tests/tests/sdfsd/dfsdf/.config deleted file mode 100644 index 8e8041b..0000000 --- a/script/tests/tests/sdfsd/dfsdf/.config +++ /dev/null @@ -1,4 +0,0 @@ -#Tue Sep 01 11:44:57 CEST 2015 -name=dfsdf -parameters=examplePar1\:2\:This is the parameter n.1 with unit [unit];examplePar2\:4.5\:This is the parameter n.2 with unit [unit]; -description=wqeqw diff --git a/script/tests/tests/sdfsd/dfsdf/dfsdf.py b/script/tests/tests/sdfsd/dfsdf/dfsdf.py deleted file mode 100644 index d724a6d..0000000 --- a/script/tests/tests/sdfsd/dfsdf/dfsdf.py +++ /dev/null @@ -1,119 +0,0 @@ -#dfsdf -#wqeqw - -###### Init - DO NOT MODIFY THE CODE BELOW ###### -global print_log, sendFeedback, inspect, log, sys, inspect, os, traceback -import sys, inspect, os, traceback - -def print_log(testName, DEVICE, text): - time.ctime() - now = time.strftime('%Y.%m.%d %H:%M:%S') - print now + ' ' + DEVICE + ' - ' + testName + ': ' + str(text) - log (now + ' ' + DEVICE + ' - ' + testName + ': ' + text ) - -#prepare and send feedback to calling tool -def sendFeedback(testPath, testName, DEVICE, returnString, testPassed): - print_log(testName, DEVICE, 'End of test. Result:') - print_log(testName, DEVICE, 'Device: ' + DEVICE) - print_log(testName, DEVICE, 'Test name: ' + testName) - print_log(testName, DEVICE, 'Test path: ' + testPath) - print_log(testName, DEVICE, 'Test passed: ' + str(testPassed)) - print_log(testName, DEVICE, 'Return string: ' + returnString) - ret = [testPath, DEVICE, returnString, testPassed] - set_return(ret) - -def startTest(testName, DEVICE, params): - try: - import traceback - #get the path of this script - testPath = inspect.getfile(inspect.currentframe()) - #by default, failed - ret = 'Test failed' - success = False - #plot name to be given to the scan. Use: scan.setPlotName(plotName) - plotName = DEVICE + ' - ' + testName -######### WRITE YOUR CODE HERE BELOW ############# - - #All the code here in this section ## ..YOUR CODE.. ## can be modified/deleted. - # INPUTS: - #If needed, the following variables are available: - #testPath string, path of this test file - #testName string, name of this test - #DEVICE string, device for which the test must run (typically it is the beginning of a process variable name) - #params dictionary, a set of key-value parameters specific to the test. - # Syntax: params[""]["value"] - # Example: access the parameter called midPoint and store it in a new variable: - # middlePoint = params["midPoint"]["value"] - # OUTPUTS: - #ret string, a text summarizing the result of the test. It must be set before the end of your code. - #success bool, True = test successful. It must be set before the end of your code. - - #Example (can be removed): print the list of parameters passed. If any error, stop and send feedback - print_log(testName, DEVICE, "Example - Test name: "+testName): - print_log(testName, DEVICE, "Example - Device name: "+DEVICE): - try: - print_log(testName, DEVICE, "Running test Initialise with the following parameters:") - print_log(testName, DEVICE, params ) - #If present, use the parameters here below for your test script - examplePar1 = float(params["examplePar1"]["value"]) ; examplePar2 = float(params["examplePar2"]["value"]) ; - except: - ret = 'Could not retrieve testing parameters - ' + traceback.format_exc() - success = False - sendFeedback(testPath, testName, DEVICE, ret, success) - return - - #example: loop to read channels for a while and plot the channels values. - - #initialise plot tab with 2 plots - scan = ManualScan(['sample'], ['Motor Status (MSTA)', 'Motor Position (VAL)'] ) - #set plot name(tab title) - scan.setPlotName(plotName) - #start plots. See further below how to add points to the plots - scan.start() - - #IMPORTANT: if the test resulted with an error, write the following: - ret = "Example - Error, the test failed because...." - success = False - #IMPORTANT: if the test was successful, write the following: - ret = "Example - Test successful, here some detail: ..." - success = True - #set up connection to channels. "type" of data can be "d" (= double), "l" (= long) - try: - pv_motor_msta = Channel(DEVICE+':MOTOR.MSTA', type = 'd') - pv_motor_val = Channel(DEVICE+':MOTOR.VAL' , type = 'd') - except: - #prepare return information: return text - ret = 'Unable to create channel - ' + traceback.format_exc() - #prepare return information: return success - success = False - #send return information - sendFeedback(testPath, testName, DEVICE, ret, success) - return - #take 100 samples of the channels - for sample in range(0, 100): - readback1 = sample - sleep( 0.1 ) # Settling time - #get value - motor_msta = pv_motor_msta.get() - #get value - motor_val = pv_motor_val.get() - #add values to plot - scan.append ([sample], [readback1], [detmotor_msta, motor_val] ) - - #Closing channels - pv_motor_msta.close() - pv_motor_val.close() - - #once the test is finished, no need to do anything. The code below yours will do the rest. -################ END OF YOUR CODE ################ -###### Final - DO NOT MODIFY THE CODE BELOW ###### - sendFeedback(testPath, testName, DEVICE, ret, success) - except: - ret = traceback.format_exc() - success = False - sendFeedback(testPath, testName, DEVICE, ret, success) - return - -#launch the test -startTest(test, device, parameters) - \ No newline at end of file diff --git a/script/tests/tests/sdfsd/dfsdf/help.html b/script/tests/tests/sdfsd/dfsdf/help.html deleted file mode 100644 index 43e9be7..0000000 --- a/script/tests/tests/sdfsd/dfsdf/help.html +++ /dev/null @@ -1,15 +0,0 @@ - - -

Short Description

-wqeqw -

Details

-Add here the detailed description of the test, with reference to the parameters (if any). -

Parameters

-examplePar1 This is the parameter n.1 with unit [unit]
-examplePar2 This is the parameter n.2 with unit [unit]
- -

Contact

-hjkhjkl - - -