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
def encode(self): json = {} json['l1'] = raritan.rpc.powerlogic.PowerMeter.MinMaxReading.encode(self.l1) json['l2'] = raritan.rpc.powerlogic.PowerMeter.MinMaxReading.encode(self.l2) json['l3'] = raritan.rpc.powerlogic.PowerMeter.MinMaxReading.encode(self.l3) json['n'] = Interface.encode(self.n) json['average'] = Interface.encode(self.average) return json
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
def encode(self): json = {} json[ "l1"] = raritan.rpc.powerlogic.PowerMeter.MinMaxReading.encode( self.l1) json[ "l2"] = raritan.rpc.powerlogic.PowerMeter.MinMaxReading.encode( self.l2) json[ "l3"] = raritan.rpc.powerlogic.PowerMeter.MinMaxReading.encode( self.l3) json["n"] = Interface.encode(self.n) json["average"] = Interface.encode(self.average) return json
def encode(self): json = {} json["webcam"] = Interface.encode(self.webcam) json["newestIndex"] = self.newestIndex json["oldestIndex"] = self.oldestIndex json["count"] = self.count return json
def encode(self): json = {} json["webcam"] = Interface.encode(self.webcam) json["interval"] = self.interval json["count"] = self.count json["done"] = self.done return json
def getMetaData(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, 'getMetaData', args) _ret_ = rsp['_ret_'] meta = [ raritan.rpc.webcam.StorageManager.ImageStorageMetaData.decode( x0, agent) for x0 in rsp['meta'] ] typecheck.is_int(_ret_, DecodeException) for x0 in meta: typecheck.is_struct( x0, raritan.rpc.webcam.StorageManager.ImageStorageMetaData, DecodeException) return (_ret_, meta)
def subscribe(self, consumer): agent = self.agent typecheck.is_interface(consumer, raritan.rpc.event.Consumer, AssertionError) args = {} args['consumer'] = Interface.encode(consumer) rsp = agent.json_rpc(self.target, 'subscribe', args)
def encode(self): json = {} json['webcam'] = Interface.encode(self.webcam) json['interval'] = self.interval json['count'] = self.count json['done'] = self.done return json
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
def encode(webcam, clientType): typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError) typecheck.is_string(clientType, AssertionError) args = {} args['webcam'] = Interface.encode(webcam) args['clientType'] = clientType return args
def encode(self): json = {} json['webcam'] = Interface.encode(self.webcam) json['newestIndex'] = self.newestIndex json['oldestIndex'] = self.oldestIndex json['count'] = self.count return json
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)
def demandEvent(self, type, src): agent = self.agent typecheck.is_typeinfo(type, AssertionError) typecheck.is_remote_obj(src, AssertionError) args = {} args["type"] = raritan.rpc.TypeInfo.encode(type) args["src"] = Interface.encode(src) rsp = agent.json_rpc(self.target, "demandEvent", args)
def cancelEvent(self, type, src): agent = self.agent typecheck.is_typeinfo(type, AssertionError) typecheck.is_remote_obj(src, AssertionError) args = {} args['type'] = raritan.rpc.TypeInfo.encode(type) args['src'] = Interface.encode(src) rsp = agent.json_rpc(self.target, 'cancelEvent', args)
def encode(self): json = {} json['current'] = raritan.rpc.powerlogic.PowerMeter.L2N_N_Avg.encode(self.current) json['voltageL2L'] = raritan.rpc.powerlogic.PowerMeter.L2L_Avg.encode(self.voltageL2L) json['voltageL2N'] = raritan.rpc.powerlogic.PowerMeter.L2N_Avg.encode(self.voltageL2N) json['frequency'] = Interface.encode(self.frequency) json['activePower'] = raritan.rpc.powerlogic.PowerMeter.L2N_plain_total.encode(self.activePower) json['reactivePower'] = raritan.rpc.powerlogic.PowerMeter.L2N_plain_total.encode(self.reactivePower) json['apparentPower'] = raritan.rpc.powerlogic.PowerMeter.L2N_plain_total.encode(self.apparentPower) json['powerFactor'] = raritan.rpc.powerlogic.PowerMeter.MinMaxReading.encode(self.powerFactor) json['activeEnergy'] = Interface.encode(self.activeEnergy) json['reactiveEnergy'] = Interface.encode(self.reactiveEnergy) json['apparentEnergy'] = Interface.encode(self.apparentEnergy) json['thdCurrent'] = raritan.rpc.powerlogic.PowerMeter.L2N.encode(self.thdCurrent) json['thdVoltageL2L'] = raritan.rpc.powerlogic.PowerMeter.L2L.encode(self.thdVoltageL2L) json['thdVoltageL2N'] = raritan.rpc.powerlogic.PowerMeter.L2N.encode(self.thdVoltageL2N) return json
def encode(webcam, count, interval): 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 return args
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_
def unsubscribe(self, consumer): agent = self.agent typecheck.is_interface(consumer, raritan.rpc.event.Consumer, AssertionError) args = {} args["consumer"] = Interface.encode(consumer) rsp = agent.json_rpc(self.target, "unsubscribe", args) _ret_ = rsp["_ret_"] typecheck.is_int(_ret_, DecodeException) return _ret_
def destroyChannel(self, channel): agent = self.agent typecheck.is_interface(channel, raritan.rpc.event.Channel, AssertionError) args = {} args["channel"] = Interface.encode(channel) rsp = agent.json_rpc(self.target, "destroyChannel", args) _ret_ = rsp["_ret_"] typecheck.is_int(_ret_, DecodeException) return _ret_
def encode(webcam, start, count, direction): 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) return args
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)
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)
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_
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 = int(rsp["index"]) typecheck.is_int(_ret_, DecodeException) typecheck.is_long(index, DecodeException) return (_ret_, index)
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_
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_
def encode(self): json = {} json[ "current"] = raritan.rpc.powerlogic.PowerMeter.L2N_N_Avg.encode( self.current) json[ "voltageL2L"] = raritan.rpc.powerlogic.PowerMeter.L2L_Avg.encode( self.voltageL2L) json[ "voltageL2N"] = raritan.rpc.powerlogic.PowerMeter.L2N_Avg.encode( self.voltageL2N) json["frequency"] = Interface.encode(self.frequency) json[ "activePower"] = raritan.rpc.powerlogic.PowerMeter.L2N_plain_total.encode( self.activePower) json[ "reactivePower"] = raritan.rpc.powerlogic.PowerMeter.L2N_plain_total.encode( self.reactivePower) json[ "apparentPower"] = raritan.rpc.powerlogic.PowerMeter.L2N_plain_total.encode( self.apparentPower) json[ "powerFactor"] = raritan.rpc.powerlogic.PowerMeter.MinMaxReading.encode( self.powerFactor) json["activeEnergy"] = Interface.encode(self.activeEnergy) json["reactiveEnergy"] = Interface.encode(self.reactiveEnergy) json["apparentEnergy"] = Interface.encode(self.apparentEnergy) json["thdCurrent"] = raritan.rpc.powerlogic.PowerMeter.L2N.encode( self.thdCurrent) json[ "thdVoltageL2L"] = raritan.rpc.powerlogic.PowerMeter.L2L.encode( self.thdVoltageL2L) json[ "thdVoltageL2N"] = raritan.rpc.powerlogic.PowerMeter.L2N.encode( self.thdVoltageL2N) return json
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)
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)
def encode(self): json = {} json["source"] = Interface.encode(self.source) return json
def encode(self): json = super(raritan.rpc.portsmodel.Port.DeviceChangedEvent, self).encode() json['oldDevice'] = Interface.encode(self.oldDevice) json['newDevice'] = Interface.encode(self.newDevice) return json
def encode(self): json = {} json['source'] = Interface.encode(self.source) return json
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
def encode(self): json = {} json['min'] = Interface.encode(self.min) json['max'] = Interface.encode(self.max) json['reading'] = Interface.encode(self.reading) return json
def encode(self): json = super(raritan.rpc.smartcard.CardReaderManager.CardReaderEvent, self).encode() json['cardReader'] = Interface.encode(self.cardReader) return json
def encode(self): json = super(raritan.rpc.serial.SerialPort.ModemEvent, self).encode() json['modem'] = Interface.encode(self.modem) return json
def encode(self): json = {} json['index'] = self.index json['webcam'] = Interface.encode(self.webcam) return json
def encode(webcam): typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError) args = {} args['webcam'] = Interface.encode(webcam) return args
def encode(self): json = super(raritan.rpc.webcam.WebcamEvent, self).encode() json['webcam'] = Interface.encode(self.webcam) return json