Startup
This commit is contained in:
@@ -22,6 +22,7 @@ class TestingTool:
|
||||
self.testName = testName
|
||||
self.testPath = testPath
|
||||
self.testParams = testParams
|
||||
self.log('\n'+'='*80)
|
||||
|
||||
def getParam(self, paramName):
|
||||
"""
|
||||
@@ -91,11 +92,14 @@ class TestingTool:
|
||||
params = the JSON object with the parameters passed by pshell
|
||||
"""
|
||||
columnsFormat = '{0:17} {1:>20} {2}'
|
||||
self.log('-'*80)
|
||||
self.log(columnsFormat.format("Parameter", "Value", "Description"))
|
||||
self.log('-'*80)
|
||||
for key in self.testParams.keys():
|
||||
self.log(columnsFormat.format(key,
|
||||
self.testParams[key]['value'],
|
||||
self.testParams[key]['description']))
|
||||
self.log('-'*80)
|
||||
|
||||
|
||||
def sendFeedback(self, returnString, testPassed):
|
||||
@@ -157,9 +161,7 @@ class Interlock:
|
||||
import binascii
|
||||
udp = UDPDatagram()
|
||||
msg = self._msgWrite()
|
||||
print 'setInterlockMode', binascii.hexlify(msg)
|
||||
modebytes = array('B', mode)
|
||||
msg.extend(modebytes)
|
||||
msg.extend(array('B', mode))
|
||||
print 'setInterlockMode', binascii.hexlify(msg)
|
||||
if not udp.send(msg):
|
||||
return False
|
||||
@@ -172,7 +174,7 @@ class Interlock:
|
||||
msg = self._msgRead()
|
||||
print 'getInterlockMode', binascii.hexlify(msg)
|
||||
rcv = udp.send(msg)
|
||||
print 'getInterlockMode', binascii.hexlify(rcv)
|
||||
#print 'getInterlockMode', binascii.hexlify(rcv)
|
||||
return rcv
|
||||
|
||||
def masterReset(self):
|
||||
@@ -190,7 +192,7 @@ class UDPDatagram:
|
||||
class for receiving and sending a udp message
|
||||
"""
|
||||
import socket
|
||||
# the constructor
|
||||
|
||||
def __init__(self):
|
||||
# communication with interlock server
|
||||
self.serverPort = 0xBB1B # interlock server
|
||||
@@ -209,7 +211,7 @@ class UDPDatagram:
|
||||
try:
|
||||
# get the ip address and send
|
||||
print 'here should sendto:', self.serverName, self.serverPort
|
||||
print 'message: ', message, binascii.hexlify(message)
|
||||
print 'message: ', binascii.hexlify(message)
|
||||
#self.sock.sendto(message, (self.serverName, self.serverPort))
|
||||
#except socket.error, msg:
|
||||
except :
|
||||
@@ -245,4 +247,5 @@ class UDPDatagram:
|
||||
def send(self, message):
|
||||
self._listenInit()
|
||||
self._sendUDP(message)
|
||||
return self._listen()
|
||||
return self._listen()
|
||||
|
||||
Reference in New Issue
Block a user