Add a real-time Plot tab to brewpi_gui, mirroring demo_sud figure 1

Embeds a dark-themed matplotlib canvas (3 stacked strip charts: theta
ist/soll, heatrate ist/soll, heater power_set/power_eff) in a new Plot
tab, sampled once per second from the latest websocket-received values.

HeaterTask now also emits a PowerSet message (the pre-discretization
target power) alongside the existing Power (effective) message, since
the GUI had no way to see the set-point side of figure 1's bottom plot
otherwise.
This commit is contained in:
2026-06-20 22:31:07 +02:00
parent bb94e065f4
commit 93b5667a64
5 changed files with 133 additions and 3 deletions
+7 -1
View File
@@ -249,6 +249,12 @@ class Ui_MainWindow(object):
self.horizontalTabWidget.addTab(self.tab, "")
self.tab_2 = QtWidgets.QWidget()
self.tab_2.setObjectName("tab_2")
self.verticalLayout_plot = QtWidgets.QVBoxLayout(self.tab_2)
self.verticalLayout_plot.setObjectName("verticalLayout_plot")
self.widget_plot = QtWidgets.QWidget(self.tab_2)
self.widget_plot.setMinimumSize(QtCore.QSize(0, 400))
self.widget_plot.setObjectName("widget_plot")
self.verticalLayout_plot.addWidget(self.widget_plot)
self.horizontalTabWidget.addTab(self.tab_2, "")
self.gridLayoutWidget = QtWidgets.QWidget(self.centralwidget)
self.gridLayoutWidget.setGeometry(QtCore.QRect(480, 70, 481, 374))
@@ -1270,7 +1276,7 @@ class Ui_MainWindow(object):
self.label_11.setText(_translate("MainWindow", "Speed [%]"))
self.horizontalTabWidget.setTabText(self.horizontalTabWidget.indexOf(self.horizontalTabWidgetPage1), _translate("MainWindow", "Manual"))
self.horizontalTabWidget.setTabText(self.horizontalTabWidget.indexOf(self.tab), _translate("MainWindow", "Automatic"))
self.horizontalTabWidget.setTabText(self.horizontalTabWidget.indexOf(self.tab_2), _translate("MainWindow", "Seite"))
self.horizontalTabWidget.setTabText(self.horizontalTabWidget.indexOf(self.tab_2), _translate("MainWindow", "Plot"))
self.label.setText(_translate("MainWindow", "Ist"))
self.label_2.setText(_translate("MainWindow", "Soll"))
self.label_3.setText(_translate("MainWindow", "Temperature [°C]"))