本文整理汇总了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()
示例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()
示例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()
示例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()
示例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
示例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
示例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()
示例8: __init__
# 需要导入模块: from Device import Device [as 别名]
# 或者: from Device.Device import __init__ [as 别名]
def __init__(self):
Device.__init__(self, "remote")
return
示例9: __init__
# 需要导入模块: from Device import Device [as 别名]
# 或者: from Device.Device import __init__ [as 别名]
def __init__(self, logfile):
Device.__init__(self)
self.file = logfile
return
示例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
示例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__