From 2a5a1f320fec055efb0e2ab84f53e90875afd07b Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Fri, 8 Jul 2016 01:23:28 +0200 Subject: [PATCH] browser, worker: feed experiments dummy devices, closes #454 * just returning `None` as dummy device (like ExamineDeviceMgr) is not explicit enough, certainly hard to debug * introducing a special flag for the `build` action does not seem the right place --- artiq/browser/experiments.py | 4 ++-- artiq/master/worker_db.py | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/artiq/browser/experiments.py b/artiq/browser/experiments.py index 2f812f297..7a0e42151 100644 --- a/artiq/browser/experiments.py +++ b/artiq/browser/experiments.py @@ -376,8 +376,8 @@ class ExperimentsArea(QtWidgets.QMdiArea): self._ddb = LocalDatasetDB(datasets_sub) self.worker_handlers = { - "get_device_db": lambda: None, - "get_device": lambda k: None, + "get_device_db": lambda: {}, + "get_device": lambda k: {"type": "dummy"}, "get_dataset": self._ddb.get, "update_dataset": self._ddb.update, } diff --git a/artiq/master/worker_db.py b/artiq/master/worker_db.py index 350b87522..11d6bf9b6 100644 --- a/artiq/master/worker_db.py +++ b/artiq/master/worker_db.py @@ -85,6 +85,10 @@ class RIDCounter: return r +class DummyDevice: + pass + + def _create_device(desc, device_mgr): ty = desc["type"] if ty == "local": @@ -109,6 +113,8 @@ def _create_device(desc, device_mgr): else: cls = Client return cls(controller["host"], controller["port"], desc["target_name"]) + elif ty == "dummy": + return DummyDevice() else: raise ValueError("Unsupported type in device DB: " + ty)