This commit is contained in:
jupfi 2024-04-27 19:44:58 +02:00
parent 822264bc79
commit 1dff0de7bb
4 changed files with 23 additions and 10 deletions

View file

@ -2,11 +2,8 @@
import logging import logging
import json import json
import numpy as np
from decimal import Decimal
from PyQt6.QtCore import pyqtSlot, pyqtSignal from PyQt6.QtCore import pyqtSlot, pyqtSignal
from PyQt6.QtWidgets import QApplication from PyQt6.QtWidgets import QApplication
from nqrduck_spectrometer.pulsesequence import PulseSequence
from .signalprocessing_options import Apodization from .signalprocessing_options import Apodization
from nqrduck.module.module_controller import ModuleController from nqrduck.module.module_controller import ModuleController
from nqrduck_spectrometer.measurement import Measurement from nqrduck_spectrometer.measurement import Measurement
@ -25,6 +22,10 @@ class MeasurementController(ModuleController):
Attributes: Attributes:
set_frequency_failure (pyqtSignal): Signal emitted when setting the frequency fails. set_frequency_failure (pyqtSignal): Signal emitted when setting the frequency fails.
set_averages_failure (pyqtSignal): Signal emitted when setting the averages fails. set_averages_failure (pyqtSignal): Signal emitted when setting the averages fails.
Signals:
set_frequency_failure: Signal emitted when setting the frequency fails.
set_averages_failure: Signal emitted when setting the averages fails.
""" """
set_frequency_failure = pyqtSignal() set_frequency_failure = pyqtSignal()
@ -156,7 +157,7 @@ class MeasurementController(ModuleController):
self.set_averages_failure.emit() self.set_averages_failure.emit()
elif key == "active_spectrometer_changed": elif key == "active_spectrometer_changed":
self.module.view._ui_form.spectrometerLabel.setText( self.module.view._ui_form.spectrometerLabel.setText(
"Spectrometer: %s" % value f"Spectrometer: {value}"
) )
def save_measurement(self, file_name: str) -> None: def save_measurement(self, file_name: str) -> None:

View file

@ -33,6 +33,14 @@ class MeasurementModel(ModuleModel):
validator_measurement_frequency (DuckFloatValidator): Validator for the measurement frequency. validator_measurement_frequency (DuckFloatValidator): Validator for the measurement frequency.
validator_averages (DuckIntValidator): Validator for the number of averages. validator_averages (DuckIntValidator): Validator for the number of averages.
Signals:
displayed_measurement_changed: Signal emitted when the displayed measurement changes.
measurements_changed: Signal emitted when the list of measurements changes.
view_mode_changed: Signal emitted when the view mode changes.
measurement_frequency_changed: Signal emitted when the measurement frequency changes.
averages_changed: Signal emitted when the number of averages changes.
""" """
FILE_EXTENSION = "meas" FILE_EXTENSION = "meas"

View file

@ -1,7 +1,6 @@
"""Signal processing options.""" """Signal processing options."""
import logging import logging
from decimal import Decimal
import numpy as np
import sympy import sympy
from nqrduck_spectrometer.measurement import Measurement from nqrduck_spectrometer.measurement import Measurement
from nqrduck.helpers.functions import Function, GaussianFunction, CustomFunction from nqrduck.helpers.functions import Function, GaussianFunction, CustomFunction
@ -9,6 +8,7 @@ from nqrduck.helpers.formbuilder import DuckFormBuilder, DuckFormFunctionSelecti
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
class FIDFunction(Function): class FIDFunction(Function):
"""The exponetial FID function.""" """The exponetial FID function."""
@ -45,7 +45,12 @@ class Apodization(DuckFormBuilder):
self.duration = (self.measurement.tdx[-1] - self.measurement.tdx[0]) * 1e-6 self.duration = (self.measurement.tdx[-1] - self.measurement.tdx[0]) * 1e-6
function_selection_field = DuckFormFunctionSelectionField( function_selection_field = DuckFormFunctionSelectionField(
text=None, tooltip=None, functions=functions, duration=self.duration, parent=parent, default_function=0 text=None,
tooltip=None,
functions=functions,
duration=self.duration,
parent=parent,
default_function=0,
) )
self.add_field(function_selection_field) self.add_field(function_selection_field)
@ -57,4 +62,3 @@ class Apodization(DuckFormBuilder):
Function: The selected function. Function: The selected function.
""" """
return self.get_values()[0] return self.get_values()[0]

View file

@ -38,7 +38,7 @@ class MeasurementView(ModuleView):
# Initialize plotter # Initialize plotter
self.init_plotter() self.init_plotter()
logger.debug( logger.debug(
"Facecolor %s" % str(self._ui_form.plotter.canvas.ax.get_facecolor()) f"Facecolor {str(self._ui_form.plotter.canvas.ax.get_facecolor())}"
) )
# Measurement dialog # Measurement dialog