diff --git a/brewpi.py b/brewpi.py index a4c186a..ecda2fd 100644 --- a/brewpi.py +++ b/brewpi.py @@ -5,7 +5,7 @@ from ws.server.ws_server_multi_user import WsServerMultiUser from components.sensor.tempSensorSim import TempSensorSim, ATemperatureSensor from components.plant.pot import Pot, APlant from components.actor.heater import Heater, AHeater -from components.pid import kalman +from components.pid import kalman, temp_controller from ws.message import MsgIo, MessageDispatcher from utils.value import Value, ValueChanged @@ -179,14 +179,36 @@ if __name__ == '__main__': "kn" : 0.2 } pot = Pot(pot_params) - pot.connect_theta_changed(sensor.set_fake_temp) + pot.set_on_changed("temp", ValueChanged(sensor.set_fake_temp, prec=1)) taskmgr.add(PotTask(pot, 0.1, dispatcher.msgio_get("Pot"))) # Heater heater = Heater() - heater.connect_power_changed(pot.setPower) + heater.set_on_changed("power_eff", ValueChanged(pot.setPower, prec=0)) taskmgr.add(HeaterTask(heater, 0.02, dispatcher.msgio_get("Heater"))) + # Temperature Controller + tc_params = { + "dt": 1.0, + "Hold": { + "Pid": { + "kp": 0.5, + "ki": 0.0, + "kd": 0.5, + "rho": 1.0 + } + }, + "Heat": { + "Pid": { + "kp": 0.002, + "ki": 0.0002, + "kd": 0.0, + "rho": 1.0 + } + } + } + tc = temp_controller.TempController(tc_params) + h_dispatcher = taskmgr.start() h_server = server.listen("localhost", 8765) asyncio.gather(h_dispatcher, h_server) diff --git a/brewpi.ui b/brewpi.ui index 10c23bb..1b8f9fe 100644 --- a/brewpi.ui +++ b/brewpi.ui @@ -9,8 +9,8 @@ 0 0 - 798 - 705 + 1591 + 718 @@ -486,8 +486,8 @@ - 0 - 10 + 10 + 0 350 471 @@ -497,1416 +497,17 @@ - + Manual - - - - - - 0 - 120 - - - - - - - - - 0 - 0 - 0 - - - - - - - 138 - 226 - 52 - - - - - - - 198 - 255 - 143 - - - - - - - 168 - 240 - 97 - - - - - - - 69 - 113 - 26 - - - - - - - 92 - 151 - 34 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 138 - 226 - 52 - - - - - - - 0 - 0 - 0 - - - - - - - 196 - 240 - 153 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - 138 - 226 - 52 - - - - - - - 198 - 255 - 143 - - - - - - - 168 - 240 - 97 - - - - - - - 69 - 113 - 26 - - - - - - - 92 - 151 - 34 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 138 - 226 - 52 - - - - - - - 0 - 0 - 0 - - - - - - - 196 - 240 - 153 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 0 - - - - - - - - - 69 - 113 - 26 - - - - - - - 138 - 226 - 52 - - - - - - - 198 - 255 - 143 - - - - - - - 168 - 240 - 97 - - - - - - - 69 - 113 - 26 - - - - - - - 92 - 151 - 34 - - - - - - - 69 - 113 - 26 - - - - - - - 255 - 255 - 255 - - - - - - - 69 - 113 - 26 - - - - - - - 138 - 226 - 52 - - - - - - - 138 - 226 - 52 - - - - - - - 0 - 0 - 0 - - - - - - - 138 - 226 - 52 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 0 - - - - - - - - QFrame::Box - - - QFrame::Raised - - - false - - - 5 - - - QLCDNumber::Filled - - - 2037.000000000000000 - - - - - - - - 0 - 120 - - - - - - - - - 0 - 0 - 0 - - - - - - - 138 - 226 - 52 - - - - - - - 198 - 255 - 143 - - - - - - - 168 - 240 - 97 - - - - - - - 69 - 113 - 26 - - - - - - - 92 - 151 - 34 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 138 - 226 - 52 - - - - - - - 0 - 0 - 0 - - - - - - - 196 - 240 - 153 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - 138 - 226 - 52 - - - - - - - 198 - 255 - 143 - - - - - - - 168 - 240 - 97 - - - - - - - 69 - 113 - 26 - - - - - - - 92 - 151 - 34 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 138 - 226 - 52 - - - - - - - 0 - 0 - 0 - - - - - - - 196 - 240 - 153 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 0 - - - - - - - - - 69 - 113 - 26 - - - - - - - 138 - 226 - 52 - - - - - - - 198 - 255 - 143 - - - - - - - 168 - 240 - 97 - - - - - - - 69 - 113 - 26 - - - - - - - 92 - 151 - 34 - - - - - - - 69 - 113 - 26 - - - - - - - 255 - 255 - 255 - - - - - - - 69 - 113 - 26 - - - - - - - 138 - 226 - 52 - - - - - - - 138 - 226 - 52 - - - - - - - 0 - 0 - 0 - - - - - - - 138 - 226 - 52 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 0 - - - - - - - - QFrame::Box - - - QFrame::Raised - - - false - - - 2037.000000000000000 - - - - - - - - 0 - 120 - - - - - - - - - 0 - 0 - 0 - - - - - - - 138 - 226 - 52 - - - - - - - 198 - 255 - 143 - - - - - - - 168 - 240 - 97 - - - - - - - 69 - 113 - 26 - - - - - - - 92 - 151 - 34 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 138 - 226 - 52 - - - - - - - 0 - 0 - 0 - - - - - - - 196 - 240 - 153 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - 138 - 226 - 52 - - - - - - - 198 - 255 - 143 - - - - - - - 168 - 240 - 97 - - - - - - - 69 - 113 - 26 - - - - - - - 92 - 151 - 34 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 138 - 226 - 52 - - - - - - - 0 - 0 - 0 - - - - - - - 196 - 240 - 153 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 0 - - - - - - - - - 69 - 113 - 26 - - - - - - - 138 - 226 - 52 - - - - - - - 198 - 255 - 143 - - - - - - - 168 - 240 - 97 - - - - - - - 69 - 113 - 26 - - - - - - - 92 - 151 - 34 - - - - - - - 69 - 113 - 26 - - - - - - - 255 - 255 - 255 - - - - - - - 69 - 113 - 26 - - - - - - - 138 - 226 - 52 - - - - - - - 138 - 226 - 52 - - - - - - - 0 - 0 - 0 - - - - - - - 138 - 226 - 52 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 0 - - - - - - - - QFrame::Box - - - QFrame::Raised - - - false - - - 2037.000000000000000 - - - - + - Seite + Automatic @@ -1915,34 +516,49 @@ - - - - 890 - 50 - 56 - 201 - - - - 410 - 30 - 261 - 441 + 370 + 70 + 111 + 401 - Heater + Power + + + + 10 + 40 + 63 + 311 + + + + 0.000000000000000 + + + 100.000000000000000 + + + 7 + + + 3 + + + 0.000000000000000 + + - 140 - 390 - 92 + 20 + 370 + 81 23 @@ -1950,13 +566,1436 @@ Activate - + + + + + 700 + 70 + 328 + 422 + + + + + + + + 0 + 120 + + + + + + + + + 0 + 0 + 0 + + + + + + + 138 + 226 + 52 + + + + + + + 198 + 255 + 143 + + + + + + + 168 + 240 + 97 + + + + + + + 69 + 113 + 26 + + + + + + + 92 + 151 + 34 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 138 + 226 + 52 + + + + + + + 0 + 0 + 0 + + + + + + + 196 + 240 + 153 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + 138 + 226 + 52 + + + + + + + 198 + 255 + 143 + + + + + + + 168 + 240 + 97 + + + + + + + 69 + 113 + 26 + + + + + + + 92 + 151 + 34 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 138 + 226 + 52 + + + + + + + 0 + 0 + 0 + + + + + + + 196 + 240 + 153 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + + + 69 + 113 + 26 + + + + + + + 138 + 226 + 52 + + + + + + + 198 + 255 + 143 + + + + + + + 168 + 240 + 97 + + + + + + + 69 + 113 + 26 + + + + + + + 92 + 151 + 34 + + + + + + + 69 + 113 + 26 + + + + + + + 255 + 255 + 255 + + + + + + + 69 + 113 + 26 + + + + + + + 138 + 226 + 52 + + + + + + + 138 + 226 + 52 + + + + + + + 0 + 0 + 0 + + + + + + + 138 + 226 + 52 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + + QFrame::Box + + + QFrame::Raised + + + false + + + 5 + + + QLCDNumber::Filled + + + 2037.000000000000000 + + + + + + + + 0 + 120 + + + + + + + + + 0 + 0 + 0 + + + + + + + 138 + 226 + 52 + + + + + + + 198 + 255 + 143 + + + + + + + 168 + 240 + 97 + + + + + + + 69 + 113 + 26 + + + + + + + 92 + 151 + 34 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 138 + 226 + 52 + + + + + + + 0 + 0 + 0 + + + + + + + 196 + 240 + 153 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + 138 + 226 + 52 + + + + + + + 198 + 255 + 143 + + + + + + + 168 + 240 + 97 + + + + + + + 69 + 113 + 26 + + + + + + + 92 + 151 + 34 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 138 + 226 + 52 + + + + + + + 0 + 0 + 0 + + + + + + + 196 + 240 + 153 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + + + 69 + 113 + 26 + + + + + + + 138 + 226 + 52 + + + + + + + 198 + 255 + 143 + + + + + + + 168 + 240 + 97 + + + + + + + 69 + 113 + 26 + + + + + + + 92 + 151 + 34 + + + + + + + 69 + 113 + 26 + + + + + + + 255 + 255 + 255 + + + + + + + 69 + 113 + 26 + + + + + + + 138 + 226 + 52 + + + + + + + 138 + 226 + 52 + + + + + + + 0 + 0 + 0 + + + + + + + 138 + 226 + 52 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + + QFrame::Box + + + QFrame::Raised + + + false + + + 2037.000000000000000 + + + + + + + + 0 + 120 + + + + + + + + + 0 + 0 + 0 + + + + + + + 138 + 226 + 52 + + + + + + + 198 + 255 + 143 + + + + + + + 168 + 240 + 97 + + + + + + + 69 + 113 + 26 + + + + + + + 92 + 151 + 34 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 138 + 226 + 52 + + + + + + + 0 + 0 + 0 + + + + + + + 196 + 240 + 153 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + 138 + 226 + 52 + + + + + + + 198 + 255 + 143 + + + + + + + 168 + 240 + 97 + + + + + + + 69 + 113 + 26 + + + + + + + 92 + 151 + 34 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 138 + 226 + 52 + + + + + + + 0 + 0 + 0 + + + + + + + 196 + 240 + 153 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + + + 69 + 113 + 26 + + + + + + + 138 + 226 + 52 + + + + + + + 198 + 255 + 143 + + + + + + + 168 + 240 + 97 + + + + + + + 69 + 113 + 26 + + + + + + + 92 + 151 + 34 + + + + + + + 69 + 113 + 26 + + + + + + + 255 + 255 + 255 + + + + + + + 69 + 113 + 26 + + + + + + + 138 + 226 + 52 + + + + + + + 138 + 226 + 52 + + + + + + + 0 + 0 + 0 + + + + + + + 138 + 226 + 52 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + + QFrame::Box + + + QFrame::Raised + + + false + + + 2037.000000000000000 + + + + + + + + + 500 + 70 + 111 + 401 + + + + Temperatur + + 10 40 - 91 - 381 + 63 + 311 @@ -1982,7 +2021,7 @@ 0 0 - 798 + 1591 22 @@ -2048,11 +2087,6 @@ QWidget
qwt_slider.h
- - QwtThermo - QWidget -
qwt_thermo.h
-
diff --git a/brewpi_gui.py b/brewpi_gui.py index e0579e9..9d92f3d 100644 --- a/brewpi_gui.py +++ b/brewpi_gui.py @@ -28,7 +28,7 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow): self.setupUi(self) self.actionStart.triggered.connect(self.connect) self.actionStop.triggered.connect(self.disconnect) - self.Slider.valueChanged.connect(self.on_slider_changed) + self.Slider_pwr_soll.valueChanged.connect(self.on_slider_changed) self.checkbox_heater_activate.stateChanged.connect(self.on_checkbox_changed) self.send_data = Queue() self.slider_initial_update = True @@ -66,14 +66,14 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow): elif "Power" in key: self.lcdNumber.display(msg['Power']) if self.slider_initial_update: - self.Slider.setValue(msg['Power']) + self.Slider_pwr_soll.setValue(msg['Power']) self.slider_initial_update = False elif "Capabilities" in key: submsg = msg['Capabilities'] if "Power" in submsg: submsg = submsg['Power'] - self.Slider.setLowerBound(submsg['Min']) - self.Slider.setUpperBound(submsg['Max']) + self.Slider_pwr_soll.setLowerBound(submsg['Min']) + self.Slider_pwr_soll.setUpperBound(submsg['Max']) def closeEvent(self, event): print("Exitting gracefully!") diff --git a/brewpi_win.py b/brewpi_win.py index 294769e..6f4707c 100644 --- a/brewpi_win.py +++ b/brewpi_win.py @@ -14,7 +14,7 @@ class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.setEnabled(True) - MainWindow.resize(798, 705) + MainWindow.resize(1591, 718) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) @@ -175,15 +175,43 @@ class Ui_MainWindow(object): self.centralwidget.setObjectName("centralwidget") self.horizontalTabWidget = QtWidgets.QTabWidget(self.centralwidget) self.horizontalTabWidget.setEnabled(True) - self.horizontalTabWidget.setGeometry(QtCore.QRect(0, 10, 350, 471)) + self.horizontalTabWidget.setGeometry(QtCore.QRect(10, 0, 350, 471)) self.horizontalTabWidget.setObjectName("horizontalTabWidget") self.horizontalTabWidgetPage1 = QtWidgets.QWidget() self.horizontalTabWidgetPage1.setObjectName("horizontalTabWidgetPage1") self.horizontalLayout = QtWidgets.QHBoxLayout(self.horizontalTabWidgetPage1) self.horizontalLayout.setObjectName("horizontalLayout") - self.verticalLayout = QtWidgets.QVBoxLayout() + self.gridLayout = QtWidgets.QGridLayout() + self.gridLayout.setObjectName("gridLayout") + self.horizontalLayout.addLayout(self.gridLayout) + self.horizontalTabWidget.addTab(self.horizontalTabWidgetPage1, "") + self.tab = QtWidgets.QWidget() + self.tab.setObjectName("tab") + self.horizontalTabWidget.addTab(self.tab, "") + self.tab_2 = QtWidgets.QWidget() + self.tab_2.setObjectName("tab_2") + self.horizontalTabWidget.addTab(self.tab_2, "") + self.groupBox = QtWidgets.QGroupBox(self.centralwidget) + self.groupBox.setGeometry(QtCore.QRect(370, 70, 111, 401)) + self.groupBox.setObjectName("groupBox") + self.Slider_pwr_soll = QwtSlider(self.groupBox) + self.Slider_pwr_soll.setGeometry(QtCore.QRect(10, 40, 63, 311)) + self.Slider_pwr_soll.setLowerBound(0.0) + self.Slider_pwr_soll.setUpperBound(100.0) + self.Slider_pwr_soll.setScaleMaxMajor(7) + self.Slider_pwr_soll.setScaleMaxMinor(3) + self.Slider_pwr_soll.setScaleStepSize(0.0) + self.Slider_pwr_soll.setObjectName("Slider_pwr_soll") + self.checkbox_heater_activate = QtWidgets.QCheckBox(self.groupBox) + self.checkbox_heater_activate.setGeometry(QtCore.QRect(20, 370, 81, 23)) + self.checkbox_heater_activate.setObjectName("checkbox_heater_activate") + self.widget = QtWidgets.QWidget(self.centralwidget) + self.widget.setGeometry(QtCore.QRect(700, 70, 328, 422)) + self.widget.setObjectName("widget") + self.verticalLayout = QtWidgets.QVBoxLayout(self.widget) + self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") - self.lcdNumber_3 = QtWidgets.QLCDNumber(self.horizontalTabWidgetPage1) + self.lcdNumber_3 = QtWidgets.QLCDNumber(self.widget) self.lcdNumber_3.setMinimumSize(QtCore.QSize(0, 120)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) @@ -339,161 +367,7 @@ class Ui_MainWindow(object): self.lcdNumber_3.setProperty("value", 2037.0) self.lcdNumber_3.setObjectName("lcdNumber_3") self.verticalLayout.addWidget(self.lcdNumber_3) - self.lcdNumber_2 = QtWidgets.QLCDNumber(self.horizontalTabWidgetPage1) - self.lcdNumber_2.setMinimumSize(QtCore.QSize(0, 120)) - palette = QtGui.QPalette() - brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) - brush = QtGui.QBrush(QtGui.QColor(138, 226, 52)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) - brush = QtGui.QBrush(QtGui.QColor(198, 255, 143)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush) - brush = QtGui.QBrush(QtGui.QColor(168, 240, 97)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush) - brush = QtGui.QBrush(QtGui.QColor(69, 113, 26)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush) - brush = QtGui.QBrush(QtGui.QColor(92, 151, 34)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush) - brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) - brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush) - brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) - brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) - brush = QtGui.QBrush(QtGui.QColor(138, 226, 52)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) - brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush) - brush = QtGui.QBrush(QtGui.QColor(196, 240, 153)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush) - brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush) - brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush) - brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.PlaceholderText, brush) - brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) - brush = QtGui.QBrush(QtGui.QColor(138, 226, 52)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) - brush = QtGui.QBrush(QtGui.QColor(198, 255, 143)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush) - brush = QtGui.QBrush(QtGui.QColor(168, 240, 97)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush) - brush = QtGui.QBrush(QtGui.QColor(69, 113, 26)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush) - brush = QtGui.QBrush(QtGui.QColor(92, 151, 34)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush) - brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) - brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush) - brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) - brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) - brush = QtGui.QBrush(QtGui.QColor(138, 226, 52)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) - brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush) - brush = QtGui.QBrush(QtGui.QColor(196, 240, 153)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush) - brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush) - brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush) - brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.PlaceholderText, brush) - brush = QtGui.QBrush(QtGui.QColor(69, 113, 26)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) - brush = QtGui.QBrush(QtGui.QColor(138, 226, 52)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) - brush = QtGui.QBrush(QtGui.QColor(198, 255, 143)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush) - brush = QtGui.QBrush(QtGui.QColor(168, 240, 97)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush) - brush = QtGui.QBrush(QtGui.QColor(69, 113, 26)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush) - brush = QtGui.QBrush(QtGui.QColor(92, 151, 34)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush) - brush = QtGui.QBrush(QtGui.QColor(69, 113, 26)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) - brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush) - brush = QtGui.QBrush(QtGui.QColor(69, 113, 26)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) - brush = QtGui.QBrush(QtGui.QColor(138, 226, 52)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) - brush = QtGui.QBrush(QtGui.QColor(138, 226, 52)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) - brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush) - brush = QtGui.QBrush(QtGui.QColor(138, 226, 52)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush) - brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush) - brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush) - brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)) - brush.setStyle(QtCore.Qt.SolidPattern) - palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.PlaceholderText, brush) - self.lcdNumber_2.setPalette(palette) - self.lcdNumber_2.setFrameShape(QtWidgets.QFrame.Box) - self.lcdNumber_2.setFrameShadow(QtWidgets.QFrame.Raised) - self.lcdNumber_2.setSmallDecimalPoint(False) - self.lcdNumber_2.setProperty("value", 2037.0) - self.lcdNumber_2.setObjectName("lcdNumber_2") - self.verticalLayout.addWidget(self.lcdNumber_2) - self.lcdNumber = QtWidgets.QLCDNumber(self.horizontalTabWidgetPage1) + self.lcdNumber = QtWidgets.QLCDNumber(self.widget) self.lcdNumber.setMinimumSize(QtCore.QSize(0, 120)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) @@ -647,34 +521,174 @@ class Ui_MainWindow(object): self.lcdNumber.setProperty("value", 2037.0) self.lcdNumber.setObjectName("lcdNumber") self.verticalLayout.addWidget(self.lcdNumber) - self.horizontalLayout.addLayout(self.verticalLayout) - self.horizontalTabWidget.addTab(self.horizontalTabWidgetPage1, "") - self.tab = QtWidgets.QWidget() - self.tab.setObjectName("tab") - self.horizontalTabWidget.addTab(self.tab, "") - self.tab_2 = QtWidgets.QWidget() - self.tab_2.setObjectName("tab_2") - self.horizontalTabWidget.addTab(self.tab_2, "") - self.Thermo = QwtThermo(self.centralwidget) - self.Thermo.setGeometry(QtCore.QRect(890, 50, 56, 201)) - self.Thermo.setObjectName("Thermo") - self.groupBox = QtWidgets.QGroupBox(self.centralwidget) - self.groupBox.setGeometry(QtCore.QRect(410, 30, 261, 441)) - self.groupBox.setObjectName("groupBox") - self.checkbox_heater_activate = QtWidgets.QCheckBox(self.groupBox) - self.checkbox_heater_activate.setGeometry(QtCore.QRect(140, 390, 92, 23)) - self.checkbox_heater_activate.setObjectName("checkbox_heater_activate") - self.Slider = QwtSlider(self.groupBox) - self.Slider.setGeometry(QtCore.QRect(10, 40, 91, 381)) - self.Slider.setLowerBound(0.0) - self.Slider.setUpperBound(100.0) - self.Slider.setScaleMaxMajor(7) - self.Slider.setScaleMaxMinor(3) - self.Slider.setScaleStepSize(0.0) - self.Slider.setObjectName("Slider") + self.lcdNumber_2 = QtWidgets.QLCDNumber(self.widget) + self.lcdNumber_2.setMinimumSize(QtCore.QSize(0, 120)) + palette = QtGui.QPalette() + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) + brush = QtGui.QBrush(QtGui.QColor(138, 226, 52)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) + brush = QtGui.QBrush(QtGui.QColor(198, 255, 143)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush) + brush = QtGui.QBrush(QtGui.QColor(168, 240, 97)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush) + brush = QtGui.QBrush(QtGui.QColor(69, 113, 26)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush) + brush = QtGui.QBrush(QtGui.QColor(92, 151, 34)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) + brush = QtGui.QBrush(QtGui.QColor(138, 226, 52)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush) + brush = QtGui.QBrush(QtGui.QColor(196, 240, 153)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.PlaceholderText, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) + brush = QtGui.QBrush(QtGui.QColor(138, 226, 52)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) + brush = QtGui.QBrush(QtGui.QColor(198, 255, 143)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush) + brush = QtGui.QBrush(QtGui.QColor(168, 240, 97)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush) + brush = QtGui.QBrush(QtGui.QColor(69, 113, 26)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush) + brush = QtGui.QBrush(QtGui.QColor(92, 151, 34)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) + brush = QtGui.QBrush(QtGui.QColor(138, 226, 52)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush) + brush = QtGui.QBrush(QtGui.QColor(196, 240, 153)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.PlaceholderText, brush) + brush = QtGui.QBrush(QtGui.QColor(69, 113, 26)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) + brush = QtGui.QBrush(QtGui.QColor(138, 226, 52)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) + brush = QtGui.QBrush(QtGui.QColor(198, 255, 143)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush) + brush = QtGui.QBrush(QtGui.QColor(168, 240, 97)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush) + brush = QtGui.QBrush(QtGui.QColor(69, 113, 26)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush) + brush = QtGui.QBrush(QtGui.QColor(92, 151, 34)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush) + brush = QtGui.QBrush(QtGui.QColor(69, 113, 26)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush) + brush = QtGui.QBrush(QtGui.QColor(69, 113, 26)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) + brush = QtGui.QBrush(QtGui.QColor(138, 226, 52)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) + brush = QtGui.QBrush(QtGui.QColor(138, 226, 52)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush) + brush = QtGui.QBrush(QtGui.QColor(138, 226, 52)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.PlaceholderText, brush) + self.lcdNumber_2.setPalette(palette) + self.lcdNumber_2.setFrameShape(QtWidgets.QFrame.Box) + self.lcdNumber_2.setFrameShadow(QtWidgets.QFrame.Raised) + self.lcdNumber_2.setSmallDecimalPoint(False) + self.lcdNumber_2.setProperty("value", 2037.0) + self.lcdNumber_2.setObjectName("lcdNumber_2") + self.verticalLayout.addWidget(self.lcdNumber_2) + self.groupBox_2 = QtWidgets.QGroupBox(self.centralwidget) + self.groupBox_2.setGeometry(QtCore.QRect(500, 70, 111, 401)) + self.groupBox_2.setObjectName("groupBox_2") + self.Slider_temp_soll = QwtSlider(self.groupBox_2) + self.Slider_temp_soll.setGeometry(QtCore.QRect(10, 40, 63, 311)) + self.Slider_temp_soll.setLowerBound(0.0) + self.Slider_temp_soll.setUpperBound(100.0) + self.Slider_temp_soll.setScaleMaxMajor(7) + self.Slider_temp_soll.setScaleMaxMinor(3) + self.Slider_temp_soll.setScaleStepSize(0.0) + self.Slider_temp_soll.setObjectName("Slider_temp_soll") MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 798, 22)) + self.menubar.setGeometry(QtCore.QRect(0, 0, 1591, 22)) self.menubar.setObjectName("menubar") self.menu_File = QtWidgets.QMenu(self.menubar) self.menu_File.setObjectName("menu_File") @@ -706,10 +720,12 @@ class Ui_MainWindow(object): def retranslateUi(self, MainWindow): _translate = QtCore.QCoreApplication.translate MainWindow.setWindowTitle(_translate("MainWindow", "BrewPi")) - self.horizontalTabWidget.setTabText(self.horizontalTabWidget.indexOf(self.tab), _translate("MainWindow", "Seite")) + 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.groupBox.setTitle(_translate("MainWindow", "Heater")) + self.groupBox.setTitle(_translate("MainWindow", "Power")) self.checkbox_heater_activate.setText(_translate("MainWindow", "Activate")) + self.groupBox_2.setTitle(_translate("MainWindow", "Temperatur")) self.menu_File.setTitle(_translate("MainWindow", "&File")) self.menu_Help.setTitle(_translate("MainWindow", "&Help")) self.toolBar.setWindowTitle(_translate("MainWindow", "toolBar")) diff --git a/components/actor/heater.py b/components/actor/heater.py index bedf078..2da0b12 100644 --- a/components/actor/heater.py +++ b/components/actor/heater.py @@ -3,14 +3,9 @@ from components.aheater import AHeater class Heater(AHeater): def __init__(self): - self.power = self.get_power_min() - self.power_last = -1 + self.power_set = self.get_power_min() self.is_active = False - - self.power_changed_callback = None - - def connect_power_changed(self, func): - self.power_changed_callback = func + self.power_eff = 0 def get_power_min(self): return 500 @@ -22,18 +17,12 @@ class Heater(AHeater): self.is_active = enable def process(self): - if self.getPower() != self.power_last: - if self.power_changed_callback is not None: - self.power_changed_callback(self.getPower()) - self.power_last = self.getPower() + self.power_eff = self.power_set if self.is_active else 0 def setPower(self, power): - self.power = max(self.get_power_min(), min(self.get_power_max(), power)) + self.power_set = max(self.get_power_min(), min(self.get_power_max(), power)) def getPower(self): - if self.is_active: - return self.power - else: - return 0 + return self.power_eff diff --git a/components/aheater.py b/components/aheater.py index ce76dc3..16a531f 100644 --- a/components/aheater.py +++ b/components/aheater.py @@ -1,10 +1,8 @@ import abc +from utils.value import AttributeChange -class AHeater: - def __init__(self): - pass - +class AHeater(AttributeChange): @abc.abstractmethod def get_power_min(self): pass @@ -28,7 +26,3 @@ class AHeater: @abc.abstractmethod def getPower(self): return None - - @abc.abstractmethod - def connect_power_changed(self, func): - pass diff --git a/components/aplant.py b/components/aplant.py index 0e1b4dc..25b7607 100644 --- a/components/aplant.py +++ b/components/aplant.py @@ -1,10 +1,8 @@ import abc +from utils.value import AttributeChange -class APlant: - def __init__(self, params): - pass - +class APlant(AttributeChange): @abc.abstractmethod def activate(self, enable): return None @@ -14,7 +12,7 @@ class APlant: pass @abc.abstractmethod - def setPower(self, power_W): + def setPower(self, power): pass @abc.abstractmethod @@ -24,7 +22,3 @@ class APlant: @abc.abstractmethod def getTemperature(self): return None - - @abc.abstractmethod - def connect_theta_changed(self, func): - pass diff --git a/components/plant/pot.py b/components/plant/pot.py index bfbe7b0..b98cdae 100644 --- a/components/plant/pot.py +++ b/components/plant/pot.py @@ -1,5 +1,4 @@ import numpy as np -import json from components.aplant import APlant @@ -20,17 +19,13 @@ class Pot(APlant): self.theta_amb = params['theta_amb'] self.theta = 0 - + self.temp = self.theta_amb self.alpha = self.dt / 1 self.alpha_delay = self.dt/self.Td - self.theta_changed_callback = None self.power_set = 0 self.power_actual = 0 - def connect_theta_changed(self, func): - self.theta_changed_callback = func - def activate(self, enable): pass @@ -41,12 +36,9 @@ class Pot(APlant): self.e = self.e * (1 - ((self.L * self.theta) * self.dt) / (self.M * self.C)) self.x = (1 - self.alpha) * self.x + self.gain * self.alpha * self.power_actual self.e += self.x - theta = self.e / (self.M * self.C) + self.theta = self.e / (self.M * self.C) - if self.theta_changed_callback is not None: - self.theta_changed_callback(self.getTemperature()) - - self.theta = theta + self.temp = self.getTemperature() def setPower(self, power): self.power_set = power diff --git a/utils/value.py b/utils/value.py index 380848c..b562e6e 100644 --- a/utils/value.py +++ b/utils/value.py @@ -33,8 +33,7 @@ class ValueChanged(object): class AttributeChange(object): - def __init__(self): - self.callbacks = {} + callbacks = {} def set_on_changed(self, key, on_changed: ValueChanged): if key not in self.callbacks: