forked from M-Labs/artiq
applets.simple: add mutate_dataset feature
This commit is contained in:
parent
1f306a2859
commit
bf46ce4a92
|
@ -22,6 +22,10 @@ class AppletControlIPC:
|
||||||
def set_dataset(self, key, value, persist=None):
|
def set_dataset(self, key, value, persist=None):
|
||||||
self.ipc.set_dataset(key, value, persist)
|
self.ipc.set_dataset(key, value, persist)
|
||||||
|
|
||||||
|
def mutate_dataset(self, key, index, value):
|
||||||
|
mod = {"action": "setitem", "path": [key, 1], "key": index, "value": value}
|
||||||
|
self.ipc.update_dataset(mod)
|
||||||
|
|
||||||
def append_to_dataset(self, key, value):
|
def append_to_dataset(self, key, value):
|
||||||
mod = {"action": "append", "path": [key, 1], "x": value}
|
mod = {"action": "append", "path": [key, 1], "x": value}
|
||||||
self.ipc.update_dataset(mod)
|
self.ipc.update_dataset(mod)
|
||||||
|
@ -41,6 +45,10 @@ class AppletControlRPC:
|
||||||
def set_dataset(self, key, value, persist=None):
|
def set_dataset(self, key, value, persist=None):
|
||||||
self._background(self.dataset_ctl.set, key, value, persist)
|
self._background(self.dataset_ctl.set, key, value, persist)
|
||||||
|
|
||||||
|
def mutate_dataset(self, key, index, value):
|
||||||
|
mod = {"action": "setitem", "path": [key, 1], "key": index, "value": value}
|
||||||
|
self._background(self.dataset_ctl.update, mod)
|
||||||
|
|
||||||
def append_to_dataset(self, key, value):
|
def append_to_dataset(self, key, value):
|
||||||
mod = {"action": "append", "path": [key, 1], "x": value}
|
mod = {"action": "append", "path": [key, 1], "x": value}
|
||||||
self._background(self.dataset_ctl.update, mod)
|
self._background(self.dataset_ctl.update, mod)
|
||||||
|
|
Loading…
Reference in New Issue