forked from M-Labs/artiq
1
0
Fork 0

gui.models: clean up LocalModelManager a bit

This commit is contained in:
Robert Jördens 2016-05-20 16:11:34 +02:00
parent 9c30f62790
commit af317f9b64
2 changed files with 5 additions and 4 deletions

View File

@ -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.tools import LayoutWidget, log_level_to_name, get_open_file_name
from artiq.gui.entries import argty_to_entry from artiq.gui.entries import argty_to_entry
from artiq.protocols import pyon from artiq.protocols import pyon
from artiq.protocols.sync_struct import process_mod
from artiq.master.worker import Worker, log_worker_exception from artiq.master.worker import Worker, log_worker_exception
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -341,7 +340,6 @@ class LocalDatasetDB:
def update(self, mod): def update(self, mod):
self.datasets_sub.update(mod) self.datasets_sub.update(mod)
process_mod(self._data, mod)
class ExperimentsArea(QtWidgets.QMdiArea): class ExperimentsArea(QtWidgets.QMdiArea):

View File

@ -1,6 +1,6 @@
from PyQt5 import QtCore from PyQt5 import QtCore
from artiq.protocols.sync_struct import Subscriber from artiq.protocols.sync_struct import Subscriber, process_mod
class ModelManager: class ModelManager:
@ -33,12 +33,15 @@ class LocalModelManager(ModelManager):
self.notify_cbs = [] self.notify_cbs = []
def update(self, mod): def update(self, mod):
process_mod(self.model, mod)
for notify_cb in self.notify_cbs: for notify_cb in self.notify_cbs:
notify_cb(mod) notify_cb(mod)
def init(self, struct): def init(self, struct):
self._create_model(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: class _SyncSubstruct: