From 986188cf9d0e95902a9f19e63fd8fbb1a6187d69 Mon Sep 17 00:00:00 2001 From: marques Date: Sat, 27 Dec 2025 14:02:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BC=82=E5=B8=B8=E5=A4=84?= =?UTF-8?q?=E7=90=86=EF=BC=8C=E6=96=B0=E5=A2=9Etraceback=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E4=BB=A5=E4=BE=BF=E4=BA=8E=E8=B0=83=E8=AF=95=EF=BC=8C=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=BD=8E=E9=80=9A=E6=BB=A4=E6=B3=A2=E5=99=A8=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- func/Module_SA_label_v2.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/func/Module_SA_label_v2.py b/func/Module_SA_label_v2.py index 76964ce..6984b80 100644 --- a/func/Module_SA_label_v2.py +++ b/func/Module_SA_label_v2.py @@ -348,6 +348,7 @@ class Data: PublicFunc.examine_artifact(self.Artifact) self.Artifact = self.Artifact.reshape(-1, 4) except Exception as e: + traceback.print_exc() return Result().failure(info=Constants.INPUT_FAILURE + Constants.FAILURE_REASON[ "Get_Artifact_Format_Exception"] + "\n" + format_exc()) @@ -449,6 +450,7 @@ class Data: self.event_index_revised[start:end] = one_data["Index"] except Exception as e: + traceback.print_exc() return Result().failure(info=Constants.INPUT_FAILURE + Constants.FAILURE_REASON[ "Label_Format_Exception"] + "\n" + format_exc()) @@ -470,7 +472,7 @@ class Data: 'lowpass', low_cut=20, order=3) self.lowPassResp = Butterworth_for_ECG_PreProcess(self.OrgBCG, orgbcg_freq, - 'lowpass', low_cut=0.7, order=3) + 'lowpass', low_cut=0.5, order=3) self.artifact_label = zeros(len(self.event_label_origin)) @@ -486,6 +488,7 @@ class Data: self.artifact_label[start:end] = artifact_type except Exception as e: + traceback.print_exc() return Result().failure(info=Constants.PREPROCESS_FAILURE + Constants.FAILURE_REASON["Preprocess_Exception"] + "\n" + format_exc()) @@ -539,6 +542,7 @@ class Data: del self.Stage except Exception as e: + traceback.print_exc() return Result().failure(info=Constants.RESAMPLE_FAILURE + Constants.FAILURE_REASON["Resample_Exception"] + "\n" + format_exc()) @@ -551,10 +555,13 @@ class Data: try: self.df_revised.to_csv(self.config["Path"]["SA_Label_Revised"], mode='w', index=None, encoding="gbk") except PermissionError as e: + traceback.print_exc() return Result().failure(info=Constants.SAVE_FAILURE + Constants.FAILURE_REASON["Save_Permission_Denied"]) except FileNotFoundError as e: + traceback.print_exc() return Result().failure(info=Constants.SAVE_FAILURE + Constants.FAILURE_REASON["Save_File_Not_Found"]) except Exception as e: + traceback.print_exc() return Result().failure(info=Constants.SAVE_FAILURE + Constants.FAILURE_REASON["Save_Exception"] + "\n" + format_exc()) @@ -619,6 +626,7 @@ class DataFrameModel(QAbstractTableModel): return QColor(0, 0, 0) except Exception as e: + traceback.print_exc() return None return None @@ -959,6 +967,7 @@ class MainWindow_SA_label(QMainWindow): self.set_tableview_column_width_by_ratio(self.ui.tableView_label_revised, [1, 3, 1, 2, 2]) except Exception as e: + traceback.print_exc() return Result().failure(info=Constants.UPDATE_FAILURE + Constants.FAILURE_REASON["Update_tableWidget_Exception"] + "\n" + format_exc()) @@ -1383,6 +1392,7 @@ class MainWindow_SA_label(QMainWindow): self.data.df_revised = self.data.df_revised[~mask].reset_index(drop=True) self.data.df_revised.to_csv(self.config["Path"]["SA_Label_Revised"], index=False, encoding="gbk") except Exception as e: + traceback.print_exc() return Result().failure(info=Constants.SAVE_FAILURE + Constants.FAILURE_REASON["Save_revised_csv_Exception"] + "\n" + format_exc()) return Result().success(info=Constants.SAVE_FINISHED) @@ -2022,6 +2032,7 @@ class MainWindow_SA_label(QMainWindow): self.ax0.set_xlim(self.check_start_end(self.config["WindowStartSecond"], 0)) self.canvas.draw() except Exception as e: + traceback.print_exc() return Result().failure(info=Constants.DRAW_FAILURE + "\n" + format_exc()) return Result().success(info=Constants.DRAW_FINISHED)