本文整理汇总了Python中driver.Driver.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Driver.__init__方法的具体用法?Python Driver.__init__怎么用?Python Driver.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类driver.Driver
的用法示例。
在下文中一共展示了Driver.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from driver import Driver [as 别名]
# 或者: from driver.Driver import __init__ [as 别名]
def __init__(self, identifier, **kargs):
Driver.__init__(self, identifier, **kargs)
# self.identifier = identifier
# self.host = host
# self.device = device
# self.port = port # XML-RPC port
if 'host' not in kargs.keys():
raise ValueError("host is requested")
if 'devices' not in kargs.keys():
raise ValueError("devices is requested")
if 'port' not in kargs.keys():
raise ValueError("port is requested")
self.xmlrpc = xmlrpclib.ServerProxy("http://%s:%d/" %
(self.host, self.port))
# Available gratings
# TODO: add resolution, blaze angle, etc...
self.gratings_properties = { 0: {'name': 'G0',
'range': [200.0, 600.0]},
1: {'name': 'G1',
'range': [600.0, 1100.0]},
2: {'name': 'G2',
'range': [1100.0, 2600.0]}
}
self.gratings = self.gratings_properties.keys()
示例2: __init__
# 需要导入模块: from driver import Driver [as 别名]
# 或者: from driver.Driver import __init__ [as 别名]
def __init__(self, parent, clargs):
Tkinter.Tk.__init__(self,parent)
Driver.__init__(self,clargs)
self.geometry('%dx%d' % (512, 512))
self.update()
self.lsign = 1
self.act()
示例3: __init__
# 需要导入模块: from driver import Driver [as 别名]
# 或者: from driver.Driver import __init__ [as 别名]
def __init__(self, identifier, **kargs):
Driver.__init__(self, identifier, **kargs)
# self.identifier = identifier
# self.host = host
# self.device = device
# self.port = port # XML-RPC port
# if 'host' not in kargs.keys():
# raise ValueError("host is requested")
# if 'devices' not in kargs.keys():
# raise ValueError("devices is requested")
# if 'port' not in kargs.keys():
# raise ValueError("port is requested")
if 'reb_id' not in kargs:
raise ValueError("reb_id is requested")
if 'host' not in kargs:
self.host = None
if 'stripe' not in kargs:
self.stripe = 0
if 'xmlfile' not in kargs:
raise ValueError("XML sequencer file is requested")
if self.hardware == 'REB1':
self.reb = reb1.REB1(reb_id=self.reb_id, ctrl_host=self.host, stripe_id=[self.stripe])
self.useCABAC = True
elif self.hardware == 'WREB1':
self.reb = wreb.WREB(rriaddress=self.reb_id, ctrl_host=self.host, stripe_id=[self.stripe])
self.useCABAC = True
self.reb.useCABACbias = True
elif self.hardware in ['REB3', 'REB4']:
self.reb = reb3.REB3(self.bcfile)
self.useCABAC = False
else:
raise ValueError('Unknown type of hardware: %s' % self.hardware)
# then check FPGA version after connecting
checkversion = self.reb.fpga.get_version()
if self.version != checkversion:
raise ValueError('Wrong version of the FPGA firmware: reading %x instead of %x'
% (checkversion, self.version))
self.reb.xmlfile = self.xmlfile
self.read_sequencer_file(self.xmlfile)
self.reb.exptime = self.reb.get_exposure_time()
# CCD and test-related values (for meta)
self.testID = { 'TESTTYPE': 'TEST', 'IMGTYPE': 'TEST', 'SEQNUM': 0}
self.sensorID = { 'CCD_MANU': 'NONE', 'CCD_TYPE': 'NONE', 'CCD_SERN': '000-00', 'LSST_NUM': 'NONE'}
logging.basicConfig(filename='REB-'+ time.strftime('%Y%m%d', time.gmtime()) + '.log',
level=logging.DEBUG, format='%(asctime)s: %(message)s')
示例4: __init__
# 需要导入模块: from driver import Driver [as 别名]
# 或者: from driver.Driver import __init__ [as 别名]
def __init__(self, probe_ids, probe_names, probe_data_type, **kwargs):
"""Initializes the Json URL driver.
Keyword arguments:
probe_ids -- list containing the probes IDs
(a wattmeter monitor sometimes several probes)
kwargs -- keyword (url) defining the Json URL driver parameters
"""
Driver.__init__(self, probe_ids, probe_names, probe_data_type, kwargs)
示例5: __init__
# 需要导入模块: from driver import Driver [as 别名]
# 或者: from driver.Driver import __init__ [as 别名]
def __init__(self, probe_ids, data_type, **kwargs):
"""Initializes the Wattsup driver.
Keyword arguments:
probe_ids -- list containing the probes IDs
(a wattmeter monitor sometimes several probes)
kwargs -- keyword (device) defining the device to read (/dev/ttyUSB0)
"""
Driver.__init__(self, probe_ids, data_type, kwargs)
示例6: __init__
# 需要导入模块: from driver import Driver [as 别名]
# 或者: from driver.Driver import __init__ [as 别名]
def __init__(self, clargs, stream=sys.stdout):
Driver.__init__(self,clargs)
self.stream = stream
self.time = time()
self.lsign = 1
self.last_step = 0
self.orbit = self.options.pop('orbit')
self.framerate = self.options.get('MaxFramerate',None)
if self.framerate:
self.hemelb.MaxFramerate = self.framerate
示例7: __init__
# 需要导入模块: from driver import Driver [as 别名]
# 或者: from driver.Driver import __init__ [as 别名]
def __init__(self, clargs, stream=sys.stdout):
Driver.__init__(self, clargs)
self.stream = stream
self.monitor = self.options.pop('monitor')
self.show = self.options.pop('show')
for option in self.options:
print("Setting %s to %s" % (option, self.options[option]) )
setattr(self.hemelb, option, self.options[option])
示例8: __init__
# 需要导入模块: from driver import Driver [as 别名]
# 或者: from driver.Driver import __init__ [as 别名]
def __init__(self, probe_ids, probe_data_type, **kwargs):
"""Initializes the IPMI driver.
Keyword arguments:
probe_ids -- list containing the probes IDs
(a wattmeter monitor sometimes several probes)
kwargs -- keywords (interface, host, username,
password) defining the IPMI parameters
"""
Driver.__init__(self, probe_ids, probe_data_type, kwargs)
示例9: __init__
# 需要导入模块: from driver import Driver [as 别名]
# 或者: from driver.Driver import __init__ [as 别名]
def __init__(self, probe_ids, **kwargs):
"""Initializes the Eaton driver.
Keyword arguments:
probe_ids -- list containing the probes IDs
(a wattmeter monitor sometimes several probes)
kwargs -- keyword (ip, user) defining the Eaton SNMP parameters
"""
Driver.__init__(self, probe_ids, kwargs)
self.cmd_gen = cmdgen.CommandGenerator()
示例10: __init__
# 需要导入模块: from driver import Driver [as 别名]
# 或者: from driver.Driver import __init__ [as 别名]
def __init__(self, probe_ids, **kwargs):
"""Initializes the dummy driver.
Keyword arguments:
probe_ids -- list containing the probes IDs
(a wattmeter monitor sometimes several probes)
kwargs -- keywords (min_value and max_value)
defining the random value interval
"""
Driver.__init__(self, probe_ids, kwargs)
self.min_value = int(kwargs.get('min', 75))
self.max_value = int(kwargs.get('max', 100))
示例11: __init__
# 需要导入模块: from driver import Driver [as 别名]
# 或者: from driver.Driver import __init__ [as 别名]
def __init__(self, probe_ids, probes_names, probe_data_type, **kwargs):
"""Initializes the SNMP driver.
Keyword arguments:
probe_ids -- list containing the probes IDs
(a metricmeter monitor sometimes several probes)
kwargs -- keyword (protocol, user or community, ip, oid) defining the
SNMP parameters
Eaton OID is 1.3.6.1.4.1.534.6.6.7.6.5.1.3
Raritan OID is 1.3.6.1.4.1.13742.4.1.2.2.1.7
"""
Driver.__init__(self, probe_ids, probes_names, probe_data_type, kwargs)
self.cmd_gen = cmdgen.CommandGenerator()
示例12: __init__
# 需要导入模块: from driver import Driver [as 别名]
# 或者: from driver.Driver import __init__ [as 别名]
def __init__(self, identifier, **kargs):
Driver.__init__(self, identifier, **kargs)
# self.identifier = identifier
# self.host = host
# self.device = device
# self.port = port # XML-RPC port
if 'host' not in kargs.keys():
raise ValueError("host is requested")
if 'devices' not in kargs.keys():
raise ValueError("devices is requested")
if 'port' not in kargs.keys():
raise ValueError("port is requested")
self.xmlrpc = xmlrpclib.ServerProxy("http://%s:%d/" %
(self.host, self.port))
示例13: __init__
# 需要导入模块: from driver import Driver [as 别名]
# 或者: from driver.Driver import __init__ [as 别名]
def __init__(self, identifier, **kargs):
Driver.__init__(self, identifier, **kargs)
示例14: __init__
# 需要导入模块: from driver import Driver [as 别名]
# 或者: from driver.Driver import __init__ [as 别名]
def __init__(self, probe_ids, **kwargs):
Driver.__init__(self, probe_ids, kwargs)
self.hosts = (kwargs.get('host'))
self.temp = (kwargs.get('time'))
示例15: __init__
# 需要导入模块: from driver import Driver [as 别名]
# 或者: from driver.Driver import __init__ [as 别名]
def __init__(self, probe_ids, **kwargs):
Driver.__init__(self, probe_ids, kwargs)