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.")
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:
"""Save measurement to file.

View file

@ -25,7 +25,7 @@
<item>
<layout class="QVBoxLayout" name="settingsLayout" stretch="0,0,0,0,0,0,0,0,0,0,0,0,0">
<item>
<widget class="QLabel" name="titleLable">
<widget class="QLabel" name="titleLabel">
<property name="font">
<font>
<weight>75</weight>
@ -100,7 +100,7 @@
</spacer>
</item>
<item>
<widget class="QLabel" name="label">
<widget class="QLabel" name="spLabel">
<property name="font">
<font>
<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.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:
"""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
# 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.settingsLayout = QtWidgets.QVBoxLayout()
self.settingsLayout.setObjectName("settingsLayout")
self.titleLable = QtWidgets.QLabel(parent=Form)
self.titleLabel = QtWidgets.QLabel(parent=Form)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.titleLable.setFont(font)
self.titleLable.setObjectName("titleLable")
self.settingsLayout.addWidget(self.titleLable)
self.titleLabel.setFont(font)
self.titleLabel.setObjectName("titleLabel")
self.settingsLayout.addWidget(self.titleLabel)
self.spectrometerLayout = QtWidgets.QHBoxLayout()
self.spectrometerLayout.setObjectName("spectrometerLayout")
self.spectrometerLabel = QtWidgets.QLabel(parent=Form)
@ -60,14 +60,14 @@ class Ui_Form(object):
self.settingsLayout.addWidget(self.buttonStart)
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
self.settingsLayout.addItem(spacerItem)
self.label = QtWidgets.QLabel(parent=Form)
self.spLabel = QtWidgets.QLabel(parent=Form)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.label.setFont(font)
self.label.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.label.setObjectName("label")
self.settingsLayout.addWidget(self.label)
self.spLabel.setFont(font)
self.spLabel.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.spLabel.setObjectName("spLabel")
self.settingsLayout.addWidget(self.spLabel)
self.pushButton_2 = QtWidgets.QPushButton(parent=Form)
self.pushButton_2.setObjectName("pushButton_2")
self.settingsLayout.addWidget(self.pushButton_2)
@ -130,13 +130,13 @@ class Ui_Form(object):
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
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.averagesLabel.setText(_translate("Form", "Averages"))
self.frequencyLabel.setText(_translate("Form", "Target Frequency"))
self.frequencyunitLabel.setText(_translate("Form", "MHz"))
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.setText(_translate("Form", "Baseline Correction"))
self.pushButton_3.setText(_translate("Form", "Peak-Picking"))