moninj: add uid fields to handlers, widgets

This commit is contained in:
Simon Renblad 2024-04-18 10:30:13 +08:00
parent b5e762854b
commit db3d4ac60c

View File

@ -34,6 +34,8 @@ class _TTLWidget(QtWidgets.QFrame):
self.setFrameShape(QtWidgets.QFrame.Box)
self.setFrameShadow(QtWidgets.QFrame.Raised)
self.uid = title
grid = QtWidgets.QGridLayout()
grid.setContentsMargins(2, 2, 2, 2)
grid.setHorizontalSpacing(2)
@ -112,6 +114,7 @@ class _TTLHandler:
self.force_out = force_out
self.set_mode = dm.ttl_set_mode
self.title = title
self.uid = title
self.cur_level = False
self.cur_oe = False
self.cur_override = False
@ -165,6 +168,8 @@ class _DDSWidget(QtWidgets.QFrame):
def __init__(self, title, is_urukul):
QtWidgets.QFrame.__init__(self)
self.uid = title
self.setFrameShape(QtWidgets.QFrame.Box)
self.setFrameShadow(QtWidgets.QFrame.Raised)
@ -282,6 +287,7 @@ class _DDSHandler:
ref_clk, cpld=None, pll=1, clk_div=0):
self.dm = dm
self.title = title
self.uid = title
self.bus_channel = bus_channel
self.channel = channel
self.cur_frequency = 0
@ -351,6 +357,8 @@ class _DACWidget(QtWidgets.QFrame):
def __init__(self, channel, title):
QtWidgets.QFrame.__init__(self)
self.uid = (title, channel)
self.setFrameShape(QtWidgets.QFrame.Box)
self.setFrameShadow(QtWidgets.QFrame.Raised)
@ -378,6 +386,7 @@ class _DACHandler:
self.spi_channel = spi_channel
self.channel = channel
self.title = title
self.uid = (title, channel)
def create_widget(self):
self.widget = _DACWidget(self.channel, self.title)