本文整理汇总了Python中raritan.rpc.Interface.encode方法的典型用法代码示例。如果您正苦于以下问题:Python Interface.encode方法的具体用法?Python Interface.encode怎么用?Python Interface.encode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类raritan.rpc.Interface
的用法示例。
在下文中一共展示了Interface.encode方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: encode
# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
def encode(self):
json = {}
json['l1'] = Interface.encode(self.l1)
json['l2'] = Interface.encode(self.l2)
json['l3'] = Interface.encode(self.l3)
json['total'] = raritan.rpc.powerlogic.PowerMeter.MinMaxReading.encode(self.total)
return json
示例2: encode
# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
def encode(webcam, image):
typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError)
typecheck.is_struct(image, raritan.rpc.webcam.Image, AssertionError)
args = {}
args['webcam'] = Interface.encode(webcam)
args['image'] = raritan.rpc.webcam.Image.encode(image)
return args
示例3: stopActivity
# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
def stopActivity(self, webcam):
agent = self.agent
typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError)
args = {}
args['webcam'] = Interface.encode(webcam)
rsp = agent.json_rpc(self.target, 'stopActivity', args)
_ret_ = rsp['_ret_']
typecheck.is_int(_ret_, DecodeException)
return _ret_
示例4: addImage
# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
def addImage(self, webcam, image):
agent = self.agent
typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError)
typecheck.is_struct(image, raritan.rpc.webcam.Image, AssertionError)
args = {}
args['webcam'] = Interface.encode(webcam)
args['image'] = raritan.rpc.webcam.Image.encode(image)
rsp = agent.json_rpc(self.target, 'addImage', args)
_ret_ = rsp['_ret_']
index = long(rsp['index'])
typecheck.is_int(_ret_, DecodeException)
typecheck.is_long(index, DecodeException)
return (_ret_, index)
示例5: getChannel
# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
def getChannel(self, webcam, clientType):
agent = self.agent
typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError)
typecheck.is_string(clientType, AssertionError)
args = {}
args['webcam'] = Interface.encode(webcam)
args['clientType'] = clientType
rsp = agent.json_rpc(self.target, 'getChannel', args)
_ret_ = rsp['_ret_']
channel = Interface.decode(rsp['channel'], agent)
typecheck.is_int(_ret_, DecodeException)
typecheck.is_interface(channel, raritan.rpc.webcam.Channel, DecodeException)
return (_ret_, channel)
示例6: startActivity
# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
def startActivity(self, webcam, count, interval):
agent = self.agent
typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError)
typecheck.is_int(count, AssertionError)
typecheck.is_int(interval, AssertionError)
args = {}
args['webcam'] = Interface.encode(webcam)
args['count'] = count
args['interval'] = interval
rsp = agent.json_rpc(self.target, 'startActivity', args)
_ret_ = rsp['_ret_']
typecheck.is_int(_ret_, DecodeException)
return _ret_
示例7: removeImages
# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
def removeImages(self, webcam, start, count, direction):
agent = self.agent
typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError)
typecheck.is_long(start, AssertionError)
typecheck.is_int(count, AssertionError)
typecheck.is_enum(direction, raritan.rpc.webcam.StorageManager.Direction, AssertionError)
args = {}
args['webcam'] = Interface.encode(webcam)
args['start'] = start
args['count'] = count
args['direction'] = raritan.rpc.webcam.StorageManager.Direction.encode(direction)
rsp = agent.json_rpc(self.target, 'removeImages', args)
_ret_ = rsp['_ret_']
typecheck.is_int(_ret_, DecodeException)
return _ret_
示例8: getPeripheralDeviceTimedRecords
# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
def getPeripheralDeviceTimedRecords(self, slot, recid, count):
agent = self.agent
typecheck.is_interface(slot, raritan.rpc.peripheral.DeviceSlot, AssertionError)
typecheck.is_int(recid, AssertionError)
typecheck.is_int(count, AssertionError)
args = {}
args['slot'] = Interface.encode(slot)
args['recid'] = recid
args['count'] = count
rsp = agent.json_rpc(self.target, 'getPeripheralDeviceTimedRecords', args)
_ret_ = rsp['_ret_']
recs = [raritan.rpc.sensors.Logger.TimedRecord.decode(x0, agent) for x0 in rsp['recs']]
typecheck.is_int(_ret_, DecodeException)
for x0 in recs:
typecheck.is_struct(x0, raritan.rpc.sensors.Logger.TimedRecord, DecodeException)
return (_ret_, recs)
示例9: getImages
# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
def getImages(self, webcam, start, count, direction):
agent = self.agent
typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError)
typecheck.is_long(start, AssertionError)
typecheck.is_int(count, AssertionError)
typecheck.is_enum(direction, raritan.rpc.webcam.StorageManager.Direction, AssertionError)
args = {}
args['webcam'] = Interface.encode(webcam)
args['start'] = start
args['count'] = count
args['direction'] = raritan.rpc.webcam.StorageManager.Direction.encode(direction)
rsp = agent.json_rpc(self.target, 'getImages', args)
_ret_ = rsp['_ret_']
image = [raritan.rpc.webcam.StorageManager.StorageImage.decode(x0, agent) for x0 in rsp['image']]
typecheck.is_int(_ret_, DecodeException)
for x0 in image:
typecheck.is_struct(x0, raritan.rpc.webcam.StorageManager.StorageImage, DecodeException)
return (_ret_, image)
示例10: encode
# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
def encode(self):
json = {}
json['source'] = Interface.encode(self.source)
return json
示例11: encode
# 需要导入模块: from raritan.rpc import Interface [as 别名]
# 或者: from raritan.rpc.Interface import encode [as 别名]
def encode(self):
json = {}
json['sensors'] = [Interface.encode(x0) for x0 in self.sensors]
json['slots'] = [Interface.encode(x0) for x0 in self.slots]
return json