Closedown

This commit is contained in:
boccioli_m
2017-08-29 11:08:45 +02:00
parent a0e8ba9b70
commit ca38b8315b
3 changed files with 16 additions and 7 deletions

View File

@@ -87,6 +87,15 @@ class TestingTool:
print now + ' ' + self.deviceName + ' - ' + self.testName + ': ' + 'cannot write Log in Data'
def printParameters(self, params):
"""
Print/log the pshell parameters
params = the JSON object with the parameters passed by pshell
"""
columnsFormat = '{0:10} {1:10} {2}'
self.log(columnsFormat.format("cedccewc", "23", "ewfe erfgerf ref erf"))
def sendFeedback(self, returnString, testPassed):
"""
Prepare and send feedback to calling tool

View File

@@ -1,5 +1,5 @@
#TestingList for pshell: configuration properties
#Mon Aug 28 15:27:51 CEST 2017
#Tue Aug 29 11:08:21 CEST 2017
customPanel=
showEnabledTestsOnly=true
listFilter=test-bx84

View File

@@ -65,11 +65,11 @@ def startTest(testName, DEVICE, params):
########## Example (can be removed) ######
# print the list of parameters passed. If any error, stop and send feedback.
test.log("Example - Test name: " + test.getName())
test.log("Example - Device name: " + test.getDeviceName() )
# test.log("Example - Test name: " + test.getName())
# test.log("Example - Device name: " + test.getDeviceName() )
try:
test.log("Running test with the following parameters:")
test.log(params)
test.printParams(params)
# If present, use the parameters here below for your test script.
# These parameters were automatically generated: you might need to change the casting.
delay = float(test.getParam('delay')) ; centre = float(test.getParam('centre')) ; moveAround = float(test.getParam('moveAround')) ; steps = float(test.getParam('steps')) ;
@@ -161,16 +161,16 @@ def startTest(testName, DEVICE, params):
maxError = abs(float(forwardsValues[sample]) - float(motor_sta) )
maxErrorPos = sample
import java.awt.Color
p1.addMarker(maxErrorPos, None, "MaxE=" + str(maxError), java.awt.Color.GREEN)
p1.addMarker(maxErrorPos, None, "Max Err = " + str(maxError), java.awt.Color.GREEN)
# Closing channels: all channels that were opened with Channel() must be closed before exit:
pv_motor_sta.close()
pv_motor_val.close()
# IMPORTANT: if the test was successful, write the report into the variables ret and success.
# for example, write the following:
ret = "Example - Test successful, max error: " + str(maxError) + " at " + str(maxErrorPos)
ret = "Test successful, max error: " + str(maxError) + " at " + str(maxErrorPos)
success = True
test.sendFeedback(ret, success)
#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 ##########