Skip to content

Commit

Permalink
Fixes to get the laser rate/type to match properly. Updated scan type…
Browse files Browse the repository at this point in the history
… selection to be a DirectConnection so we don't need to pause weirdly to make sure the update has ocurred before we check for the new allowed rates.
  • Loading branch information
lange50 committed Mar 27, 2025
1 parent 20eb17e commit 76f479a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/qudi/gui/terascan/terascan_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
from PySide2 import QtCore, QtGui
from typing import List
from time import sleep

from qudi.util.datastorage import TextDataStorage
from qudi.core.module import GuiBase
Expand Down Expand Up @@ -54,9 +55,11 @@ def on_activate(self) -> None:
self._mw.stop_wavelength.setValue(self._stop_wavelength)

for txt, scan_type in self._terascan_logic().scan_types.items():
print(txt, scan_type)
self._mw.scan_type.addItem(txt, scan_type)
for txt, scan_rate in self._terascan_logic().scan_rates.items():
self._mw.scan_rate.addItem(txt, scan_rate)
print(txt, scan_rate)

# connect all GUI internal signals
self._mw.start_wavelength.valueChanged.connect(self._start_changed)
Expand Down Expand Up @@ -98,7 +101,7 @@ def on_activate(self) -> None:
)

self.sigSetScanType.connect(
self._terascan_logic().set_scan_type, QtCore.Qt.QueuedConnection
self._terascan_logic().set_scan_type, QtCore.Qt.DirectConnection # this is direct on purpose
)

self.sigSetScanRate.connect(
Expand Down Expand Up @@ -178,7 +181,6 @@ def _scan_type_changed(self, _: int):
""" Qt slot to be called upon scan type change """

self.sigSetScanType.emit(self._mw.scan_type.currentData().value)

# When type changes, update UI for allowed rates
self._mw.scan_rate.clear() # Clear previous rates
for txt, scan_rate in self._terascan_logic().scan_rates.items():
Expand Down
4 changes: 2 additions & 2 deletions src/qudi/hardware/laser/solstis_laser.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class SolstisLaser(ScanningLaserInterface):
_start_wavelength = StatusVar('start_wavelength', default=0.78)
_end_wavelength = StatusVar('end_wavelength', default=0.785)

_scan_type = StatusVar('scan_type', default=2)
_scan_rate = StatusVar('scan_rate', default=13)
_scan_type = StatusVar('scan_type', default=TeraScanType.SCAN_TYPE_FINE)
_scan_rate = StatusVar('scan_rate', default=TeraScanRate.SCAN_RATE_FINE_LINE_20_GHZ)

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Expand Down
4 changes: 2 additions & 2 deletions src/qudi/logic/terascan_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def on_activate(self):
self.sigConfigureCounter.connect(counter.configure, QtCore.Qt.QueuedConnection)
self.sigSetLaserWavelengths.connect(laser.set_wavelengths, QtCore.Qt.QueuedConnection)
self.sigSetLaserScanRate.connect(laser.set_scan_rate, QtCore.Qt.QueuedConnection)
self.sigSetLaserScanType.connect(laser.set_scan_type, QtCore.Qt.QueuedConnection)
self.sigSetLaserScanType.connect(laser.set_scan_type, QtCore.Qt.DirectConnection) # Is direct on purpose

self.sigStartScan.connect(counter.start_measure, QtCore.Qt.QueuedConnection)
self.sigStartScan.connect(laser.start_scan, QtCore.Qt.QueuedConnection)
Expand Down Expand Up @@ -188,7 +188,7 @@ def set_scan_type(self, scan_type: int):
self._scan_type = scan_type
self.sigSetLaserScanType.emit(scan_type)

self._scan_rate = list(self._laser().get_scan_rates(scan_type))[0]
self._scan_rate = list(self._laser().get_scan_rates.values())[0].value
self.sigSetLaserScanRate.emit(self._scan_rate)

else:
Expand Down

0 comments on commit 76f479a

Please sign in to comment.