diff --git a/artiq/dashboard/moninj.py b/artiq/dashboard/moninj.py index d015f5384..e677231f8 100644 --- a/artiq/dashboard/moninj.py +++ b/artiq/dashboard/moninj.py @@ -158,6 +158,9 @@ class _TTLHandler: self.widget.level_toggled.connect(self.level_toggled) self.refresh_display() + def to_model_path(self): + return "ttl/{}".format(self.title) + class _DDSWidget(QtWidgets.QFrame): apply_changes = QtCore.pyqtSignal() @@ -351,6 +354,9 @@ class _DDSHandler: def off_clicked(self): self.dm.dds_channel_toggle(self.dds_name, sw=False) + def to_model_path(self): + return "dds/{}".format(self.title) + class _DACWidget(QtWidgets.QFrame): def __init__(self, channel, title): @@ -401,6 +407,9 @@ class _DACHandler: if self.widget is not None: self.widget.set_value(self.cur_value * 100 / 2**16) + def to_model_path(self): + return "dac/{} ch{}".format(self.title, self.channel) + class Model(DictSyncTreeSepModel): def __init__(self, init): @@ -413,7 +422,7 @@ class Model(DictSyncTreeSepModel): def update(self, d): for k, v in d.items(): - self[str(k)] = v + self[v.to_model_path()] = v class _AddChannelDialog(QtWidgets.QDialog):