From 6ab41a1943f9d546b22e9f6c02b73e83c37b9f2b Mon Sep 17 00:00:00 2001 From: atse Date: Tue, 27 Aug 2024 15:20:50 +0800 Subject: [PATCH] Move autotune ticking connect --- pytec/pytec/gui/model/pid_autotuner.py | 3 +++ pytec/tec_qt.py | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pytec/pytec/gui/model/pid_autotuner.py b/pytec/pytec/gui/model/pid_autotuner.py index c42ce37..16ccb88 100644 --- a/pytec/pytec/gui/model/pid_autotuner.py +++ b/pytec/pytec/gui/model/pid_autotuner.py @@ -8,6 +8,9 @@ class PIDAutoTuner(QObject): super().__init__(parent) self._thermostat = thermostat + self._thermostat.report_update.connect(self.tick) + self._thermostat.interval_update.connect(self.update_sampling_interval) + self.autotuners = [PIDAutotune(25) for _ in range(num_of_channel)] self.target_temp = [20.0 for _ in range(num_of_channel)] self.test_current = [1.0 for _ in range(num_of_channel)] diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index 70734ef..6426699 100755 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -107,11 +107,8 @@ class MainWindow(QtWidgets.QMainWindow): self.zero_limits_warning.set_limits_warning ) - self.thermostat.report_update.connect(self.autotuners.tick) self.thermostat.report_update.connect(self.pid_autotune_handler) - self.thermostat.interval_update.connect( - self.autotuners.update_sampling_interval - ) + self.thermostat.hw_rev_update.connect(self._status) self.report_apply_btn.clicked.connect( lambda: self.thermostat.set_update_s(self.report_refresh_spin.value())