diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index ad09ec4..4eba71e 100644 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -651,9 +651,8 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): self.params[channel].child("PID Config", "Kp").setValue(settings["parameters"]["kp"]) self.params[channel].child("PID Config", "Ki").setValue(settings["parameters"]["ki"]) self.params[channel].child("PID Config", "Kd").setValue(settings["parameters"]["kd"]) - if self.params[channel].child("Output Config", "Control Method").value(): - self.params[channel].child("Output Config", "Control Method", "Set Temperature").setValue(settings["target"]) - getattr(self, f'ch{channel}_t_line').setValue(settings["target"]) + self.params[channel].child("Output Config", "Control Method", "Set Temperature").setValue(settings["target"]) + getattr(self, f'ch{channel}_t_line').setValue(settings["target"]) @pyqtSlot(list) def update_report(self, report_data): @@ -663,9 +662,8 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): self.params[channel].child("Output Config", "Control Method").setValue(settings["pid_engaged"]) getattr(self, f'ch{channel}_t_line').setVisible(settings["pid_engaged"]) self.params[channel].child("Output Config", "Control Method", "Constant Current").setValue(settings["i_set"]) - if settings['temperature'] is not None: + if settings['temperature'] is not None and settings['tec_i'] is not None: self.params[channel].child("Temperature").setValue(settings['temperature']) - if settings['tec_i'] is not None: self.params[channel].child("Current through TEC").setValue(settings['tec_i']) @pyqtSlot(list)