From 85a69648e0573d107168ab03c540b92320dde5e9 Mon Sep 17 00:00:00 2001 From: Yorusora <2944763079@qq.com> Date: Thu, 22 May 2025 09:50:03 +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_SA_label.py | 61 +++++++++++++++++++---------------- func/Module_artifact_label.py | 19 ++++++----- func/Module_label_check.py | 16 +++++---- func/Module_mainwindow.py | 16 ++++++++- func/Module_preprocess.py | 7 ++-- 5 files changed, 71 insertions(+), 48 deletions(-) diff --git a/func/Module_SA_label.py b/func/Module_SA_label.py index c6bbeff..53c6a72 100644 --- a/func/Module_SA_label.py +++ b/func/Module_SA_label.py @@ -1000,33 +1000,40 @@ class MainWindow_SA_label(QMainWindow): self.ui.spinBox_correctEnd.setValue(Config["BCG_EP"]) def reset_axes(self): - self.ax0.clear() - self.ax1.clear() - self.ax2.clear() - self.ax3.clear() - self.ax4.clear() - self.ax5.clear() - self.ax6.clear() - self.ax0.grid(True) - self.ax0.xaxis.set_major_formatter(ConfigParams.FORMATTER) - self.ax0.tick_params(axis='x', colors=Constants.PLOT_COLOR_WHITE) - self.ax1.grid(True) - self.ax1.xaxis.set_major_formatter(ConfigParams.FORMATTER) - self.ax1.tick_params(axis='x', colors=Constants.PLOT_COLOR_WHITE) - self.ax2.grid(True) - self.ax2.xaxis.set_major_formatter(ConfigParams.FORMATTER) - self.ax2.tick_params(axis='x', colors=Constants.PLOT_COLOR_WHITE) - self.ax3.grid(True) - self.ax3.xaxis.set_major_formatter(ConfigParams.FORMATTER) - self.ax3.tick_params(axis='x', colors=Constants.PLOT_COLOR_WHITE) - self.ax4.grid(True) - self.ax4.xaxis.set_major_formatter(ConfigParams.FORMATTER) - self.ax4.tick_params(axis='x', colors=Constants.PLOT_COLOR_WHITE) - self.ax5.grid(True) - self.ax5.xaxis.set_major_formatter(ConfigParams.FORMATTER) - self.ax5.tick_params(axis='x', colors=Constants.PLOT_COLOR_WHITE) - self.ax6.grid(True) - self.ax6.xaxis.set_major_formatter(ConfigParams.FORMATTER) + if self.ax0 is not None: + self.ax0.clear() + self.ax0.grid(True) + self.ax0.xaxis.set_major_formatter(ConfigParams.FORMATTER) + self.ax0.tick_params(axis='x', colors=Constants.PLOT_COLOR_WHITE) + if self.ax1 is not None: + self.ax1.clear() + self.ax1.grid(True) + self.ax1.xaxis.set_major_formatter(ConfigParams.FORMATTER) + self.ax1.tick_params(axis='x', colors=Constants.PLOT_COLOR_WHITE) + if self.ax2 is not None: + self.ax2.clear() + self.ax2.grid(True) + self.ax2.xaxis.set_major_formatter(ConfigParams.FORMATTER) + self.ax2.tick_params(axis='x', colors=Constants.PLOT_COLOR_WHITE) + if self.ax3 is not None: + self.ax3.clear() + self.ax3.grid(True) + self.ax3.xaxis.set_major_formatter(ConfigParams.FORMATTER) + self.ax3.tick_params(axis='x', colors=Constants.PLOT_COLOR_WHITE) + if self.ax4 is not None: + self.ax4.clear() + self.ax4.grid(True) + self.ax4.xaxis.set_major_formatter(ConfigParams.FORMATTER) + self.ax4.tick_params(axis='x', colors=Constants.PLOT_COLOR_WHITE) + if self.ax5 is not None: + self.ax5.clear() + self.ax5.grid(True) + self.ax5.xaxis.set_major_formatter(ConfigParams.FORMATTER) + self.ax5.tick_params(axis='x', colors=Constants.PLOT_COLOR_WHITE) + if self.ax6 is not None: + self.ax6.clear() + self.ax6.grid(True) + self.ax6.xaxis.set_major_formatter(ConfigParams.FORMATTER) def on_xlim_change(self, event_ax): # 获取当前x轴范围 diff --git a/func/Module_artifact_label.py b/func/Module_artifact_label.py index 805f9f9..7754abe 100644 --- a/func/Module_artifact_label.py +++ b/func/Module_artifact_label.py @@ -592,9 +592,6 @@ class MainWindow_artifact_label(QMainWindow): else: PublicFunc.text_output(self.ui, "(2/6)" + result.info, Constants.TIPS_TYPE_INFO) - self.__reset__() - PublicFunc.finish_operation(self, ButtonState) - # 获取存档 PublicFunc.progressbar_update(self, 3, 6, Constants.LOADING_ARCHIVE, 50) result = self.data.get_archive() @@ -929,13 +926,15 @@ class MainWindow_artifact_label(QMainWindow): PublicFunc.text_output(self.ui, f"{Constants.ARTIFACT_LABEL_JUMP_ARTIFACT}{str(self.pressed_number)}", Constants.TIPS_TYPE_INFO) def reset_axes(self): - self.ax0.clear() - self.ax1.clear() - self.ax0.grid(True) - self.ax0.xaxis.set_major_formatter(ConfigParams.FORMATTER) - self.ax0.tick_params(axis='x', colors=Constants.PLOT_COLOR_WHITE) - self.ax1.grid(True) - self.ax1.xaxis.set_major_formatter(ConfigParams.FORMATTER) + if self.ax0 is not None: + self.ax0.clear() + self.ax0.grid(True) + self.ax0.xaxis.set_major_formatter(ConfigParams.FORMATTER) + self.ax0.tick_params(axis='x', colors=Constants.PLOT_COLOR_WHITE) + if self.ax1 is not None: + self.ax1.clear() + self.ax1.grid(True) + self.ax1.xaxis.set_major_formatter(ConfigParams.FORMATTER) def on_xlim_change(self, event_ax): try: diff --git a/func/Module_label_check.py b/func/Module_label_check.py index 78ce4e9..b97a1fd 100644 --- a/func/Module_label_check.py +++ b/func/Module_label_check.py @@ -670,13 +670,15 @@ class MainWindow_label_check(QMainWindow): PublicFunc.text_output(self.ui, f"{Constants.LABEL_CHECK_JUMP_X_INDEX}{str(int(x))}", Constants.TIPS_TYPE_INFO) def reset_axes(self): - self.ax0.clear() - self.ax1.clear() - self.ax0.grid(True) - self.ax0.xaxis.set_major_formatter(ConfigParams.FORMATTER) - self.ax0.tick_params(axis='x', colors=Constants.PLOT_COLOR_WHITE) - self.ax1.grid(True) - self.ax1.xaxis.set_major_formatter(ConfigParams.FORMATTER) + if self.ax0 is not None: + self.ax0.clear() + self.ax0.grid(True) + self.ax0.xaxis.set_major_formatter(ConfigParams.FORMATTER) + self.ax0.tick_params(axis='x', colors=Constants.PLOT_COLOR_WHITE) + if self.ax1 is not None: + self.ax1.clear() + self.ax1.grid(True) + self.ax1.xaxis.set_major_formatter(ConfigParams.FORMATTER) def on_xlim_change(self, event_ax): try: diff --git a/func/Module_mainwindow.py b/func/Module_mainwindow.py index d89b0bc..b5d294a 100644 --- a/func/Module_mainwindow.py +++ b/func/Module_mainwindow.py @@ -16,6 +16,7 @@ from func.Module_label_check import MainWindow_label_check from func.Module_precisely_align import MainWindow_precisely_align from func.Module_cut_PSG import MainWindow_cut_PSG from func.Module_artifact_label import MainWindow_artifact_label +from func.Module_resp_quality_label import MainWindow_resp_quality_label from func.Module_SA_label import MainWindow_SA_label from func.utils.Constants import Constants, ConfigParams @@ -62,7 +63,7 @@ class MainWindow(QMainWindow, Ui_Signal_Label): self.precisely_align = None self.cut_PSG = None self.artifact_label = None - + self.resp_quality_label = None self.SA_label = None # 绑定槽函数 @@ -77,6 +78,7 @@ class MainWindow(QMainWindow, Ui_Signal_Label): self.ui.pushButton_precisely_align.clicked.connect(self.__slot_btn_precisely_align__) self.ui.pushButton_cut_PSG.clicked.connect(self.__slot_btn_cut_PSG__) self.ui.pushButton_artifact_label.clicked.connect(self.__slot_btn_artifact_label__) + self.ui.pushButton_resp_quality_label.clicked.connect(self.__slot_btn_resp_quality_label__) self.ui.pushButton_SA_label.clicked.connect(self.__slot_btn_SA_label__) @staticmethod @@ -222,6 +224,18 @@ class MainWindow(QMainWindow, Ui_Signal_Label): # 默认最大化显示而非固定分辨率 self.artifact_label.showMaximized() + def __slot_btn_resp_quality_label__(self): + self.resp_quality_label = MainWindow_resp_quality_label() + root_path = self.ui.plainTextEdit_root_path.toPlainText() + sampID = self.ui.comboBox_sampID.currentText() + if not self.check_root_path(): + return + if not self.check_sampID(): + return + self.resp_quality_label.show(root_path, int(sampID)) + # 默认最大化显示而非固定分辨率 + self.resp_quality_label.showMaximized() + def __slot_btn_SA_label__(self): self.SA_label = MainWindow_SA_label() root_path = self.ui.plainTextEdit_root_path.toPlainText() diff --git a/func/Module_preprocess.py b/func/Module_preprocess.py index cac14da..823aadd 100644 --- a/func/Module_preprocess.py +++ b/func/Module_preprocess.py @@ -385,9 +385,10 @@ class MainWindow_preprocess(QMainWindow): PublicFunc.finish_operation(self, ButtonState) def reset_axes(self): - self.ax0.clear() - self.ax0.grid(True) - self.ax0.xaxis.set_major_formatter(ConfigParams.FORMATTER) + if self.ax0 is not None: + self.ax0.clear() + self.ax0.grid(True) + self.ax0.xaxis.set_major_formatter(ConfigParams.FORMATTER) class Data: