Merge branch 'master' into cxh_dev
This commit is contained in:
@ -87,8 +87,12 @@ class SettingWindow(QMainWindow):
|
||||
self.root_path = root_path
|
||||
self.sampID = sampID
|
||||
|
||||
self.msgBox = QMessageBox()
|
||||
self.msgBox.setWindowTitle(Constants.MAINWINDOW_MSGBOX_TITLE)
|
||||
|
||||
self.config = None
|
||||
self.__read_config__()
|
||||
self.__examine_freq__()
|
||||
|
||||
self.ui.spinBox_input_freq_signal_OrgBCG.valueChanged.connect(self.__update_ui__)
|
||||
self.ui.spinBox_input_freq_signal_Tho.valueChanged.connect(self.__update_ui__)
|
||||
@ -237,6 +241,59 @@ class SettingWindow(QMainWindow):
|
||||
str(self.ui.spinBox_input_freq_signal_SpO2.value()) +
|
||||
Params.ENDSWITH_TXT))))
|
||||
|
||||
def __examine_freq__(self):
|
||||
if Path(Config["Path"]["Input_OrgBCG"]).is_file():
|
||||
Config["Path"]["Input_OrgBCG"] = str(Path(Config["Path"]["Input_OrgBCG"]).parent)
|
||||
if Path(Config["Path"]["Input_Tho"]).is_file():
|
||||
Config["Path"]["Input_Tho"] = str(Path(Config["Path"]["Input_Tho"]).parent)
|
||||
if Path(Config["Path"]["Input_Abd"]).is_file():
|
||||
Config["Path"]["Input_Abd"] = str(Path(Config["Path"]["Input_Abd"]).parent)
|
||||
if Path(Config["Path"]["Input_FlowT"]).is_file():
|
||||
Config["Path"]["Input_FlowT"] = str(Path(Config["Path"]["Input_FlowT"]).parent)
|
||||
if Path(Config["Path"]["Input_FlowP"]).is_file():
|
||||
Config["Path"]["Input_FlowP"] = str(Path(Config["Path"]["Input_FlowP"]).parent)
|
||||
if Path(Config["Path"]["Input_SpO2"]).is_file():
|
||||
Config["Path"]["Input_SpO2"] = str(Path(Config["Path"]["Input_SpO2"]).parent)
|
||||
|
||||
result = PublicFunc.examine_file(Config["Path"]["Input_OrgBCG"], Filename.ORGBCG_SYNC, Params.ENDSWITH_TXT)
|
||||
if result.status:
|
||||
Config["InputConfig"]["OrgBCGFreq"] = result.data["freq"]
|
||||
else:
|
||||
PublicFunc.msgbox_output(self, Filename.ORGBCG_SYNC + Constants.FAILURE_REASON["Get_Freq_Not_Correct"], Constants.MSGBOX_TYPE_ERROR)
|
||||
result = PublicFunc.examine_file(Config["Path"]["Input_Tho"], Filename.THO_SYNC, Params.ENDSWITH_TXT)
|
||||
if result.status:
|
||||
Config["InputConfig"]["ThoFreq"] = result.data["freq"]
|
||||
else:
|
||||
PublicFunc.msgbox_output(self, Filename.THO_SYNC + Constants.FAILURE_REASON["Get_Freq_Not_Correct"], Constants.MSGBOX_TYPE_ERROR)
|
||||
result = PublicFunc.examine_file(Config["Path"]["Input_Abd"], Filename.ABD_SYNC, Params.ENDSWITH_TXT)
|
||||
if result.status:
|
||||
Config["InputConfig"]["AbdFreq"] = result.data["freq"]
|
||||
else:
|
||||
PublicFunc.msgbox_output(self, Filename.ABD_SYNC + Constants.FAILURE_REASON["Get_Freq_Not_Correct"], Constants.MSGBOX_TYPE_ERROR)
|
||||
result = PublicFunc.examine_file(Config["Path"]["Input_FlowT"], Filename.FLOWT_SYNC, Params.ENDSWITH_TXT)
|
||||
if result.status:
|
||||
Config["InputConfig"]["FlowTFreq"] = result.data["freq"]
|
||||
else:
|
||||
PublicFunc.msgbox_output(self, Filename.FLOWT_SYNC + Constants.FAILURE_REASON["Get_Freq_Not_Correct"], Constants.MSGBOX_TYPE_ERROR)
|
||||
result = PublicFunc.examine_file(Config["Path"]["Input_FlowP"], Filename.FLOWP_SYNC, Params.ENDSWITH_TXT)
|
||||
if result.status:
|
||||
Config["InputConfig"]["FlowPFreq"] = result.data["freq"]
|
||||
else:
|
||||
PublicFunc.msgbox_output(self, Filename.FLOWP_SYNC + Constants.FAILURE_REASON["Get_Freq_Not_Correct"], Constants.MSGBOX_TYPE_ERROR)
|
||||
result = PublicFunc.examine_file(Config["Path"]["Input_SpO2"], Filename.SPO2_SYNC, Params.ENDSWITH_TXT)
|
||||
if result.status:
|
||||
Config["InputConfig"]["SpO2Freq"] = result.data["freq"]
|
||||
else:
|
||||
PublicFunc.msgbox_output(self, Filename.SPO2_SYNC + Constants.FAILURE_REASON["Get_Freq_Not_Correct"], Constants.MSGBOX_TYPE_ERROR)
|
||||
|
||||
# 数据回显
|
||||
self.ui.spinBox_input_freq_signal_OrgBCG.setValue(Config["InputConfig"]["OrgBCGFreq"])
|
||||
self.ui.spinBox_input_freq_signal_Tho.setValue(Config["InputConfig"]["ThoFreq"])
|
||||
self.ui.spinBox_input_freq_signal_Abd.setValue(Config["InputConfig"]["AbdFreq"])
|
||||
self.ui.spinBox_input_freq_signal_FlowT.setValue(Config["InputConfig"]["FlowTFreq"])
|
||||
self.ui.spinBox_input_freq_signal_FlowP.setValue(Config["InputConfig"]["FlowPFreq"])
|
||||
self.ui.spinBox_input_freq_signal_SpO2.setValue(Config["InputConfig"]["SpO2Freq"])
|
||||
|
||||
|
||||
class MainWindow_SA_label(QMainWindow):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user