當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。