Exemplo n.º 1
0
    def __init__(self, config, device_no=1, hot_start=False, print_logs=False):

        Device.__init__(self, config, device_no, hot_start, print_logs)

        # Basics
        self.CommandEndCharacter = '\r\n'
        self.ReadSleepTime = .1
        self.WriteSleepTime = .1
        self.AnswerTime = .1
        self.Config = config
        self.MaxVoltage = None

        self.Identifier = None
        self.Model = None

        # Serial
        self.bOpen = False
        self.SerialPortName = self.Config.get(self.SectionName, 'address')
        self.Serial = None
        self.open_serial_port()

        # Info
        self.Busy = False
        self.last_write = ''
        self.LastMeasurement = -1
        self.LastCurrents = []
        self.LastVoltages = []
        self.LastStatusUpdate = -1
        self.LastStatus = []
        self.lastVoltage = 0
        self.CanRamp = True

        self.init_device(hot_start)
        self.hot_start()
Exemplo n.º 2
0
    def __init__(self):

        Device.__init__(self)

        self.__pagein  = 0
        self.__pageout = 0
        self.__time    = time.time()
        self.__lock    = threading.Lock()
Exemplo n.º 3
0
    def __init__(self, dev):

        Device.__init__(self)

        self.__dev = dev
        buf = gtop.netload(dev)
        self.__in, self.__out = buf.bytes_in, buf.bytes_out
        self.__time = time.time()
        self.__lock = threading.Lock()
Exemplo n.º 4
0
    def __init__(self):

        Device.__init__(self)

        self.__total = 0.0
        self.__user  = 0.0
        self.__sys   = 0.0
        self.__nice  = 0.0
        self.__idle  = 0.0
        self.__lock  = threading.Lock()
Exemplo n.º 5
0
    def __init__(self, port, host=''):
        import socket
        from NetRenderer import NetRenderer

        Device.__init__(self, NetRenderer())

        self._server = (host, port)
        self._socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

        return
Exemplo n.º 6
0
    def __init__(self, key, port, host=''):
        import socket
        from NetRenderer import NetRenderer

        Device.__init__(self, NetRenderer())

        self.host = host
        self.port = port

        import journal
        self._marshaller = journal.pickler()
        self._marshaller.key = key

        return
Exemplo n.º 7
0
    def __init__(self, key, port, host=''):
        import socket
        from NetRenderer import NetRenderer

        Device.__init__(self, NetRenderer())

        self.host = host
        self.port = port

        import journal
        self._marshaller = journal.pickler()
        self._marshaller.key = key

        return
Exemplo n.º 8
0
    def __init__(self, key, port, host=''):
        import socket
        from NetRenderer import NetRenderer

        Device.__init__(self, NetRenderer())

        import pyre.ipc
        self._connection = pyre.ipc.connection('udp')
        self._connection.connect((host, port))

        import journal
        self._marshaller = journal.pickler()
        self._marshaller.key = key

        return
Exemplo n.º 9
0
    def __init__(self, key, port, host=''):
        import socket
        from NetRenderer import NetRenderer

        Device.__init__(self, NetRenderer())

        import pyre.ipc
        self._connection = pyre.ipc.connection('udp')
        self._connection.connect((host, port))

        import journal
        self._marshaller = journal.pickler()
        self._marshaller.key = key

        return
Exemplo n.º 10
0
    def __init__(self, config, device_no=1, hot_start=False):

        Device.__init__(self, config, device_no, hot_start)

        # Serial
        self.bOpen = False
        self.bOpenInformed = False
        self.serialPortName = config.get(self.SectionName, 'address')
        self.baudrate = config.getint(self.SectionName, 'baudrate')
        self.serial = None
        self.commandEndCharacter = chr(13) + chr(10)

        self.writeSleepTime = 0.1
        self.readSleepTime = 0.2
        self.measurements = deque()
        self.last_voltage = 0
        self.identifier = None
        self.Model = None
        self.MaxVoltage = None
        self.manual = False
        self.open_serial_port()
Exemplo n.º 11
0
 def __init__(self):
     Device.__init__(self, "remote")
     return
Exemplo n.º 12
0
 def __init__(self):
     Device.__init__(self, "console")
     return
Exemplo n.º 13
0
 def __init__(self, logfile):
     Device.__init__(self)
     self.file = logfile
     return
Exemplo n.º 14
0
 def __init__(self, stream, name=None):
     if name is None:
         name = "stream"
     Device.__init__(self, name)
     self.stream = stream
     return
Exemplo n.º 15
0
 def __init__(self, vera, device_id):
     Device.__init__(self, vera, device_id)
     self.device_id = device_id
     self.device_type = __name__
Exemplo n.º 16
0
 def __init__(self):
     Device.__init__(self, "file")
     return
Exemplo n.º 17
0
 def __init__(self, logfile):
     Device.__init__(self)
     self.file = logfile
     return
Exemplo n.º 18
0
 def __init__(self):
     Device.__init__(self, "console")
     return
Exemplo n.º 19
0
 def __init__(self):
     Device.__init__(self, "remote")
     return
Exemplo n.º 20
0
 def __init__(self):
     Device.__init__(self, "file")
     return