当前位置: 首页>>代码示例>>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;未经允许,请勿转载。