Add a GUI text entry to set the ambient temperature live
New lineEdit_ambient next to the host/connect row - type a value and
press Enter to send {"System": {"AmbientTemp": ...}}. The server now
has a recv handler for the System channel (previously send-only):
updates the real Pot's ambient temperature and, where the controller
has an internal model (Smith), its model Pots too (new
set_ambient_temperature() on TempControllerSmith), then echoes the new
value back so the status bar label and entry itself stay in sync.
This commit is contained in:
@@ -1230,6 +1230,13 @@ class Ui_MainWindow(object):
|
||||
self.btn_connect = QtWidgets.QPushButton(self.centralwidget)
|
||||
self.btn_connect.setGeometry(QtCore.QRect(440, 500, 70, 31))
|
||||
self.btn_connect.setObjectName("btn_connect")
|
||||
self.label_ambient = QtWidgets.QLabel(self.centralwidget)
|
||||
self.label_ambient.setGeometry(QtCore.QRect(520, 500, 91, 31))
|
||||
self.label_ambient.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_ambient.setObjectName("label_ambient")
|
||||
self.lineEdit_ambient = QtWidgets.QLineEdit(self.centralwidget)
|
||||
self.lineEdit_ambient.setGeometry(QtCore.QRect(620, 500, 70, 31))
|
||||
self.lineEdit_ambient.setObjectName("lineEdit_ambient")
|
||||
self.label_8 = QtWidgets.QLabel(self.centralwidget)
|
||||
self.label_8.setGeometry(QtCore.QRect(200, 500, 67, 31))
|
||||
self.label_8.setAlignment(QtCore.Qt.AlignCenter)
|
||||
@@ -1298,6 +1305,8 @@ class Ui_MainWindow(object):
|
||||
self.label_state.setText(_translate("MainWindow", "State"))
|
||||
self.plainTextUri.setPlainText(_translate("MainWindow", "ws://localhost:8765"))
|
||||
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.label_8.setText(_translate("MainWindow", "Host"))
|
||||
self.menu_File.setTitle(_translate("MainWindow", "&File"))
|
||||
self.menu_Help.setTitle(_translate("MainWindow", "&Help"))
|
||||
|
||||
Reference in New Issue
Block a user