当前位置: 首页>>代码示例>>Python>>正文


Python Driver.__init__方法代码示例

本文整理汇总了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()
开发者ID:lsst-camera-dh,项目名称:pybench-ccd-reb,代码行数:34,代码来源:monochromator_triax.py

示例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()
开发者ID:jenshnielsen,项目名称:hemelb,代码行数:10,代码来源:steering.py

示例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')
开发者ID:lsst-camera-dh,项目名称:pybench-ccd-reb,代码行数:60,代码来源:ccd_reb.py

示例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)
开发者ID:grid5000,项目名称:kwapi-g5k,代码行数:11,代码来源:json_url.py

示例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)
开发者ID:grid5000,项目名称:kwapi-g5k,代码行数:12,代码来源:wattsup.py

示例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
开发者ID:uschille,项目名称:hemelb,代码行数:12,代码来源:timing_client.py

示例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])
开发者ID:jenshnielsen,项目名称:hemelb,代码行数:12,代码来源:steering_cli.py

示例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)
开发者ID:grid5000,项目名称:kwapi-g5k,代码行数:13,代码来源:ipmi.py

示例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()
开发者ID:mosieurlaurin,项目名称:kwapi,代码行数:13,代码来源:eaton.py

示例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))
开发者ID:Farrael,项目名称:kwapi,代码行数:15,代码来源:dummy.py

示例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()
开发者ID:grid5000,项目名称:kwapi-g5k,代码行数:16,代码来源:snmp.py

示例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))
开发者ID:lsst-camera-dh,项目名称:pybench-ccd-reb,代码行数:21,代码来源:power_backsubstrate_ks.py

示例13: __init__

# 需要导入模块: from driver import Driver [as 别名]
# 或者: from driver.Driver import __init__ [as 别名]
 def __init__(self, identifier, **kargs):
     Driver.__init__(self, identifier, **kargs)
开发者ID:lsst-camera-dh,项目名称:pybench-ccd-reb,代码行数:4,代码来源:ds9display.py

示例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'))
开发者ID:carriercomm,项目名称:Arcus-Energy-Monitor,代码行数:6,代码来源:ibmssh.py

示例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)
开发者ID:carriercomm,项目名称:Arcus-Energy-Monitor,代码行数:4,代码来源:ibmdriver.py


注:本文中的driver.Driver.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。