本文整理汇总了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())
示例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))
示例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())