From da9e10fc7ebe1e9f4ef88f7f85aa1ffae5c49d27 Mon Sep 17 00:00:00 2001 From: boccioli_m Date: Tue, 4 Aug 2015 13:40:36 +0200 Subject: [PATCH] Startup --- .gitignore | 19 +- config/config.properties | 10 +- config/jcae.properties | 2 +- plugins/TestingList.java | 1 + plugins/mount.png | Bin 15987 -> 0 bytes .../Calibrate test vme/Calibrate test vme.py | 217 ++++++----- .../Motor Test 1/Motor Test 1.py | 332 +++++++++-------- .../Motor Test 2/Motor Test 2.py | 351 +++++++++--------- .../PS Tests/power-supply-A/power-supply-A.py | 56 +-- .../PS Tests/power-supply-B/power-supply-B.py | 62 ++-- 10 files changed, 567 insertions(+), 483 deletions(-) delete mode 100644 plugins/mount.png diff --git a/.gitignore b/.gitignore index bfc2607..4739de4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,10 @@ -/context -/data -/extensions -/log -/sessions -/www -script/cachedir +/* +!/script +!/plugins +!/devices +!/config script/Lib -script/*.class -script/*.pyc -plugins/*.class +script/**/cachedir +script/**/*.class +script/**/*.pyc +plugins/*.class \ No newline at end of file diff --git a/config/config.properties b/config/config.properties index d28ae98..b9f0631 100644 --- a/config/config.properties +++ b/config/config.properties @@ -1,10 +1,8 @@ -#Fri Jul 03 14:34:59 CEST 2015 +#Tue Aug 04 11:09:00 CEST 2015 autoSaveScanData=true createSessionFiles=false -dataFile={data}/{year}_{month}/{date}/{date}_{time}_{context} -dataFileName={data}/{year}_{month}/{date}/{date}_{time}_{context} dataFilesCreation=true -dataPath={data}/{year}_{month}/{date}/{date}_{time}_{context} +dataPath={data}/{year}_{month}/{date}/{date}_{time}_{exec} dataProvider=text dataScanFlushRecords=false dataScanStrategy=table @@ -21,6 +19,8 @@ simulation=false tasksFile={config}/tasks.properties terminalEnabled=true terminalPort=3579 -versionTrackingEnabled=false +userAuthenticator= +userManagement=false +versionTrackingEnabled=true versionTrackingLogin={config}/agkey versionTrackingRemote=ssh\://git@github.psi.ch\:7999/psd/ncs.git diff --git a/config/jcae.properties b/config/jcae.properties index 863f716..410e599 100644 --- a/config/jcae.properties +++ b/config/jcae.properties @@ -1,4 +1,4 @@ -ch.psi.jcae.ContextFactory.addressList=129.129.144.80 129.129.130.188 129.129.145.206:54321 +ch.psi.jcae.ContextFactory.addressList=129.129.144.80 129.129.130.188 172.25.60.255 172.25.60.102 129.129.145.206:54321 ch.psi.jcae.ContextFactory.maxArrayBytes=10000000 ch.psi.jcae.ChannelFactory.timeout=2000 diff --git a/plugins/TestingList.java b/plugins/TestingList.java index 706faa7..58bdd2d 100644 --- a/plugins/TestingList.java +++ b/plugins/TestingList.java @@ -32,6 +32,7 @@ import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Vector; +import java.util.function.Consumer; import java.util.logging.FileHandler; import java.util.logging.SimpleFormatter; import javax.swing.DefaultCellEditor; diff --git a/plugins/mount.png b/plugins/mount.png deleted file mode 100644 index 731d12e12bd6233dbce34ee4d51e41b374fe8597..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15987 zcmeHu_dnI|8~^JVQL-|VA{3&|n-a2)trSW&Mvi4Nd_J$2pPGsyvSCYGfAjIqlLZnSj z1Wy>~8MxtpD7!m~GDvm{>ooj@#7z2@G=k)YQ0(0&g})!QR?@LUkQ4TV|4@UbY|aQG zNq${U`mQr}eqh^6{lU)R@}ku1m-(`rZ;D>Yyv2CG$>({e`Lde;P81YvUv&2Sq<@eWEaa%0Q z)d)KtjK2e~QOFgZ&7m)$rDvnPXNZuqz|uqtwAk;1@NCO`K2v`*f=@hq4@G{B+iWV% z-XTVE{?@V(Lc;?NR>At6IiVDN>GC8lqcw2GtN^^GwRWA4#> zL`Whu26${cPiM!U>a)hWOCTg9uu?5cYIk2gdQGYbYvL=BL=^2r zZe2pii9jCq4o%P5nNp711I=eD)Z94{5)>?@>3wP%!0#Y6?2_QONQ!?2{!7m4(e;8u zUVfOq`$b=Q4JU#z2j3>Ssh6t$pF(olRA56+JsArBiUXFuaU0aRa;@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ev1Toc<(s|(ydjJ%@tNd0W$qMy7wQ8|&|EE+PORKL zS`z1$HvioDW?FmK2UV}u2DVydO^i&bsdUcU5^|It(DY$}Imjm%0pSE^kl&8o80-6`(2ce$Hs zv`hwRVvuP&DOw7~Etq>t5&-sm_;3@!kA=sUncdsXu_H}JsulVxL+JFYml4yC7>!?nVEnXBmeuz n_J3a%|35#czC%5*cNj;Nc@XLQOA$V|MXt-M$Ysmid-8t(RIl9Y diff --git a/script/tests/tests/Collimator Tests/Calibrate test vme/Calibrate test vme.py b/script/tests/tests/Collimator Tests/Calibrate test vme/Calibrate test vme.py index 1cfbe9c..d2b8bfe 100644 --- a/script/tests/tests/Collimator Tests/Calibrate test vme/Calibrate test vme.py +++ b/script/tests/tests/Collimator Tests/Calibrate test vme/Calibrate test vme.py @@ -1,97 +1,136 @@ #Script imported from: Calibrate.xml -ret = 'Test failed' -status = False +###### DO NOT MODIFY THE CODE BELOW ###### +import sys, inspect, os, traceback, time +global print_log, sendFeedback +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 ####### -#Pre-actions -try: - caput('PO2DV-NCS-'+DEVICE+':INIT.PROC', '1') -except: - print "Unexpected error:", sys.exc_info()[0] - ret = 'Unable to create channel' - success = False - raise - sys.exit() + #Pre-actions + try: + caput(DEVICE+':INIT.PROC', '1') + except: + ret = 'Unable to create channel - ' + traceback.format_exc() + success = False + sendFeedback(testPath, testName, DEVICE, ret, success) + return -#TODO: Set the diplay names of positioners and detectors -scan = ManualScan(['id000000'], ['id000001', 'id000002', 'id000003', 'id000004', 'id000005', 'id000006', 'id000007', 'id000008', 'id000009', 'id000010', 'idResult'] , [0.0], [1000.0], [1000]) -scan.start() + #TODO: Set the diplay names of positioners and detectors + scan = ManualScan(['id000000'], ['id000001', 'id000002', 'id000003', 'id000004', 'id000005', 'id000006', 'id000007', 'id000008', 'id000009', 'id000010', 'idResult'] , [0.0], [1000.0], [1000]) + scan.start() -#Creating channels: dimension 1 -#PseudoPositioner id000000 -#ScalarDetector id000001 -id000001 = Channel('PO2DV-NCS-'+DEVICE+':MOTOR.MSTA', type = 'd') -#ScalarDetector id000002 -id000002 = Channel('PO2DV-NCS-'+DEVICE+':MOTOR.RVAL', type = 'd') -#ScalarDetector id000003 -id000003 = Channel('PO2DV-NCS-'+DEVICE+':MOTOR.VAL', type = 'd') -#ScalarDetector id000004 -id000004 = Channel('PO2DV-NCS-'+DEVICE+':MOTOR.ATHM', type = 'd') -#ScalarDetector id000005 -id000005 = Channel('PO2DV-NCS-'+DEVICE+':MOTOR.LLS', type = 'd') -#ScalarDetector id000006 -id000006 = Channel('PO2DV-NCS-'+DEVICE+':MOTOR.HLS', type = 'd') -#ScalarDetector id000007 -id000007 = Channel('PO2DV-NCS-'+DEVICE+':ENCODERraw', type = 'd') -#ScalarDetector id000008 -id000008 = Channel('PO2DV-NCS-'+DEVICE+':ENCODER', type = 'd') -#ScalarDetector id000009 -id000009 = Channel('PO2DV-NCS-'+DEVICE+':RDY', type = 'd') -#ScalarDetector id000010 -id000010 = Channel('PO2DV-NCS-'+DEVICE+':ILK', type = 'd') + #Creating channels: dimension 1 + #PseudoPositioner id000000 + #ScalarDetector id000001 + id000001 = Channel(DEVICE+':MOTOR.MSTA', type = 'd') + #ScalarDetector id000002 + id000002 = Channel(DEVICE+':MOTOR.RVAL', type = 'd') + #ScalarDetector id000003 + id000003 = Channel(DEVICE+':MOTOR.VAL', type = 'd') + #ScalarDetector id000004 + id000004 = Channel(DEVICE+':MOTOR.ATHM', type = 'd') + #ScalarDetector id000005 + id000005 = Channel(DEVICE+':MOTOR.LLS', type = 'd') + #ScalarDetector id000006 + id000006 = Channel(DEVICE+':MOTOR.HLS', type = 'd') + #ScalarDetector id000007 + id000007 = Channel(DEVICE+':ENCODERraw', type = 'd') + #ScalarDetector id000008 + id000008 = Channel(DEVICE+':ENCODER', type = 'd') + #ScalarDetector id000009 + id000009 = Channel(DEVICE+':RDY', type = 'd') + #ScalarDetector id000010 + id000010 = Channel(DEVICE+':ILK', type = 'd') -#Dimension 1 -#PseudoPositioner id000000 -for setpoint1 in range(0, 1000): - readback1 = setpoint1 - sleep( 0.05 ) # Settling time - #Detector id000001 - detector1 = id000001.get() - #Detector id000002 - detector2 = id000002.get() - #Detector id000003 - detector3 = id000003.get() - #Detector id000004 - detector4 = id000004.get() - #Detector id000005 - detector5 = id000005.get() - #Detector id000006 - detector6 = id000006.get() - #Detector id000007 - detector7 = id000007.get() - #Detector id000008 - detector8 = id000008.get() - #Detector id000009 - detector9 = id000009.get() - #Detector id000010 - detector10 = id000010.get() - #Manipulation idResult - #Variable Mappings - ready = detector9 - interlock = detector10 - count = setpoint1 - if count < 800: - idResult = (0, "Note: the "+DEVICE+" calibration procedure did not complete.") - if ready == 1 and interlock == 1: - #print "The "+DEVICE+" drive was successfully initialised. The RDY and ILK signals indicate the drive is ready." - ret = 'Drive successfully initialised' - status = True - else: - #print "The RS calibration procedure failed. The RDY and ILK signals indicate the drive was NOT ready at the expected time (after 40s)." - ret = 'The RDY and ILK signals indicate the drive was NOT ready at the expected time (after 40s).' - status = False - scan.append ([setpoint1], [readback1], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, detector9, detector10, idResult]) + #Dimension 1 + #PseudoPositioner id000000 + for setpoint1 in range(0, 1000): + readback1 = setpoint1 + sleep( 0.05 ) # Settling time + #Detector id000001 + detector1 = id000001.get() + #Detector id000002 + detector2 = id000002.get() + #Detector id000003 + detector3 = id000003.get() + #Detector id000004 + detector4 = id000004.get() + #Detector id000005 + detector5 = id000005.get() + #Detector id000006 + detector6 = id000006.get() + #Detector id000007 + detector7 = id000007.get() + #Detector id000008 + detector8 = id000008.get() + #Detector id000009 + detector9 = id000009.get() + #Detector id000010 + detector10 = id000010.get() + #Manipulation idResult + #Variable Mappings + ready = detector9 + interlock = detector10 + count = setpoint1 + if count < 800: + idResult = (0, "Note: the "+DEVICE+" calibration procedure did not complete.") + if ready == 1 and interlock == 1: + #print "The "+DEVICE+" drive was successfully initialised. The RDY and ILK signals indicate the drive is ready." + ret = 'Drive successfully initialised' + status = True + else: + #print "The RS calibration procedure failed. The RDY and ILK signals indicate the drive was NOT ready at the expected time (after 40s)." + ret = 'The RDY and ILK signals indicate the drive was NOT ready at the expected time (after 40s).' + status = False + scan.append ([setpoint1], [readback1], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, detector9, detector10, idResult]) -#Closing channels -id000001.close() -id000002.close() -id000003.close() -id000004.close() -id000005.close() -id000006.close() -id000007.close() -id000008.close() -id000009.close() -id000010.close() + #Closing channels + id000001.close() + id000002.close() + id000003.close() + id000004.close() + id000005.close() + id000006.close() + id000007.close() + id000008.close() + id000009.close() + id000010.close() -scan.end() + scan.end() +############# END OF YOUR CODE ########### +###### 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 + +#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, 'Test path: ' + testPath) + print_log(testName, DEVICE, 'Test name: ' + testName) + print_log(testName, DEVICE, 'Device: ' + DEVICE) + print_log(testName, DEVICE, 'Test passed: ' + str(testPassed)) + print_log(testName, DEVICE, 'Return string: ' + returnString) + ret = [testPath, DEVICE, returnString, testPassed] + set_return(ret) + +def print_log(testName, DEVICE, text): + time.ctime() + now = time.strftime('%Y.%m.%d %H:%M:%S') + print now + ' ' + DEVICE + ' - ' + testName + ': ' + text + +#launch the test +startTest(test, device, parameters) + \ No newline at end of file diff --git a/script/tests/tests/Collimator Tests/Motor Test 1/Motor Test 1.py b/script/tests/tests/Collimator Tests/Motor Test 1/Motor Test 1.py index f14d7ef..7108e23 100644 --- a/script/tests/tests/Collimator Tests/Motor Test 1/Motor Test 1.py +++ b/script/tests/tests/Collimator Tests/Motor Test 1/Motor Test 1.py @@ -1,154 +1,192 @@ #Script Motor Test 1 #Moves to CCW switch; then for M times moves N times to CW switch then CCW switch; between each M pauses for delay; log at CCW and CW -import traceback +###### DO NOT MODIFY THE CODE BELOW ###### +import sys, inspect, os, traceback, time +global print_log, sendFeedback -#by default, failed -ret = 'Test failed' -status = False -DEVICE = device -params = parameters -#DEVICE = 'PO2DV-NCS-LS' -#get parameters from the calling interface -try: - print "Running test Motor Test 1 with the following parameters:" - print params - loopTimes = int(params["repeatTimes"]["value"]) - delaySeconds = int(params["delayS"]["value"]) -except: - print "Could not retrieve testing parameters: ", sys.exc_info()[0] - ret = 'Could not retrieve testing parameters - ' + traceback.format_exc() - success = False - raise Exception('Could not retrieve testing parameters - ' + traceback.format_exc()) +#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, 'Test path: ' + testPath) + print_log(testName, DEVICE, 'Test name: ' + testName) + print_log(testName, DEVICE, 'Device: ' + DEVICE) + print_log(testName, DEVICE, 'Test passed: ' + str(testPassed)) + print_log(testName, DEVICE, 'Return string: ' + returnString) + ret = [testPath, DEVICE, returnString, testPassed] + set_return(ret) + +def print_log(testName, DEVICE, text): + time.ctime() + now = time.strftime('%Y.%m.%d %H:%M:%S') + print now + ' ' + DEVICE + ' - ' + testName + ': ' + text -#TODO: Set the diplay names of positioners and detectors -#scan = ManualScan(['idX', 'idInkr'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idPotiProc', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [-0.5, 0.0], [4.0, 3000.0], [3000, 20]) -scan = ManualScan(['idX'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idPotiProc', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [ 0.0], [ 3000.0], [20]) -scan.start() -#Creating channels: dimension 1 -try: - #RegionPositioner idInkr - #idInkr = Channel(DEVICE+':INKR:2', type = 'd') - idInkr = Channel(DEVICE+':MOTOR.VAL', type = 'd') - #ScalarDetector idMotorStatus - #idMotorStatus = Channel(DEVICE+':STA:1', type = 'd') - idMotorStatus = Channel(DEVICE+':MOTOR.MSTA', type = 'd') - #ScalarDetector idLogicalPosition - #idLogicalPosition = Channel(DEVICE+':IST:2', type = 'd') - idLogicalPosition = Channel(DEVICE+':MOTOR.RVAL', type = 'd') - #ScalarDetector idDiameter - #idDiameter = Channel(DEVICE+':DIAM:2', type = 'd') - idDiameter = Channel(DEVICE+':ENCODERoff', type = 'd') - #ScalarDetector idMotorPosition - #idMotorPosition = Channel(DEVICE+':IST1:2', type = 'd') - idMotorPosition = Channel(DEVICE+':MOTOR.RBV', type = 'd') - #ScalarDetector idPotiRaw - #idPotiRaw = Channel(DEVICE+':POSA:1', type = 'd') - idPotiRaw = Channel(DEVICE+':ENCODERraw', type = 'd') - #ScalarDetector idPotiProc - #idPotiProc = Channel(DEVICE+':POSA:2', type = 'd') - idPotiProc = Channel(DEVICE+':ENCODER', type = 'd') - #ScalarDetector idBtvsRaw - #idBtvsRaw = Channel(DEVICE+':IST3:1', type = 'd') - idBtvsRaw = Channel(DEVICE+':MOTOR.LLS', type = 'd') - #ScalarDetector idBtvsProc - #idBtvsProc = Channel(DEVICE+':IST3:2', type = 'd') - idBtvsProc = Channel(DEVICE+':MOTOR.HLS', type = 'd') - #ScalarDetector idEndSwitchL - #idBtvsRaw = Channel(DEVICE+':IST3:1', type = 'd') - idEndSwitchL = Channel(DEVICE+':MOTOR.LLS', type = 'd') - #ScalarDetector idEndSwitchH - #idBtvsProc = Channel(DEVICE+':IST3:2', type = 'd') - idEndSwitchH = Channel(DEVICE+':MOTOR.HLS', type = 'd') - #high position limit - idLimitH = Channel(DEVICE+':MOTOR.HLM', type = 'd') - #low position limit - idLimitL = Channel(DEVICE+':MOTOR.LLM', type = 'd') -except: - print "Unexpected error:", sys.exc_info()[0] - ret = 'Unable to create channel - ' + traceback.format_exc() - success = False - raise Exception('Unable to create channel - ' + traceback.format_exc()) - sys.exit() +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 -#remove limits -idLimitH.put(999999.9, timeout=None) -idLimitL.put(-999999.9, timeout=None) -#Dimension 1 -direction = 1.0; -startDefault = -100.0 -endDefault = 1000.0 -end = endDefault -#find position at Low end switch: it will be the starting point of the test -print 'Homing' -idInkr.put(-100.0, timeout=None) # TODO: Set appropriate timeout -start = startDefault #idInkr.get()+direction -setpoint2 = end -count = 0 -print 'Starting test sequence' -for setpoint1 in range(0, loopTimes*2): - sleep( delaySeconds ) # Settling time - #RegionPositioner idInkr - idInkr.put(setpoint2, timeout=None) # TODO: Set appropriate timeout - readback2 = idInkr.get() - #if abs(readback2 - setpoint2) > 1 : # TODO: Check accuracy - # ret = 'Actor idInkr could not be set to the value ' + str(setpoint2) + ' (current value: ' + str(readback2) + ')' - # success = False - # raise Exception(ret) - #Detector idMotorStatus - detector1 = idMotorStatus.get() - #Detector idLogicalPosition - detector2 = idLogicalPosition.get() - #Detector idDiameter - detector3 = idDiameter.get() - #Detector idMotorPosition - detector4 = idMotorPosition.get() - #Detector idPotiRaw - detector5 = idPotiRaw.get() - #Detector idPotiProc - detector6 = idPotiProc.get() - #Detector idBtvsRaw - detector7 = idBtvsRaw.get() - #Detector idBtvsProc - detector8 = idBtvsProc.get() - #end switches - endH = idEndSwitchH.get() - endL = idEndSwitchL.get() - #Manipulation idDiff02 - #Variable Mappings - a = detector4 - b = detector8 - idDiff02 = a-b - #Manipulation idDiff01 - #Variable Mappings - a = detector4 - b = detector6 - count = count + 1 - idDiff01 = a-b - if endH>0.0 : - #invert direction and swap start with end of translation - setpoint2 = start - print 'End H switch, changing target to ' + str(setpoint2) - scan.append ([setpoint2], [readback2], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, idDiff02, idDiff01]) - if endL>0.0 : - #invert direction and swap start with end of translation +####### WRITE YOUR CODE HERE BELOW ######## + + #DEVICE = 'PO2DV-NCS-LS' + #get parameters from the calling interface + try: + print_log(testName, DEVICE, "Running test Motor Test 1 with the following parameters:") + print_log(testName, DEVICE, params ) + loopTimes = int(params["repeatTimes"]["value"]) + delaySeconds = int(params["delayS"]["value"]) + except: + ret = 'Could not retrieve testing parameters - ' + traceback.format_exc() + success = False + sendFeedback(testPath, testName, DEVICE, ret, success) + return + + #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.start() + #Creating channels: dimension 1 + try: + #RegionPositioner idInkr + #idInkr = Channel(DEVICE+':INKR:2', type = 'd') + idInkr = Channel(DEVICE+':MOTOR.VAL', type = 'd') + #ScalarDetector idMotorStatus + #idMotorStatus = Channel(DEVICE+':STA:1', type = 'd') + idMotorStatus = Channel(DEVICE+':MOTOR.MSTA', type = 'd') + #ScalarDetector idLogicalPosition + #idLogicalPosition = Channel(DEVICE+':IST:2', type = 'd') + idLogicalPosition = Channel(DEVICE+':MOTOR.RVAL', type = 'd') + #ScalarDetector idDiameter + #idDiameter = Channel(DEVICE+':DIAM:2', type = 'd') + idDiameter = Channel(DEVICE+':ENCODERoff', type = 'd') + #ScalarDetector idMotorPosition + #idMotorPosition = Channel(DEVICE+':IST1:2', type = 'd') + idMotorPosition = Channel(DEVICE+':MOTOR.RBV', type = 'd') + #ScalarDetector idPotiRaw + #idPotiRaw = Channel(DEVICE+':POSA:1', type = 'd') + idPotiRaw = Channel(DEVICE+':ENCODERraw', type = 'd') + #ScalarDetector idPotiProc + #idPotiProc = Channel(DEVICE+':POSA:2', type = 'd') + idPotiProc = Channel(DEVICE+':ENCODER', type = 'd') + #ScalarDetector idBtvsRaw + #idBtvsRaw = Channel(DEVICE+':IST3:1', type = 'd') + idBtvsRaw = Channel(DEVICE+':MOTOR.LLS', type = 'd') + #ScalarDetector idBtvsProc + #idBtvsProc = Channel(DEVICE+':IST3:2', type = 'd') + idBtvsProc = Channel(DEVICE+':MOTOR.HLS', type = 'd') + #ScalarDetector idEndSwitchL + #idBtvsRaw = Channel(DEVICE+':IST3:1', type = 'd') + idEndSwitchL = Channel(DEVICE+':MOTOR.LLS', type = 'd') + #ScalarDetector idEndSwitchH + #idBtvsProc = Channel(DEVICE+':IST3:2', type = 'd') + idEndSwitchH = Channel(DEVICE+':MOTOR.HLS', type = 'd') + #high position limit + idLimitH = Channel(DEVICE+':MOTOR.HLM', type = 'd') + #low position limit + idLimitL = Channel(DEVICE+':MOTOR.LLM', type = 'd') + except: + ret = 'Unable to create channel - ' + traceback.format_exc() + success = False + sendFeedback(testPath, testName, DEVICE, ret, success) + return + + #remove limits + idLimitH.put(999999.9, timeout=None) + idLimitL.put(-999999.9, timeout=None) + #Dimension 1 + direction = 1.0; + startDefault = -100.0 + endDefault = 1000.0 + end = endDefault + #find position at Low end switch: it will be the starting point of the test + print_log(testName, DEVICE, 'Homing') + idInkr.put(-100.0, timeout=None) # TODO: Set appropriate timeout + start = startDefault #idInkr.get()+direction setpoint2 = end - print 'End L switch, changing target to ' + str(setpoint2) - scan.append ([setpoint2], [readback2], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, idDiff02, idDiff01]) - -#set limits back -idLimitH.put(145.0, timeout=None) -idLimitL.put(0.0, timeout=None) -#Closing channels -idInkr.close() -idMotorStatus.close() -idLogicalPosition.close() -idDiameter.close() -idMotorPosition.close() -idPotiRaw.close() -idPotiProc.close() -idBtvsRaw.close() -idBtvsProc.close() -scan.end() -ret = 'Slide moved back and forth (' + str(count) + ' runs)' -status = True + count = 0 + print_log(testName, DEVICE, 'Starting test sequence') + for setpoint1 in range(0, loopTimes*2): + sleep( delaySeconds ) # Settling time + #RegionPositioner idInkr + idInkr.put(setpoint2, timeout=None) # TODO: Set appropriate timeout + readback2 = idInkr.get() + #if abs(readback2 - setpoint2) > 1 : # TODO: Check accuracy + # ret = 'Actor idInkr could not be set to the value ' + str(setpoint2) + ' (current value: ' + str(readback2) + ')' + # success = False + # raise Exception(ret) + #Detector idMotorStatus + detector1 = idMotorStatus.get() + #Detector idLogicalPosition + detector2 = idLogicalPosition.get() + #Detector idDiameter + detector3 = idDiameter.get() + #Detector idMotorPosition + detector4 = idMotorPosition.get() + #Detector idPotiRaw + detector5 = idPotiRaw.get() + #Detector idPotiProc + detector6 = idPotiProc.get() + #Detector idBtvsRaw + detector7 = idBtvsRaw.get() + #Detector idBtvsProc + detector8 = idBtvsProc.get() + #end switches + endH = idEndSwitchH.get() + endL = idEndSwitchL.get() + #Manipulation idDiff02 + #Variable Mappings + a = detector4 + b = detector8 + idDiff02 = a-b + #Manipulation idDiff01 + #Variable Mappings + a = detector4 + b = detector6 + count = count + 1 + idDiff01 = a-b + if endH>0.0 : + #invert direction and swap start with end of translation + setpoint2 = start + print_log(testName, DEVICE, 'End H switch, changing target to ' + str(setpoint2)) + scan.append ([setpoint2], [readback2], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, idDiff02, idDiff01]) + if endL>0.0 : + #invert direction and swap start with end of translation + setpoint2 = end + print_log(testName, DEVICE, 'End L switch, changing target to ' + str(setpoint2)) + scan.append ([setpoint2], [readback2], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, idDiff02, idDiff01]) + + #set limits back + idLimitH.put(145.0, timeout=None) + idLimitL.put(0.0, timeout=None) + #Closing channels + idInkr.close() + idMotorStatus.close() + idLogicalPosition.close() + idDiameter.close() + idMotorPosition.close() + idPotiRaw.close() + idPotiProc.close() + idBtvsRaw.close() + idBtvsProc.close() + scan.end() + ret = 'Slide moved back and forth (' + str(count) + ' runs)' + success = True + +############# END OF YOUR CODE ########### +###### 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/Collimator Tests/Motor Test 2/Motor Test 2.py b/script/tests/tests/Collimator Tests/Motor Test 2/Motor Test 2.py index 5500dc8..cd96ea9 100644 --- a/script/tests/tests/Collimator Tests/Motor Test 2/Motor Test 2.py +++ b/script/tests/tests/Collimator Tests/Motor Test 2/Motor Test 2.py @@ -1,185 +1,192 @@ #Script Motor Test 2 #Go to absolute position A, then move +B steps, then -2B steps, then +2Bsteps (ie oscillate round centre position, logging after each movement); repeat N times -import sys, inspect, os, traceback, time + ###### DO NOT MODIFY THE CODE BELOW ###### +import sys, inspect, os, traceback, time +global print_log, sendFeedback def startTest(testName, DEVICE, params): - #get the path of this script - testPath = inspect.getfile(inspect.currentframe()) - #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 ####### - - #get parameters from the calling interface try: - print_log(testName, DEVICE, "Running test Motor Test 2 for device " + DEVICE + " with the following parameters:\n" + str(params)) - middle = float(params["midPoint"]["value"]) - loopTimes = int(params["repeatTimes"]["value"]) - span = float(params["spanFromMidPoint"]["value"]) - except: - ret = 'Could not retrieve testing parameters - ' + traceback.format_exc() - success = False - sendFeedback(testPath, testName, DEVICE, ret, status) - return + 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 ####### - #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.start() + #get parameters from the calling interface + try: + print_log(testName, DEVICE, "Running test Motor Test 2 for device " + DEVICE + " with the following parameters:\n" + str(params)) + middle = float(params["midPoint"]["value"]) + loopTimes = int(params["repeatTimes"]["value"]) + span = float(params["spanFromMidPoint"]["value"]) + except: + ret = 'Could not retrieve testing parameters - ' + traceback.format_exc() + success = False + sendFeedback(testPath, testName, DEVICE, ret, success) + return - #Creating channels: dimension 1 - try: - #RegionPositioner idInkr - #idInkr = Channel(DEVICE+':INKR:2', type = 'd') - idInkr = Channel(DEVICE+':MOTOR.VAL', type = 'd') - #ScalarDetector idMotorStatus - #idMotorStatus = Channel(DEVICE+':STA:1', type = 'd') - idMotorStatus = Channel(DEVICE+':MOTOR.MSTA', type = 'd') - #ScalarDetector idLogicalPosition - #idLogicalPosition = Channel(DEVICE+':IST:2', type = 'd') - idLogicalPosition = Channel(DEVICE+':MOTOR.RVAL', type = 'd') - #ScalarDetector idDiameter - #idDiameter = Channel(DEVICE+':DIAM:2', type = 'd') - idDiameter = Channel(DEVICE+':ENCODERoff', type = 'd') - #ScalarDetector idMotorPosition - #idMotorPosition = Channel(DEVICE+':IST1:2', type = 'd') - idMotorPosition = Channel(DEVICE+':MOTOR.RBV', type = 'd') - #ScalarDetector idPotiRaw - #idPotiRaw = Channel(DEVICE+':POSA:1', type = 'd') - idPotiRaw = Channel(DEVICE+':ENCODERraw', type = 'd') - #ScalarDetector idPotiProc - #idPotiProc = Channel(DEVICE+':POSA:2', type = 'd') - idPotiProc = Channel(DEVICE+':ENCODER', type = 'd') - #ScalarDetector idBtvsRaw - #idBtvsRaw = Channel(DEVICE+':IST3:1', type = 'd') - idBtvsRaw = Channel(DEVICE+':MOTOR.LLS', type = 'd') - #ScalarDetector idBtvsProc - #idBtvsProc = Channel(DEVICE+':IST3:2', type = 'd') - idBtvsProc = Channel(DEVICE+':MOTOR.HLS', type = 'd') - #ScalarDetector idEndSwitchL - #idBtvsRaw = Channel(DEVICE+':IST3:1', type = 'd') - idEndSwitchL = Channel(DEVICE+':MOTOR.LLS', type = 'd') - #ScalarDetector idEndSwitchH - #idBtvsProc = Channel(DEVICE+':IST3:2', type = 'd') - idEndSwitchH = Channel(DEVICE+':MOTOR.HLS', type = 'd') - #high position limit - idLimitH = Channel(DEVICE+':MOTOR.HLM', type = 'd') - #low position limit - idLimitL = Channel(DEVICE+':MOTOR.LLM', type = 'd') - except: - ret = 'Unable to create channel - ' + traceback.format_exc() - success = False - sendFeedback(testPath, testName, DEVICE, ret, status) - return + #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.start() + #Creating channels: dimension 1 + try: + #RegionPositioner idInkr + #idInkr = Channel(DEVICE+':INKR:2', type = 'd') + idInkr = Channel(DEVICE+':MOTOR.VAL', type = 'd') + #ScalarDetector idMotorStatus + #idMotorStatus = Channel(DEVICE+':STA:1', type = 'd') + idMotorStatus = Channel(DEVICE+':MOTOR.MSTA', type = 'd') + #ScalarDetector idLogicalPosition + #idLogicalPosition = Channel(DEVICE+':IST:2', type = 'd') + idLogicalPosition = Channel(DEVICE+':MOTOR.RVAL', type = 'd') + #ScalarDetector idDiameter + #idDiameter = Channel(DEVICE+':DIAM:2', type = 'd') + idDiameter = Channel(DEVICE+':ENCODERoff', type = 'd') + #ScalarDetector idMotorPosition + #idMotorPosition = Channel(DEVICE+':IST1:2', type = 'd') + idMotorPosition = Channel(DEVICE+':MOTOR.RBV', type = 'd') + #ScalarDetector idPotiRaw + #idPotiRaw = Channel(DEVICE+':POSA:1', type = 'd') + idPotiRaw = Channel(DEVICE+':ENCODERraw', type = 'd') + #ScalarDetector idPotiProc + #idPotiProc = Channel(DEVICE+':POSA:2', type = 'd') + idPotiProc = Channel(DEVICE+':ENCODER', type = 'd') + #ScalarDetector idBtvsRaw + #idBtvsRaw = Channel(DEVICE+':IST3:1', type = 'd') + idBtvsRaw = Channel(DEVICE+':MOTOR.LLS', type = 'd') + #ScalarDetector idBtvsProc + #idBtvsProc = Channel(DEVICE+':IST3:2', type = 'd') + idBtvsProc = Channel(DEVICE+':MOTOR.HLS', type = 'd') + #ScalarDetector idEndSwitchL + #idBtvsRaw = Channel(DEVICE+':IST3:1', type = 'd') + idEndSwitchL = Channel(DEVICE+':MOTOR.LLS', type = 'd') + #ScalarDetector idEndSwitchH + #idBtvsProc = Channel(DEVICE+':IST3:2', type = 'd') + idEndSwitchH = Channel(DEVICE+':MOTOR.HLS', type = 'd') + #high position limit + idLimitH = Channel(DEVICE+':MOTOR.HLM', type = 'd') + #low position limit + idLimitL = Channel(DEVICE+':MOTOR.LLM', type = 'd') + except: + ret = 'Unable to create channel - ' + traceback.format_exc() + success = False + sendFeedback(testPath, testName, DEVICE, ret, success) + return - #remove limits - idLimitH.put(999999.9, timeout=None) - idLimitL.put(-999999.9, timeout=None) + #remove limits + idLimitH.put(999999.9, timeout=None) + idLimitL.put(-999999.9, timeout=None) - direction = 1.0 - startDefault = middle - span - endDefault = middle + span - end = endDefault+1 - #find position: it will be the middle point of the test - print_log(testName, DEVICE, 'Moving to middle point ' + str(middle) ) - idInkr.put(middle, timeout=None) # TODO: Set appropriate timeout - readback2 = idInkr.get() - if abs(readback2 - middle) > 1 : # TODO: Check accuracy - ret = 'Actor idInkr could not be set to the value ' + str(middle) + ' (current value: ' + str(readback2) + ')' - success = False - sendFeedback(testPath, testName, DEVICE, ret, status) - return - start = readback2+direction - countSteps = 0 - count = 0 - print_log(testName, DEVICE, 'Moving around middle point (+-' + str(span) + ')' ) - for setpoint1 in range(0, loopTimes*2): - count = count + 1 - sleep( 2 ) # Settling time - #RegionPositioner idInkr - for setpoint2 in frange(start, end, direction): - readback1 = setpoint1 - idInkr.put(setpoint2, timeout=None) # TODO: Set appropriate timeout - sleep( 0.2 ) # Settling time - readback2 = idInkr.get() - if abs(readback2 - setpoint2) > 1 : # TODO: Check accuracy - ret = 'Actor idInkr could not be set to the value ' + str(setpoint2) + ' (current value: ' + str(readback2) + ')' - success = False - sendFeedback(testPath, testName, DEVICE, ret, status) - return - #Detector idMotorStatus - detector1 = idMotorStatus.get() - #Detector idLogicalPosition - detector2 = idLogicalPosition.get() - #Detector idDiameter - detector3 = idDiameter.get() - #Detector idMotorPosition - detector4 = idMotorPosition.get() - #Detector idPotiRaw - detector5 = idPotiRaw.get() - #Detector idPotiProc - detector6 = idPotiProc.get() - #Detector idBtvsRaw - detector7 = idBtvsRaw.get() - #Detector idBtvsProc - detector8 = idBtvsProc.get() - #end switches - endH = idEndSwitchH.get() - endL = idEndSwitchL.get() - #Manipulation idDiff02 - #Variable Mappings - a = detector4 - b = detector8 - idDiff02 = a-b - #Manipulation idDiff01 - #Variable Mappings - a = detector4 - b = detector6 - idDiff01 = a-b - countSteps = countSteps + 1 - scan.append ([countSteps], [countSteps], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, idDiff02, idDiff01]) - if endH>0.0 or (direction > 0.0 and setpoint2 >= end -1): - #invert direction and swap start with end of translation - end = startDefault-1 - start = setpoint2 - direction - direction = -1.0 - print_log(testName, DEVICE, 'End of span (' + str(setpoint2) + '), changing direction to ' + str(direction) ) - break - if endL>0.0 or ( direction < 0.0 and setpoint2 <= end +1): - #invert direction and swap start with end of translation - end = endDefault+1 - start = setpoint2 - direction - direction = 1.0 - print_log(testName, DEVICE, 'End of span (' + str(setpoint2) + '), changing direction to ' + str(direction) ) - break + direction = 1.0 + startDefault = middle - span + endDefault = middle + span + end = endDefault+1 + #find position: it will be the middle point of the test + print_log(testName, DEVICE, 'Moving to middle point ' + str(middle) ) + idInkr.put(middle, timeout=None) # TODO: Set appropriate timeout + readback2 = idInkr.get() + if abs(readback2 - middle) > 1 : # TODO: Check accuracy + ret = 'Actor idInkr could not be set to the value ' + str(middle) + ' (current value: ' + str(readback2) + ')' + success = False + sendFeedback(testPath, testName, DEVICE, ret, success) + return + start = readback2+direction + countSteps = 0 + count = 0 + print_log(testName, DEVICE, 'Moving around middle point (+-' + str(span) + ')' ) + for setpoint1 in range(0, loopTimes*2): + count = count + 1 + sleep( 2 ) # Settling time + #RegionPositioner idInkr + for setpoint2 in frange(start, end, direction): + readback1 = setpoint1 + idInkr.put(setpoint2, timeout=None) # TODO: Set appropriate timeout + sleep( 0.2 ) # Settling time + readback2 = idInkr.get() + if abs(readback2 - setpoint2) > 1 : # TODO: Check accuracy + ret = 'Actor idInkr could not be set to the value ' + str(setpoint2) + ' (current value: ' + str(readback2) + ')' + success = False + sendFeedback(testPath, testName, DEVICE, ret, success) + return + #Detector idMotorStatus + detector1 = idMotorStatus.get() + #Detector idLogicalPosition + detector2 = idLogicalPosition.get() + #Detector idDiameter + detector3 = idDiameter.get() + #Detector idMotorPosition + detector4 = idMotorPosition.get() + #Detector idPotiRaw + detector5 = idPotiRaw.get() + #Detector idPotiProc + detector6 = idPotiProc.get() + #Detector idBtvsRaw + detector7 = idBtvsRaw.get() + #Detector idBtvsProc + detector8 = idBtvsProc.get() + #end switches + endH = idEndSwitchH.get() + endL = idEndSwitchL.get() + #Manipulation idDiff02 + #Variable Mappings + a = detector4 + b = detector8 + idDiff02 = a-b + #Manipulation idDiff01 + #Variable Mappings + a = detector4 + b = detector6 + idDiff01 = a-b + countSteps = countSteps + 1 + scan.append ([countSteps], [countSteps], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, idDiff02, idDiff01]) + if endH>0.0 or (direction > 0.0 and setpoint2 >= end -1): + #invert direction and swap start with end of translation + end = startDefault-1 + start = setpoint2 - direction + direction = -1.0 + print_log(testName, DEVICE, 'End of span (' + str(setpoint2) + '), changing direction to ' + str(direction) ) + break + if endL>0.0 or ( direction < 0.0 and setpoint2 <= end +1): + #invert direction and swap start with end of translation + end = endDefault+1 + start = setpoint2 - direction + direction = 1.0 + print_log(testName, DEVICE, 'End of span (' + str(setpoint2) + '), changing direction to ' + str(direction) ) + break - #set limits back - idLimitH.put(145.0, timeout=None) - idLimitL.put(0.0, timeout=None) + #set limits back + idLimitH.put(145.0, timeout=None) + idLimitL.put(0.0, timeout=None) - #Closing channels - idInkr.close() - idMotorStatus.close() - idLogicalPosition.close() - idDiameter.close() - idMotorPosition.close() - idPotiRaw.close() - idPotiProc.close() - idBtvsRaw.close() - idBtvsProc.close() - - scan.end() - ret = 'Slide moved back and forth (' + str(count) + ' runs)' - status = True - -########## END OF YOUR CODE ########### + #Closing channels + idInkr.close() + idMotorStatus.close() + idLogicalPosition.close() + idDiameter.close() + idMotorPosition.close() + idPotiRaw.close() + idPotiProc.close() + idBtvsRaw.close() + idBtvsProc.close() + + scan.end() + ret = 'Slide moved back and forth (' + str(count) + ' runs)' + success = True +############# END OF YOUR CODE ########### ###### DO NOT MODIFY THE CODE BELOW ###### - sendFeedback(testPath, testName, DEVICE, ret, status) + sendFeedback(testPath, testName, DEVICE, ret, success) + except: + ret = traceback.format_exc() + success = False + sendFeedback(testPath, testName, DEVICE, ret, success) + return #prepare and send feedback to calling tool def sendFeedback(testPath, testName, DEVICE, returnString, testPassed): @@ -196,11 +203,9 @@ def print_log(testName, DEVICE, text): time.ctime() now = time.strftime('%Y.%m.%d %H:%M:%S') print now + ' ' + DEVICE + ' - ' + testName + ': ' + text - -#get test arguments -DEVICE = device -testName = test -params = parameters #launch the test -startTest(testName, DEVICE, params) +#from pshellTestGeneral import testUtils +#testUtil = testUtils() +#testUtil.print_log(test, device, "CLASSE!!!") +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 deade75..af33e11 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 @@ -1,7 +1,27 @@ ###### DO NOT MODIFY THE CODE BELOW ###### +global print_log, sendFeedback, inspect +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 + ': ' + 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): #get the path of this script + import inspect testPath = inspect.getfile(inspect.currentframe()) #by default, failed ret = 'Test failed' @@ -9,10 +29,11 @@ def startTest(testName, DEVICE, params): #plot name to be given to the scan. Use: scan.setPlotName(plotName) plotName = DEVICE + ' - ' + testName ###### WRITE YOUR CODE HERE BELOW ####### - print_log(testName, DEVICE, 'testpath A: ' + testPath ) - print_log(testName, DEVICE, 'parameters: ' + str(params) ) + print_log(testName, DEVICE, 'testpath A: ' + testPath ) + print_log(testName, DEVICE, 'parameters: ' + str(params) ) print_log(testName, DEVICE, 'device: ' + DEVICE ) - scan = ManualScan(['time'], ['SetV', 'ActualV', 'ActualI'] , [0.0], [30.0], [20]) + #scan = ManualScan(['time'], ['SetV', 'ActualV', 'ActualI'] , [0.0], [30.0], [20]) + scan = ManualScan(['time'], ['SetV', 'ActualV', 'ActualI']) scan.setPlotName(plotName) scan.start() @@ -32,6 +53,7 @@ def startTest(testName, DEVICE, params): ActualI = Channel(DEVICE + ':Actual-IA', type = 'd') #ActualI = Channel('pw84:ai', type = 'd') except: + import traceback sendFeedback(testPath, testName, DEVICE, 'Unable to create channel - ' + traceback.format_exc(), False) #raise Exception('Unable to create channel - ' + traceback.format_exc()) return @@ -85,32 +107,12 @@ def startTest(testName, DEVICE, params): ActualI.close() scan.end() -########## END OF YOUR CODE ########### - +############# END OF YOUR CODE ########### ###### DO NOT MODIFY THE CODE BELOW ###### sendFeedback(testPath, testName, DEVICE, ret, status) -#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, 'Test path: ' + testPath) - print_log(testName, DEVICE, 'Test name: ' + testName ) - print_log(testName, DEVICE, 'Device: ' + DEVICE) - print_log(testName, DEVICE, 'Test passed: ' + str(testPassed)) - print_log(testName, DEVICE, 'Return string: ' + returnString) - ret = [testPath, DEVICE, returnString, testPassed] - set_return(ret) - -def print_log(testName, DEVICE, text): - time.ctime() - now = time.strftime('%Y.%m.%d %H:%M:%S') - print now + ' ' + DEVICE + ' - ' + testName + ': ' + text - -import sys, inspect, os, traceback -#get test arguments -DEVICE = device -testName = test -params = parameters + #launch the test -startTest(testName, DEVICE, params) +parameters = {} +startTest(test, device, parameters) \ No newline at end of file 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 37beb0c..3c8fb6f 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 @@ -1,18 +1,39 @@ -###### DO NOT MODIFY THE CODE BELOW ###### +###### Init - DO NOT MODIFY THE CODE BELOW ###### +global print_log, sendFeedback, inspect +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 + ': ' + 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): #get the path of this script + import inspect testPath = inspect.getfile(inspect.currentframe()) #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 ####### + plotName = DEVICE + ' - ' + testName +######### WRITE YOUR CODE HERE BELOW ############# print_log(testName, DEVICE, 'testpath B: ' + testPath ) print_log(testName, DEVICE, 'parameters:' + str( params) ) - print_log(testName, DEVICE, device: ' + DEVICE ) - scan = ManualScan(['time'], ['SetVB', 'ActualVB', 'ActualIB'] , [0.0], [30.0], [20]) + 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.start() @@ -33,7 +54,6 @@ def startTest(testName, DEVICE, params): #ActualIA = Channel('pw84:ai', type = 'd') except: sendFeedback(testPath, testName, DEVICE, 'Unable to create channel - ' + traceback.format_exc(), False) - #raise Exception('Unable to create channel - ' + traceback.format_exc()) return #Init SetRamp.put(10.0, timeout=None) @@ -82,31 +102,11 @@ def startTest(testName, DEVICE, params): SetVA.close() ActualVA.close() ActualIA.close() -########## END OF YOUR CODE ########### - -###### DO NOT MODIFY THE CODE BELOW ###### +################ END OF YOUR CODE ################ +###### Final - DO NOT MODIFY THE CODE BELOW ###### sendFeedback(testPath, testName, DEVICE, ret, status) -#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, 'Test path: ' + testPath) - print_log(testName, DEVICE, 'Test name: ' + testName ) - print_log(testName, DEVICE, 'Device: ' + DEVICE) - print_log(testName, DEVICE, 'Test passed: ' + str(testPassed)) - print_log(testName, DEVICE, 'Return string: ' + returnString) - ret = [testPath, DEVICE, returnString, testPassed] - set_return(ret) - -def print_log(testName, DEVICE, text): - time.ctime() - now = time.strftime('%Y.%m.%d %H:%M:%S') - print now + ' ' + DEVICE + ' - ' + testName + ': ' + text - -import sys, inspect, os, traceback -#get test arguments -DEVICE = device -testName = test -params = parameters #launch the test -startTest(testName, DEVICE, params) +parameters = {} +startTest(test, device, parameters) +