From bc35c6e4a83d75d85150825ced1575162204e9c4 Mon Sep 17 00:00:00 2001 From: Eddie Date: Wed, 13 Sep 2023 19:59:15 -0500 Subject: [PATCH] check fi device connected in bt_ota_start --- main.py | 5 +++++ modules/btn_callbacks.py | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/main.py b/main.py index 310c1fd..e89613b 100644 --- a/main.py +++ b/main.py @@ -216,6 +216,11 @@ def openCloseRightBox(): self.ui.scannerSettigns.setMaximumHeight(1000000) self.ui.scannerSettigns.show() + #hide unfinished sections + self.ui.btn_exit.hide() + self.ui.btn_save.hide() + self.ui.btn_widgets.hide() + # Set up the axes (assuming the chart is already set up in the .ui file) self.axisX = QtCharts.QValueAxis() diff --git a/modules/btn_callbacks.py b/modules/btn_callbacks.py index 85a3a14..763f02d 100644 --- a/modules/btn_callbacks.py +++ b/modules/btn_callbacks.py @@ -632,6 +632,10 @@ def load_bin(main_window): logger.info(f"Error loading binary: {err}") def start_ota(main_window): + logger = logging.getLogger("PDexLogger") + if main_window.connectedDevice.is_connected == False: + logger.info("No device connected") + return main_window.connectedDevice.device_ota_update_start.emit(main_window.connectedDevice , main_window.fileName, main_window.fileLen, main_window.fileCrc32) def register_button_callbacks(main_window):