GUI: add a spinbox to pre-dial the simulated Pot's reset temperature

btn_pot_reset always reset the simulated Pot to the ambient
temperature. Add doubleSpinBox_pot_temp next to it (shown/hidden
together, same as the button) so the user can dial in a different
starting temperature before committing it - it seeds from the same
remembered ambient value on startup but is otherwise independent and
not persisted.

tasks/pot.py's PotTask.recv() now resets the plant to whatever
temperature the 'Reset' message carries, falling back to ambient for
the bare True a caller might still send.
This commit is contained in:
2026-06-23 19:34:33 +02:00
parent e4f8b15ab0
commit f035e1decd
4 changed files with 74 additions and 2 deletions
+13
View File
@@ -1247,6 +1247,17 @@ class Ui_MainWindow(object):
self.btn_pot_reset = QtWidgets.QPushButton(self.centralwidget)
self.btn_pot_reset.setGeometry(QtCore.QRect(700, 500, 220, 31))
self.btn_pot_reset.setObjectName("btn_pot_reset")
self.label_pot_temp = QtWidgets.QLabel(self.centralwidget)
self.label_pot_temp.setGeometry(QtCore.QRect(930, 500, 91, 31))
self.label_pot_temp.setAlignment(QtCore.Qt.AlignCenter)
self.label_pot_temp.setObjectName("label_pot_temp")
self.doubleSpinBox_pot_temp = QtWidgets.QDoubleSpinBox(self.centralwidget)
self.doubleSpinBox_pot_temp.setGeometry(QtCore.QRect(1030, 500, 70, 31))
self.doubleSpinBox_pot_temp.setDecimals(0)
self.doubleSpinBox_pot_temp.setMinimum(-999.0)
self.doubleSpinBox_pot_temp.setMaximum(999.0)
self.doubleSpinBox_pot_temp.setSingleStep(1.0)
self.doubleSpinBox_pot_temp.setObjectName("doubleSpinBox_pot_temp")
self.label_8 = QtWidgets.QLabel(self.centralwidget)
self.label_8.setGeometry(QtCore.QRect(200, 500, 67, 31))
self.label_8.setAlignment(QtCore.Qt.AlignCenter)
@@ -1321,6 +1332,8 @@ class Ui_MainWindow(object):
self.doubleSpinBox_ambient.setToolTip(_translate("MainWindow", "Set the simulated/assumed ambient temperature"))
self.btn_pot_reset.setToolTip(_translate("MainWindow", "Only available when the server\'s Pot is simulated"))
self.btn_pot_reset.setText(_translate("MainWindow", "Pot reset to ambient temperature"))
self.label_pot_temp.setText(_translate("MainWindow", "Pot [°C]"))
self.doubleSpinBox_pot_temp.setToolTip(_translate("MainWindow", "Pre-dial the temperature btn_pot_reset applies to the simulated Pot"))
self.label_8.setText(_translate("MainWindow", "Host"))
self.menu_File.setTitle(_translate("MainWindow", "&File"))
self.menu_Help.setTitle(_translate("MainWindow", "&Help"))