From ed5e0035caf8a18e83de314b62ef6c3d60dab117 Mon Sep 17 00:00:00 2001 From: boccioli_m Date: Tue, 29 Aug 2017 14:38:33 +0200 Subject: [PATCH] Closedown --- script/tests/tests.properties | 2 +- .../test without ioc/test without ioc.py | 1 + script/tests/tests/sad/rightleft/.config | 4 ++-- script/tests/tests/sad/rightleft/rightleft.py | 17 +++++++++-------- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/script/tests/tests.properties b/script/tests/tests.properties index 099de89..59e701a 100644 --- a/script/tests/tests.properties +++ b/script/tests/tests.properties @@ -1,5 +1,5 @@ #TestingList for pshell: configuration properties -#Tue Aug 29 13:21:38 CEST 2017 +#Tue Aug 29 14:37:04 CEST 2017 customPanel= showEnabledTestsOnly=true listFilter=test-bx84 diff --git a/script/tests/tests/PS Tests/test without ioc/test without ioc.py b/script/tests/tests/PS Tests/test without ioc/test without ioc.py index f1835df..86e9018 100644 --- a/script/tests/tests/PS Tests/test without ioc/test without ioc.py +++ b/script/tests/tests/PS Tests/test without ioc/test without ioc.py @@ -57,6 +57,7 @@ def startTest(testName, DEVICE, params): ########## Example (can be removed) ###### #print the list of parameters passed. If any error, stop and send feedback + test.log("-------------------------------------------") test.log("Example - Test name: "+testName) test.log("Example - Device name: "+DEVICE) try: diff --git a/script/tests/tests/sad/rightleft/.config b/script/tests/tests/sad/rightleft/.config index 0576f2d..83d8b2f 100644 --- a/script/tests/tests/sad/rightleft/.config +++ b/script/tests/tests/sad/rightleft/.config @@ -1,4 +1,4 @@ -#Mon Aug 28 14:48:34 CEST 2017 +#Tue Aug 29 13:35:39 CEST 2017 name=rightleft +parameters=delay\:.4\:delay between 2 steps;centre\:2\:centre where to move around;moveAround\:20\:move right and left from centre;steps\:1\:steps of each move;maxErr\:5\:maximum allowed error; description=move around a value and plot the result -parameters=delay\:.1\:delay between 2 steps;centre\:2\:centre where to move around;moveAround\:10\:move right and left from centre;steps\:1\:steps of each move;maxErr\:5\:maximum allowed error; \ No newline at end of file diff --git a/script/tests/tests/sad/rightleft/rightleft.py b/script/tests/tests/sad/rightleft/rightleft.py index 8f469b1..4d07b19 100644 --- a/script/tests/tests/sad/rightleft/rightleft.py +++ b/script/tests/tests/sad/rightleft/rightleft.py @@ -99,7 +99,7 @@ def startTest(testName, DEVICE, params): # inject a sinus into the plot, as example from math import sin motor_val = 0 - # take 100 samples of a sinus and a jigsaw plot them: + # for testing: remove: for sample in range(int(-moveAround), int(moveAround)+1, int(steps)): break readback1 = sample #the x axis. @@ -120,6 +120,7 @@ def startTest(testName, DEVICE, params): # set up connection to channels. "type" of data can be "d" (= double), "l" (= long). pv_motor_sta = Channel(test.getDeviceName() + ':ao' , type='d') pv_motor_val = Channel(test.getDeviceName() + ':ai' , type='d') + pv_motor_sta = Channel('DMAF1:IST3:1', type='l') except: # prepare return information: return text: import traceback @@ -142,12 +143,12 @@ def startTest(testName, DEVICE, params): motor_val = float(readback1) pv_motor_val.put(motor_val) # get value (it is translated to a caget): - motor_sta = pv_motor_sta.get() + motor_sta = float(pv_motor_sta.get()) # add values to plot: #scan.append([readback1], [readback1], [motor_sta, motor_val]) # 2 colour plot - p1.getSeries(0).appendData(motor_val, float(motor_sta)) - forwardsValues[sample] = float(motor_sta) + p1.getSeries(0).appendData(motor_val, motor_sta) + forwardsValues[sample] = motor_sta for sample in range(int(moveAround), int(-moveAround)-1, int(-steps)): readback1 = sample #the x axis. sleep(delay) # settling time. @@ -155,13 +156,13 @@ def startTest(testName, DEVICE, params): motor_val = float(readback1) pv_motor_val.put(motor_val+1.0) # get value (it is translated to a caget): - motor_sta = pv_motor_sta.get() + 5 + motor_sta = float(pv_motor_sta.get()) # add values to plot: # scan.append([readback1], [readback1], [motor_sta, motor_val]) # 2 colour plot - p1.getSeries(1).appendData(motor_val, float(motor_sta)) - if abs(float(forwardsValues[sample]) - float(motor_sta)) > maxError: - maxError = abs(float(forwardsValues[sample]) - float(motor_sta) ) + p1.getSeries(1).appendData(motor_val, motor_sta) + if abs(forwardsValues[sample] - motor_sta) > maxError: + maxError = abs(forwardsValues[sample] - motor_sta) maxErrorPos = sample import java.awt.Color p1.addMarker(maxErrorPos, None, "Max Err = " + str(maxError), java.awt.Color.GREEN)