为<BCG的J峰算法定位>、<ECG的R峰算法定位>、<人工纠正>增加了不做滤波的选项
This commit is contained in:
@ -201,6 +201,8 @@ class MainWindow_detect_Rpeak(QMainWindow):
|
||||
self.ui.doubleSpinBox_bandPassHigh.editingFinished.connect(self.__update_config__)
|
||||
self.ui.spinBox_peaksValue.editingFinished.connect(self.__update_config__)
|
||||
self.ui.comboBox_method.currentTextChanged.connect(self.__update_config__)
|
||||
self.ui.radioButton_skip_process.toggled.connect(self.__update_config__)
|
||||
self.ui.radioButton_bandpass_process.toggled.connect(self.__update_config__)
|
||||
|
||||
@overrides
|
||||
def closeEvent(self, event):
|
||||
@ -260,10 +262,15 @@ class MainWindow_detect_Rpeak(QMainWindow):
|
||||
return Result().failure(info=Constants.DRAW_FAILURE)
|
||||
|
||||
def __update_config__(self):
|
||||
sender = self.sender()
|
||||
Config["Filter"]["BandPassLow"] = self.ui.doubleSpinBox_bandPassLow.value()
|
||||
Config["Filter"]["BandPassHigh"] = self.ui.doubleSpinBox_bandPassHigh.value()
|
||||
Config["PeaksValue"] = self.ui.spinBox_peaksValue.value()
|
||||
Config["DetectMethod"] = self.ui.comboBox_method.currentText()
|
||||
if sender == self.ui.radioButton_skip_process:
|
||||
Config["Filter"]["Mode"] = "skip"
|
||||
elif sender == self.ui.radioButton_bandpass_process:
|
||||
Config["Filter"]["Mode"] = "bandpass"
|
||||
|
||||
def __slot_btn_input__(self):
|
||||
PublicFunc.__disableAllButton__(self, ButtonState)
|
||||
@ -446,20 +453,23 @@ class Data:
|
||||
Constants.FAILURE_REASON["Data_Not_Exist"])
|
||||
|
||||
try:
|
||||
if ((Config["Filter"]["BandPassLow"] >= Config["Filter"]["BandPassHigh"]) or
|
||||
(Config["Filter"]["BandPassLow"] <= 0) or (Config["Filter"]["BandPassHigh"] <= 0)):
|
||||
return Result().failure(
|
||||
info=Constants.PREPROCESS_FAILURE + Constants.FAILURE_REASON["Filter_Args_Not_Correct"])
|
||||
self.processed_data = preprocess(self.raw_data,
|
||||
Config["InputConfig"]["Freq"],
|
||||
Config["Filter"]["BandPassLow"],
|
||||
Config["Filter"]["BandPassHigh"])
|
||||
if Config["Filter"]["Mode"] == "skip":
|
||||
self.processed_data = self.raw_data
|
||||
return Result().success(info=Constants.PREPROCESS_NO_NEED)
|
||||
elif Config["Filter"]["Mode"] == "bandpass":
|
||||
if ((Config["Filter"]["BandPassLow"] >= Config["Filter"]["BandPassHigh"]) or
|
||||
(Config["Filter"]["BandPassLow"] <= 0) or (Config["Filter"]["BandPassHigh"] <= 0)):
|
||||
return Result().failure(
|
||||
info=Constants.PREPROCESS_FAILURE + Constants.FAILURE_REASON["Filter_Args_Not_Correct"])
|
||||
self.processed_data = preprocess(self.raw_data,
|
||||
Config["InputConfig"]["Freq"],
|
||||
Config["Filter"]["BandPassLow"],
|
||||
Config["Filter"]["BandPassHigh"])
|
||||
return Result().success(info=Constants.PREPROCESS_FINISHED)
|
||||
except Exception as e:
|
||||
return Result().failure(info=Constants.PREPROCESS_FAILURE +
|
||||
Constants.FAILURE_REASON["Preprocess_Exception"] + "\n" + format_exc())
|
||||
|
||||
return Result().success(info=Constants.PREPROCESS_FINISHED)
|
||||
|
||||
def predict_Rpeak(self):
|
||||
if self.processed_data is None:
|
||||
return Result().failure(info=Constants.DETECT_RPEAK_PREDICT_FAILURE +
|
||||
|
||||
Reference in New Issue
Block a user