Go to the documentation of this file.00001 __author__ = 'tom1231'
00002 from BAL.Header.Response.ParamBuildResponse import ParamBuildResponse, EngineOL
00003 import struct
00004
00005 MSG_LEN = 30
00006
00007
00008 class OpenLoopMotorParamResponse(ParamBuildResponse):
00009
00010 def __init__(self, devId, param):
00011 ParamBuildResponse.__init__(self, EngineOL, devId, 0)
00012 self._length = MSG_LEN
00013 self._checkSum = 0
00014 self._address = param.getOpenLoopAddress(devId)
00015 self._channel = param.getOpenLoopChannel(devId)
00016 self._timeout = param.getOpenLoopTimeout(devId)
00017 self._max = param.getOpenLoopMax(devId)
00018
00019 self._checkSum = self.calCheckSum(self.dataTosend())
00020
00021 def dataTosend(self):
00022 return ParamBuildResponse.dataTosend(self) \
00023 + struct.pack('<I', self._address) \
00024 + struct.pack('<I', self._channel) \
00025 + struct.pack('<I', self._timeout) \
00026 + struct.pack('<i', self._max)
00027