moninj: remove unneccesary callbacks

This commit is contained in:
Simon Renblad 2024-04-16 13:48:45 +08:00
parent aeaa337b1a
commit b4fb9b9bc6

View File

@ -513,17 +513,14 @@ class _DeviceManager:
self.setup_ttl_monitoring(False, handler.channel)
handler.delete_widget()
del self.ttl_handlers[handler.channel]
self.ttl_cb()
elif isinstance(handler, _DDSHandler):
self.setup_dds_monitoring(False, handler.bus_channel, handler.channel)
handler.delete_widget()
del self.dds_handlers[(handler.bus_channel, handler.channel)]
self.dds_cb()
elif isinstance(handler, _DACHandler):
self.setup_dac_monitoring(False, handler.spi_channel, handler.channel)
handler.delete_widget()
del self.dac_handlers[(handler.spi_channel, handler.channel)]
self.dac_cb()
else:
raise ValueError
@ -536,19 +533,21 @@ class _DeviceManager:
if isinstance(handler, _TTLHandler):
self.ttl_handlers[handler.channel] = handler
self.ttl_cb()
self.setup_ttl_monitoring(True, handler.channel)
elif isinstance(handler, _DDSHandler):
self.dds_handlers[(handler.bus_channel, handler.channel)] = handler
self.dds_cb()
self.setup_dds_monitoring(True, handler.bus_channel, handler.channel)
elif isinstance(handler, _DACHandler):
self.dac_handlers[(handler.spi_channel, handler.channel)] = handler
self.dac_cb()
self.setup_dac_monitoring(True, handler.spi_channel, handler.channel)
else:
raise ValueError
if description != self.description:
self.ttl_cb()
self.dds_cb()
self.dac_cb()
self.description = description
def ttl_set_mode(self, channel, mode):