53 lines
1.6 KiB
Python
Executable File
53 lines
1.6 KiB
Python
Executable File
#Script imported from: test7.xml
|
|
|
|
#Variables
|
|
var1 = 0.0
|
|
|
|
#TODO: Set the diplay names of positioners and detectors
|
|
scan = ManualScan(['id278043'], ['id348623', 'id367393', 'id192931', 'id173831'] , [0.0], [31.0], [31])
|
|
scan.start()
|
|
|
|
#Creating channels: dimension 1
|
|
#LinearPositioner id278043
|
|
id278043 = Channel('TESTIOC:TESTCALCOUT:Input', type = 'd')
|
|
#ScalarDetector id348623
|
|
id348623 = Channel('TESTIOC:TESTCALCOUT:Output', type = 'd')
|
|
#ScalarDetector id367393
|
|
id367393 = Channel('TESTIOC:TESTSINUS:SinCalc', type = 'd')
|
|
#Timestamp id192931
|
|
|
|
#Dimension 1
|
|
#LinearPositioner id278043
|
|
for setpoint1 in frange(0.0, 31.0, 1.0, True):
|
|
if setpoint1 > 31.0 or setpoint1 < 0.0:
|
|
break
|
|
id278043.put(setpoint1, timeout=None) # TODO: Set appropriate timeout
|
|
readback1 = id278043.get()
|
|
if abs(readback1 - setpoint1) > 0.5 : # TODO: Check accuracy
|
|
raise Exception('Actor id278043 could not be set to the value ' + str(setpoint1))
|
|
#Dimension Actions
|
|
#Script action
|
|
#Variable Mappings
|
|
x = Channel('TESTIOC:TESTSINUS:SinCalc', type = 'd')
|
|
#TODO: Move, if needed, this import to the file header: import time
|
|
time.sleep(0.1)
|
|
#print "==>" + str(x.getValue())
|
|
#Detector id348623
|
|
detector1 = id348623.get()
|
|
#Detector id367393
|
|
detector2 = id367393.get()
|
|
#Detector id192931
|
|
detector3 = float(java.lang.System.currentTimeMillis())
|
|
#Manipulation id173831
|
|
#Variable Mappings
|
|
v = detector2
|
|
id173831 = v+100.0
|
|
scan.append ([setpoint1], [readback1], [detector1, detector2, detector3, id173831])
|
|
|
|
#Closing channels
|
|
id278043.close()
|
|
id348623.close()
|
|
id367393.close()
|
|
|
|
scan.end()
|