mirror of
https://github.com/nqrduck/nqrduck-broadband.git
synced 2025-01-03 13:18:10 +00:00
Receiving el. LUT data
This commit is contained in:
parent
1e0d23a86c
commit
3a036d570a
3 changed files with 26 additions and 2 deletions
|
@ -32,7 +32,13 @@ class BroadbandController(ModuleController):
|
|||
elif key == "failure_set_averages" and value == self.module.view._ui_form.averagesEdit.text():
|
||||
logger.debug("Received set averages failure.")
|
||||
self.set_averages_failure.emit()
|
||||
|
||||
# receive LUT data
|
||||
elif key == "LUT_finished":
|
||||
logger.debug("Received LUT data.")
|
||||
self.module.model.LUT = value
|
||||
self.change_start_frequency(self.module.model.LUT.start_frequency)
|
||||
self.change_stop_frequency(self.module.model.LUT.stop_frequency)
|
||||
self.change_frequency_step(self.module.model.LUT.frequency_step)
|
||||
|
||||
@pyqtSlot(str)
|
||||
def set_frequency(self, value : str) -> None:
|
||||
|
@ -80,7 +86,6 @@ class BroadbandController(ModuleController):
|
|||
def change_frequency_step(self, value :str) -> None:
|
||||
"""Changes the frequency step of the measurement."""
|
||||
try:
|
||||
logger.debug("Changing frequency step to: " + value)
|
||||
value = float(value) * 1e6
|
||||
if value > 0:
|
||||
self.module.model.frequency_step = value
|
||||
|
|
|
@ -14,6 +14,7 @@ class BroadbandModel(ModuleModel):
|
|||
|
||||
start_frequency_changed = pyqtSignal(float)
|
||||
stop_frequency_changed = pyqtSignal(float)
|
||||
LUT_changed = pyqtSignal()
|
||||
|
||||
def __init__(self, module) -> None:
|
||||
super().__init__(module)
|
||||
|
@ -56,6 +57,15 @@ class BroadbandModel(ModuleModel):
|
|||
def current_broadband_measurement(self, value):
|
||||
self._current_broadband_measurement = value
|
||||
|
||||
@property
|
||||
def LUT(self):
|
||||
return self._LUT
|
||||
|
||||
@LUT.setter
|
||||
def LUT(self, value):
|
||||
self._LUT = value
|
||||
self.LUT_changed.emit()
|
||||
|
||||
class BroadbandMeasurement(QObject):
|
||||
"""This class represents a single broadband measurement."""
|
||||
|
||||
|
|
|
@ -61,6 +61,9 @@ class BroadbandView(ModuleView):
|
|||
self.module.controller.set_averages_failure.connect(self.on_set_averages_failure)
|
||||
self.module.controller.set_frequency_step_failure.connect(self.on_set_frequency_step_failure)
|
||||
|
||||
# LUT data
|
||||
self.module.model.LUT_changed.connect(self.on_LUT_changed)
|
||||
|
||||
@pyqtSlot()
|
||||
def start_measurement_clicked(self) -> None:
|
||||
"""This method is called when the start measurement button is clicked.
|
||||
|
@ -208,6 +211,12 @@ class BroadbandView(ModuleView):
|
|||
|
||||
QApplication.processEvents()
|
||||
|
||||
@pyqtSlot()
|
||||
def on_LUT_changed(self) -> None:
|
||||
"""This method is called when the LUT data is changed."""
|
||||
logger.debug("Updating LUT fields.")
|
||||
# LUT type here
|
||||
|
||||
def add_info_text(self, text : str) -> None:
|
||||
"""Add a text to the info box with a timestamp.
|
||||
|
||||
|
|
Loading…
Reference in a new issue