コード例 #1
0
ファイル: conftest.py プロジェクト: rohanpok/xpdAcq
def fresh_xrun(bt, db):
    # loop
    loop = asyncio.new_event_loop()
    loop.set_debug(True)
    # create xrun
    xrun = CustomizedRunEngine(None, loop=loop)
    xrun.md["beamline_id"] = glbl_dict["beamline_id"]
    xrun.md["group"] = glbl_dict["group"]
    xrun.md["facility"] = glbl_dict["facility"]
    xrun.ignore_callback_exceptions = False
    xrun.beamtime = bt
    # link mds
    xrun.subscribe(db.insert, "all")
    # set simulation objects
    # alias
    pe1c = simple_pe1c
    configure_device(
        db=db,
        shutter=shctl1,
        area_det=pe1c,
        temp_controller=cs700,
        ring_current=ring_current,
        filter_bank=fb,
    )
    yield xrun
    # clean
    print("Clean xrun loop")
    if xrun.state != "idle":
        xrun.halt()
    ev = asyncio.Event(loop=loop)
    ev.set()
    loop.run_until_complete(ev.wait())
コード例 #2
0
ファイル: conftest.py プロジェクト: st3107/xpdAcq
def fresh_xrun(bt, db, set_xpd_configuration):
    xrun = CustomizedRunEngine(None)
    xrun.md["beamline_id"] = glbl_dict["beamline_id"]
    xrun.md["group"] = glbl_dict["group"]
    xrun.md["facility"] = glbl_dict["facility"]
    xrun.ignore_callback_exceptions = False
    xrun.beamtime = bt
    # link mds
    xrun.subscribe(db.v1.insert, "all")
    return xrun