selectionmodel = QtCore.QItemSelectionModel(headermodel) metadataview = MDVConusumer(headermodel, selectionmodel) view_box = MDVWithButtons(metadataview) hw = hw() hw.motor.set(15) hw.motor.delay = 0.1 hw.motor1.delay = 0.2 hw.motor2.delay = 0.3 hw.det.kind = "hinted" hw.det1.kind = "hinted" hw.det2.kind = "hinted" RE, queue, thread, teleport = spawn_RE() cg = ControlGui( queue, teleport, Count("Count", bp.count, DetectorSelector(detectors=[hw.det, hw.det1, hw.det2])), Scan1D( "1D absolute scan", bp.scan, MotorSelector([hw.motor, hw.motor1, hw.motor2]), DetectorSelector(detectors=[hw.det, hw.det1, hw.det2]), ), Scan1D( "1D relative scan", bp.rel_scan, MotorSelector([hw.motor, hw.motor1, hw.motor2]),
from ophyd.sim import hw hw = hw() hw.rand.kind = 'hinted' hw.det1.kind = 'hinted' plan_map = {} plan_map['ct'] = {'func': bp.count, 'args': ([hw.rand],), 'kwargs': {'num': 5}} plan_map['ascan'] = {'func': bp.scan, 'args': ([hw.det1], hw.motor, -5, 5, 15), 'kwargs': {}} RE, queue, theard = spawn_RE(md={'location': 'server'}) bec = BestEffortCallback() bec.disable_plots() RE.subscribe(bec) app = web.Application() app['context'] = {'plan_map': plan_map} app['guts'] = {'queue': queue, 'RE': RE} loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) setup_routes(app) aiohttp_jinja2.setup( app, loader=jinja2.PackageLoader('mily.server', 'templates'))