當前位置: 首頁>>代碼示例>>Python>>正文


Python Device.__init__方法代碼示例

本文整理匯總了Python中Device.Device.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python Device.__init__方法的具體用法?Python Device.__init__怎麽用?Python Device.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Device.Device的用法示例。


在下文中一共展示了Device.__init__方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from Device import Device [as 別名]
# 或者: from Device.Device import __init__ [as 別名]
    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()
開發者ID:diamondIPP,項目名稱:keithleyClient,代碼行數:36,代碼來源:ISEG.py

示例2: __init__

# 需要導入模塊: from Device import Device [as 別名]
# 或者: from Device.Device import __init__ [as 別名]
    def __init__(self):

        Device.__init__(self)

        self.__pagein  = 0
        self.__pageout = 0
        self.__time    = time.time()
        self.__lock    = threading.Lock()
開發者ID:RaumZeit,項目名稱:gdesklets-core,代碼行數:10,代碼來源:Swap.py

示例3: __init__

# 需要導入模塊: from Device import Device [as 別名]
# 或者: from Device.Device import __init__ [as 別名]
    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()
開發者ID:RaumZeit,項目名稱:gdesklets-core,代碼行數:11,代碼來源:Net.py

示例4: __init__

# 需要導入模塊: from Device import Device [as 別名]
# 或者: from Device.Device import __init__ [as 別名]
    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()
開發者ID:RaumZeit,項目名稱:gdesklets-core,代碼行數:12,代碼來源:CPU.py

示例5: __init__

# 需要導入模塊: from Device import Device [as 別名]
# 或者: from Device.Device import __init__ [as 別名]
    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
開發者ID:bmi-forum,項目名稱:bmi-pyre,代碼行數:16,代碼來源:TCPDevice.py

示例6: __init__

# 需要導入模塊: from Device import Device [as 別名]
# 或者: from Device.Device import __init__ [as 別名]
    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
開發者ID:Alex-Song,項目名稱:vmaf,代碼行數:17,代碼來源:UDPDevice.py

示例7: __init__

# 需要導入模塊: from Device import Device [as 別名]
# 或者: from Device.Device import __init__ [as 別名]
    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()
開發者ID:diamondIPP,項目名稱:keithleyClient,代碼行數:23,代碼來源:KeithleyHead.py

示例8: __init__

# 需要導入模塊: from Device import Device [as 別名]
# 或者: from Device.Device import __init__ [as 別名]
 def __init__(self):
     Device.__init__(self, "remote")
     return
開發者ID:Alex-Song,項目名稱:vmaf,代碼行數:5,代碼來源:Remote.py

示例9: __init__

# 需要導入模塊: from Device import Device [as 別名]
# 或者: from Device.Device import __init__ [as 別名]
 def __init__(self, logfile):
     Device.__init__(self)
     self.file = logfile
     return
開發者ID:Alex-Song,項目名稱:vmaf,代碼行數:6,代碼來源:File.py

示例10: __init__

# 需要導入模塊: from Device import Device [as 別名]
# 或者: from Device.Device import __init__ [as 別名]
 def __init__(self, stream, name=None):
     if name is None:
         name = "stream"
     Device.__init__(self, name)
     self.stream = stream
     return
開發者ID:geodynamics,項目名稱:pythia,代碼行數:8,代碼來源:Stream.py

示例11: __init__

# 需要導入模塊: from Device import Device [as 別名]
# 或者: from Device.Device import __init__ [as 別名]
 def __init__(self, vera, device_id):
     Device.__init__(self, vera, device_id)
     self.device_id = device_id
     self.device_type = __name__
開發者ID:danwangkoala,項目名稱:vera_chil,代碼行數:6,代碼來源:Switch.py


注:本文中的Device.Device.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。