diff --git a/artiq/applets/simple.py b/artiq/applets/simple.py index c9b512a56..80cab97f6 100644 --- a/artiq/applets/simple.py +++ b/artiq/applets/simple.py @@ -22,6 +22,10 @@ class AppletControlIPC: def set_dataset(self, key, value, persist=None): self.ipc.set_dataset(key, value, persist) + def append_to_dataset(self, key, value): + mod = {"action": "append", "path": [key, 1], "x": value} + self.ipc.update_dataset(mod) + class AppletControlRPC: def __init__(self, loop, dataset_ctl): @@ -37,6 +41,10 @@ class AppletControlRPC: def set_dataset(self, key, value, persist=None): self._background(self.dataset_ctl.set, key, value, persist) + def append_to_dataset(self, key, value): + mod = {"action": "append", "path": [key, 1], "x": value} + self._background(self.dataset_ctl.update, mod) + class AppletIPCClient(AsyncioChildComm): def set_close_cb(self, close_cb): @@ -102,6 +110,10 @@ class AppletIPCClient(AsyncioChildComm): "value": value, "persist": persist}) + def update_dataset(self, mod): + self.write_pyon({"action": "update_dataset", + "mod": mod}) + class SimpleApplet: def __init__(self, main_widget_class, cmd_description=None,