From fe7bc5b7e5de6ff5358310eeb0d10079357a7e37 Mon Sep 17 00:00:00 2001 From: atse Date: Tue, 29 Aug 2023 12:27:19 +0800 Subject: [PATCH] Load config --- pytec/tec_qt.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index c6bc45f..1347e8c 100644 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -261,7 +261,8 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): {'name': 'Run', 'type': 'action', 'tip': 'Run'}, ]}, ]}, - {'name': 'Save to flash', 'type': 'action', 'tip': 'Save config to thermostat, applies on reset'} + {'name': 'Save to flash', 'type': 'action', 'tip': 'Save config to thermostat, applies on reset'}, + {'name': 'Load from flash', 'type': 'action', 'tip': 'Load config from flash'} ] for ch in range(2)] def __init__(self, args): @@ -643,6 +644,12 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): self.params[i].child('Save to flash').sigActivated.connect(save) + @asyncSlot() + async def load(_, channel=i): + await self.client.load_config(channel) + + self.params[i].child('Load from flash').sigActivated.connect(load) + @pyqtSlot(list) def update_pid(self, pid_settings): for settings in pid_settings: