forked from M-Labs/artiq
applets.simple: add append_to_dataset feature
This commit is contained in:
parent
c298ec4c2e
commit
150d325fc1
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue