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


Python HardwareRepository.getHardwareObject方法代码示例

本文整理汇总了Python中HardwareRepository.HardwareRepository.getHardwareObject方法的典型用法代码示例。如果您正苦于以下问题:Python HardwareRepository.getHardwareObject方法的具体用法?Python HardwareRepository.getHardwareObject怎么用?Python HardwareRepository.getHardwareObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HardwareRepository.HardwareRepository的用法示例。


在下文中一共展示了HardwareRepository.getHardwareObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: complete_initialization

# 需要导入模块: from HardwareRepository import HardwareRepository [as 别名]
# 或者: from HardwareRepository.HardwareRepository import getHardwareObject [as 别名]
    def complete_initialization(app):
        app.beamline = hwr.getHardwareObject(cmdline_options.beamline_setup)
        app.session = app.beamline.getObjectByRole("session")
        app.collect = app.beamline.getObjectByRole("collect")

        Utils.enable_snapshots(app.collect)

        app.diffractometer = app.beamline.getObjectByRole("diffractometer")

        if getattr(app.diffractometer, 'centring_motors_list', None) is None:
            # centring_motors_list is the list of roles corresponding to diffractometer motors
            app.diffractometer.centring_motors_list = app.diffractometer.getPositions().keys()

        app.db_connection = app.beamline.getObjectByRole("lims_client")
        app.empty_queue = pickle.dumps(hwr.getHardwareObject(cmdline_options.queue_model))
        app.sample_changer = app.beamline.getObjectByRole("sample_changer")
        app.rest_lims = app.beamline.getObjectByRole("lims_rest_client")
        app.queue = qutils.new_queue()

        try:
            SampleCentring.init_signals()
            SampleChanger.init_signals()
            Beamline.init_signals()
        except Exception:
            sys.excepthook(*sys.exc_info())
开发者ID:bolmsten,项目名称:mxcube3,代码行数:27,代码来源:__init__.py

示例2: complete_initialization

# 需要导入模块: from HardwareRepository import HardwareRepository [as 别名]
# 或者: from HardwareRepository.HardwareRepository import getHardwareObject [as 别名]
    def complete_initialization(app):
        app.beamline = hwr.getHardwareObject(cmdline_options.beamline_setup)
        app.xml_rpc_server = hwr.getHardwareObject('xml-rpc-server')
        app.session = app.beamline.getObjectByRole("session")
        app.collect = app.beamline.getObjectByRole("collect")
        app.workflow = app.beamline.getObjectByRole("workflow")
        app.shapes = app.beamline.getObjectByRole("shape_history")

        Utils.enable_snapshots(app.collect)

        app.diffractometer = app.beamline.getObjectByRole("diffractometer")

        if getattr(app.diffractometer, 'centring_motors_list', None) is None:
            # centring_motors_list is the list of roles corresponding to diffractometer motors
            app.diffractometer.centring_motors_list = app.diffractometer.getPositions().keys()

        app.db_connection = app.beamline.getObjectByRole("lims_client")
        app.empty_queue = pickle.dumps(hwr.getHardwareObject(cmdline_options.queue_model))
        app.sample_changer = app.beamline.getObjectByRole("sample_changer")
        app.sc_maintenance = app.beamline.getObjectByRole("sample_changer_maintenance")
        app.rest_lims = app.beamline.getObjectByRole("lims_rest_client")
        app.queue = qutils.new_queue()
        app.actions = hwr.getHardwareObject(cmdline_options.beamline_actions)
        app.plotting = hwr.getHardwareObject(cmdline_options.plotting)

        # SampleID of currently mounted sample
        app.CURRENTLY_MOUNTED_SAMPLE = None
        app.SAMPLE_TO_BE_MOUNTED = ''
        app.AUTO_MOUNT_SAMPLE = False
        app.AUTO_ADD_DIFFPLAN = False
        app.CENTRING_METHOD = CENTRING_METHOD.LOOP
        app.NUM_SNAPSHOTS = app.collect.getProperty('num_snapshots', 4)
        app.NODE_ID_TO_LIMS_ID = {}
        app.INITIAL_FILE_LIST = []
        app.SC_CONTENTS = {"FROM_CODE": {}, "FROM_LOCATION": {}}
        app.SAMPLE_LIST = {"sampleList": {}, 'sampleOrder': []}
        app.TEMP_DISABLED = []

        # set up streaming
        from mxcube3.video import streaming

        try:
            streaming.init(app.diffractometer.camera, cmdline_options.video_device)
        except RuntimeError as ex:
            logging.getLogger('HWR').info(str(ex))
            app.VIDEO_DEVICE = None
        else:
            app.VIDEO_DEVICE = cmdline_options.video_device

        try:
            SampleCentring.init_signals()
            SampleChanger.init_signals()
            Beamline.init_signals()
            Diffractometer.init_signals()
        except Exception:
            sys.excepthook(*sys.exc_info())

        logging.getLogger("HWR").info("MXCuBE 3 initialized, it took %.1f seconds" % (time.time() - t0))
开发者ID:MartinSavko,项目名称:mxcube3,代码行数:60,代码来源:__init__.py

示例3: complete_initialization

# 需要导入模块: from HardwareRepository import HardwareRepository [as 别名]
# 或者: from HardwareRepository.HardwareRepository import getHardwareObject [as 别名]
 def complete_initialization(app):
     app.beamline = hwr.getHardwareObject(cmdline_options.beamline_setup)
     app.session = app.beamline.getObjectByRole("session")
     app.collect = app.beamline.getObjectByRole("collect")
     app.diffractometer = app.beamline.getObjectByRole("diffractometer")
     app.db_connection = app.beamline.getObjectByRole("lims_client")
     app.empty_queue = jsonpickle.encode(hwr.getHardwareObject(cmdline_options.queue_model))
     app.sample_changer = app.beamline.getObjectByRole("sample_changer")
     try:
         routes.SampleCentring.init_signals()
     except Exception:
         sys.excepthook(*sys.exc_info())
开发者ID:milanprica,项目名称:mxcube3,代码行数:14,代码来源:__init__.py


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