forked from M-Labs/artiq
gui.models: clean up LocalModelManager a bit
This commit is contained in:
parent
9c30f62790
commit
af317f9b64
|
@ -11,7 +11,6 @@ from artiq import __artiq_dir__ as artiq_dir
|
|||
from artiq.gui.tools import LayoutWidget, log_level_to_name, get_open_file_name
|
||||
from artiq.gui.entries import argty_to_entry
|
||||
from artiq.protocols import pyon
|
||||
from artiq.protocols.sync_struct import process_mod
|
||||
from artiq.master.worker import Worker, log_worker_exception
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -341,7 +340,6 @@ class LocalDatasetDB:
|
|||
|
||||
def update(self, mod):
|
||||
self.datasets_sub.update(mod)
|
||||
process_mod(self._data, mod)
|
||||
|
||||
|
||||
class ExperimentsArea(QtWidgets.QMdiArea):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from PyQt5 import QtCore
|
||||
|
||||
from artiq.protocols.sync_struct import Subscriber
|
||||
from artiq.protocols.sync_struct import Subscriber, process_mod
|
||||
|
||||
|
||||
class ModelManager:
|
||||
|
@ -33,12 +33,15 @@ class LocalModelManager(ModelManager):
|
|||
self.notify_cbs = []
|
||||
|
||||
def update(self, mod):
|
||||
process_mod(self.model, mod)
|
||||
for notify_cb in self.notify_cbs:
|
||||
notify_cb(mod)
|
||||
|
||||
def init(self, struct):
|
||||
self._create_model(struct)
|
||||
self.update({"action": "init", "struct": struct})
|
||||
mod = {"action": "init", "struct": struct}
|
||||
for notify_cb in self.notify_cbs:
|
||||
notify_cb(mod)
|
||||
|
||||
|
||||
class _SyncSubstruct:
|
||||
|
|
Loading…
Reference in New Issue