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 json
import numpy as np
from decimal import Decimal
from PyQt6.QtCore import pyqtSlot, pyqtSignal
from PyQt6.QtWidgets import QApplication
from nqrduck_spectrometer.pulsesequence import PulseSequence
from .signalprocessing_options import Apodization
from nqrduck.module.module_controller import ModuleController
from nqrduck_spectrometer.measurement import Measurement
@ -25,6 +22,10 @@ class MeasurementController(ModuleController):
Attributes:
set_frequency_failure (pyqtSignal): Signal emitted when setting the frequency 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()
@ -156,7 +157,7 @@ class MeasurementController(ModuleController):
self.set_averages_failure.emit()
elif key == "active_spectrometer_changed":
self.module.view._ui_form.spectrometerLabel.setText(
"Spectrometer: %s" % value
f"Spectrometer: {value}"
)
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_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"

View file

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

View file

@ -38,7 +38,7 @@ class MeasurementView(ModuleView):
# Initialize plotter
self.init_plotter()
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