Updated spectrometer label with active spectrometer.

This commit is contained in:
jupfi 2023-12-16 13:46:27 +01:00
parent dc938599ae
commit 6fef0c2753
4 changed files with 22 additions and 15 deletions

View file

@ -101,6 +101,9 @@ class MeasurementController(ModuleController):
): ):
logger.debug("Received set averages failure.") logger.debug("Received set averages failure.")
self.set_averages_failure.emit() self.set_averages_failure.emit()
elif key == "active_spectrometer_changed":
self.module.view._ui_form.spectrometerLabel.setText("Spectrometer: %s" % value)
def save_measurement(self, file_name : str) -> None: def save_measurement(self, file_name : str) -> None:
"""Save measurement to file. """Save measurement to file.

View file

@ -25,7 +25,7 @@
<item> <item>
<layout class="QVBoxLayout" name="settingsLayout" stretch="0,0,0,0,0,0,0,0,0,0,0,0,0"> <layout class="QVBoxLayout" name="settingsLayout" stretch="0,0,0,0,0,0,0,0,0,0,0,0,0">
<item> <item>
<widget class="QLabel" name="titleLable"> <widget class="QLabel" name="titleLabel">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -100,7 +100,7 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="spLabel">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>

View file

@ -76,6 +76,10 @@ class MeasurementView(ModuleView):
self._ui_form.exportButton.clicked.connect(self.on_measurement_save_button_clicked) self._ui_form.exportButton.clicked.connect(self.on_measurement_save_button_clicked)
self._ui_form.importButton.clicked.connect(self.on_measurement_load_button_clicked) self._ui_form.importButton.clicked.connect(self.on_measurement_load_button_clicked)
# Make title label bold
self._ui_form.titleLabel.setStyleSheet("font-weight: bold;")
self._ui_form.spLabel.setStyleSheet("font-weight: bold;")
def init_plotter(self) -> None: def init_plotter(self) -> None:
"""Initialize plotter with the according units for time domain.""" """Initialize plotter with the according units for time domain."""

View file

@ -1,6 +1,6 @@
# Form implementation generated from reading ui file '../Modules/nqrduck-measurement/src/nqrduck_measurement/resources/measurement_widget.ui' # Form implementation generated from reading ui file 'Modules/nqrduck-measurement/src/nqrduck_measurement/resources/measurement_widget.ui'
# #
# Created by: PyQt6 UI code generator 6.5.2 # Created by: PyQt6 UI code generator 6.5.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing. # run again. Do not edit this file unless you know what you are doing.
@ -24,13 +24,13 @@ class Ui_Form(object):
self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.settingsLayout = QtWidgets.QVBoxLayout() self.settingsLayout = QtWidgets.QVBoxLayout()
self.settingsLayout.setObjectName("settingsLayout") self.settingsLayout.setObjectName("settingsLayout")
self.titleLable = QtWidgets.QLabel(parent=Form) self.titleLabel = QtWidgets.QLabel(parent=Form)
font = QtGui.QFont() font = QtGui.QFont()
font.setBold(True) font.setBold(True)
font.setWeight(75) font.setWeight(75)
self.titleLable.setFont(font) self.titleLabel.setFont(font)
self.titleLable.setObjectName("titleLable") self.titleLabel.setObjectName("titleLabel")
self.settingsLayout.addWidget(self.titleLable) self.settingsLayout.addWidget(self.titleLabel)
self.spectrometerLayout = QtWidgets.QHBoxLayout() self.spectrometerLayout = QtWidgets.QHBoxLayout()
self.spectrometerLayout.setObjectName("spectrometerLayout") self.spectrometerLayout.setObjectName("spectrometerLayout")
self.spectrometerLabel = QtWidgets.QLabel(parent=Form) self.spectrometerLabel = QtWidgets.QLabel(parent=Form)
@ -60,14 +60,14 @@ class Ui_Form(object):
self.settingsLayout.addWidget(self.buttonStart) self.settingsLayout.addWidget(self.buttonStart)
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
self.settingsLayout.addItem(spacerItem) self.settingsLayout.addItem(spacerItem)
self.label = QtWidgets.QLabel(parent=Form) self.spLabel = QtWidgets.QLabel(parent=Form)
font = QtGui.QFont() font = QtGui.QFont()
font.setBold(True) font.setBold(True)
font.setWeight(75) font.setWeight(75)
self.label.setFont(font) self.spLabel.setFont(font)
self.label.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) self.spLabel.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.label.setObjectName("label") self.spLabel.setObjectName("spLabel")
self.settingsLayout.addWidget(self.label) self.settingsLayout.addWidget(self.spLabel)
self.pushButton_2 = QtWidgets.QPushButton(parent=Form) self.pushButton_2 = QtWidgets.QPushButton(parent=Form)
self.pushButton_2.setObjectName("pushButton_2") self.pushButton_2.setObjectName("pushButton_2")
self.settingsLayout.addWidget(self.pushButton_2) self.settingsLayout.addWidget(self.pushButton_2)
@ -130,13 +130,13 @@ class Ui_Form(object):
def retranslateUi(self, Form): def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate _translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "Form")) Form.setWindowTitle(_translate("Form", "Form"))
self.titleLable.setText(_translate("Form", "Single Frequency Measurement: ")) self.titleLabel.setText(_translate("Form", "Single Frequency Measurement: "))
self.spectrometerLabel.setText(_translate("Form", "Spectrometer:")) self.spectrometerLabel.setText(_translate("Form", "Spectrometer:"))
self.averagesLabel.setText(_translate("Form", "Averages")) self.averagesLabel.setText(_translate("Form", "Averages"))
self.frequencyLabel.setText(_translate("Form", "Target Frequency")) self.frequencyLabel.setText(_translate("Form", "Target Frequency"))
self.frequencyunitLabel.setText(_translate("Form", "MHz")) self.frequencyunitLabel.setText(_translate("Form", "MHz"))
self.buttonStart.setText(_translate("Form", "Start Measurement")) self.buttonStart.setText(_translate("Form", "Start Measurement"))
self.label.setText(_translate("Form", "Signal Processing")) self.spLabel.setText(_translate("Form", "Signal Processing"))
self.pushButton_2.setText(_translate("Form", "Apodization")) self.pushButton_2.setText(_translate("Form", "Apodization"))
self.pushButton.setText(_translate("Form", "Baseline Correction")) self.pushButton.setText(_translate("Form", "Baseline Correction"))
self.pushButton_3.setText(_translate("Form", "Peak-Picking")) self.pushButton_3.setText(_translate("Form", "Peak-Picking"))