Closedown

This commit is contained in:
boccioli_m
2017-08-29 14:38:33 +02:00
parent 8c78864d1b
commit ed5e0035ca
4 changed files with 13 additions and 11 deletions

View File

@@ -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

View File

@@ -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:

View File

@@ -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;

View File

@@ -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)