Closedown

This commit is contained in:
boccioli_m
2015-10-08 14:42:36 +02:00
parent cb948868bb
commit b8cfa76f09
13 changed files with 222 additions and 855 deletions

View File

@@ -1,161 +0,0 @@
#Script Motor Test 3
#Moves from CCW to CW as a series of discrete translations (C times) logs after each translation. When end switch is encountered change direction. Repeat N times
time.sleep(5)
import traceback
#by default, failed
ret = 'Test failed'
status = False
DEVICE="PO2DV-NCS-LS"
params = parameters
print "100ms params: "
print params
#TODO: Set the diplay names of positioners and detectors
#scan = ManualScan(['idX', 'idInkr'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idPotiProc', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [-0.5, 0.0], [4.0, 3000.0], [3000, 20])
scan = ManualScan(['idX'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idPotiProc', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [ 0.0], [ 3000.0], [20])
scan.setPlotName("Bla")
scan.start()
#Creating channels: dimension 1
try:
#RegionPositioner idInkr
#idInkr = Channel(DEVICE+':INKR:2', type = 'd')
idInkr = Channel(DEVICE+':MOTOR.VAL', type = 'd')
#ScalarDetector idMotorStatus
#idMotorStatus = Channel(DEVICE+':STA:1', type = 'd')
idMotorStatus = Channel(DEVICE+':MOTOR.MSTA', type = 'd')
#ScalarDetector idLogicalPosition
#idLogicalPosition = Channel(DEVICE+':IST:2', type = 'd')
idLogicalPosition = Channel(DEVICE+':MOTOR.RVAL', type = 'd')
#ScalarDetector idDiameter
#idDiameter = Channel(DEVICE+':DIAM:2', type = 'd')
idDiameter = Channel(DEVICE+':ENCODERoff', type = 'd')
#ScalarDetector idMotorPosition
#idMotorPosition = Channel(DEVICE+':IST1:2', type = 'd')
idMotorPosition = Channel(DEVICE+':MOTOR.RBV', type = 'd')
#ScalarDetector idPotiRaw
#idPotiRaw = Channel(DEVICE+':POSA:1', type = 'd')
idPotiRaw = Channel(DEVICE+':ENCODERraw', type = 'd')
#ScalarDetector idPotiProc
#idPotiProc = Channel(DEVICE+':POSA:2', type = 'd')
idPotiProc = Channel(DEVICE+':ENCODER', type = 'd')
#ScalarDetector idBtvsRaw
#idBtvsRaw = Channel(DEVICE+':IST3:1', type = 'd')
idBtvsRaw = Channel(DEVICE+':MOTOR.LLS', type = 'd')
#ScalarDetector idBtvsProc
#idBtvsProc = Channel(DEVICE+':IST3:2', type = 'd')
idBtvsProc = Channel(DEVICE+':MOTOR.HLS', type = 'd')
#ScalarDetector idEndSwitchL
#idBtvsRaw = Channel(DEVICE+':IST3:1', type = 'd')
idEndSwitchL = Channel(DEVICE+':MOTOR.LLS', type = 'd')
#ScalarDetector idEndSwitchH
#idBtvsProc = Channel(DEVICE+':IST3:2', type = 'd')
idEndSwitchH = Channel(DEVICE+':MOTOR.HLS', type = 'd')
#high position limit
idLimitH = Channel(DEVICE+':MOTOR.HLM', type = 'd')
#low position limit
idLimitL = Channel(DEVICE+':MOTOR.LLM', type = 'd')
except:
print "Unexpected error:", sys.exc_info()[0]
ret = 'Unable to create channel - ' + traceback.format_exc()
success = False
raise
sys.exit()
#remove limits
idLimitH.put(999999.9, timeout=None)
idLimitL.put(-999999.9, timeout=None)
#Dimension 1
direction = 1.0;
startDefault = -100.0
endDefault = 1000.0
end = endDefault
#find position at Low end switch: it will be the starting point of the test
idInkr.put(-100.0, timeout=None) # TODO: Set appropriate timeout
start = idInkr.get()+direction
countSteps = 0
count = 0
for setpoint1 in range(0, 0):
count = count + 1
sleep( 5 ) # Settling time
#RegionPositioner idInkr
for setpoint2 in frange(start, end, direction):
readback1 = setpoint1
idInkr.put(setpoint2, timeout=None) # TODO: Set appropriate timeout
sleep( 0.1 ) # Settling time
readback2 = idInkr.get()
#if abs(readback2 - setpoint2) > 1 : # TODO: Check accuracy
# ret = 'Actor idInkr could not be set to the value ' + str(setpoint2) + ' (current value: ' + str(readback2) + ')'
# success = False
# raise Exception(ret)
#Detector idMotorStatus
detector1 = idMotorStatus.get()
#Detector idLogicalPosition
detector2 = idLogicalPosition.get()
#Detector idDiameter
detector3 = idDiameter.get()
#Detector idMotorPosition
detector4 = idMotorPosition.get()
#Detector idPotiRaw
detector5 = idPotiRaw.get()
#Detector idPotiProc
detector6 = idPotiProc.get()
#Detector idBtvsRaw
detector7 = idBtvsRaw.get()
#Detector idBtvsProc
detector8 = idBtvsProc.get()
#end switches
endH = idEndSwitchH.get()
endL = idEndSwitchL.get()
#Manipulation idDiff02
#Variable Mappings
a = detector4
b = detector8
idDiff02 = a-b
#Manipulation idDiff01
#Variable Mappings
a = detector4
b = detector6
idDiff01 = a-b
countSteps = countSteps + 1
scan.append ([countSteps], [countSteps], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, idDiff02, idDiff01])
if endH>0.0 :
#invert direction and swap start with end of translation
end = startDefault
start = readback2 - direction
direction = -1.0
print 'End H switch, changing direction to ' + str(direction)
break
if endL>0.0 :
#invert direction and swap start with end of translation
end = endDefault
start = readback2 - direction
direction = 1.0
print 'End L switch, changing direction to ' + str(direction)
break
#set limits back
idLimitH.put(145.0, timeout=None)
idLimitL.put(0.0, timeout=None)
#Closing channels
idInkr.close()
idMotorStatus.close()
idLogicalPosition.close()
idDiameter.close()
idMotorPosition.close()
idPotiRaw.close()
idPotiProc.close()
idBtvsRaw.close()
idBtvsProc.close()
scan.end()
ret = 'Slide moved back and forth (' + str(count) + ' runs)'
status = True
set_return("OK")

View File

@@ -1,157 +0,0 @@
#Script Motor Test 3
#Moves from CCW to CW as a series of discrete translations (C times) logs after each translation. When end switch is encountered change direction. Repeat N times
time.sleep(2)
import traceback
#by default, failed
ret = 'Test failed'
status = False
DEVICE="PO2DV-NCS-LS"
#TODO: Set the diplay names of positioners and detectors
#scan = ManualScan(['idX', 'idInkr'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idPotiProc', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [-0.5, 0.0], [4.0, 3000.0], [3000, 20])
scan = ManualScan(['idX'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idPotiProc', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [ 0.0], [ 3000.0], [20])
scan.setPlotName("Bla")
scan.start()
#Creating channels: dimension 1
try:
#RegionPositioner idInkr
#idInkr = Channel(DEVICE+':INKR:2', type = 'd')
idInkr = Channel(DEVICE+':MOTOR.VAL', type = 'd')
#ScalarDetector idMotorStatus
#idMotorStatus = Channel(DEVICE+':STA:1', type = 'd')
idMotorStatus = Channel(DEVICE+':MOTOR.MSTA', type = 'd')
#ScalarDetector idLogicalPosition
#idLogicalPosition = Channel(DEVICE+':IST:2', type = 'd')
idLogicalPosition = Channel(DEVICE+':MOTOR.RVAL', type = 'd')
#ScalarDetector idDiameter
#idDiameter = Channel(DEVICE+':DIAM:2', type = 'd')
idDiameter = Channel(DEVICE+':ENCODERoff', type = 'd')
#ScalarDetector idMotorPosition
#idMotorPosition = Channel(DEVICE+':IST1:2', type = 'd')
idMotorPosition = Channel(DEVICE+':MOTOR.RBV', type = 'd')
#ScalarDetector idPotiRaw
#idPotiRaw = Channel(DEVICE+':POSA:1', type = 'd')
idPotiRaw = Channel(DEVICE+':ENCODERraw', type = 'd')
#ScalarDetector idPotiProc
#idPotiProc = Channel(DEVICE+':POSA:2', type = 'd')
idPotiProc = Channel(DEVICE+':ENCODER', type = 'd')
#ScalarDetector idBtvsRaw
#idBtvsRaw = Channel(DEVICE+':IST3:1', type = 'd')
idBtvsRaw = Channel(DEVICE+':MOTOR.LLS', type = 'd')
#ScalarDetector idBtvsProc
#idBtvsProc = Channel(DEVICE+':IST3:2', type = 'd')
idBtvsProc = Channel(DEVICE+':MOTOR.HLS', type = 'd')
#ScalarDetector idEndSwitchL
#idBtvsRaw = Channel(DEVICE+':IST3:1', type = 'd')
idEndSwitchL = Channel(DEVICE+':MOTOR.LLS', type = 'd')
#ScalarDetector idEndSwitchH
#idBtvsProc = Channel(DEVICE+':IST3:2', type = 'd')
idEndSwitchH = Channel(DEVICE+':MOTOR.HLS', type = 'd')
#high position limit
idLimitH = Channel(DEVICE+':MOTOR.HLM', type = 'd')
#low position limit
idLimitL = Channel(DEVICE+':MOTOR.LLM', type = 'd')
except:
print "Unexpected error:", sys.exc_info()[0]
ret = 'Unable to create channel - ' + traceback.format_exc()
success = False
raise
sys.exit()
#remove limits
idLimitH.put(999999.9, timeout=None)
idLimitL.put(-999999.9, timeout=None)
#Dimension 1
direction = 1.0;
startDefault = -100.0
endDefault = 10.0
end = endDefault
#find position at Low end switch: it will be the starting point of the test
idInkr.put(-100.0, timeout=None) # TODO: Set appropriate timeout
start = idInkr.get()+direction
countSteps = 0
count = 0
for setpoint1 in range(0, 0):
count = count + 1
sleep( 5 ) # Settling time
#RegionPositioner idInkr
for setpoint2 in frange(start, end, direction):
readback1 = setpoint1
idInkr.put(setpoint2, timeout=None) # TODO: Set appropriate timeout
sleep( 0.2 ) # Settling time
readback2 = idInkr.get()
#if abs(readback2 - setpoint2) > 1 : # TODO: Check accuracy
# ret = 'Actor idInkr could not be set to the value ' + str(setpoint2) + ' (current value: ' + str(readback2) + ')'
# success = False
# raise Exception(ret)
#Detector idMotorStatus
detector1 = idMotorStatus.get()
#Detector idLogicalPosition
detector2 = idLogicalPosition.get()
#Detector idDiameter
detector3 = idDiameter.get()
#Detector idMotorPosition
detector4 = idMotorPosition.get()
#Detector idPotiRaw
detector5 = idPotiRaw.get()
#Detector idPotiProc
detector6 = idPotiProc.get()
#Detector idBtvsRaw
detector7 = idBtvsRaw.get()
#Detector idBtvsProc
detector8 = idBtvsProc.get()
#end switches
endH = idEndSwitchH.get()
endL = idEndSwitchL.get()
#Manipulation idDiff02
#Variable Mappings
a = detector4
b = detector8
idDiff02 = a-b
#Manipulation idDiff01
#Variable Mappings
a = detector4
b = detector6
idDiff01 = a-b
countSteps = countSteps + 1
scan.append ([countSteps], [countSteps], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, idDiff02, idDiff01])
if endH>0.0 :
#invert direction and swap start with end of translation
end = startDefault
start = readback2 - direction
direction = -1.0
print 'End H switch, changing direction to ' + str(direction)
break
if endL>0.0 :
#invert direction and swap start with end of translation
end = endDefault
start = readback2 - direction
direction = 1.0
print 'End L switch, changing direction to ' + str(direction)
break
#set limits back
idLimitH.put(145.0, timeout=None)
idLimitL.put(0.0, timeout=None)
#Closing channels
idInkr.close()
idMotorStatus.close()
idLogicalPosition.close()
idDiameter.close()
idMotorPosition.close()
idPotiRaw.close()
idPotiProc.close()
idBtvsRaw.close()
idBtvsProc.close()
scan.end()
ret = 'Slide moved back and forth (' + str(count) + ' runs)'
status = True
set_return("OK2")

View File

@@ -1,153 +0,0 @@
#Script Motor Test 3
#Moves from CCW to CW as a series of discrete translations (C times) logs after each translation. When end switch is encountered change direction. Repeat N times
import traceback
#by default, failed
ret = 'Test failed'
status = False
#TODO: Set the diplay names of positioners and detectors
#scan = ManualScan(['idX', 'idInkr'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idPotiProc', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [-0.5, 0.0], [4.0, 3000.0], [3000, 20])
scan = ManualScan(['idX'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idPotiProc', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [ 0.0], [ 3000.0], [20])
scan.start()
#Creating channels: dimension 1
try:
#RegionPositioner idInkr
#idInkr = Channel(DEVICE+':INKR:2', type = 'd')
idInkr = Channel(DEVICE+':MOTOR.VAL', type = 'd')
#ScalarDetector idMotorStatus
#idMotorStatus = Channel(DEVICE+':STA:1', type = 'd')
idMotorStatus = Channel(DEVICE+':MOTOR.MSTA', type = 'd')
#ScalarDetector idLogicalPosition
#idLogicalPosition = Channel(DEVICE+':IST:2', type = 'd')
idLogicalPosition = Channel(DEVICE+':MOTOR.RVAL', type = 'd')
#ScalarDetector idDiameter
#idDiameter = Channel(DEVICE+':DIAM:2', type = 'd')
idDiameter = Channel(DEVICE+':ENCODERoff', type = 'd')
#ScalarDetector idMotorPosition
#idMotorPosition = Channel(DEVICE+':IST1:2', type = 'd')
idMotorPosition = Channel(DEVICE+':MOTOR.RBV', type = 'd')
#ScalarDetector idPotiRaw
#idPotiRaw = Channel(DEVICE+':POSA:1', type = 'd')
idPotiRaw = Channel(DEVICE+':ENCODERraw', type = 'd')
#ScalarDetector idPotiProc
#idPotiProc = Channel(DEVICE+':POSA:2', type = 'd')
idPotiProc = Channel(DEVICE+':ENCODER', type = 'd')
#ScalarDetector idBtvsRaw
#idBtvsRaw = Channel(DEVICE+':IST3:1', type = 'd')
idBtvsRaw = Channel(DEVICE+':MOTOR.LLS', type = 'd')
#ScalarDetector idBtvsProc
#idBtvsProc = Channel(DEVICE+':IST3:2', type = 'd')
idBtvsProc = Channel(DEVICE+':MOTOR.HLS', type = 'd')
#ScalarDetector idEndSwitchL
#idBtvsRaw = Channel(DEVICE+':IST3:1', type = 'd')
idEndSwitchL = Channel(DEVICE+':MOTOR.LLS', type = 'd')
#ScalarDetector idEndSwitchH
#idBtvsProc = Channel(DEVICE+':IST3:2', type = 'd')
idEndSwitchH = Channel(DEVICE+':MOTOR.HLS', type = 'd')
#high position limit
idLimitH = Channel(DEVICE+':MOTOR.HLM', type = 'd')
#low position limit
idLimitL = Channel(DEVICE+':MOTOR.LLM', type = 'd')
except:
print "Unexpected error:", sys.exc_info()[0]
ret = 'Unable to create channel - ' + traceback.format_exc()
success = False
raise
sys.exit()
#remove limits
idLimitH.put(999999.9, timeout=None)
idLimitL.put(-999999.9, timeout=None)
#Dimension 1
direction = 1.0;
startDefault = -100.0
endDefault = 1000.0
end = endDefault
#find position at Low end switch: it will be the starting point of the test
idInkr.put(-100.0, timeout=None) # TODO: Set appropriate timeout
start = idInkr.get()+direction
countSteps = 0
count = 0
for setpoint1 in range(0, 10):
count = count + 1
sleep( 5 ) # Settling time
#RegionPositioner idInkr
for setpoint2 in frange(start, end, direction):
readback1 = setpoint1
idInkr.put(setpoint2, timeout=None) # TODO: Set appropriate timeout
sleep( 0.5 ) # Settling time
readback2 = idInkr.get()
#if abs(readback2 - setpoint2) > 1 : # TODO: Check accuracy
# ret = 'Actor idInkr could not be set to the value ' + str(setpoint2) + ' (current value: ' + str(readback2) + ')'
# success = False
# raise Exception(ret)
#Detector idMotorStatus
detector1 = idMotorStatus.get()
#Detector idLogicalPosition
detector2 = idLogicalPosition.get()
#Detector idDiameter
detector3 = idDiameter.get()
#Detector idMotorPosition
detector4 = idMotorPosition.get()
#Detector idPotiRaw
detector5 = idPotiRaw.get()
#Detector idPotiProc
detector6 = idPotiProc.get()
#Detector idBtvsRaw
detector7 = idBtvsRaw.get()
#Detector idBtvsProc
detector8 = idBtvsProc.get()
#end switches
endH = idEndSwitchH.get()
endL = idEndSwitchL.get()
#Manipulation idDiff02
#Variable Mappings
a = detector4
b = detector8
idDiff02 = a-b
#Manipulation idDiff01
#Variable Mappings
a = detector4
b = detector6
idDiff01 = a-b
countSteps = countSteps + 1
scan.append ([countSteps], [countSteps], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, idDiff02, idDiff01])
if endH>0.0 :
#invert direction and swap start with end of translation
end = startDefault
start = readback2 - direction
direction = -1.0
print 'End H switch, changing direction to ' + str(direction)
break
if endL>0.0 :
#invert direction and swap start with end of translation
end = endDefault
start = readback2 - direction
direction = 1.0
print 'End L switch, changing direction to ' + str(direction)
break
#set limits back
idLimitH.put(145.0, timeout=None)
idLimitL.put(0.0, timeout=None)
#Closing channels
idInkr.close()
idMotorStatus.close()
idLogicalPosition.close()
idDiameter.close()
idMotorPosition.close()
idPotiRaw.close()
idPotiProc.close()
idBtvsRaw.close()
idBtvsProc.close()
scan.end()
ret = 'Slide moved back and forth (' + str(count) + ' runs)'
status = True

View File

@@ -1,81 +0,0 @@
#Script imported from: Motor Test 3 - with original pv.xml
#TODO: Set the diplay names of positioners and detectors
scan = ManualScan(['idX', 'idInkr'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idPotiProc', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [0.0, 0.0], [3000.0, 10.0], [3000, 20])
scan.start()
#Creating channels: dimension 1
#PseudoPositioner idX
#RegionPositioner idInkr
idInkr = Channel('{DEVICE}:INKR:2', type = 'd')
#ScalarDetector idMotorStatus
idMotorStatus = Channel('{DEVICE}:STA:1', type = 'd')
#ScalarDetector idLogicalPosition
idLogicalPosition = Channel('{DEVICE}:IST:2', type = 'd')
#ScalarDetector idDiameter
idDiameter = Channel('{DEVICE}:DIAM:2', type = 'd')
#ScalarDetector idMotorPosition
idMotorPosition = Channel('{DEVICE}:IST1:2', type = 'd')
#ScalarDetector idPotiRaw
idPotiRaw = Channel('{DEVICE}:POSA:1', type = 'd')
#ScalarDetector idPotiProc
idPotiProc = Channel('{DEVICE}:POSA:2', type = 'd')
#ScalarDetector idBtvsRaw
idBtvsRaw = Channel('{DEVICE}:IST3:1', type = 'd')
#ScalarDetector idBtvsProc
idBtvsProc = Channel('{DEVICE}:IST3:2', type = 'd')
#Dimension 1
#PseudoPositioner idX
for setpoint1 in range(0, 3000):
readback1 = setpoint1
sleep( 0.1 ) # Settling time
#RegionPositioner idInkr
for setpoint2 in frange(0.0, 10.0, 1.0, True) + frange(11.0, 0.0, -1.0, True):
idInkr.put(setpoint2, timeout=None) # TODO: Set appropriate timeout
readback2 = idInkr.get()
if abs(readback2 - setpoint2) > -0.5 : # TODO: Check accuracy
raise Exception('Actor idInkr could not be set to the value ' + str(setpoint2))
sleep( 5.0 ) # Settling time
#Detector idMotorStatus
detector1 = idMotorStatus.get()
#Detector idLogicalPosition
detector2 = idLogicalPosition.get()
#Detector idDiameter
detector3 = idDiameter.get()
#Detector idMotorPosition
detector4 = idMotorPosition.get()
#Detector idPotiRaw
detector5 = idPotiRaw.get()
#Detector idPotiProc
detector6 = idPotiProc.get()
#Detector idBtvsRaw
detector7 = idBtvsRaw.get()
#Detector idBtvsProc
detector8 = idBtvsProc.get()
#Manipulation idDiff02
#Variable Mappings
a = detector4
b = detector8
count = setpoint1
idDiff02 = a-b
#Manipulation idDiff01
#Variable Mappings
a = detector4
b = detector6
count = setpoint1
idDiff01 = a-b
scan.append ([setpoint1, setpoint2], [readback1, readback2], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, idDiff02, idDiff01])
#Closing channels
idInkr.close()
idMotorStatus.close()
idLogicalPosition.close()
idDiameter.close()
idMotorPosition.close()
idPotiRaw.close()
idPotiProc.close()
idBtvsRaw.close()
idBtvsProc.close()
scan.end()

View File

@@ -1 +0,0 @@
set_return("OK dammy")

View File

@@ -1,22 +0,0 @@
global print_log, sendFeedback, inspect
import sys, inspect, os, traceback, time
def print_log(testName, DEVICE, text):
time.ctime()
now = time.strftime('%Y.%m.%d %H:%M:%S')
textToLog = now + ' ' + DEVICE + ' - ' + testName + ': ' + str(text)
print textToLog
#prepare and send feedback to calling tool
def buildFeedback(testPath, testName, DEVICE, returnString, testPassed):
print_log(testName, DEVICE, 'End of test. Result:')
print_log(testName, DEVICE, 'Device: ' + DEVICE)
print_log(testName, DEVICE, 'Test name: ' + testName)
print_log(testName, DEVICE, 'Test path: ' + testPath)
print_log(testName, DEVICE, 'Test passed: ' + str(testPassed))
print_log(testName, DEVICE, 'Return string: ' + returnString)
ret = [testPath, DEVICE, returnString, testPassed]
return ret

View File

@@ -1,15 +0,0 @@
global aa
global bb
def bb():
print "bb"
def aa():
print "aa"
bb()
print 'testLocalVar1- a: ' + str(a)
print 'testLocalVar1- b: ' + str(b)
time.ctime()
print time.strftime('%Y.%m.%d %H:%M:%S')
bb()
aa()
set_return("OK 1")

View File

@@ -1,7 +0,0 @@
print 'testLocalVar2- a: ' + str(a)
print 'testLocalVar2- b: ' + str(b)
time.ctime()
print time.strftime('%Y.%m.%d %H:%M:%S')
set_return("OK 2")

View File

@@ -1,24 +0,0 @@
global print_log, sendFeedback, sys, inspect, os, traceback
import sys, inspect, os, traceback
def print_log(testName, DEVICE, text):
import time
time.ctime()
now = time.strftime('%Y.%m.%d %H:%M:%S')
print now + ' ' + DEVICE + ' - ' + testName + ': ' + str(text)
#prepare and send feedback to calling tool
def sendFeedback(testPath, testName, DEVICE, returnString, testPassed):
print_log(testName, DEVICE, 'End of test. Result:')
print_log(testName, DEVICE, 'Device: ' + DEVICE)
print_log(testName, DEVICE, 'Test name: ' + testName)
print_log(testName, DEVICE, 'Test path: ' + testPath)
print_log(testName, DEVICE, 'Test passed: ' + str(testPassed))
print_log(testName, DEVICE, 'Return string: ' + returnString)
ret = [testPath, DEVICE, returnString, testPassed]
return ret
pippo = 'pippo'
def print_pio():
print 'piopio'

View File

@@ -1,36 +0,0 @@
global print_log, sendFeedback, sys, inspect, os, traceback
import sys, inspect, os, traceback
class TestingTool:
pippo = 'pippo'
deviceName = ''
testName = ''
testPath = ''
def __init__(self, testName, testPath, deviceName):
self.deviceName = deviceName
self.testName = testName
self.testPath = testPath
def print_log(self, text):
import time
time.ctime()
now = time.strftime('%Y.%m.%d %H:%M:%S')
print now + ' ' + self.deviceName + ' - ' + self.testName + ': ' + str(text)
#prepare and send feedback to calling tool
def sendFeedback(self, returnString, testPassed):
self.print_log('End of test. Result:')
self.print_log('Device: ' + self.deviceName)
self.print_log('Test name: ' + self.testName)
self.print_log('Test path: ' + self.testPath)
self.print_log('Test passed: ' + str(testPassed))
self.print_log('Return string: ' + returnString)
ret = [self.testPath, self.deviceName, returnString, testPassed]
set_return( ret)
def print_pio(self):
print 'piopio'