forked from M-Labs/artiq
artiq_dashboard: connect Devices sub after loading state
This commit is contained in:
parent
15e1aef38b
commit
d47be456ff
|
@ -236,13 +236,6 @@ def main():
|
||||||
)
|
)
|
||||||
atexit_register_coroutine(d_waveform.stop, loop=loop)
|
atexit_register_coroutine(d_waveform.stop, loop=loop)
|
||||||
|
|
||||||
def init_cbs(ddb):
|
|
||||||
moninj_mgr.dm.init_ddb(ddb)
|
|
||||||
d_waveform.init_ddb(ddb)
|
|
||||||
return ddb
|
|
||||||
devices_sub = Subscriber("devices", init_cbs, [moninj_mgr.dm.notify_ddb, d_waveform.notify_ddb])
|
|
||||||
loop.run_until_complete(devices_sub.connect(args.server, args.port_notify))
|
|
||||||
atexit_register_coroutine(devices_sub.close, loop=loop)
|
|
||||||
|
|
||||||
d_interactive_args = interactive_args.InteractiveArgsDock(
|
d_interactive_args = interactive_args.InteractiveArgsDock(
|
||||||
sub_clients["interactive_args"],
|
sub_clients["interactive_args"],
|
||||||
|
@ -278,7 +271,18 @@ def main():
|
||||||
# Otherwise, the windows of those applets that are in detached
|
# Otherwise, the windows of those applets that are in detached
|
||||||
# QDockWidgets fail to be embedded.
|
# QDockWidgets fail to be embedded.
|
||||||
main_window.show()
|
main_window.show()
|
||||||
|
|
||||||
smgr.load()
|
smgr.load()
|
||||||
|
|
||||||
|
# connect devices_sub after loading state, else moninj widgets may not be created
|
||||||
|
def init_cbs(ddb):
|
||||||
|
moninj_mgr.dm.init_ddb(ddb)
|
||||||
|
d_waveform.init_ddb(ddb)
|
||||||
|
return ddb
|
||||||
|
devices_sub = Subscriber("devices", init_cbs, [moninj_mgr.dm.notify_ddb, d_waveform.notify_ddb])
|
||||||
|
loop.run_until_complete(devices_sub.connect(args.server, args.port_notify))
|
||||||
|
|
||||||
|
atexit_register_coroutine(devices_sub.close, loop=loop)
|
||||||
smgr.start(loop=loop)
|
smgr.start(loop=loop)
|
||||||
atexit_register_coroutine(smgr.stop, loop=loop)
|
atexit_register_coroutine(smgr.stop, loop=loop)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue