From a7758e502e0bf63f52a81ecf2456a186c5e714d5 Mon Sep 17 00:00:00 2001 From: Yorusora <2944763079@qq.com> Date: Thu, 22 May 2025 10:02:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=86=E9=87=8D=E7=BD=AE?= =?UTF-8?q?=E7=BB=98=E5=9B=BE=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- func/Module_artifact_label.py | 6 ++++-- func/Module_detect_Jpeak.py | 3 ++- func/Module_detect_Rpeak.py | 6 ++++-- func/Module_label_check.py | 6 ++++-- func/Module_preprocess.py | 3 ++- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/func/Module_artifact_label.py b/func/Module_artifact_label.py index 7754abe..f79f52b 100644 --- a/func/Module_artifact_label.py +++ b/func/Module_artifact_label.py @@ -300,8 +300,10 @@ class MainWindow_artifact_label(QMainWindow): del self.rectangles_ax0_patches del self.rectangles_ax1_patches del self.annotation_tableWidget - self.ax0.clear() - self.ax1.clear() + if self.ax0 is not None: + self.ax0.clear() + if self.ax1 is not None: + self.ax1.clear() # 释放资源 del self.data diff --git a/func/Module_detect_Jpeak.py b/func/Module_detect_Jpeak.py index 3744bf6..6f6c5b0 100644 --- a/func/Module_detect_Jpeak.py +++ b/func/Module_detect_Jpeak.py @@ -204,7 +204,8 @@ class MainWindow_detect_Jpeak(QMainWindow): QApplication.processEvents() # 清空画框 - self.ax0.clear() + if self.ax0 is not None: + self.ax0.clear() # 释放资源 del self.data diff --git a/func/Module_detect_Rpeak.py b/func/Module_detect_Rpeak.py index a64d20c..9b73f7d 100644 --- a/func/Module_detect_Rpeak.py +++ b/func/Module_detect_Rpeak.py @@ -197,8 +197,10 @@ class MainWindow_detect_Rpeak(QMainWindow): QApplication.processEvents() # 清空画框 - self.ax0.clear() - self.ax1.clear() + if self.ax0 is not None: + self.ax0.clear() + if self.ax1 is not None: + self.ax1.clear() # 释放资源 del self.data diff --git a/func/Module_label_check.py b/func/Module_label_check.py index b97a1fd..ec22501 100644 --- a/func/Module_label_check.py +++ b/func/Module_label_check.py @@ -340,8 +340,10 @@ class MainWindow_label_check(QMainWindow): del self.point_peak_original del self.point_peak_corrected del self.annotation_tableWidget - self.ax0.clear() - self.ax1.clear() + if self.ax0 is not None: + self.ax0.clear() + if self.ax1 is not None: + self.ax1.clear() # 释放资源 del self.data diff --git a/func/Module_preprocess.py b/func/Module_preprocess.py index 823aadd..dbf6921 100644 --- a/func/Module_preprocess.py +++ b/func/Module_preprocess.py @@ -239,7 +239,8 @@ class MainWindow_preprocess(QMainWindow): QApplication.processEvents() # 清空画框 - self.ax0.clear() + if self.ax0 is not None: + self.ax0.clear() # 释放资源 del self.data