Fix setpoint line label to not display old values

Setpoint line still displays 0 °C sometimes!
This commit is contained in:
atse 2023-11-27 11:52:15 +08:00
parent 9797364043
commit d4bf06e242
1 changed files with 5 additions and 5 deletions

View File

@ -216,11 +216,11 @@ class ChannelGraphs:
self._t_line.setVisible(visible) self._t_line.setVisible(visible)
if temp is not None: if temp is not None:
self._t_line.setValue(temp) self._t_line.setValue(temp)
if visible is False:
# PyQtGraph does not update this text when the line # PyQtGraph normally does not update this text when the line
# is not visible, but we need it so that the temperature # is not visible, so make sure that the temperature label
# label doesn't display 0 °C despite not being at 0 °C. # gets updated always, and doesn't stay at an old value.
self._t_line.label.setText(f"{temp} °C") self._t_line.label.setText(f"{temp} °C")
class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):