dashboard: Plumb through datasets client to ExperimentManager

This is analogous to the explist/schedule subscribers, and allows
custom argument editors (such as ndscan) to provide hints/defaults/…
from datasets once available.
pull/1916/head^2
David Nadlinger 2022-06-18 01:08:49 +01:00 committed by Sébastien Bourdeauducq
parent 85895ab89b
commit c4068e6896
2 changed files with 7 additions and 1 deletions

View File

@ -544,7 +544,7 @@ class _QuickOpenDialog(QtWidgets.QDialog):
class ExperimentManager:
def __init__(self, main_window,
def __init__(self, main_window, dataset_sub,
explist_sub, schedule_sub,
schedule_ctl, experiment_db_ctl):
self.main_window = main_window
@ -556,6 +556,8 @@ class ExperimentManager:
self.submission_options = dict()
self.submission_arguments = dict()
self.datasets = dict()
dataset_sub.add_setmodel_callback(self.set_dataset_model)
self.explist = dict()
explist_sub.add_setmodel_callback(self.set_explist_model)
self.schedule = dict()
@ -570,6 +572,9 @@ class ExperimentManager:
quick_open_shortcut.setContext(QtCore.Qt.ApplicationShortcut)
quick_open_shortcut.activated.connect(self.show_quick_open)
def set_dataset_model(self, model):
self.datasets = model
def set_explist_model(self, model):
self.explist = model.backing_store

View File

@ -169,6 +169,7 @@ def main():
# create UI components
expmgr = experiments.ExperimentManager(main_window,
sub_clients["datasets"],
sub_clients["explist"],
sub_clients["schedule"],
rpc_clients["schedule"],