Closedown
This commit is contained in:
@@ -20,14 +20,14 @@ class TestingTool:
|
||||
print now + ' ' + DEVICE + ' - ' + testName + ': ' + str(text)
|
||||
|
||||
#prepare and send feedback to calling tool
|
||||
def sendFeedback(self, testPath, testName, DEVICE, returnString, testPassed):
|
||||
def sendFeedback(self, 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, 'Device: ' + self.deviceName)
|
||||
print_log(testName, DEVICE, 'Test name: ' + self.testName)
|
||||
print_log(testName, DEVICE, 'Test path: ' + self.testPath)
|
||||
print_log(testName, DEVICE, 'Test passed: ' + str(testPassed))
|
||||
print_log(testName, DEVICE, 'Return string: ' + returnString)
|
||||
ret = [testPath, DEVICE, returnString, testPassed]
|
||||
ret = [self.testPath, self.deviceName, returnString, testPassed]
|
||||
return ret
|
||||
|
||||
|
||||
|
||||
@@ -3,21 +3,14 @@
|
||||
#########################################
|
||||
global print_log, sendFeedback, sys, inspect, os, traceback, testcommons
|
||||
import sys, inspect, os, traceback, testcommons
|
||||
|
||||
def print_log(testName, DEVICE, text):
|
||||
testcommons.print_log(testName, DEVICE, text)
|
||||
|
||||
def sendFeedback(testPath, testName, DEVICE, returnString, testPassed):
|
||||
ret = testcommons.sendFeedback(testPath, testName, DEVICE, returnString, testPassed)
|
||||
set_return(ret)
|
||||
|
||||
def startTest(testName, DEVICE, params):
|
||||
#get the path of this script
|
||||
test = testcommons.TestingTool(testName, DEVICE)
|
||||
test.print_pio()
|
||||
|
||||
import inspect
|
||||
testPath = inspect.getfile(inspect.currentframe())
|
||||
test = testcommons.TestingTool(testName, DEVICE, testPath)
|
||||
test.print_pio()
|
||||
#by default, failed
|
||||
ret = 'Test failed'
|
||||
status = False
|
||||
@@ -26,9 +19,9 @@ def startTest(testName, DEVICE, params):
|
||||
#########################################
|
||||
###### WRITE YOUR CODE HERE BELOW #######
|
||||
#########################################
|
||||
print_log(testName, DEVICE, 'testpath A: ' + testPath )
|
||||
print_log(testName, DEVICE, 'parameters: ' + str(params) )
|
||||
print_log(testName, DEVICE, 'device: ' + DEVICE )
|
||||
test.print_log('testpath A: ' + testPath )
|
||||
test.print_log('parameters: ' + str(params) )
|
||||
test.print_log('device: ' + DEVICE )
|
||||
#scan = ManualScan(['time'], ['SetV', 'ActualV', 'ActualI'] , [0.0], [30.0], [20])
|
||||
scan = ManualScan(['time'], ['SetV', 'ActualV', 'ActualI'])
|
||||
scan.setPlotName(plotName)
|
||||
@@ -50,7 +43,7 @@ def startTest(testName, DEVICE, params):
|
||||
#ActualI = Channel('pw84:ai', type = 'd')
|
||||
except:
|
||||
import traceback
|
||||
sendFeedback(testPath, testName, DEVICE, 'Unable to create channel - ' + traceback.format_exc(), False)
|
||||
test.sendFeedback('Unable to create channel - ' + traceback.format_exc(), False)
|
||||
#raise Exception('Unable to create channel - ' + traceback.format_exc())
|
||||
return
|
||||
|
||||
@@ -58,7 +51,7 @@ def startTest(testName, DEVICE, params):
|
||||
SetRamp.put(10.0, timeout=None)
|
||||
|
||||
#set voltage to 0
|
||||
print_log(testName, DEVICE, 'Ramping down power supply A to 0V' )
|
||||
test.print_log( 'Ramping down power supply A to 0V' )
|
||||
SetV.put(0.0, timeout=None)
|
||||
|
||||
#wait up to 2 minutes for voltage to be ~0
|
||||
@@ -70,7 +63,7 @@ def startTest(testName, DEVICE, params):
|
||||
|
||||
#Dimension 1
|
||||
#LinearPositioner SetV
|
||||
print_log(testName, DEVICE, 'Ramping up power supply A' )
|
||||
test.print_log( 'Ramping up power supply A' )
|
||||
for setpoint1 in frange(0.0, 20.0, 5.0, True):
|
||||
if setpoint1 > 50.0 or setpoint1 < 0.0:
|
||||
break
|
||||
@@ -108,7 +101,7 @@ def startTest(testName, DEVICE, params):
|
||||
#########################################
|
||||
###### DO NOT MODIFY THE CODE BELOW #####
|
||||
#########################################
|
||||
sendFeedback(testPath, testName, DEVICE, ret, status)
|
||||
test.sendFeedback(ret, status)
|
||||
|
||||
|
||||
#launch the test
|
||||
|
||||
Reference in New Issue
Block a user