1、完成了<数据精对齐>的所有代码
This commit is contained in:
@ -144,10 +144,6 @@ class MainWindow_detect_Jpeak(QMainWindow):
|
||||
self.gs = None
|
||||
self.ax0 = None
|
||||
|
||||
self.line_data = None
|
||||
self.point_peak = None
|
||||
self.line_interval = None
|
||||
|
||||
self.msgBox = QMessageBox()
|
||||
self.msgBox.setWindowTitle(Constants.MAINWINDOW_MSGBOX_TITLE)
|
||||
|
||||
@ -207,11 +203,7 @@ class MainWindow_detect_Jpeak(QMainWindow):
|
||||
QApplication.processEvents()
|
||||
|
||||
# 清空画框
|
||||
if self.line_data and self.point_peak:
|
||||
del self.line_data
|
||||
del self.point_peak
|
||||
del self.line_interval
|
||||
self.canvas.draw()
|
||||
self.ax0.clear()
|
||||
|
||||
# 释放资源
|
||||
del self.data
|
||||
@ -232,24 +224,18 @@ class MainWindow_detect_Jpeak(QMainWindow):
|
||||
def __plot__(self):
|
||||
|
||||
# 清空画框
|
||||
if self.line_data and self.point_peak and self.line_interval:
|
||||
try:
|
||||
self.line_data.remove()
|
||||
self.point_peak.remove()
|
||||
self.line_interval.remove()
|
||||
except ValueError:
|
||||
pass
|
||||
self.reset_axes()
|
||||
|
||||
sender = self.sender()
|
||||
|
||||
if sender == self.ui.pushButton_view:
|
||||
self.line_data, = self.ax0.plot(self.data.processed_data,
|
||||
self.ax0.plot(self.data.processed_data,
|
||||
color=Constants.PLOT_COLOR_BLUE,
|
||||
label=Constants.DETECT_JPEAK_PLOT_LABEL_BCG)
|
||||
self.point_peak, = self.ax0.plot(self.data.peak, self.data.processed_data[self.data.peak],
|
||||
self.ax0.plot(self.data.peak, self.data.processed_data[self.data.peak],
|
||||
'r.',
|
||||
label=Constants.DETECT_JPEAK_PLOT_LABEL_J_PEAKS)
|
||||
self.line_interval, = self.ax0.plot(self.data.interval,
|
||||
self.ax0.plot(self.data.interval,
|
||||
color=Constants.PLOT_COLOR_ORANGE,
|
||||
label=Constants.DETECT_JPEAK_PLOT_LABEL_INTERVAL)
|
||||
self.ax0.legend(loc=Constants.PLOT_UPPER_RIGHT)
|
||||
@ -278,13 +264,7 @@ class MainWindow_detect_Jpeak(QMainWindow):
|
||||
PublicFunc.__disableAllButton__(self, ButtonState)
|
||||
|
||||
# 清空画框
|
||||
if self.line_data and self.point_peak and self.line_interval:
|
||||
try:
|
||||
self.line_data.remove()
|
||||
self.point_peak.remove()
|
||||
self.line_interval.remove()
|
||||
except ValueError:
|
||||
pass
|
||||
self.reset_axes()
|
||||
self.canvas.draw()
|
||||
|
||||
# 清空模型列表
|
||||
@ -401,6 +381,12 @@ class MainWindow_detect_Jpeak(QMainWindow):
|
||||
|
||||
PublicFunc.finish_operation(self, ButtonState)
|
||||
|
||||
def reset_axes(self):
|
||||
|
||||
self.ax0.clear()
|
||||
self.ax0.grid(True)
|
||||
self.ax0.xaxis.set_major_formatter(ConfigParams.FORMATTER)
|
||||
|
||||
def update_ui_comboBox_model(self, model_list):
|
||||
|
||||
self.ui.comboBox_model.clear()
|
||||
@ -479,8 +465,7 @@ class Data:
|
||||
try:
|
||||
# DataFrame(self.processed_data.reshape(-1)).to_csv(self.file_path_save,
|
||||
# index=False,
|
||||
# header=False,
|
||||
# float_format='%.4f')
|
||||
# header=False)
|
||||
chunk.to_csv(self.file_path_save, mode='a', index=False, header=False)
|
||||
except Exception:
|
||||
return False, Constants.SAVING_FAILURE + Constants.DETECT_JPEAK_FAILURE_REASON["Save_Exception"]
|
||||
|
||||
@ -142,11 +142,6 @@ class MainWindow_detect_Rpeak(QMainWindow):
|
||||
self.ax0 = None
|
||||
self.ax1 = None
|
||||
|
||||
self.line_data = None
|
||||
self.point_peak = None
|
||||
self.line_interval = None
|
||||
self.point_RRIV = None
|
||||
|
||||
self.msgBox = QMessageBox()
|
||||
self.msgBox.setWindowTitle(Constants.MAINWINDOW_MSGBOX_TITLE)
|
||||
|
||||
@ -202,11 +197,8 @@ class MainWindow_detect_Rpeak(QMainWindow):
|
||||
QApplication.processEvents()
|
||||
|
||||
# 清空画框
|
||||
if self.line_data and self.point_peak:
|
||||
del self.line_data
|
||||
del self.point_peak
|
||||
del self.line_interval
|
||||
self.canvas.draw()
|
||||
self.ax0.clear()
|
||||
self.ax1.clear()
|
||||
|
||||
# 释放资源
|
||||
del self.data
|
||||
@ -226,28 +218,21 @@ class MainWindow_detect_Rpeak(QMainWindow):
|
||||
def __plot__(self):
|
||||
|
||||
# 清空画框
|
||||
if self.line_data and self.point_peak and self.line_interval and self.point_RRIV:
|
||||
try:
|
||||
self.line_data.remove()
|
||||
self.point_peak.remove()
|
||||
self.line_interval.remove()
|
||||
self.point_RRIV.remove()
|
||||
except ValueError:
|
||||
pass
|
||||
self.reset_axes()
|
||||
|
||||
sender = self.sender()
|
||||
|
||||
if sender == self.ui.pushButton_view:
|
||||
self.point_RRIV, = self.ax0.plot(self.data.peak[2:], self.data.RRIV,
|
||||
self.ax0.plot(self.data.peak[2:], self.data.RRIV,
|
||||
'r.',
|
||||
label=Constants.DETECT_RPEAK_PLOT_LABEL_RRIV)
|
||||
self.line_data, = self.ax1.plot(self.data.processed_data,
|
||||
self.ax1.plot(self.data.processed_data,
|
||||
color=Constants.PLOT_COLOR_BLUE,
|
||||
label=Constants.DETECT_RPEAK_PLOT_LABEL_ECG)
|
||||
self.point_peak, = self.ax1.plot(self.data.peak, self.data.processed_data[self.data.peak],
|
||||
self.ax1.plot(self.data.peak, self.data.processed_data[self.data.peak],
|
||||
'r*',
|
||||
label=Constants.DETECT_RPEAK_PLOT_LABEL_R_PEAKS)
|
||||
self.line_interval, = self.ax1.plot(self.data.interval,
|
||||
self.ax1.plot(self.data.interval,
|
||||
color=Constants.PLOT_COLOR_GREEN,
|
||||
label=Constants.DETECT_RPEAK_PLOT_LABEL_INTERVAL)
|
||||
self.ax0.legend(loc=Constants.PLOT_UPPER_RIGHT)
|
||||
@ -273,14 +258,7 @@ class MainWindow_detect_Rpeak(QMainWindow):
|
||||
PublicFunc.__disableAllButton__(self, ButtonState)
|
||||
|
||||
# 清空画框
|
||||
if self.line_data and self.point_peak and self.line_interval and self.point_RRIV:
|
||||
try:
|
||||
self.line_data.remove()
|
||||
self.point_peak.remove()
|
||||
self.line_interval.remove()
|
||||
self.point_RRIV.remove()
|
||||
except ValueError:
|
||||
pass
|
||||
self.reset_axes()
|
||||
self.canvas.draw()
|
||||
|
||||
# 清空方法列表
|
||||
@ -402,6 +380,16 @@ class MainWindow_detect_Rpeak(QMainWindow):
|
||||
|
||||
PublicFunc.finish_operation(self, ButtonState)
|
||||
|
||||
def reset_axes(self):
|
||||
|
||||
self.ax0.clear()
|
||||
self.ax1.clear()
|
||||
self.ax0.grid(True)
|
||||
self.ax0.xaxis.set_major_formatter(ConfigParams.FORMATTER)
|
||||
self.ax0.tick_params(axis='x', colors=Constants.PLOT_COLOR_WHITE)
|
||||
self.ax1.grid(True)
|
||||
self.ax1.xaxis.set_major_formatter(ConfigParams.FORMATTER)
|
||||
|
||||
def update_ui_comboBox_method(self, method_list):
|
||||
|
||||
self.ui.comboBox_method.clear()
|
||||
@ -472,8 +460,7 @@ class Data:
|
||||
try:
|
||||
# DataFrame(self.processed_data.reshape(-1)).to_csv(self.file_path_save,
|
||||
# index=False,
|
||||
# header=False,
|
||||
# float_format='%.4f')
|
||||
# header=False)
|
||||
chunk.to_csv(self.file_path_save, mode='a', index=False, header=False)
|
||||
except Exception:
|
||||
return False, Constants.SAVING_FAILURE + Constants.DETECT_RPEAK_FAILURE_REASON["Save_Exception"]
|
||||
|
||||
@ -213,8 +213,6 @@ class MainWindow_label_check(QMainWindow):
|
||||
self.is_left_button_pressed = None
|
||||
self.is_right_button_pressed = None
|
||||
|
||||
self.line_processed_data_1 = None
|
||||
self.line_processed_data_2 = None
|
||||
self.point_peak_original = None
|
||||
self.point_peak_corrected = None
|
||||
self.annotation_tableWidget = None
|
||||
@ -250,6 +248,7 @@ class MainWindow_label_check(QMainWindow):
|
||||
self.fig = plt.figure(figsize=(12, 9), dpi=100)
|
||||
self.canvas = FigureCanvasQTAgg(self.fig)
|
||||
self.figToolbar = CustomNavigationToolbar(self.canvas, self)
|
||||
self.figToolbar.action_Label_Multiple.setEnabled(False)
|
||||
for action in self.figToolbar._actions.values():
|
||||
action.setEnabled(False)
|
||||
for action in self.figToolbar.actions():
|
||||
@ -300,7 +299,6 @@ class MainWindow_label_check(QMainWindow):
|
||||
self.ui.tableWidget_peak_corrected.cellDoubleClicked.connect(
|
||||
self.__slot_tableWidget_on_cell_double_clicked__)
|
||||
|
||||
|
||||
self.ui.doubleSpinBox_findpeaks_min_interval.editingFinished.connect(self.__update_config__)
|
||||
self.ui.doubleSpinBox_findpeaks_min_height.editingFinished.connect(self.__update_config__)
|
||||
self.ui.spinBox_moveLength.editingFinished.connect(self.__update_config__)
|
||||
@ -316,12 +314,11 @@ class MainWindow_label_check(QMainWindow):
|
||||
QApplication.processEvents()
|
||||
|
||||
# 清空画框
|
||||
if self.line_processed_data_1 and self.line_processed_data_2 and self.point_peak_original and self.point_peak_corrected:
|
||||
del self.line_processed_data_1
|
||||
del self.line_processed_data_2
|
||||
del self.point_peak_original
|
||||
del self.point_peak_corrected
|
||||
self.canvas.draw()
|
||||
del self.point_peak_original
|
||||
del self.point_peak_corrected
|
||||
del self.annotation_tableWidget
|
||||
self.ax0.clear()
|
||||
self.ax1.clear()
|
||||
|
||||
# 释放资源
|
||||
del self.data
|
||||
@ -340,25 +337,28 @@ class MainWindow_label_check(QMainWindow):
|
||||
def __plot__(self):
|
||||
|
||||
# 清空画框
|
||||
if self.line_processed_data_1 and self.line_processed_data_2 and self.point_peak_original and self.point_peak_corrected:
|
||||
try:
|
||||
self.line_processed_data_1.remove()
|
||||
self.line_processed_data_2.remove()
|
||||
self.point_peak_original.remove()
|
||||
self.point_peak_corrected.remove()
|
||||
except ValueError:
|
||||
pass
|
||||
if self.point_peak_original is not None:
|
||||
self.point_peak_original.remove()
|
||||
self.point_peak_original = None
|
||||
if self.point_peak_corrected is not None:
|
||||
self.point_peak_corrected.remove()
|
||||
self.point_peak_corrected = None
|
||||
if self.annotation_tableWidget is not None:
|
||||
self.annotation_tableWidget.remove()
|
||||
self.annotation_tableWidget = None
|
||||
|
||||
self.reset_axes()
|
||||
|
||||
sender = self.sender()
|
||||
|
||||
if sender == self.ui.pushButton_input:
|
||||
self.ui.spinBox_data_length.setValue(len(self.data.processed_data))
|
||||
self.line_processed_data_1, = self.ax0.plot(self.data.processed_data,
|
||||
label=Constants.LABEL_CHECK_PLOT_LABEL_SIGNAL,
|
||||
color=Constants.PLOT_COLOR_BLUE)
|
||||
self.line_processed_data_2, = self.ax1.plot(self.data.processed_data,
|
||||
label=Constants.LABEL_CHECK_PLOT_LABEL_SIGNAL,
|
||||
color=Constants.PLOT_COLOR_BLUE)
|
||||
self.ax0.plot(self.data.processed_data,
|
||||
label=Constants.LABEL_CHECK_PLOT_LABEL_SIGNAL,
|
||||
color=Constants.PLOT_COLOR_BLUE)
|
||||
self.ax1.plot(self.data.processed_data,
|
||||
label=Constants.LABEL_CHECK_PLOT_LABEL_SIGNAL,
|
||||
color=Constants.PLOT_COLOR_BLUE)
|
||||
self.ax0.legend(loc=Constants.PLOT_UPPER_RIGHT)
|
||||
self.ax1.legend(loc=Constants.PLOT_UPPER_RIGHT)
|
||||
status = True
|
||||
@ -382,7 +382,7 @@ class MainWindow_label_check(QMainWindow):
|
||||
self.ax1.callbacks.connect('xlim_changed', lambda ax: self.on_xlim_change(ax))
|
||||
self.ax0.legend(loc=Constants.PLOT_UPPER_RIGHT)
|
||||
self.ax1.legend(loc=Constants.PLOT_UPPER_RIGHT)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
return False, Constants.DRAWING_FAILURE
|
||||
|
||||
self.canvas.draw()
|
||||
@ -431,14 +431,17 @@ class MainWindow_label_check(QMainWindow):
|
||||
PublicFunc.__disableAllButton__(self, ButtonState)
|
||||
|
||||
# 清空画框
|
||||
if self.line_processed_data_1 and self.line_processed_data_2 and self.point_peak_original and self.point_peak_corrected:
|
||||
try:
|
||||
self.line_processed_data_1.remove()
|
||||
self.line_processed_data_2.remove()
|
||||
self.point_peak_original.remove()
|
||||
self.point_peak_corrected.remove()
|
||||
except ValueError:
|
||||
pass
|
||||
if self.point_peak_original is not None:
|
||||
self.point_peak_original.remove()
|
||||
self.point_peak_original = None
|
||||
if self.point_peak_corrected is not None:
|
||||
self.point_peak_corrected.remove()
|
||||
self.point_peak_corrected = None
|
||||
if self.annotation_tableWidget is not None:
|
||||
self.annotation_tableWidget.remove()
|
||||
self.annotation_tableWidget = None
|
||||
|
||||
self.reset_axes()
|
||||
self.canvas.draw()
|
||||
|
||||
self.data = Data()
|
||||
@ -653,14 +656,24 @@ class MainWindow_label_check(QMainWindow):
|
||||
self.canvas.draw()
|
||||
PublicFunc.text_output(self.ui, f"{Constants.LABEL_CHECK_JUMP_X_INDEX}{str(int(x))}", Constants.TIPS_TYPE_INFO)
|
||||
|
||||
def reset_axes(self):
|
||||
|
||||
self.ax0.clear()
|
||||
self.ax1.clear()
|
||||
self.ax0.grid(True)
|
||||
self.ax0.xaxis.set_major_formatter(ConfigParams.FORMATTER)
|
||||
self.ax0.tick_params(axis='x', colors=Constants.PLOT_COLOR_WHITE)
|
||||
self.ax1.grid(True)
|
||||
self.ax1.xaxis.set_major_formatter(ConfigParams.FORMATTER)
|
||||
|
||||
def on_xlim_change(self, event_ax):
|
||||
|
||||
try:
|
||||
if self.annotation_tableWidget:
|
||||
if self.annotation_tableWidget is not None:
|
||||
self.annotation_tableWidget.remove()
|
||||
self.annotation_tableWidget = None
|
||||
except AttributeError:
|
||||
pass
|
||||
self.annotation_tableWidget = None
|
||||
|
||||
def autoplay_move_xlim(self):
|
||||
|
||||
@ -967,7 +980,6 @@ class Data:
|
||||
|
||||
class CustomNavigationToolbar(NavigationToolbar2QT):
|
||||
|
||||
|
||||
def __init__(self, canvas, parent):
|
||||
super().__init__(canvas, parent)
|
||||
# 初始化画框工具栏
|
||||
@ -997,24 +1009,20 @@ class CustomNavigationToolbar(NavigationToolbar2QT):
|
||||
self.rect_patch_ax0 = None # 用于绘制矩形的patch
|
||||
self.rect_patch_ax1 = None # 用于绘制矩形的patch
|
||||
|
||||
|
||||
def home(self, *args):
|
||||
|
||||
pass
|
||||
|
||||
|
||||
def zoom(self, *args):
|
||||
|
||||
super().zoom(*args)
|
||||
self.deactivate_figToorbar_changeLabel_mode()
|
||||
|
||||
|
||||
def pan(self, *args):
|
||||
|
||||
super().pan(*args)
|
||||
self.deactivate_figToorbar_changeLabel_mode()
|
||||
|
||||
|
||||
def deactivate_figToorbar_changeLabel_mode(self):
|
||||
|
||||
if self.action_Label_Multiple.isChecked():
|
||||
|
||||
@ -4,7 +4,6 @@ from PySide6.QtWidgets import QMainWindow, QMessageBox, QFileDialog
|
||||
from matplotlib import use
|
||||
from yaml import dump, load, FullLoader
|
||||
|
||||
|
||||
from func.utils.PublicFunc import PublicFunc
|
||||
from ui.MainWindow.MainWindow_menu import Ui_Signal_Label
|
||||
|
||||
@ -12,6 +11,7 @@ from func.Module_preprocess import MainWindow_preprocess
|
||||
from func.Module_detect_Jpeak import MainWindow_detect_Jpeak
|
||||
from func.Module_detect_Rpeak import MainWindow_detect_Rpeak
|
||||
from func.Module_label_check import MainWindow_label_check
|
||||
from func.Module_precisely_align import MainWindow_precisely_align
|
||||
|
||||
from func.utils.Constants import Constants, ConfigParams
|
||||
|
||||
@ -44,6 +44,7 @@ class MainWindow(QMainWindow, Ui_Signal_Label):
|
||||
self.detect_Jpeak = None
|
||||
self.detect_Rpeak = None
|
||||
self.label_check = None
|
||||
self.precisely_align = None
|
||||
|
||||
# 绑定槽函数
|
||||
self.ui.pushButton_open.clicked.connect(self.__slot_btn_open__)
|
||||
@ -53,6 +54,7 @@ class MainWindow(QMainWindow, Ui_Signal_Label):
|
||||
self.ui.pushButton_detect_Rpeak.clicked.connect(self.__slot_btn_detect_Rpeak__)
|
||||
self.ui.pushButton_label_check_BCG.clicked.connect(self.__slot_btn_label_check__)
|
||||
self.ui.pushButton_label_check_ECG.clicked.connect(self.__slot_btn_label_check__)
|
||||
self.ui.pushButton_precisely_align.clicked.connect(self.__slot_btn_precisely_align__)
|
||||
|
||||
@staticmethod
|
||||
def __read_config__():
|
||||
@ -98,7 +100,7 @@ class MainWindow(QMainWindow, Ui_Signal_Label):
|
||||
elif sender == self.ui.pushButton_preprocess_ECG:
|
||||
mode = "ECG"
|
||||
else:
|
||||
mode = "ModeNotExist"
|
||||
raise ValueError("模式不存在")
|
||||
self.preprocess.show(mode, root_path, sampID)
|
||||
|
||||
def __slot_btn_detect_Jpeak__(self):
|
||||
@ -127,9 +129,16 @@ class MainWindow(QMainWindow, Ui_Signal_Label):
|
||||
elif sender == self.ui.pushButton_label_check_ECG:
|
||||
mode = "ECG"
|
||||
else:
|
||||
mode = "ModeNotExist"
|
||||
raise ValueError("模式不存在")
|
||||
self.label_check.show(mode, root_path, sampID)
|
||||
|
||||
def __slot_btn_precisely_align__(self):
|
||||
|
||||
self.precisely_align = MainWindow_precisely_align()
|
||||
root_path = self.ui.plainTextEdit_root_path.toPlainText()
|
||||
sampID = int(self.ui.comboBox_sampID.currentText())
|
||||
self.precisely_align.show(root_path, sampID)
|
||||
|
||||
def seek_sampID(self, path):
|
||||
|
||||
if not Path(path).exists():
|
||||
|
||||
1684
func/Module_precisely_align.py
Normal file
1684
func/Module_precisely_align.py
Normal file
File diff suppressed because it is too large
Load Diff
@ -192,9 +192,6 @@ class MainWindow_preprocess(QMainWindow):
|
||||
self.gs = None
|
||||
self.ax0 = None
|
||||
|
||||
self.line_raw_data = None
|
||||
self.line_processed_data = None
|
||||
|
||||
self.msgBox = QMessageBox()
|
||||
self.msgBox.setWindowTitle(Constants.MAINWINDOW_MSGBOX_TITLE)
|
||||
|
||||
@ -254,10 +251,7 @@ class MainWindow_preprocess(QMainWindow):
|
||||
QApplication.processEvents()
|
||||
|
||||
# 清空画框
|
||||
if self.line_raw_data and self.line_processed_data:
|
||||
del self.line_raw_data
|
||||
del self.line_processed_data
|
||||
self.canvas.draw()
|
||||
self.ax0.clear()
|
||||
|
||||
# 释放资源
|
||||
del self.data
|
||||
@ -277,22 +271,17 @@ class MainWindow_preprocess(QMainWindow):
|
||||
def __plot__(self):
|
||||
|
||||
# 清空画框
|
||||
if self.line_raw_data and self.line_processed_data:
|
||||
try:
|
||||
self.line_raw_data.remove()
|
||||
self.line_processed_data.remove()
|
||||
except ValueError:
|
||||
pass
|
||||
self.reset_axes()
|
||||
|
||||
sender = self.sender()
|
||||
|
||||
if sender == self.ui.pushButton_view:
|
||||
self.line_raw_data, = self.ax0.plot(self.data.raw_data,
|
||||
color=Constants.PLOT_COLOR_RED,
|
||||
label=Constants.PREPROCESS_PLOT_LABEL_ORIGINAL_DATA)
|
||||
self.line_processed_data, = self.ax0.plot(self.data.processed_data + Constants.PREPROCESS_OUTPUT_INPUT_AMP_OFFSET,
|
||||
color=Constants.PLOT_COLOR_BLUE,
|
||||
label=Constants.PREPROCESS_PLOT_LABEL_PROCESSED_DATA)
|
||||
self.ax0.plot(self.data.raw_data,
|
||||
color=Constants.PLOT_COLOR_RED,
|
||||
label=Constants.PREPROCESS_PLOT_LABEL_ORIGINAL_DATA)
|
||||
self.ax0.plot(self.data.processed_data + Constants.PREPROCESS_OUTPUT_INPUT_AMP_OFFSET,
|
||||
color=Constants.PLOT_COLOR_BLUE,
|
||||
label=Constants.PREPROCESS_PLOT_LABEL_PROCESSED_DATA)
|
||||
self.ax0.legend(loc=Constants.PLOT_UPPER_RIGHT)
|
||||
status = True
|
||||
info = Constants.DRAWING_FINISHED
|
||||
@ -321,12 +310,8 @@ class MainWindow_preprocess(QMainWindow):
|
||||
PublicFunc.__disableAllButton__(self, ButtonState)
|
||||
|
||||
# 清空画框
|
||||
if self.line_raw_data and self.line_processed_data:
|
||||
try:
|
||||
self.line_raw_data.remove()
|
||||
self.line_processed_data.remove()
|
||||
except ValueError:
|
||||
pass
|
||||
self.reset_axes()
|
||||
|
||||
self.canvas.draw()
|
||||
|
||||
self.data = Data()
|
||||
@ -408,6 +393,12 @@ class MainWindow_preprocess(QMainWindow):
|
||||
|
||||
PublicFunc.finish_operation(self, ButtonState)
|
||||
|
||||
def reset_axes(self):
|
||||
|
||||
self.ax0.clear()
|
||||
self.ax0.grid(True)
|
||||
self.ax0.xaxis.set_major_formatter(ConfigParams.FORMATTER)
|
||||
|
||||
|
||||
class Data:
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@ class ConfigParams:
|
||||
FORMATTER = FuncFormatter(lambda x, p: f"{x:.0f}")
|
||||
ACTION_PAN_SHORTCUT_KEY: str = "X"
|
||||
ACTION_ZOOM_SHORTCUT_KEY: str = "C"
|
||||
FONT: str = "Microsoft YaHei UI"
|
||||
|
||||
# 数据粗同步
|
||||
|
||||
@ -127,22 +128,28 @@ class ConfigParams:
|
||||
LABEL_CHECK_LABEL_TRANSPARENCY: float = 0.2
|
||||
LABEL_CHECK_ACTION_LABEL_MULTIPLE_SHORTCUT_KEY: str = "Z"
|
||||
|
||||
# 数据精同步
|
||||
PRECISELY_ALIGN_CONFIG_FILE_PATH: str = "./config/Config_precisely_align.yaml"
|
||||
PRECISELY_ALIGN_CONFIG_NEW_CONTENT = {
|
||||
"InputConfig": {
|
||||
"ECGFreq": 1000
|
||||
}
|
||||
}
|
||||
PRECISELY_ALIGN_INPUT_BCG_FILENAME: str = "DSbcg_sig_"
|
||||
PRECISELY_ALIGN_INPUT_JPEAK_FILENAME: str = "JPeak_revise_corrected"
|
||||
PRECISELY_ALIGN_SAVE_BCG_FILENAME: str = "Align_info"
|
||||
PRECISELY_ALIGN_INPUT_ECG_FILENAME: str = "ECG_filter_"
|
||||
PRECISELY_ALIGN_INPUT_RPEAK_FILENAME: str = "final_Rpeak_corrected"
|
||||
PRECISELY_ALIGN_SAVE_ECG_FILENAME: str = "Align_info"
|
||||
PRECISELY_ALIGN_ACTION_GET_RANGE_SHORTCUT_KEY: str = "Z"
|
||||
|
||||
# 体动标注
|
||||
|
||||
# TODO:弃用
|
||||
|
||||
# 通用
|
||||
# 目前用到这个编码的地方:
|
||||
# <BCG的质量评估打标>里的保存和读取csv文件的地方(注意的是,读取原始数据时依然使用UTF-8)
|
||||
|
||||
VALIDATOR_INTEGER = QIntValidator(-2**31, 2**31 - 1)
|
||||
VALIDATOR_DOUBLE = QDoubleValidator(-1e100, 1e100, 10)
|
||||
|
||||
FONT: str = "Microsoft YaHei UI"
|
||||
|
||||
# 菜单界面
|
||||
MATPLOTLIB_PLOT_PRECISION_PARAM: int = 10000
|
||||
|
||||
# 数据粗同步
|
||||
APPROXIMATELY_ALIGN_INPUT_ORGBCG_FILENAME: str = "orgBcg_Raw_"
|
||||
APPROXIMATELY_ALIGN_INPUT_PSG_FILENAME: str = "A"
|
||||
|
||||
@ -11,6 +11,9 @@ class Constants:
|
||||
MSGBOX_TYPE_ERROR: str = "Error"
|
||||
MSGBOX_TYPE_QUESTION: str = "Question"
|
||||
|
||||
MAINWINDOW_ROOT_PATH_NOT_EXIST: str = "根目录路径输入错误"
|
||||
MAINWINDOW_MSGBOX_TITLE: str = "消息"
|
||||
|
||||
INPUTTING_DATA: str = "正在导入数据"
|
||||
INPUT_FINISHED: str = "导入完成"
|
||||
INPUT_FAILURE: str = "导入失败"
|
||||
@ -193,24 +196,53 @@ class Constants:
|
||||
LABEL_CHECK_NO_POINT_IN_THE_INTERVAL: str = "所选区间内无新增或删除点"
|
||||
LABEL_CHECK_ACTION_LABEL_MULTIPLE_NAME: str = f"批量更改标签({ConfigParams.LABEL_CHECK_ACTION_LABEL_MULTIPLE_SHORTCUT_KEY})"
|
||||
|
||||
# 数据精同步
|
||||
PRECISELY_ALIGN_PROCESSING_DATA: str = "正在处理数据"
|
||||
PRECISELY_ALIGN_PROCESS_FINISHED: str = "处理完成"
|
||||
PRECISELY_ALIGN_PROCESS_FAILURE: str = "处理失败"
|
||||
|
||||
PRECISELY_ALIGN_CALCULATING_CORRELATION_FRONT: str = "正在计算前段相关性"
|
||||
PRECISELY_ALIGN_CALCULATE_FINISHED_FRONT: str = "计算前段相关性完成"
|
||||
PRECISELY_ALIGN_CALCULATE_FAILURE_FRONT: str = "计算前段相关性失败"
|
||||
PRECISELY_ALIGN_CALCULATING_CORRELATION_BACK: str = "正在计算后段相关性"
|
||||
PRECISELY_ALIGN_CALCULATE_FINISHED_BACK: str = "计算后段相关性完成"
|
||||
PRECISELY_ALIGN_CALCULATE_FAILURE_BACK: str = "计算后段相关性失败"
|
||||
|
||||
PRECISELY_ALIGN_ALIGNING_CORRELATION: str = "正在处理相关对齐"
|
||||
PRECISELY_ALIGN_ALIGN_CORRELATION_FINISHED: str = "处理相关对齐完成"
|
||||
PRECISELY_ALIGN_ALIGN_CORRELATION_FAILURE: str = "处理相关对齐失败"
|
||||
|
||||
PRECISELY_ALIGN_POSTPROCESSING_VIEW: str = "正在数据后处理"
|
||||
PRECISELY_ALIGN_POSTPROCESS_VIEW_FINISHED: str = "数据后处理完成"
|
||||
PRECISELY_ALIGN_POSTPROCESS_VIEW_FAILURE: str = "数据后处理失败"
|
||||
|
||||
PRECISELY_ALIGN_FAILURE_REASON = {
|
||||
"Data_Path_Not_Exist": "(数据路径不存在)",
|
||||
"Read_Data_Exception": "(读取数据异常)",
|
||||
"Data_Not_Exist": "(数据不存在)",
|
||||
"Process_Data_Exception": "(处理数据异常)",
|
||||
"Calculate_Correlation_Value_Equal": "(计算相关性参数相同)",
|
||||
"Calculate_Correlation_JJIVRange_too_Large": "(计算相关性JJIV范围大于RRIV范围)",
|
||||
"Calculate_Correlation_Exception": "(计算相关性异常)",
|
||||
"Correlation_Align_Exception": "(处理相关对齐异常)",
|
||||
"PostProcess_Align_Exception": "(数据后处理异常)",
|
||||
"Save_Exception": "(保存异常)"
|
||||
}
|
||||
|
||||
PRECISELY_ALIGN_PLOT_LABEL_JJIV: str = "JJIV"
|
||||
PRECISELY_ALIGN_PLOT_LABEL_RRIV: str = "RRIV"
|
||||
PRECISELY_ALIGN_PLOT_LABEL_CORRE_RRIV_JJIV: str = "corre(RRIV, JJIV)"
|
||||
PRECISELY_ALIGN_PLOT_LABEL_ECG: str = "ECG"
|
||||
PRECISELY_ALIGN_PLOT_LABEL_BCG: str = "BCG"
|
||||
PRECISELY_ALIGN_PLOT_LABEL_RPEAK: str = "Rpeak_ECG"
|
||||
PRECISELY_ALIGN_PLOT_LABEL_JPEAK: str = "Jpeak_BCG"
|
||||
PRECISELY_ALIGN_PLOT_LABEL_SELECTED_POINT: str = "Selected Point"
|
||||
PRECISELY_ALIGN_NO_POINT_IN_THE_INTERVAL: str = "所选区间内无有效点"
|
||||
PRECISELY_ALIGN_ACTION_GET_RANGE_NAME: str = f"设置范围({ConfigParams.PRECISELY_ALIGN_ACTION_GET_RANGE_SHORTCUT_KEY})"
|
||||
|
||||
# 体动标注
|
||||
|
||||
# TODO:弃用
|
||||
|
||||
# 通用
|
||||
|
||||
FOLDER_DIR_NOT_EXIST_THEN_CREATE: str = "检测到保存路径所指向的文件夹不存在,已创建相应文件夹"
|
||||
|
||||
# 菜单界面
|
||||
MAINWINDOW_ROOT_PATH_NOT_EXIST: str = "根目录路径输入错误"
|
||||
MAINWINDOW_MSGBOX_TITLE: str = "消息"
|
||||
MAINWINDOW_DIALOG_TITLE: str = "确认数据的采样率"
|
||||
MAINWINDOW_BACK_TO_MENU: str = "返回主菜单"
|
||||
MAINWINDOW_QUESTION_BACK_TO_MENU: str = "确定要返回主菜单吗"
|
||||
|
||||
# 数据粗同步
|
||||
APPROXIMATELY_ALIGN_FILES_NOT_FOUND: str = f"无法找到{ConfigParams.APPROXIMATELY_ALIGN_INPUT_ORGBCG_FILENAME}{ConfigParams.ENDSWITH_TXT}或{ConfigParams.APPROXIMATELY_ALIGN_INPUT_PSG_FILENAME}{ConfigParams.ENDSWITH_EDF},无法执行<数据粗同步>"
|
||||
APPROXIMATELY_ALIGN_FILES_FOUND: str = f"找到{ConfigParams.APPROXIMATELY_ALIGN_INPUT_ORGBCG_FILENAME}{ConfigParams.ENDSWITH_TXT}和{ConfigParams.APPROXIMATELY_ALIGN_INPUT_PSG_FILENAME}{ConfigParams.ENDSWITH_EDF}"
|
||||
|
||||
Reference in New Issue
Block a user