dashboard: add device database reload action in context menu (#1853)

This commit is contained in:
Steve Fan 2022-02-22 16:18:27 +08:00 committed by GitHub
parent 69ce09c7c0
commit ad656d1e53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -159,7 +159,7 @@ class WaitingPanel(LayoutWidget):
class ExplorerDock(QtWidgets.QDockWidget):
def __init__(self, exp_manager, d_shortcuts,
explist_sub, explist_status_sub,
schedule_ctl, experiment_db_ctl):
schedule_ctl, experiment_db_ctl, device_db_ctl):
QtWidgets.QDockWidget.__init__(self, "Explorer")
self.setObjectName("Explorer")
self.setFeatures(QtWidgets.QDockWidget.DockWidgetMovable |
@ -251,6 +251,12 @@ class ExplorerDock(QtWidgets.QDockWidget):
scan_repository_action.triggered.connect(scan_repository)
self.el.addAction(scan_repository_action)
scan_ddb_action = QtWidgets.QAction("Scan device database", self.el)
def scan_ddb():
asyncio.ensure_future(device_db_ctl.scan())
scan_ddb_action.triggered.connect(scan_ddb)
self.el.addAction(scan_ddb_action)
self.current_directory = ""
open_file_action = QtWidgets.QAction("Open file outside repository",
self.el)

View File

@ -109,7 +109,7 @@ def main():
# create connections to master
rpc_clients = dict()
for target in "schedule", "experiment_db", "dataset_db":
for target in "schedule", "experiment_db", "dataset_db", "device_db":
client = AsyncioClient()
loop.run_until_complete(client.connect_rpc(
args.server, args.port_control, "master_" + target))
@ -171,7 +171,8 @@ def main():
sub_clients["explist"],
sub_clients["explist_status"],
rpc_clients["schedule"],
rpc_clients["experiment_db"])
rpc_clients["experiment_db"],
rpc_clients["device_db"])
smgr.register(d_explorer)
d_datasets = datasets.DatasetsDock(sub_clients["datasets"],