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 __init__(self, index, webcam): typecheck.is_long(index, AssertionError) typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError) self.index = index self.webcam = webcam
def getWebcam(self): agent = self.agent args = {} rsp = agent.json_rpc(self.target, 'getWebcam', args) _ret_ = Interface.decode(rsp['_ret_'], agent) typecheck.is_interface(_ret_, raritan.rpc.webcam.Webcam, DecodeException) return _ret_
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 decode(rsp, agent): _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 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 createChannel(self): agent = self.agent args = {} rsp = agent.json_rpc(self.target, "createChannel", args) _ret_ = Interface.decode(rsp["_ret_"], agent) typecheck.is_interface(_ret_, raritan.rpc.event.Channel, DecodeException) return _ret_
def getPeripheralDeviceManager(self): agent = self.agent args = {} rsp = agent.json_rpc(self.target, 'getPeripheralDeviceManager', args) _ret_ = Interface.decode(rsp['_ret_'], agent) typecheck.is_interface(_ret_, raritan.rpc.peripheral.DeviceManager, DecodeException) return _ret_
def getSensorLogger(self): agent = self.agent args = {} rsp = agent.json_rpc(self.target, 'getSensorLogger', args) _ret_ = Interface.decode(rsp['_ret_'], agent) typecheck.is_interface(_ret_, raritan.rpc.sensors.Logger, DecodeException) return _ret_
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 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 __init__(self, cardReader, source): super(raritan.rpc.smartcard.CardReaderManager.CardReaderEvent, self).__init__(source) typecheck.is_interface(cardReader, raritan.rpc.smartcard.CardReader, AssertionError) self.cardReader = cardReader
def getAuxiliaryPorts(self): agent = self.agent args = {} rsp = agent.json_rpc(self.target, 'getAuxiliaryPorts', args) _ret_ = [Interface.decode(x0, agent) for x0 in rsp['_ret_']] for x0 in _ret_: typecheck.is_interface(x0, raritan.rpc.portsmodel.Port, DecodeException) return _ret_
def getChannels(self): agent = self.agent args = {} rsp = agent.json_rpc(self.target, 'getChannels', args) _ret_ = [Interface.decode(x0, agent) for x0 in rsp['_ret_']] for x0 in _ret_: typecheck.is_interface(x0, raritan.rpc.webcam.Channel, DecodeException) return _ret_
def getActualValues(self): agent = self.agent args = {} rsp = agent.json_rpc(self.target, 'getActualValues', args) _ret_ = [Interface.decode(x0, agent) for x0 in rsp['_ret_']] for x0 in _ret_: typecheck.is_interface(x0, raritan.rpc.lhxmodel.Parameter, DecodeException) return _ret_
def getDisplays(self): agent = self.agent args = {} rsp = agent.json_rpc(self.target, "getDisplays", args) _ret_ = [Interface.decode(x0, agent) for x0 in rsp["_ret_"]] for x0 in _ret_: typecheck.is_interface(x0, raritan.rpc.test.Display, DecodeException) return _ret_
def getCardReaders(self): agent = self.agent args = {} rsp = agent.json_rpc(self.target, 'getCardReaders', args) _ret_ = [Interface.decode(x0, agent) for x0 in rsp['_ret_']] for x0 in _ret_: typecheck.is_interface(x0, raritan.rpc.smartcard.CardReader, DecodeException) return _ret_
def getActualValues(self): agent = self.agent args = {} rsp = agent.json_rpc(self.target, 'getActualValues', args) _ret_ = [Interface.decode(x0, agent) for x0 in rsp['_ret_']] for x0 in _ret_: typecheck.is_interface(x0, raritan.rpc.lhxmodel.Parameter, DecodeException) return _ret_
def __init__(self, sensors, slots): for x0 in sensors: typecheck.is_interface(x0, raritan.rpc.sensors.Sensor, AssertionError) for x0 in slots: typecheck.is_interface(x0, raritan.rpc.peripheral.DeviceSlot, AssertionError) self.sensors = sensors self.slots = slots
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 getCardReaderById(self, readerId): agent = self.agent typecheck.is_string(readerId, AssertionError) args = {} args['readerId'] = readerId rsp = agent.json_rpc(self.target, 'getCardReaderById', args) _ret_ = Interface.decode(rsp['_ret_'], agent) typecheck.is_interface(_ret_, raritan.rpc.smartcard.CardReader, 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 getFeaturePorts(self): agent = self.agent args = {} rsp = agent.json_rpc(self.target, "getFeaturePorts", args) _ret_ = [Interface.decode(x0, agent) for x0 in rsp["_ret_"]] for x0 in _ret_: typecheck.is_interface(x0, raritan.rpc.portsmodel.Port, DecodeException) return _ret_
def getScanner(self, name): agent = self.agent typecheck.is_string(name, AssertionError) args = {} args['name'] = name rsp = agent.json_rpc(self.target, 'getScanner', args) _ret_ = Interface.decode(rsp['_ret_'], agent) typecheck.is_interface(_ret_, raritan.rpc.tfw.ScannerCtrl, DecodeException) return _ret_
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 getCardReaders(self): agent = self.agent args = {} rsp = agent.json_rpc(self.target, "getCardReaders", args) _ret_ = [Interface.decode(x0, agent) for x0 in rsp["_ret_"]] for x0 in _ret_: typecheck.is_interface(x0, raritan.rpc.smartcard.CardReader, DecodeException) return _ret_
def getCardReaderById(self, readerId): agent = self.agent typecheck.is_string(readerId, AssertionError) args = {} args["readerId"] = readerId rsp = agent.json_rpc(self.target, "getCardReaderById", args) _ret_ = Interface.decode(rsp["_ret_"], agent) typecheck.is_interface(_ret_, raritan.rpc.smartcard.CardReader, DecodeException) return _ret_
def __init__(self, webcam, interval, count, done): typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError) typecheck.is_int(interval, AssertionError) typecheck.is_int(count, AssertionError) typecheck.is_int(done, AssertionError) self.webcam = webcam self.interval = interval self.count = count self.done = done
def __init__(self, l1, l2, l3, average): typecheck.is_struct(l1, raritan.rpc.powerlogic.PowerMeter.MinMaxReading, AssertionError) typecheck.is_struct(l2, raritan.rpc.powerlogic.PowerMeter.MinMaxReading, AssertionError) typecheck.is_struct(l3, raritan.rpc.powerlogic.PowerMeter.MinMaxReading, AssertionError) typecheck.is_interface(average, raritan.rpc.sensors.NumericSensor, AssertionError) self.l1 = l1 self.l2 = l2 self.l3 = l3 self.average = average
def __init__(self, webcam, newestIndex, oldestIndex, count): typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError) typecheck.is_long(newestIndex, AssertionError) typecheck.is_long(oldestIndex, AssertionError) typecheck.is_int(count, AssertionError) self.webcam = webcam self.newestIndex = newestIndex self.oldestIndex = oldestIndex self.count = count
def __init__(self, l1, l2, l3, average): typecheck.is_struct(l1, raritan.rpc.powerlogic.PowerMeter.MinMaxReading, AssertionError) typecheck.is_struct(l2, raritan.rpc.powerlogic.PowerMeter.MinMaxReading, AssertionError) typecheck.is_struct(l3, raritan.rpc.powerlogic.PowerMeter.MinMaxReading, AssertionError) typecheck.is_interface(average, raritan.rpc.sensors.NumericSensor, AssertionError) self.l1 = l1 self.l2 = l2 self.l3 = l3 self.average = average
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 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 = 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 __init__(self, current, voltageL2L, voltageL2N, frequency, activePower, reactivePower, apparentPower, powerFactor, activeEnergy, reactiveEnergy, apparentEnergy, thdCurrent, thdVoltageL2L, thdVoltageL2N): typecheck.is_struct(current, raritan.rpc.powerlogic.PowerMeter.L2N_N_Avg, AssertionError) typecheck.is_struct(voltageL2L, raritan.rpc.powerlogic.PowerMeter.L2L_Avg, AssertionError) typecheck.is_struct(voltageL2N, raritan.rpc.powerlogic.PowerMeter.L2N_Avg, AssertionError) typecheck.is_interface(frequency, raritan.rpc.sensors.NumericSensor, AssertionError) typecheck.is_struct(activePower, raritan.rpc.powerlogic.PowerMeter.L2N_plain_total, AssertionError) typecheck.is_struct(reactivePower, raritan.rpc.powerlogic.PowerMeter.L2N_plain_total, AssertionError) typecheck.is_struct(apparentPower, raritan.rpc.powerlogic.PowerMeter.L2N_plain_total, AssertionError) typecheck.is_struct(powerFactor, raritan.rpc.powerlogic.PowerMeter.MinMaxReading, AssertionError) typecheck.is_interface(activeEnergy, raritan.rpc.sensors.NumericSensor, AssertionError) typecheck.is_interface(reactiveEnergy, raritan.rpc.sensors.NumericSensor, AssertionError) typecheck.is_interface(apparentEnergy, raritan.rpc.sensors.NumericSensor, AssertionError) typecheck.is_struct(thdCurrent, raritan.rpc.powerlogic.PowerMeter.L2N, AssertionError) typecheck.is_struct(thdVoltageL2L, raritan.rpc.powerlogic.PowerMeter.L2L, AssertionError) typecheck.is_struct(thdVoltageL2N, raritan.rpc.powerlogic.PowerMeter.L2N, AssertionError) self.current = current self.voltageL2L = voltageL2L self.voltageL2N = voltageL2N self.frequency = frequency self.activePower = activePower self.reactivePower = reactivePower self.apparentPower = apparentPower self.powerFactor = powerFactor self.activeEnergy = activeEnergy self.reactiveEnergy = reactiveEnergy self.apparentEnergy = apparentEnergy self.thdCurrent = thdCurrent self.thdVoltageL2L = thdVoltageL2L self.thdVoltageL2N = thdVoltageL2N
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 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 __init__(self, min, max, reading): typecheck.is_interface(min, raritan.rpc.sensors.NumericSensor, AssertionError) typecheck.is_interface(max, raritan.rpc.sensors.NumericSensor, AssertionError) typecheck.is_interface(reading, raritan.rpc.sensors.NumericSensor, AssertionError) self.min = min self.max = max self.reading = reading
def decode(rsp, agent): _ret_ = Interface.decode(rsp['_ret_'], agent) typecheck.is_interface(_ret_, raritan.rpc.sensors.Logger, DecodeException) return _ret_
def decode(rsp, agent): _ret_ = [Interface.decode(x0, agent) for x0 in rsp['_ret_']] for x0 in _ret_: typecheck.is_interface(x0, raritan.rpc.portsmodel.Port, DecodeException) return _ret_
def decode(rsp, agent): _ret_ = Interface.decode(rsp['_ret_'], agent) typecheck.is_interface(_ret_, raritan.rpc.hmi.InternalBeeper, DecodeException) return _ret_
def decode(rsp, agent): _ret_ = Interface.decode(rsp['_ret_'], agent) typecheck.is_interface(_ret_, raritan.rpc.peripheral.DeviceManager, DecodeException) return _ret_
def __init__(self, index, webcam): typecheck.is_long(index, AssertionError) typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError) self.index = index self.webcam = webcam