Skip to content

Commit

Permalink
Updated wavemeter to emit with less frequency to not overwhelm the lo…
Browse files Browse the repository at this point in the history
…gic.
  • Loading branch information
lange50 committed Apr 4, 2025
1 parent a885dd5 commit 62404c6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/qudi/hardware/wavemeter/high_finesse_wavemeter.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ def on_activate(self):

self._data = np.zeros((4, 1))

self.__timer = QtCore.QTimer()
self.__timer.setSingleShot(False)
self.__timer.timeout.connect(self.__timer_callback)
self.__timer.start(1) # 100 ms timer

@wlmData.CALLBACK_TYPE
def cb(mode, _intval, dblval):
self._update(mode, _intval, dblval)
Expand All @@ -74,6 +79,9 @@ def on_deactivate(self):
""" Deactivate module.
"""
self._dll.Instantiate(wlmConst.cInstNotification, wlmConst.cNotifyRemoveCallback, None, 0)
self.__timer.stop()
self.__timer.timeout.disconnect()
self.__timer = None


def get_wavelengths(self) -> np.ndarray:
Expand Down Expand Up @@ -105,5 +113,11 @@ def _update(self, mode, _intval, dblval):

if self.module_state() == 'locked':
self._data[i] = dblval



def __timer_callback(self):
""" Callback function for the timer. """
if self.module_state() == 'locked':
self.sigWavelengthUpdated.emit(self._data)

0 comments on commit 62404c6

Please sign in to comment.