点击功能模块时,程序将自动检查并获取数据文件的采样率,若能获取成功,则将数值填入导入设置的采样率中。若获取失败,则弹窗提示并填入yaml配置文件中的预设采样率。
This commit is contained in:
@ -71,8 +71,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_orgBcg.valueChanged.connect(self.__update_ui__)
|
||||
self.ui.spinBox_input_freq_BCG.valueChanged.connect(self.__update_ui__)
|
||||
@ -152,6 +156,27 @@ class SettingWindow(QMainWindow):
|
||||
str(self.ui.spinBox_input_freq_BCG.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_BCG"]).is_file():
|
||||
Config["Path"]["Input_BCG"] = str(Path(Config["Path"]["Input_BCG"]).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_BCG"], Filename.BCG_SYNC, Params.ENDSWITH_TXT)
|
||||
if result.status:
|
||||
Config["InputConfig"]["BCGFreq"] = result.data["freq"]
|
||||
else:
|
||||
PublicFunc.msgbox_output(self, Filename.BCG_SYNC + Constants.FAILURE_REASON["Get_Freq_Not_Correct"], Constants.MSGBOX_TYPE_ERROR)
|
||||
|
||||
# 数据回显
|
||||
self.ui.spinBox_input_freq_orgBcg.setValue(Config["InputConfig"]["orgBcgFreq"])
|
||||
self.ui.spinBox_input_freq_BCG.setValue(Config["InputConfig"]["BCGFreq"])
|
||||
|
||||
|
||||
class MainWindow_artifact_label(QMainWindow):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user