diff --git a/script/tests/devices/DMAF1/.config b/script/tests/devices/DMAF1/.config new file mode 100644 index 0000000..27ff671 --- /dev/null +++ b/script/tests/devices/DMAF1/.config @@ -0,0 +1,3 @@ +name=PROF02:DMAF1 +description=Collimators +tests=Collimator Tests pro diff --git a/script/tests/devices/PO2DV-NCS-LS/.config b/script/tests/devices/PO2DV-NCS-LS/.config new file mode 100644 index 0000000..f8e665f --- /dev/null +++ b/script/tests/devices/PO2DV-NCS-LS/.config @@ -0,0 +1,4 @@ +name=PO2DV-NCS-LS +description=Optis 2 Linear Slide in test office setup +#tests=Collimator Tests +tests=Linear Slide Tests \ No newline at end of file diff --git a/script/tests/devices/PO2DV-NCS-VHQ1/.config b/script/tests/devices/PO2DV-NCS-VHQ1/.config new file mode 100644 index 0000000..0138ca6 --- /dev/null +++ b/script/tests/devices/PO2DV-NCS-VHQ1/.config @@ -0,0 +1,3 @@ +name=PO2DV-NCS-VHQ1 +description=Optis 2 Linear Slide in test office setup +tests=PS Tests diff --git a/script/tests/devices/Production/DMAF1/.config b/script/tests/devices/Production/DMAF1/.config new file mode 100644 index 0000000..27ff671 --- /dev/null +++ b/script/tests/devices/Production/DMAF1/.config @@ -0,0 +1,3 @@ +name=PROF02:DMAF1 +description=Collimators +tests=Collimator Tests pro diff --git a/script/tests/devices/Production/PO2DV-NCS-VHQ1/.config b/script/tests/devices/Production/PO2DV-NCS-VHQ1/.config new file mode 100644 index 0000000..0138ca6 --- /dev/null +++ b/script/tests/devices/Production/PO2DV-NCS-VHQ1/.config @@ -0,0 +1,3 @@ +name=PO2DV-NCS-VHQ1 +description=Optis 2 Linear Slide in test office setup +tests=PS Tests diff --git a/script/tests/devices/Production/PO2TC-NCS-FIXL/.config b/script/tests/devices/Production/PO2TC-NCS-FIXL/.config new file mode 100644 index 0000000..78146dc --- /dev/null +++ b/script/tests/devices/Production/PO2TC-NCS-FIXL/.config @@ -0,0 +1,3 @@ +name=PO2TC-NCS-FIXL +description=FIXL: Fixation Light +tests=Display Tests diff --git a/script/tests/devices/Production/PO2TC-NCS-MWD/.config b/script/tests/devices/Production/PO2TC-NCS-MWD/.config new file mode 100644 index 0000000..24ba199 --- /dev/null +++ b/script/tests/devices/Production/PO2TC-NCS-MWD/.config @@ -0,0 +1,3 @@ +name=PO2TC-NCS-MWD +description=MWD: Modulator Wheel Display +tests=Display Tests diff --git a/script/tests/devices/Production/PO2TC-NCS-RS/.config b/script/tests/devices/Production/PO2TC-NCS-RS/.config new file mode 100644 index 0000000..192671b --- /dev/null +++ b/script/tests/devices/Production/PO2TC-NCS-RS/.config @@ -0,0 +1,3 @@ +name=PO2TC-NCS-RS +description=RS: Range Shifter +tests=Range Shifter Tests diff --git a/script/tests/devices/Production/PO2TC-NCS-SC21/.config b/script/tests/devices/Production/PO2TC-NCS-SC21/.config new file mode 100644 index 0000000..4421815 --- /dev/null +++ b/script/tests/devices/Production/PO2TC-NCS-SC21/.config @@ -0,0 +1,3 @@ +name=PO2TC-NCS-SC21 +description=SC21: Scatter Foil 2.1 +tests=Linear Slide Tests diff --git a/script/tests/devices/Production/PO2TC-NCS-SC22/.config b/script/tests/devices/Production/PO2TC-NCS-SC22/.config new file mode 100644 index 0000000..77904ce --- /dev/null +++ b/script/tests/devices/Production/PO2TC-NCS-SC22/.config @@ -0,0 +1,3 @@ +name=PO2TC-NCS-SC22 +description=SC21: Scatter Foil 2.2 +tests=Linear Slide Tests diff --git a/script/tests/devices/Production/PO2TC-NCS-SC23/.config b/script/tests/devices/Production/PO2TC-NCS-SC23/.config new file mode 100644 index 0000000..ba7e6a0 --- /dev/null +++ b/script/tests/devices/Production/PO2TC-NCS-SC23/.config @@ -0,0 +1,3 @@ +name=PO2TC-NCS-SC23 +description=SC23: Scatter Foil 2.3 +tests=Linear Slide Tests diff --git a/script/tests/tests/Modulator Wheel Display Tests/.config b/script/tests/tests/Display Tests/.config similarity index 97% rename from script/tests/tests/Modulator Wheel Display Tests/.config rename to script/tests/tests/Display Tests/.config index fa926ac..46cc90a 100644 --- a/script/tests/tests/Modulator Wheel Display Tests/.config +++ b/script/tests/tests/Display Tests/.config @@ -1,2 +1,2 @@ -name=Modulator Wheel Display Tests -description=Tests on the OPTIS2 Modulator Wheel Display +name=Modulator Wheel Display Tests +description=Tests on the OPTIS2 Modulator Wheel Display diff --git a/script/tests/tests/Display Tests/Display Test/.config b/script/tests/tests/Display Tests/Display Test/.config new file mode 100644 index 0000000..2e0d737 --- /dev/null +++ b/script/tests/tests/Display Tests/Display Test/.config @@ -0,0 +1,6 @@ +name=Display Test +description=Positioning sequence + +#optional parameters. Description is compulsory. Syntax: +#parameters=::[;::] +parameters=repeatTimes:2:Repeat N times;delayS:4:Delay between each initialisation [s] \ No newline at end of file diff --git a/script/tests/tests/Display Tests/Display Test/Display Test.py b/script/tests/tests/Display Tests/Display Test/Display Test.py new file mode 100644 index 0000000..8733ff4 --- /dev/null +++ b/script/tests/tests/Display Tests/Display Test/Display Test.py @@ -0,0 +1,90 @@ + + + +###### 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 + ': ' + str(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 ####### + + # caput(DEVICE+':INIT.PROC', '1') + + #get parameters from the calling interface + try: + print_log(testName, DEVICE, "Running test Initialise 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 + + scan = ManualScan(['idX'], ['idPositioner'] ) + scan.setPlotName(plotName) + scan.start() + try: + idInit = Channel(DEVICE+':DEMAND', type = 'l') + except: + ret = 'Unable to create channel - ' + traceback.format_exc() + success = False + sendFeedback(testPath, testName, DEVICE, ret, success) + return + + for count in range(1, loopTimes+1): + print_log(testName, DEVICE, 'Positioning sequence #' + str(count) + '/' + str(loopTimes)) + timeStampStart = float(java.lang.System.currentTimeMillis()) + for positioner in range(1, 143): + #Detector time + idInit.put(positioner, timeout=1000) # TODO: Set appropriate timeout + timeStamp = float(java.lang.System.currentTimeMillis()) + sleep( 0.01 ) + detector = idInit.get() + scan.append ([timeStamp],[timeStamp], [detector]) + if(count < loopTimes): + print_log(testName, DEVICE, 'Next sequence starting in ' + str(delaySeconds) + 's') + sleep( delaySeconds ) # pause between two sequences + + idInit.close() + 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 + +#launch the test +startTest(test, device, parameters) + \ No newline at end of file diff --git a/script/tests/tests/Modulator Wheel Display Tests/Display Test/Display Test.xml b/script/tests/tests/Display Tests/Display Test/Display Test.xml similarity index 97% rename from script/tests/tests/Modulator Wheel Display Tests/Display Test/Display Test.xml rename to script/tests/tests/Display Tests/Display Test/Display Test.xml index 69b8eb8..4b87e8a 100644 --- a/script/tests/tests/Modulator Wheel Display Tests/Display Test/Display Test.xml +++ b/script/tests/tests/Display Tests/Display Test/Display Test.xml @@ -1,32 +1,32 @@ - - - - - - - - - - - - 1000 - - - - 1 - 143 - 1 - - - - - - - 1 - - - - - - - + + + + + + + + + + + + 1000 + + + + 1 + 143 + 1 + + + + + + + 1 + + + + + + + diff --git a/script/tests/tests/Fixation Light Tests/.config b/script/tests/tests/Fixation Light Tests/.config deleted file mode 100644 index f6afae3..0000000 --- a/script/tests/tests/Fixation Light Tests/.config +++ /dev/null @@ -1,2 +0,0 @@ -name=Fixation Light Tests -description=Tests on the OPTIS2 fixation light diff --git a/script/tests/tests/Fixation Light Tests/Lamp Test/.config b/script/tests/tests/Fixation Light Tests/Lamp Test/.config deleted file mode 100644 index a87d8c0..0000000 --- a/script/tests/tests/Fixation Light Tests/Lamp Test/.config +++ /dev/null @@ -1,3 +0,0 @@ -name=Lamp Test -description=Turns on every LED in sequence -filename=Lamp Test.xml diff --git a/script/tests/tests/Fixation Light Tests/Lamp Test/Lamp Test.xml b/script/tests/tests/Fixation Light Tests/Lamp Test/Lamp Test.xml deleted file mode 100644 index 636fff5..0000000 --- a/script/tests/tests/Fixation Light Tests/Lamp Test/Lamp Test.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - 1000 - - - - 1 - 143 - 1 - - - - - - - 1 - - - - - - - diff --git a/script/tests/tests/Modulator Wheel Display Tests/Display Test/.config b/script/tests/tests/Modulator Wheel Display Tests/Display Test/.config deleted file mode 100644 index ecbcff6..0000000 --- a/script/tests/tests/Modulator Wheel Display Tests/Display Test/.config +++ /dev/null @@ -1,3 +0,0 @@ -name=Display Test -description=Displays an incrementing number -filename=Display Test.xml diff --git a/script/tests/tests/Modulator Wheel Display Tests/Lamp Test/.config b/script/tests/tests/Modulator Wheel Display Tests/Lamp Test/.config deleted file mode 100644 index a87d8c0..0000000 --- a/script/tests/tests/Modulator Wheel Display Tests/Lamp Test/.config +++ /dev/null @@ -1,3 +0,0 @@ -name=Lamp Test -description=Turns on every LED in sequence -filename=Lamp Test.xml diff --git a/script/tests/tests/Modulator Wheel Display Tests/Lamp Test/Lamp Test.xml b/script/tests/tests/Modulator Wheel Display Tests/Lamp Test/Lamp Test.xml deleted file mode 100644 index 636fff5..0000000 --- a/script/tests/tests/Modulator Wheel Display Tests/Lamp Test/Lamp Test.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - 1000 - - - - 1 - 143 - 1 - - - - - - - 1 - - - - - - - diff --git a/script/tests/tests/Office Linear Slide Tests/.config b/script/tests/tests/Office Linear Slide Tests/.config deleted file mode 100644 index 4db5623..0000000 --- a/script/tests/tests/Office Linear Slide Tests/.config +++ /dev/null @@ -1,2 +0,0 @@ -name=Office Linear Slide Tests -description=Tests on the office linear slides diff --git a/script/tests/tests/Office Linear Slide Tests/Calibrate/.config b/script/tests/tests/Office Linear Slide Tests/Calibrate/.config deleted file mode 100644 index e75c90e..0000000 --- a/script/tests/tests/Office Linear Slide Tests/Calibrate/.config +++ /dev/null @@ -1,3 +0,0 @@ -name=Calibrate -description=Calibrates the device -filename=Calibrate.xml diff --git a/script/tests/tests/Office Linear Slide Tests/Calibrate/Calibrate.py b/script/tests/tests/Office Linear Slide Tests/Calibrate/Calibrate.py deleted file mode 100644 index 1cfbe9c..0000000 --- a/script/tests/tests/Office Linear Slide Tests/Calibrate/Calibrate.py +++ /dev/null @@ -1,97 +0,0 @@ -#Script imported from: Calibrate.xml - -ret = 'Test failed' -status = False - -#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() - -#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') - -#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() - -scan.end() diff --git a/script/tests/tests/Office Linear Slide Tests/Calibrate/Calibrate.xml b/script/tests/tests/Office Linear Slide Tests/Calibrate/Calibrate.xml deleted file mode 100644 index eef74b6..0000000 --- a/script/tests/tests/Office Linear Slide Tests/Calibrate/Calibrate.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - 1000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/script/tests/tests/Office Linear Slide Tests/Calibrate/doit.sh b/script/tests/tests/Office Linear Slide Tests/Calibrate/doit.sh deleted file mode 100644 index 4807a72..0000000 --- a/script/tests/tests/Office Linear Slide Tests/Calibrate/doit.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -sleep 5 diff --git a/script/tests/tests/Office Linear Slide Tests/Check Status/.config b/script/tests/tests/Office Linear Slide Tests/Check Status/.config deleted file mode 100644 index 35dbf62..0000000 --- a/script/tests/tests/Office Linear Slide Tests/Check Status/.config +++ /dev/null @@ -1,3 +0,0 @@ -name=Check Status -description=Checks the drive status -filename=Check Status.xml diff --git a/script/tests/tests/Office Linear Slide Tests/Check Status/Check Status.xml b/script/tests/tests/Office Linear Slide Tests/Check Status/Check Status.xml deleted file mode 100644 index 4c716b1..0000000 --- a/script/tests/tests/Office Linear Slide Tests/Check Status/Check Status.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - 1000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/script/tests/tests/Office Linear Slide Tests/motor-slide/.config b/script/tests/tests/Office Linear Slide Tests/motor-slide/.config deleted file mode 100644 index 3616e40..0000000 --- a/script/tests/tests/Office Linear Slide Tests/motor-slide/.config +++ /dev/null @@ -1,3 +0,0 @@ -name=motor-slide -description=Moves the device -filename=Calibrate.xml diff --git a/script/tests/tests/Office Linear Slide Tests/motor-slide/motor-slide.py b/script/tests/tests/Office Linear Slide Tests/motor-slide/motor-slide.py deleted file mode 100644 index cd4161e..0000000 --- a/script/tests/tests/Office Linear Slide Tests/motor-slide/motor-slide.py +++ /dev/null @@ -1,73 +0,0 @@ -#Script imported from: PO2DV-NCS-LS_mot.xml -import traceback - -#by default, failed -ret = 'Test failed' -status = False - -#Pre-actions -try: - caput('PO2DV-NCS-LS:MOTOR.TWF', '0') - sleep(0.5) - caput('PO2DV-NCS-LS:MOTOR.RDBD', '0.1') -except: - print "Unexpected error:", sys.exc_info()[0] - ret = 'Unable to create channel - ' + traceback.format_exc() - success = False - raise - sys.exit() - -#TODO: Set the diplay names of positioners and detectors -scan = ManualScan(['VAL'], ['time', 'RVAL', 'Encoder', 'RBV', 'Busy'] , [40.0], [44.0], [22]) -scan.start() - -#Creating channels: dimension 1 -#RegionPositioner VAL -VAL = Channel('PO2DV-NCS-LS:MOTOR.VAL', type = 'd') -VALReadback = Channel('PO2DV-NCS-LS:MOTOR.RBV', type = 'd') -#Timestamp time -#ScalarDetector RVAL -RVAL = Channel('PO2DV-NCS-LS:MOTOR.RVAL', type = 'd') -#ScalarDetector ENCODER -ENCODER = Channel('PO2DV-NCS-LS:ENCODER', type = 'd') -#ScalarDetector RBV -RBV = Channel('PO2DV-NCS-LS:MOTOR.RBV', type = 'd') -#ScalarDetector Busy -Busy = Channel('PO2DV-NCS-LS:MOTOR.DMOV', type = 'd') - -#Dimension 1 -#RegionPositioner VAL -for setpoint1 in frange(40.0, 42.0, 0.2, True) + frange(41.8, 40.0, 0.2, True): - VAL.put(setpoint1, timeout=None) # TODO: Set appropriate timeout - readback1 = VALReadback.get() - if abs(readback1 - setpoint1) > 0.1 : # TODO: Check accuracy - ret = 'Actor VAL could not be set to the value ' + str(setpoint2) + ' (current value: ' + str(readback2) + ')' - success = False - raise Exception(ret) - #Detector time - detector1 = float(java.lang.System.currentTimeMillis()) - #Detector RVAL - detector2 = RVAL.get() - #Detector TWF - detector3 = ENCODER.get() - #Detector RBV - detector4 = RBV.get() - #Detector Busy - detector5 = Busy.get() - scan.append ([setpoint1], [readback1], [detector1, detector2, detector3, detector4, detector5]) - -#Closing channels -VAL.close() -VALReadback.close() -RVAL.close() -ENCODER.close() -RBV.close() -Busy.close() - -scan.end() - -#Post-actions -caput('PO2DV-NCS-LS:MOTOR.RDBD', '1') - -ret = 'Test done' -status = True \ No newline at end of file diff --git a/script/tests/tests/Office Linear Slide Tests/power-supply/.config b/script/tests/tests/Office Linear Slide Tests/power-supply/.config deleted file mode 100644 index db5d8ae..0000000 --- a/script/tests/tests/Office Linear Slide Tests/power-supply/.config +++ /dev/null @@ -1,3 +0,0 @@ -name=power-supply -description=Moves HV -filename=Calibrate.xml diff --git a/script/tests/tests/Office Linear Slide Tests/power-supply/power-supply.py b/script/tests/tests/Office Linear Slide Tests/power-supply/power-supply.py deleted file mode 100644 index a8162b8..0000000 --- a/script/tests/tests/Office Linear Slide Tests/power-supply/power-supply.py +++ /dev/null @@ -1,77 +0,0 @@ -#TODO: Set the diplay names of positioners and detectors -#ManualScan(writables, readables, start = None, end = None, steps = None, relative = False) - -#by default, failed -ret = 'Test failed' -status = False -DEVICE = 'PO2DV-NCS-VHQ1' - -scan = ManualScan(['time'], ['SetVA', 'ActualVA', 'ActualIA'] , [0.0], [20.0], [10]) -scan.start() - -#Creating channels: dimension 1 -#Ramp rate -SetRamp = Channel('PO2DV-NCS-VHQ1:Set-RampA', type = 'd') -#SetRamp = Channel('pw84:ai', type = 'd') -#LinearPositioner SetVA -SetVA = Channel('PO2DV-NCS-VHQ1:Set-VA', type = 'd') -#SetVA = Channel('pw84:ai', type = 'd') -#Timestamp time -#ScalarDetector ActualVA -ActualVA = Channel('PO2DV-NCS-VHQ1:Actual-VA', type = 'd') -#ActualVA = Channel('pw84:ai', type = 'd') -#ScalarDetector ActualIA -ActualIA = Channel('PO2DV-NCS-VHQ1:Actual-IA', type = 'd') -#ActualIA = Channel('pw84:ai', type = 'd') - -#Init -SetRamp.put(10.0, timeout=None) - -#set voltage to 0 -print 'Ramping down power supply to 0V' -SetVA.put(0.0, timeout=None) - -#wait up to 2 minutes for voltage to be ~0 -for setpoint1 in frange(0.0, 120.0, 1.0, True): - detector2 = ActualVA.get() - if detector2 <= 1.0: - break - sleep(0.5) - -#Dimension 1 -#LinearPositioner SetVA -print 'Ramping up power supply' -for setpoint1 in frange(0.0, 20.0, 1.0, True): - if setpoint1 > 50.0 or setpoint1 < 0.0: - break - SetVA.put(setpoint1, timeout=None) # TODO: Set appropriate timeout - readback1 = SetVA.get() - if abs(readback1 - setpoint1) > 0.5 : # TODO: Check accuracy - raise Exception('Actor SetVA could not be set to the value ' + str(setpoint1)) - ret = 'SetVA could not be set to the value ' + str(setpoint1) + '(measured value: '+str(readback1)+')' - status = False - break - #scan quickly the output during some seconds - for setpoint2 in range(0, 20): - #Detector time - detector1 = float(java.lang.System.currentTimeMillis()) - #Detector ActualVA - detector2 = ActualVA.get() - detector3 = ActualIA.get() - #scan.append ([setpoint1], [readback1], [detector1, detector2]) - #append(setpoints, positions, values) - scan.append ([detector1], [detector1], [readback1, detector2, detector3]) - sleep( 0.1 ) # Settling time - ret = 'Test completed' - status = True - -#reset output to 0V -SetVA.put(0.0, timeout=None) -#Closing channels -SetVA.close() -ActualVA.close() -ActualIA.close() - - - -scan.end() diff --git a/script/tests/tests/Range Shifter Tests/.config b/script/tests/tests/Range Shifter Tests/.config deleted file mode 100644 index 05be1e2..0000000 --- a/script/tests/tests/Range Shifter Tests/.config +++ /dev/null @@ -1,2 +0,0 @@ -name=Range Shifter Tests -description=Tests on the OPTIS2 Range Shifter diff --git a/script/tests/tests/Range Shifter Tests/Calibrate/.config b/script/tests/tests/Range Shifter Tests/Calibrate/.config index e75c90e..e97fcc1 100644 --- a/script/tests/tests/Range Shifter Tests/Calibrate/.config +++ b/script/tests/tests/Range Shifter Tests/Calibrate/.config @@ -1,3 +1,8 @@ -name=Calibrate -description=Calibrates the device -filename=Calibrate.xml +name=Calibrate +description=Initialises the motor +help = \ +This test sends a INIT command to the device, as many times as configured with the parameter RepeatTimes. + +#optional parameters. Description is compulsory. Syntax: +#parameters=::[;::] +parameters=repeatTimes:2:Repeat N times;delayS:4:Delay between each initialisation [s] \ No newline at end of file diff --git a/script/tests/tests/Range Shifter Tests/Calibrate/Calibrate.xml b/script/tests/tests/Range Shifter Tests/Calibrate/Calibrate.xml deleted file mode 100644 index 6b363a5..0000000 --- a/script/tests/tests/Range Shifter Tests/Calibrate/Calibrate.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - 70 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/script/tests/tests/Range Shifter Tests/Calibrate/doit.sh b/script/tests/tests/Range Shifter Tests/Calibrate/doit.sh deleted file mode 100644 index 4807a72..0000000 --- a/script/tests/tests/Range Shifter Tests/Calibrate/doit.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -sleep 5 diff --git a/script/tests/tests/Range Shifter Tests/Check Linearity/.config b/script/tests/tests/Range Shifter Tests/Check Linearity/.config index 978a7b5..5a93789 100644 --- a/script/tests/tests/Range Shifter Tests/Check Linearity/.config +++ b/script/tests/tests/Range Shifter Tests/Check Linearity/.config @@ -1,3 +1,7 @@ name=Check Linearity -description=Compares the position reported by the motor and the incremental encoder -filename=Check Linearity.xml +description=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 + + +#optional parameters. Description is compulsory. Syntax: +#parameters=::[;::] +parameters=repeatTimes:2:Repeat N times;midPoint:41.0:Middle point A;spanFromMidPoint:3.0:B steps around middle point A;delayS:0:Delay between each oscillation [s] diff --git a/script/tests/tests/Range Shifter Tests/Check Linearity/Check Linearity.xml b/script/tests/tests/Range Shifter Tests/Check Linearity/Check Linearity.xml deleted file mode 100644 index bc9a9c6..0000000 --- a/script/tests/tests/Range Shifter Tests/Check Linearity/Check Linearity.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - 200 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/script/tests/tests/Range Shifter Tests/Check Linearity/doit.sh b/script/tests/tests/Range Shifter Tests/Check Linearity/doit.sh deleted file mode 100644 index 4807a72..0000000 --- a/script/tests/tests/Range Shifter Tests/Check Linearity/doit.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -sleep 5