更新UI布局,新增样本编号标签和添加zscore限幅选项,调整窗口大小和字体设置

This commit is contained in:
2025-12-15 21:39:34 +08:00
parent 8546ea730a
commit 20ad915760
3 changed files with 259 additions and 177 deletions

View File

@ -212,11 +212,13 @@ class SettingWindow(QMainWindow):
Config["InputConfig"]["orgBcgFreq"] = result.data["freq"]
else:
PublicFunc.msgbox_output(self, Filename.ORGBCG_RAW + Constants.FAILURE_REASON["Get_Freq_Not_Correct"], Constants.MSGBOX_TYPE_ERROR)
result = PublicFunc.examine_file(Config["Path"]["Input_Tho"], Filename.THO_RAW, Params.ENDSWITH_TXT)
if result.status:
Config["InputConfig"]["ThoFreq"] = result.data["freq"]
else:
PublicFunc.msgbox_output(self, Filename.THO_RAW + Constants.FAILURE_REASON["Get_Freq_Not_Correct"], Constants.MSGBOX_TYPE_ERROR)
result = PublicFunc.examine_file(Config["Path"]["Input_Abd"], Filename.ABD_RAW, Params.ENDSWITH_TXT)
if result.status:
Config["InputConfig"]["AbdFreq"] = result.data["freq"]
@ -272,6 +274,8 @@ class MainWindow_approximately_align(QMainWindow):
self.ui.verticalLayout_canvas.addWidget(self.canvas)
self.ui.verticalLayout_canvas.addWidget(self.figToolbar)
self.ui.label_sampno.setText(str(self.sampID))
PublicFunc.__resetAllButton__(self, ButtonState)
self.ui.pushButton_input.clicked.connect(self.__slot_btn_input__)
@ -446,13 +450,16 @@ class MainWindow_approximately_align(QMainWindow):
Config["RawSignal"] = self.ui.checkBox_RawSignal.isChecked()
Config["orgBcgConfig"].update({
"orgBcgDelBase": self.ui.checkBox_orgBcgDelBase.isChecked(),
"orgBcgZScore": self.ui.checkBox_orgBcgZScore.isChecked()
"orgBcgZScore": self.ui.checkBox_orgBcgZScore.isChecked(),
"orgBcgZScoreLimit": self.ui.checkBox_orgBcgZScoreLimit.isChecked(),
})
Config["PSGConfig"].update({
"PSGDelBase": self.ui.checkBox_PSGDelBase.isChecked(),
"PSGZScore": self.ui.checkBox_PSGZScore.isChecked()
"PSGZScore": self.ui.checkBox_PSGZScore.isChecked(),
"PSGZScoreLimit": self.ui.checkBox_PSGZScoreLimit.isChecked(),
})
if Config["RawSignal"]:
# 仅重采样
PublicFunc.progressbar_update(self, 1, 1, Constants.APPROXIMATELY_ONLY_ALIGN_RESAMPLING, 0)
@ -1116,6 +1123,7 @@ class Data:
int(Config["orgBcg_seconds"] * Config["ApplyFrequency"]))
self.processed_Tho = resample(self.raw_Tho, int(Config["PSG_seconds"] * Config["ApplyFrequency"]))
self.processed_Abd = resample(self.raw_Abd, int(Config["PSG_seconds"] * Config["ApplyFrequency"]))
self.processed_downsample_orgBcg = self.processed_orgBcg.copy()
self.processed_downsample_Tho = self.processed_Tho.copy()
self.processed_downsample_Abd = self.processed_Abd.copy()
@ -1211,9 +1219,20 @@ class Data:
if Config["PSGConfig"]["PSGZScore"]:
self.processed_Tho = (self.processed_Tho - mean(self.processed_Tho)) / std(self.processed_Tho)
self.processed_Abd = (self.processed_Abd - mean(self.processed_Abd)) / std(self.processed_Abd)
if Config["PSGConfig"]["PSGZScoreLimit"]:
limit = 6
self.processed_Tho[self.processed_Tho > limit] = limit
self.processed_Tho[self.processed_Tho < -limit] = -limit
self.processed_Abd[self.processed_Abd > limit] = limit
self.processed_Abd[self.processed_Abd < -limit] = -limit
if Config["orgBcgConfig"]["orgBcgZScore"]:
self.processed_orgBcg = (self.processed_orgBcg - mean(self.processed_orgBcg)) / std(
self.processed_orgBcg)
if Config["orgBcgConfig"]["orgBcgZScoreLimit"]:
limit = 6
self.processed_orgBcg[self.processed_orgBcg > limit] = limit
self.processed_orgBcg[self.processed_orgBcg < -limit] = -limit
except Exception as e:
return Result().failure(
info=Constants.APPROXIMATELY_STANDARDIZE_FAILURE + Constants.FAILURE_REASON[