def jsonToactuator(self, jsonData):
     adDict = json.loads(jsonData)
     ad = ActuatorData()
     ad.name = adDict['name']
     ad.timeStamp = adDict['timeStamp']
     ad.hasError = adDict['hasError']
     ad.command = adDict['command']
     ad.errCode = adDict['errCode']
     ad.statusCode = adDict['statusCode']
     ad.stateData = adDict['stateData']
     ad.curValue = adDict['curValue']
     return ad
Beispiel #2
0
 def jsonToactuator(self,jsonData):
     actdataDict = json.loads(jsonData)
     print(" decode [pre] --> " + str(actdataDict))
     actdata = ActuatorData()
     actdata.name = actdataDict['name']
     actdata.time = actdataDict['timeStamp']
     actdata.hasError = actdataDict['hasError']
     actdata.command = actdataDict['command']
     actdata.errCode = actdataDict['errCode']
     actdata.statusCode = actdataDict['statusCode']
     actdata.stateData = actdataDict['stateData']
     actdata.curValue = actdataDict['curValue']
     print(" decode [post] --> " + str(actdata))
     return actdata
Beispiel #3
0
    def jsonToActuatorData(self, jsonData):
        adDict = json.loads(jsonData)

        #print(" decode [pre] --> " + str(adDict))

        ad = ActuatorData()
        ad.name = adDict['name']
        ad.timeStamp = adDict['timeStamp']
        ad.hasError = adDict['hasError']
        ad.command = adDict['command']
        ad.errCode = adDict['errCode']
        ad.statusCode = adDict['statusCode']
        ad.stateData = adDict['stateData']
        ad.curValue = adDict['curValue']

        #print(" decode [post] --> " + str(ad))

        return ad