Add a "Pot reset to ambient temperature" button, sim-only

New btn_pot_reset next to the ambient entry, sends {"Pot": {"Reset":
true}}; tasks/pot.py's PotTask.recv() (previously a no-op) now resets
the plant to its current ambient temperature (Pot.initial()) on that
command.

The button only appears when the server reports its Pot is simulated
(new "PlantSim" field on the System channel, derived from
config.json's previously-unused Controller.plant_name) - resetting a
simulated plant's temperature is meaningless for a real one.
This commit is contained in:
2026-06-21 12:15:35 +02:00
parent 40cf4b69cc
commit 19be2a7670
5 changed files with 36 additions and 2 deletions
+5
View File
@@ -1237,6 +1237,9 @@ class Ui_MainWindow(object):
self.lineEdit_ambient = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit_ambient.setGeometry(QtCore.QRect(620, 500, 70, 31))
self.lineEdit_ambient.setObjectName("lineEdit_ambient")
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_8 = QtWidgets.QLabel(self.centralwidget)
self.label_8.setGeometry(QtCore.QRect(200, 500, 67, 31))
self.label_8.setAlignment(QtCore.Qt.AlignCenter)
@@ -1307,6 +1310,8 @@ class Ui_MainWindow(object):
self.btn_connect.setText(_translate("MainWindow", "Connect"))
self.label_ambient.setText(_translate("MainWindow", "Ambient [°C]"))
self.lineEdit_ambient.setToolTip(_translate("MainWindow", "Set the simulated/assumed ambient temperature - press Enter to apply"))
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_8.setText(_translate("MainWindow", "Host"))
self.menu_File.setTitle(_translate("MainWindow", "&File"))
self.menu_Help.setTitle(_translate("MainWindow", "&Help"))