mirror of https://github.com/m-labs/artiq.git
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
This commit is contained in:
parent
b7cca38f72
commit
2a5a1f320f
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue