Closedown

This commit is contained in:
boccioli_m
2017-08-28 15:26:08 +02:00
parent fbb589a9fc
commit 6a79a92f66
3 changed files with 31 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
#TestingList for pshell: configuration properties
#Fri Aug 25 16:57:39 CEST 2017
#Mon Aug 28 15:25:01 CEST 2017
customPanel=
showEnabledTestsOnly=true
listFilter=test-bx84

View File

@@ -1,4 +1,4 @@
#Fri Aug 25 16:45:24 CEST 2017
#Mon Aug 28 14:48:34 CEST 2017
name=rightleft
parameters=delay\:.2\: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;
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;
description=move around a value and plot the result

View File

@@ -98,7 +98,8 @@ def startTest(testName, DEVICE, params):
from math import sin
motor_val = 0
# take 100 samples of a sinus and a jigsaw plot them:
for sample in range(int(-moveAround), int(moveAround), int(steps)):
for sample in range(int(-moveAround), int(moveAround)+1, int(steps)):
break
readback1 = sample #the x axis.
sleep(delay) # settling time.
# get value (it is translated to a caget):
@@ -128,25 +129,46 @@ def startTest(testName, DEVICE, params):
# send a command to a channel (it is translated to a caput): uncomment this line below to try it
#pv_motor_com.put(1.0, timeout=None) # optionally, a timeout can be given.
# take 100 samples of the channels and plot them:
for sample in range(int(moveAround), int(-moveAround), int(-steps)):
forwardsValues = {}
maxError = 0.0
maxErrorPos = 0.0
for sample in range(int(-moveAround), int(moveAround)+1, int(steps)):
readback1 = sample #the x axis.
sleep(delay) # settling time.
# get value:
motor_val = pv_motor_val.put(float(readback1))
motor_val = float(readback1)
pv_motor_val.put(motor_val)
# get value (it is translated to a caget):
motor_sta = pv_motor_sta.get()
# add values to plot:
#scan.append([readback1], [readback1], [motor_sta, motor_val])
# 2 colour plot
p1.getSeries(1).appendData(float(motor_val), float(motor_sta))
p1.getSeries(0).appendData(motor_val, float(motor_sta))
forwardsValues[sample] = float(motor_sta)
for sample in range(int(moveAround), int(-moveAround)-1, int(-steps)):
readback1 = sample #the x axis.
sleep(delay) # settling time.
# get value:
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
# 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) )
maxErrorPos = sample
import java.awt.Color
p1.addMarker(maxErrorPos, None, "MaxE=" + 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, here some detail: ..."
ret = "Example - Test successful, max error: " + str(maxError) + " at " + str(maxErrorPos)
success = True
test.sendFeedback(ret, success)
# once the test is finished, no need to do anything. The code below yours will do the rest.