From c4068e689694e5d0f04c9e2be811c1d1e9e9c187 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Sat, 18 Jun 2022 01:08:49 +0100 Subject: [PATCH] dashboard: Plumb through datasets client to ExperimentManager MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is analogous to the explist/schedule subscribers, and allows custom argument editors (such as ndscan) to provide hints/defaults/… from datasets once available. --- artiq/dashboard/experiments.py | 7 ++++++- artiq/frontend/artiq_dashboard.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/artiq/dashboard/experiments.py b/artiq/dashboard/experiments.py index 871894a66..4bf062ba9 100644 --- a/artiq/dashboard/experiments.py +++ b/artiq/dashboard/experiments.py @@ -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 diff --git a/artiq/frontend/artiq_dashboard.py b/artiq/frontend/artiq_dashboard.py index 1cdbac731..89b0efe1a 100755 --- a/artiq/frontend/artiq_dashboard.py +++ b/artiq/frontend/artiq_dashboard.py @@ -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"],