diff --git a/func/Module_detect_Jpeak.py b/func/Module_detect_Jpeak.py index a264d61..76a13b4 100644 --- a/func/Module_detect_Jpeak.py +++ b/func/Module_detect_Jpeak.py @@ -59,7 +59,6 @@ class SettingWindow(QMainWindow): def __read_config__(self): - if not Path(ConfigParams.DETECT_JPEAK_CONFIG_FILE_PATH).exists(): with open(ConfigParams.DETECT_JPEAK_CONFIG_FILE_PATH, "w") as f: dump(ConfigParams.DETECT_JPEAK_CONFIG_NEW_CONTENT, f) @@ -246,13 +245,13 @@ class MainWindow_detect_Jpeak(QMainWindow): if sender == self.ui.pushButton_view: self.line_data, = self.ax0.plot(self.data.processed_data, color=Constants.PLOT_COLOR_BLUE, - label=Constants.DETECT_J_PEAK_PLOT_LABEL_BCG) + label=Constants.DETECT_JPEAK_PLOT_LABEL_BCG) self.point_peak, = self.ax0.plot(self.data.peak, self.data.processed_data[self.data.peak], 'r.', - label=Constants.DETECT_J_PEAK_PLOT_LABEL_J_PEAKS) + label=Constants.DETECT_JPEAK_PLOT_LABEL_J_PEAKS) self.line_interval, = self.ax0.plot(self.data.interval, color=Constants.PLOT_COLOR_ORANGE, - label=Constants.DETECT_J_PEAK_PLOT_LABEL_INTERVAL) + label=Constants.DETECT_JPEAK_PLOT_LABEL_INTERVAL) self.ax0.legend(loc=Constants.PLOT_UPPER_RIGHT) status = True info = Constants.DRAWING_FINISHED @@ -293,6 +292,41 @@ class MainWindow_detect_Jpeak(QMainWindow): if widget.objectName() in ButtonState["Default"].keys(): widget.setEnabled(ButtonState["Default"][widget.objectName()]) + def __update_config__(self): + + Config["Filter"]["BandPassLow"] = self.ui.doubleSpinBox_bandPassLow.value() + Config["Filter"]["BandPassHigh"] = self.ui.doubleSpinBox_bandPassHigh.value() + Config["PeaksValue"] = self.ui.spinBox_peaksValue.value() + Config["AmpValue"] = self.ui.doubleSpinBox_ampValue.value() + Config["IntervalLow"] = self.ui.spinBox_intervalLow.value() + Config["IntervalHigh"] = self.ui.spinBox_intervalHigh.value() + Config["UseCPU"] = self.ui.checkBox_useCPU.isChecked() + Config["DetectMethod"] = self.ui.comboBox_model.currentText() + + def finish_operation(self): + + self.statusbar_show_msg(PublicFunc.format_status_msg(Constants.OPERATION_FINISHED)) + self.progressbar.setValue(100) + QApplication.processEvents() + + self.__enableAllButton__() + + def add_progressbar(self): + + self.progressbar = QProgressBar() + self.progressbar.setRange(0, 100) + self.progressbar.setValue(0) + self.progressbar.setStyleSheet(Constants.PROGRESSBAR_STYLE) + self.ui.statusbar.addPermanentWidget(self.progressbar) + + def statusbar_show_msg(self, msg): + + self.ui.statusbar.showMessage(msg) + + def statusbar_clear_msg(self): + + self.ui.statusbar.clearMessage() + def __slot_btn_input__(self): self.__disableAllButton__() @@ -310,7 +344,7 @@ class MainWindow_detect_Jpeak(QMainWindow): # 清空模型列表 self.ui.comboBox_model.clear() - self.statusbar_show_msg(PublicFunc.format_status_msg(Constants.LOADING_MODEL)) + self.statusbar_show_msg(PublicFunc.format_status_msg("(1/2)" + Constants.DETECT_JPEAK_LOADING_MODEL)) self.progressbar.setValue(0) QApplication.processEvents() @@ -318,15 +352,15 @@ class MainWindow_detect_Jpeak(QMainWindow): self.model = Model() status, info = self.model.seek_model() if not status: - PublicFunc.text_output(self.ui, info, Constants.TIPS_TYPE_ERROR) + PublicFunc.text_output(self.ui, "(1/2)" + info, Constants.TIPS_TYPE_ERROR) PublicFunc.msgbox_output(self, info, Constants.MSGBOX_TYPE_ERROR) self.finish_operation() return else: - PublicFunc.text_output(self.ui, info, Constants.TIPS_TYPE_INFO) + PublicFunc.text_output(self.ui, "(1/2)" + info, Constants.TIPS_TYPE_INFO) self.update_ui_comboBox_model(self.model.model_list) - self.statusbar_show_msg(PublicFunc.format_status_msg(Constants.INPUTTING_DATA)) + self.statusbar_show_msg(PublicFunc.format_status_msg("(2/2)" + Constants.INPUTTING_DATA)) self.progressbar.setValue(10) QApplication.processEvents() @@ -334,12 +368,12 @@ class MainWindow_detect_Jpeak(QMainWindow): self.data = Data() status, info = self.data.open_file() if not status: - PublicFunc.text_output(self.ui, info, Constants.TIPS_TYPE_ERROR) + PublicFunc.text_output(self.ui, "(2/2)" + info, Constants.TIPS_TYPE_ERROR) PublicFunc.msgbox_output(self, info, Constants.MSGBOX_TYPE_ERROR) self.finish_operation() return else: - PublicFunc.text_output(self.ui, info, Constants.TIPS_TYPE_INFO) + PublicFunc.text_output(self.ui, "(2/2)" + info, Constants.TIPS_TYPE_INFO) MainWindow_detect_Jpeak.__reset__() self.finish_operation() @@ -348,21 +382,21 @@ class MainWindow_detect_Jpeak(QMainWindow): self.__disableAllButton__() - self.statusbar_show_msg(PublicFunc.format_status_msg(Constants.DETECT_JPEAK_PROCESSING_DATA)) + self.statusbar_show_msg(PublicFunc.format_status_msg("(1/3)" + Constants.DETECT_JPEAK_PROCESSING_DATA)) self.progressbar.setValue(0) QApplication.processEvents() # 数据预处理 status, info = self.data.preprocess() if not status: - PublicFunc.text_output(self.ui, info, Constants.TIPS_TYPE_ERROR) + PublicFunc.text_output(self.ui, "(1/3)" + info, Constants.TIPS_TYPE_ERROR) PublicFunc.msgbox_output(self, info, Constants.MSGBOX_TYPE_ERROR) self.finish_operation() return else: - PublicFunc.text_output(self.ui, info, Constants.TIPS_TYPE_INFO) + PublicFunc.text_output(self.ui, "(1/3)" + info, Constants.TIPS_TYPE_INFO) - self.statusbar_show_msg(PublicFunc.format_status_msg(Constants.DETECT_JPEAK_PREDICTING_PEAK)) + self.statusbar_show_msg(PublicFunc.format_status_msg("(2/3)" + Constants.DETECT_JPEAK_PREDICTING_PEAK)) self.progressbar.setValue(10) QApplication.processEvents() @@ -370,33 +404,33 @@ class MainWindow_detect_Jpeak(QMainWindow): self.model.selected_model = Config["DetectMethod"] status, info = self.data.predict_Jpeak(self.model) if not status: - PublicFunc.text_output(self.ui, info, Constants.TIPS_TYPE_ERROR) + PublicFunc.text_output(self.ui, "(2/3)" + info, Constants.TIPS_TYPE_ERROR) PublicFunc.msgbox_output(self, info, Constants.MSGBOX_TYPE_ERROR) self.finish_operation() return else: - PublicFunc.text_output(self.ui, info, Constants.TIPS_TYPE_INFO) - PublicFunc.text_output(self.ui, Constants.DETECT_J_PEAK_DATA_LENGTH_POINTS + str(len(self.data.data)), + PublicFunc.text_output(self.ui, "(2/3)" + info, Constants.TIPS_TYPE_INFO) + PublicFunc.text_output(self.ui, Constants.DETECT_JPEAK_DATA_LENGTH_POINTS + str(len(self.data.raw_data)), Constants.TIPS_TYPE_INFO) - PublicFunc.text_output(self.ui, Constants.DETECT_J_PEAK_DURATION_MIN + - str((len(self.data.data) / Config["InputConfig"]["Freq"] / 60)), + PublicFunc.text_output(self.ui, Constants.DETECT_JPEAK_DURATION_MIN + + str((len(self.data.raw_data) / Config["InputConfig"]["Freq"] / 60)), Constants.TIPS_TYPE_INFO) - PublicFunc.text_output(self.ui, Constants.DETECT_J_PEAK_JPEAK_AMOUNT + str(len(self.data.peak)), + PublicFunc.text_output(self.ui, Constants.DETECT_JPEAK_PEAK_AMOUNT + str(len(self.data.peak)), Constants.TIPS_TYPE_INFO) - self.statusbar_show_msg(PublicFunc.format_status_msg(Constants.DRAWING_DATA)) + self.statusbar_show_msg(PublicFunc.format_status_msg("(3/3)" + Constants.DRAWING_DATA)) self.progressbar.setValue(70) QApplication.processEvents() # 绘图 status, info = self.__plot__() if not status: - PublicFunc.text_output(self.ui, info, Constants.TIPS_TYPE_ERROR) + PublicFunc.text_output(self.ui, "(3/3)" + info, Constants.TIPS_TYPE_ERROR) PublicFunc.msgbox_output(self, info, Constants.MSGBOX_TYPE_ERROR) self.finish_operation() return else: - PublicFunc.text_output(self.ui, info, Constants.TIPS_TYPE_INFO) + PublicFunc.text_output(self.ui, "(3/3)" + info, Constants.TIPS_TYPE_INFO) ButtonState["Current"]["pushButton_save"] = True self.finish_operation() @@ -410,14 +444,14 @@ class MainWindow_detect_Jpeak(QMainWindow): if reply == QMessageBox.Yes: self.__disableAllButton__() - self.statusbar_show_msg(PublicFunc.format_status_msg(Constants.SAVING_DATA)) + self.statusbar_show_msg(PublicFunc.format_status_msg("(1/1)" + Constants.SAVING_DATA)) self.progressbar.setValue(0) QApplication.processEvents() # 保存 # status, info = self.data.save() total_rows = len(DataFrame(self.data.peak.reshape(-1))) - chunk_size = ConfigParams.PREPROCESS_SAVE_CHUNK_SIZE + chunk_size = ConfigParams.DETECT_JPEAK_SAVE_CHUNK_SIZE with open(Config["Path"]["Save"], 'w') as f: for start in range(0, total_rows, chunk_size): end = min(start + chunk_size, total_rows) @@ -428,56 +462,21 @@ class MainWindow_detect_Jpeak(QMainWindow): QApplication.processEvents() if not status: - PublicFunc.text_output(self.ui, info, Constants.TIPS_TYPE_ERROR) + PublicFunc.text_output(self.ui, "(1/1)" + info, Constants.TIPS_TYPE_ERROR) PublicFunc.msgbox_output(self, info, Constants.MSGBOX_TYPE_ERROR) self.finish_operation() return else: - PublicFunc.text_output(self.ui, info, Constants.TIPS_TYPE_INFO) + PublicFunc.text_output(self.ui, "(1/1)" + info, Constants.TIPS_TYPE_INFO) PublicFunc.msgbox_output(self, info, Constants.TIPS_TYPE_INFO) self.finish_operation() - def __update_config__(self): - - Config["Filter"]["BandPassLow"] = self.ui.doubleSpinBox_bandPassLow.value() - Config["Filter"]["BandPassHigh"] = self.ui.doubleSpinBox_bandPassHigh.value() - Config["PeaksValue"] = self.ui.spinBox_peaksValue.value() - Config["AmpValue"] = self.ui.doubleSpinBox_ampValue.value() - Config["IntervalLow"] = self.ui.spinBox_intervalLow.value() - Config["IntervalHigh"] = self.ui.spinBox_intervalHigh.value() - Config["UseCPU"] = self.ui.checkBox_useCPU.isChecked() - Config["DetectMethod"] = self.ui.comboBox_model.currentText() - def update_ui_comboBox_model(self, model_list): self.ui.comboBox_model.clear() self.ui.comboBox_model.addItems(model_list) - def finish_operation(self): - - self.statusbar_show_msg(PublicFunc.format_status_msg(Constants.OPERATION_FINISHED)) - self.progressbar.setValue(100) - QApplication.processEvents() - - self.__enableAllButton__() - - def add_progressbar(self): - - self.progressbar = QProgressBar() - self.progressbar.setRange(0, 100) - self.progressbar.setValue(0) - self.progressbar.setStyleSheet(Constants.PROGRESSBAR_STYLE) - self.ui.statusBar.addPermanentWidget(self.progressbar) - - def statusbar_show_msg(self, msg): - - self.ui.statusBar.showMessage(msg) - - def statusbar_clear_msg(self): - - self.ui.statusBar.clearMessage() - class Data: @@ -486,7 +485,7 @@ class Data: self.file_path_input = Config["Path"]["Input"] self.file_path_save = Config["Path"]["Save"] - self.data = None + self.raw_data = None self.processed_data = None self.peak = None self.interval = None @@ -497,21 +496,21 @@ class Data: return False, Constants.INPUT_FAILURE + Constants.DETECT_JPEAK_FAILURE_REASON["Data_Path_Not_Exist"] try: - self.data = read_csv(self.file_path_input, + self.raw_data = read_csv(self.file_path_input, encoding=ConfigParams.UTF8_ENCODING, header=None).to_numpy().reshape(-1) except Exception: - return False, Constants.INPUT_FAILURE + Constants.DETECT_JPEAK_FAILURE_REASON["Read_File_Exception"] + return False, Constants.INPUT_FAILURE + Constants.DETECT_JPEAK_FAILURE_REASON["Read_Data_Exception"] return True, Constants.INPUT_FINISHED def preprocess(self): - if self.data is None: + if self.raw_data is None: return False, Constants.DETECT_JPEAK_PROCESS_FAILURE + Constants.DETECT_JPEAK_FAILURE_REASON["Raw_Data_Not_Exist"] try: - self.processed_data = preprocess(self.data, + self.processed_data = preprocess(self.raw_data, Config["InputConfig"]["Freq"], Config["Filter"]["BandPassLow"], Config["Filter"]["BandPassHigh"], @@ -555,7 +554,7 @@ class Data: # float_format='%.4f') chunk.to_csv(self.file_path_save, mode='a', index=False, header=False) except Exception: - return False, Constants.SAVING_FAILURE + Constants.PREPROCESS_FAILURE_REASON["Save_Exception"] + return False, Constants.SAVING_FAILURE + Constants.DETECT_JPEAK_FAILURE_REASON["Save_Exception"] return True, Constants.SAVING_FINISHED @@ -572,13 +571,13 @@ class Model: def seek_model(self): if not Path(Config["ModelFolderPath"]).exists(): - return False, Constants.LOAD_FAILURE + Constants.DETECT_JPEAK_FAILURE_REASON["Model_Path_Not_Exist"] + return False, Constants.DETECT_JPEAK_LOAD_FAILURE + Constants.DETECT_JPEAK_FAILURE_REASON["Model_Path_Not_Exist"] try: self.model_list = [file.name for file in Path(Config["ModelFolderPath"]).iterdir() if file.is_file()] if len(self.model_list) == 0: return False, Constants.DETECT_JPEAK_FAILURE_REASON["Model_File_Not_Exist"] except Exception: - return False, Constants.LOAD_FAILURE + Constants.DETECT_JPEAK_FAILURE_REASON["Read_Model_Exception"] + return False, Constants.DETECT_JPEAK_LOAD_FAILURE + Constants.DETECT_JPEAK_FAILURE_REASON["Read_Model_Exception"] - return True, Constants.LOAD_FINISHED \ No newline at end of file + return True, Constants.DETECT_JPEAK_LOAD_FINISHED \ No newline at end of file diff --git a/func/Module_detect_Rpeak.py b/func/Module_detect_Rpeak.py new file mode 100644 index 0000000..d349ce9 --- /dev/null +++ b/func/Module_detect_Rpeak.py @@ -0,0 +1,550 @@ +from gc import collect +from pathlib import Path + +import matplotlib.pyplot as plt +from PySide6.QtWidgets import QMessageBox, QMainWindow, QWidget, QPushButton, QProgressBar, QApplication +from matplotlib import gridspec +from matplotlib.backends.backend_qt import NavigationToolbar2QT +from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg +from overrides import overrides +from pandas import read_csv, DataFrame +from yaml import dump, load, FullLoader + +from func.utils.PublicFunc import PublicFunc +from func.utils.Constants import Constants, ConfigParams +from func.utils.detect_Rpeak import preprocess, Rpeak_Detection, get_method + +from ui.MainWindow.MainWindow_detect_Rpeak import Ui_MainWindow_detect_Rpeak +from ui.setting.detect_Rpeak_input_setting import Ui_MainWindow_detect_Rpeak_input_setting + + +Config = { + +} + +ButtonState = { + "Default": { + "pushButton_input_setting": True, + "pushButton_input": True, + "pushButton_view": False, + "pushButton_save": False + }, + "Current": { + "pushButton_input_setting": True, + "pushButton_input": True, + "pushButton_view": False, + "pushButton_save": False + } +} + + +class SettingWindow(QMainWindow): + + def __init__(self, root_path, sampID): + + super(SettingWindow, self).__init__() + self.ui = Ui_MainWindow_detect_Rpeak_input_setting() + self.ui.setupUi(self) + + self.root_path = root_path + self.sampID = sampID + + self.config = None + self.__read_config__() + + self.ui.spinBox_input_freq.valueChanged.connect(self.__update_ui__) + self.ui.pushButton_confirm.clicked.connect(self.__write_config__) + self.ui.pushButton_cancel.clicked.connect(self.__rollback_config__) + self.ui.pushButton_cancel.clicked.connect(self.close) + + def __read_config__(self): + + if not Path(ConfigParams.DETECT_RPEAK_CONFIG_FILE_PATH).exists(): + with open(ConfigParams.DETECT_RPEAK_CONFIG_FILE_PATH, "w") as f: + dump(ConfigParams.DETECT_RPEAK_CONFIG_NEW_CONTENT, f) + + with open(ConfigParams.DETECT_RPEAK_CONFIG_FILE_PATH, "r") as f: + file_config = load(f.read(), Loader=FullLoader) + Config.update(file_config) + self.config = file_config + + Config.update({ + "Path": { + "Input": str((Path(self.root_path) / ConfigParams.PUBLIC_PATH_PSG_TEXT / + Path(str(self.sampID)) / Path(ConfigParams.DETECT_RPEAK_INPUT_ECG_FILENAME + + str(Config["InputConfig"]["Freq"]) + + ConfigParams.ENDSWITH_TXT))), + "Save": str((Path(self.root_path) / ConfigParams.PUBLIC_PATH_PSG_TEXT / + Path(str(self.sampID)) / Path(ConfigParams.DETECT_RPEAK_SAVE_FILENAME + + ConfigParams.ENDSWITH_TXT))) + } + }) + + # 数据回显 + self.ui.spinBox_input_freq.setValue(Config["InputConfig"]["Freq"]) + self.ui.plainTextEdit_file_path_input.setPlainText(Config["Path"]["Input"]) + self.ui.plainTextEdit_file_path_save.setPlainText(Config["Path"]["Save"]) + + def __write_config__(self): + + # 从界面写入配置 + Config["InputConfig"]["Freq"] = self.ui.spinBox_input_freq.value() + Config["Path"]["Input"] = self.ui.plainTextEdit_file_path_input.toPlainText() + Config["Path"]["Save"] = self.ui.plainTextEdit_file_path_save.toPlainText() + + # 保存配置到文件 + self.config["InputConfig"]["Freq"] = self.ui.spinBox_input_freq.value() + + with open(ConfigParams.DETECT_RPEAK_CONFIG_FILE_PATH, "w") as f: + dump(self.config, f) + + self.close() + + def __rollback_config__(self): + + self.__read_config__() + + def __update_ui__(self): + + self.ui.plainTextEdit_file_path_input.setPlainText( + str((Path(self.root_path) / + ConfigParams.PUBLIC_PATH_PSG_TEXT / + Path(str(self.sampID)) / + Path(ConfigParams.DETECT_RPEAK_INPUT_ECG_FILENAME + + str(self.ui.spinBox_input_freq.value()) + + ConfigParams.ENDSWITH_TXT)))) + + +class MainWindow_detect_Rpeak(QMainWindow): + + def __init__(self): + + super(MainWindow_detect_Rpeak, self).__init__() + self.ui = Ui_MainWindow_detect_Rpeak() + self.ui.setupUi(self) + + self.root_path = None + self.sampID = None + + self.data = None + + self.setting = None + + # 初始化进度条 + self.progressbar = None + self.add_progressbar() + + #初始化画框 + self.fig = None + self.canvas = None + self.figToolbar = None + self.gs = None + 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) + + @overrides + def show(self, root_path, sampID): + + super().show() + self.root_path = root_path + self.sampID = sampID + + self.setting = SettingWindow(root_path, sampID) + + # 初始化画框 + self.fig = plt.figure(figsize=(12, 9), dpi=100) + self.canvas = FigureCanvasQTAgg(self.fig) + self.figToolbar = NavigationToolbar2QT(self.canvas) + for action in self.figToolbar.actions(): + if action.text() == "Subplots" or action.text() == "Customize": + self.figToolbar.removeAction(action) + self.ui.verticalLayout_canvas.addWidget(self.canvas) + self.ui.verticalLayout_canvas.addWidget(self.figToolbar) + self.gs = gridspec.GridSpec(2, 1, height_ratios=[1, 1]) + self.fig.subplots_adjust(top=0.98, bottom=0.05, right=0.98, left=0.1, hspace=0, wspace=0) + self.ax0 = self.fig.add_subplot(self.gs[0]) + 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 = self.fig.add_subplot(self.gs[1], sharex=self.ax0) + self.ax1.grid(True) + self.ax1.xaxis.set_major_formatter(ConfigParams.FORMATTER) + + self.__resetAllButton__() + + self.ui.doubleSpinBox_bandPassLow.setValue(Config["Filter"]["BandPassLow"]) + self.ui.doubleSpinBox_bandPassHigh.setValue(Config["Filter"]["BandPassHigh"]) + self.ui.spinBox_peaksValue.setValue(Config["PeaksValue"]) + + self.ui.pushButton_input.clicked.connect(self.__slot_btn_input__) + self.ui.pushButton_input_setting.clicked.connect(self.setting.show) + self.ui.pushButton_view.clicked.connect(self.__slot_btn_view__) + self.ui.pushButton_save.clicked.connect(self.__slot_btn_save__) + self.ui.doubleSpinBox_bandPassLow.editingFinished.connect(self.__update_config__) + 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__) + + @overrides + def closeEvent(self, event): + + self.__disableAllButton__() + + self.statusbar_show_msg(PublicFunc.format_status_msg(Constants.SHUTTING_DOWN)) + 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() + + # 释放资源 + del self.data + self.fig.clf() + plt.close(self.fig) + self.deleteLater() + collect() + self.canvas = None + event.accept() + + @staticmethod + def __reset__(): + + ButtonState["Current"].update(ButtonState["Default"].copy()) + ButtonState["Current"]["pushButton_view"] = True + + 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 + + sender = self.sender() + + if sender == self.ui.pushButton_view: + self.point_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, + 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], + 'r*', + label=Constants.DETECT_RPEAK_PLOT_LABEL_R_PEAKS) + self.line_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) + self.ax1.legend(loc=Constants.PLOT_UPPER_RIGHT) + status = True + info = Constants.DRAWING_FINISHED + else: + status = False + info = Constants.DRAWING_FAILURE + + self.canvas.draw() + return status, info + + def __disableAllButton__(self): + # 禁用所有按钮 + all_widgets = self.centralWidget().findChildren(QWidget) + + # 迭代所有部件,查找按钮并禁用它们 + for widget in all_widgets: + if isinstance(widget, QPushButton): + if widget.objectName() in ButtonState["Current"].keys(): + widget.setEnabled(False) + + def __enableAllButton__(self): + # 启用按钮 + all_widgets = self.centralWidget().findChildren(QWidget) + + # 迭代所有部件,查找按钮并启用它们 + for widget in all_widgets: + if isinstance(widget, QPushButton): + if widget.objectName() in ButtonState["Current"].keys(): + widget.setEnabled(ButtonState["Current"][widget.objectName()]) + + def __resetAllButton__(self): + # 启用按钮 + all_widgets = self.centralWidget().findChildren(QWidget) + + # 迭代所有部件,查找按钮并启用它们 + for widget in all_widgets: + if isinstance(widget, QPushButton): + if widget.objectName() in ButtonState["Default"].keys(): + widget.setEnabled(ButtonState["Default"][widget.objectName()]) + + def __update_config__(self): + + 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() + + def finish_operation(self): + + self.statusbar_show_msg(PublicFunc.format_status_msg(Constants.OPERATION_FINISHED)) + self.progressbar.setValue(100) + QApplication.processEvents() + + self.__enableAllButton__() + + def add_progressbar(self): + + self.progressbar = QProgressBar() + self.progressbar.setRange(0, 100) + self.progressbar.setValue(0) + self.progressbar.setStyleSheet(Constants.PROGRESSBAR_STYLE) + self.ui.statusbar.addPermanentWidget(self.progressbar) + + def statusbar_show_msg(self, msg): + + self.ui.statusbar.showMessage(msg) + + def statusbar_clear_msg(self): + + self.ui.statusbar.clearMessage() + + def __slot_btn_input__(self): + + self.__disableAllButton__() + + # 清空画框 + 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.canvas.draw() + + # 清空方法列表 + self.ui.comboBox_method.clear() + + self.statusbar_show_msg(PublicFunc.format_status_msg("(1/2)" + Constants.DETECT_RPEAK_LOADING_METHOD)) + self.progressbar.setValue(0) + QApplication.processEvents() + + # 寻找方法 + method_list = get_method() + if len(method_list) == 0 or method_list is None: + status = False + info = Constants.DETECT_RPEAK_LOAD_FAILURE + Constants.DETECT_RPEAK_FAILURE_REASON["Method_Not_Exist"] + else: + status = True + info = Constants.DETECT_RPEAK_LOAD_FINISHED + if not status: + PublicFunc.text_output(self.ui, "(1/2)" + info, Constants.TIPS_TYPE_ERROR) + PublicFunc.msgbox_output(self, info, Constants.MSGBOX_TYPE_ERROR) + self.finish_operation() + return + else: + PublicFunc.text_output(self.ui, "(1/2)" + info, Constants.TIPS_TYPE_INFO) + self.update_ui_comboBox_method(method_list) + + self.statusbar_show_msg(PublicFunc.format_status_msg("(2/2)" + Constants.INPUTTING_DATA)) + self.progressbar.setValue(10) + QApplication.processEvents() + + # 导入数据 + self.data = Data() + status, info = self.data.open_file() + if not status: + PublicFunc.text_output(self.ui, "(2/2)" + info, Constants.TIPS_TYPE_ERROR) + PublicFunc.msgbox_output(self, info, Constants.MSGBOX_TYPE_ERROR) + self.finish_operation() + return + else: + PublicFunc.text_output(self.ui, "(2/2)" + info, Constants.TIPS_TYPE_INFO) + + MainWindow_detect_Rpeak.__reset__() + self.finish_operation() + + def __slot_btn_view__(self): + + self.__disableAllButton__() + + self.statusbar_show_msg(PublicFunc.format_status_msg("(1/3)" + Constants.DETECT_RPEAK_PROCESSING_DATA)) + self.progressbar.setValue(0) + QApplication.processEvents() + + # 数据预处理 + status, info = self.data.preprocess() + if not status: + PublicFunc.text_output(self.ui, "(1/3)" + info, Constants.TIPS_TYPE_ERROR) + PublicFunc.msgbox_output(self, info, Constants.MSGBOX_TYPE_ERROR) + self.finish_operation() + return + else: + PublicFunc.text_output(self.ui, "(1/3)" + info, Constants.TIPS_TYPE_INFO) + + self.statusbar_show_msg(PublicFunc.format_status_msg("(2/3)" + Constants.DETECT_RPEAK_PREDICTING_PEAK)) + self.progressbar.setValue(10) + QApplication.processEvents() + + # 预测峰值 + status, info = self.data.predict_Rpeak() + if not status: + PublicFunc.text_output(self.ui, "(2/3)" + info, Constants.TIPS_TYPE_ERROR) + PublicFunc.msgbox_output(self, info, Constants.MSGBOX_TYPE_ERROR) + self.finish_operation() + return + else: + PublicFunc.text_output(self.ui, "(2/3)" + info, Constants.TIPS_TYPE_INFO) + PublicFunc.text_output(self.ui, Constants.DETECT_RPEAK_DATA_LENGTH_POINTS + str(len(self.data.raw_data)), + Constants.TIPS_TYPE_INFO) + PublicFunc.text_output(self.ui, Constants.DETECT_RPEAK_DURATION_MIN + + str((len(self.data.raw_data) / Config["InputConfig"]["Freq"] / 60)), + Constants.TIPS_TYPE_INFO) + PublicFunc.text_output(self.ui, Constants.DETECT_RPEAK_PEAK_AMOUNT + str(len(self.data.peak)), + Constants.TIPS_TYPE_INFO) + + self.statusbar_show_msg(PublicFunc.format_status_msg("(3/3)" + Constants.DRAWING_DATA)) + self.progressbar.setValue(70) + QApplication.processEvents() + + # 绘图 + status, info = self.__plot__() + if not status: + PublicFunc.text_output(self.ui, "(3/3)" + info, Constants.TIPS_TYPE_ERROR) + PublicFunc.msgbox_output(self, info, Constants.MSGBOX_TYPE_ERROR) + self.finish_operation() + return + else: + PublicFunc.text_output(self.ui, "(3/3)" + info, Constants.TIPS_TYPE_INFO) + + ButtonState["Current"]["pushButton_save"] = True + self.finish_operation() + + def __slot_btn_save__(self): + + reply = QMessageBox.question(self, Constants.QUESTION_TITLE, + Constants.QUESTION_CONTENT + Config["Path"]["Save"], + QMessageBox.Yes | QMessageBox.No, + QMessageBox.Yes) + if reply == QMessageBox.Yes: + self.__disableAllButton__() + + self.statusbar_show_msg(PublicFunc.format_status_msg("(1/1)" + Constants.SAVING_DATA)) + self.progressbar.setValue(0) + QApplication.processEvents() + + # 保存 + # status, info = self.data.save() + total_rows = len(DataFrame(self.data.peak.reshape(-1))) + chunk_size = ConfigParams.DETECT_RPEAK_SAVE_CHUNK_SIZE + with open(Config["Path"]["Save"], 'w') as f: + for start in range(0, total_rows, chunk_size): + end = min(start + chunk_size, total_rows) + chunk = DataFrame(self.data.peak.reshape(-1)).iloc[start:end] + status, info = self.data.save(chunk) + progress = int((end / total_rows) * 100) + self.progressbar.setValue(progress) + QApplication.processEvents() + + if not status: + PublicFunc.text_output(self.ui, "(1/1)" + info, Constants.TIPS_TYPE_ERROR) + PublicFunc.msgbox_output(self, info, Constants.MSGBOX_TYPE_ERROR) + self.finish_operation() + return + else: + PublicFunc.text_output(self.ui, "(1/1)" + info, Constants.TIPS_TYPE_INFO) + PublicFunc.msgbox_output(self, info, Constants.TIPS_TYPE_INFO) + + self.finish_operation() + + def update_ui_comboBox_method(self, method_list): + + self.ui.comboBox_method.clear() + self.ui.comboBox_method.addItems(method_list) + + +class Data: + + def __init__(self): + self.file_path_input = Config["Path"]["Input"] + self.file_path_save = Config["Path"]["Save"] + + self.raw_data = None + self.processed_data = None + self.peak = None + self.interval = None + self.RRIV = None + + def open_file(self): + + if not Path(Config["Path"]["Input"]).exists(): + return False, Constants.INPUT_FAILURE + Constants.DETECT_RPEAK_FAILURE_REASON["Data_Path_Not_Exist"] + + try: + self.raw_data = read_csv(self.file_path_input, + encoding=ConfigParams.UTF8_ENCODING, + header=None).to_numpy().reshape(-1) + except Exception: + return False, Constants.INPUT_FAILURE + Constants.DETECT_RPEAK_FAILURE_REASON["Read_Data_Exception"] + + return True, Constants.INPUT_FINISHED + + def preprocess(self): + + if self.raw_data is None: + return False, Constants.DETECT_RPEAK_PROCESS_FAILURE + Constants.DETECT_RPEAK_FAILURE_REASON["Raw_Data_Not_Exist"] + + try: + self.processed_data = preprocess(self.raw_data, + Config["InputConfig"]["Freq"], + Config["Filter"]["BandPassLow"], + Config["Filter"]["BandPassHigh"]) + except Exception: + return False, Constants.DETECT_RPEAK_PROCESS_FAILURE + Constants.DETECT_RPEAK_FAILURE_REASON["Filter_Exception"] + + return True, Constants.DETECT_RPEAK_PROCESS_FINISHED + + def predict_Rpeak(self): + + if self.processed_data is None: + return False, Constants.DETECT_RPEAK_PREDICT_FAILURE + Constants.DETECT_RPEAK_FAILURE_REASON["Processed_Data_Not_Exist"] + + try: + self.peak, self.interval, self.RRIV = Rpeak_Detection(self.processed_data, + Config["InputConfig"]["Freq"], + Config["PeaksValue"], + Config["DetectMethod"]) + except Exception: + return False, Constants.DETECT_RPEAK_PREDICT_FAILURE + Constants.DETECT_RPEAK_FAILURE_REASON["Predict_Exception"] + + return True, Constants.DETECT_RPEAK_PREDICT_FINISHED + + def save(self, chunk): + + if self.peak is None: + return False, Constants.SAVING_FAILURE + Constants.DETECT_RPEAK_FAILURE_REASON["Peak_Not_Exist"] + + try: + # DataFrame(self.processed_data.reshape(-1)).to_csv(self.file_path_save, + # index=False, + # header=False, + # float_format='%.4f') + 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"] + + return True, Constants.SAVING_FINISHED \ No newline at end of file diff --git a/func/Module_mainwindow.py b/func/Module_mainwindow.py index 10dbe7e..c7d63bf 100644 --- a/func/Module_mainwindow.py +++ b/func/Module_mainwindow.py @@ -9,6 +9,7 @@ from ui.MainWindow.MainWindow_menu import Ui_Signal_Label 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.utils.Constants import Constants, ConfigParams @@ -44,6 +45,7 @@ class MainWindow(QMainWindow, Ui_Signal_Label): self.ui.pushButton_preprocess_BCG.clicked.connect(self.__slot_btn_preprocess__) self.ui.pushButton_preprocess_ECG.clicked.connect(self.__slot_btn_preprocess__) self.ui.pushButton_detect_Jpeak.clicked.connect(self.__slot_btn_detect_Jpeak__) + self.ui.pushButton_detect_Rpeak.clicked.connect(self.__slot_btn_detect_Rpeak__) @staticmethod def __read_config__(): @@ -98,6 +100,13 @@ class MainWindow(QMainWindow, Ui_Signal_Label): sampID = int(self.ui.comboBox_sampID.currentText()) self.detect_Jpeak.show(root_path, sampID) + def __slot_btn_detect_Rpeak__(self): + + self.detect_Rpeak = MainWindow_detect_Rpeak() + root_path = self.ui.plainTextEdit_root_path.toPlainText() + sampID = int(self.ui.comboBox_sampID.currentText()) + self.detect_Rpeak.show(root_path, sampID) + def seek_sampID(self, path): if not Path(path).exists(): diff --git a/func/Module_preprocess.py b/func/Module_preprocess.py index 400c1f4..723f0ea 100644 --- a/func/Module_preprocess.py +++ b/func/Module_preprocess.py @@ -322,109 +322,6 @@ class MainWindow_preprocess(QMainWindow): if widget.objectName() in ButtonState["Default"].keys(): widget.setEnabled(ButtonState["Default"][widget.objectName()]) - def __slot_btn_input__(self): - - self.__disableAllButton__() - - # 清空画框 - 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.canvas.draw() - - self.statusbar_show_msg(PublicFunc.format_status_msg(Constants.INPUTTING_DATA)) - self.progressbar.setValue(0) - QApplication.processEvents() - - # 导入数据 - self.data = Data() - status, info = self.data.open_file() - if not status: - PublicFunc.text_output(self.ui, info, Constants.TIPS_TYPE_ERROR) - PublicFunc.msgbox_output(self, info, Constants.MSGBOX_TYPE_ERROR) - self.finish_operation() - return - else: - PublicFunc.text_output(self.ui, info, Constants.TIPS_TYPE_INFO) - - MainWindow_preprocess.__reset__() - self.finish_operation() - - def __slot_btn_view__(self): - - self.__disableAllButton__() - - self.statusbar_show_msg(PublicFunc.format_status_msg(Constants.PREPROCESS_PROCESSING_DATA)) - self.progressbar.setValue(0) - QApplication.processEvents() - - # 数据预处理 - status, info = self.data.preprocess() - if not status: - PublicFunc.text_output(self.ui, info, Constants.TIPS_TYPE_ERROR) - PublicFunc.msgbox_output(self, info, Constants.MSGBOX_TYPE_ERROR) - self.finish_operation() - return - else: - PublicFunc.text_output(self.ui, info, Constants.TIPS_TYPE_INFO) - - self.statusbar_show_msg(PublicFunc.format_status_msg(Constants.DRAWING_DATA)) - self.progressbar.setValue(50) - QApplication.processEvents() - - # 绘图 - status, info = self.__plot__() - if not status: - PublicFunc.text_output(self.ui, info, Constants.TIPS_TYPE_ERROR) - PublicFunc.msgbox_output(self, info, Constants.MSGBOX_TYPE_ERROR) - self.finish_operation() - return - else: - PublicFunc.text_output(self.ui, info, Constants.TIPS_TYPE_INFO) - - ButtonState["Current"]["pushButton_save"] = True - self.finish_operation() - - def __slot_btn_save__(self): - - reply = QMessageBox.question(self, Constants.QUESTION_TITLE, - Constants.QUESTION_CONTENT + Config["Path"]["Save"], - QMessageBox.Yes | QMessageBox.No, - QMessageBox.Yes) - if reply == QMessageBox.Yes: - self.__disableAllButton__() - - self.statusbar_show_msg(PublicFunc.format_status_msg(Constants.SAVING_DATA)) - self.progressbar.setValue(0) - QApplication.processEvents() - - # 保存 - # status, info = self.data.save() - total_rows = len(DataFrame(self.data.processed_data.reshape(-1))) - chunk_size = ConfigParams.PREPROCESS_SAVE_CHUNK_SIZE - with open(Config["Path"]["Save"], 'w') as f: - for start in range(0, total_rows, chunk_size): - end = min(start + chunk_size, total_rows) - chunk = DataFrame(self.data.processed_data.reshape(-1)).iloc[start:end] - status, info = self.data.save(chunk) - progress = int((end / total_rows) * 100) - self.progressbar.setValue(progress) - QApplication.processEvents() - - if not status: - PublicFunc.text_output(self.ui, info, Constants.TIPS_TYPE_ERROR) - PublicFunc.msgbox_output(self, info, Constants.MSGBOX_TYPE_ERROR) - self.finish_operation() - return - else: - PublicFunc.text_output(self.ui, info, Constants.TIPS_TYPE_INFO) - PublicFunc.msgbox_output(self, info, Constants.TIPS_TYPE_INFO) - - self.finish_operation() - def __update_config__(self): if self.mode == "BCG": @@ -450,15 +347,118 @@ class MainWindow_preprocess(QMainWindow): self.progressbar.setRange(0, 100) self.progressbar.setValue(0) self.progressbar.setStyleSheet(Constants.PROGRESSBAR_STYLE) - self.ui.statusBar.addPermanentWidget(self.progressbar) + self.ui.statusbar.addPermanentWidget(self.progressbar) def statusbar_show_msg(self, msg): - self.ui.statusBar.showMessage(msg) + self.ui.statusbar.showMessage(msg) def statusbar_clear_msg(self): - self.ui.statusBar.clearMessage() + self.ui.statusbar.clearMessage() + + def __slot_btn_input__(self): + + self.__disableAllButton__() + + # 清空画框 + 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.canvas.draw() + + self.statusbar_show_msg(PublicFunc.format_status_msg("(1/1)" + Constants.INPUTTING_DATA)) + self.progressbar.setValue(0) + QApplication.processEvents() + + # 导入数据 + self.data = Data() + status, info = self.data.open_file() + if not status: + PublicFunc.text_output(self.ui, "(1/1)" + info, Constants.TIPS_TYPE_ERROR) + PublicFunc.msgbox_output(self, info, Constants.MSGBOX_TYPE_ERROR) + self.finish_operation() + return + else: + PublicFunc.text_output(self.ui, "(1/1)" + info, Constants.TIPS_TYPE_INFO) + + MainWindow_preprocess.__reset__() + self.finish_operation() + + def __slot_btn_view__(self): + + self.__disableAllButton__() + + self.statusbar_show_msg(PublicFunc.format_status_msg("(1/2)" + Constants.PREPROCESS_PROCESSING_DATA)) + self.progressbar.setValue(0) + QApplication.processEvents() + + # 数据预处理 + status, info = self.data.preprocess() + if not status: + PublicFunc.text_output(self.ui, "(1/2)" + info, Constants.TIPS_TYPE_ERROR) + PublicFunc.msgbox_output(self, info, Constants.MSGBOX_TYPE_ERROR) + self.finish_operation() + return + else: + PublicFunc.text_output(self.ui, "(1/2)" + info, Constants.TIPS_TYPE_INFO) + + self.statusbar_show_msg(PublicFunc.format_status_msg("(2/2)" + Constants.DRAWING_DATA)) + self.progressbar.setValue(50) + QApplication.processEvents() + + # 绘图 + status, info = self.__plot__() + if not status: + PublicFunc.text_output(self.ui, "(2/2)" + info, Constants.TIPS_TYPE_ERROR) + PublicFunc.msgbox_output(self, info, Constants.MSGBOX_TYPE_ERROR) + self.finish_operation() + return + else: + PublicFunc.text_output(self.ui, "(2/2)" + info, Constants.TIPS_TYPE_INFO) + + ButtonState["Current"]["pushButton_save"] = True + self.finish_operation() + + def __slot_btn_save__(self): + + reply = QMessageBox.question(self, Constants.QUESTION_TITLE, + Constants.QUESTION_CONTENT + Config["Path"]["Save"], + QMessageBox.Yes | QMessageBox.No, + QMessageBox.Yes) + if reply == QMessageBox.Yes: + self.__disableAllButton__() + + self.statusbar_show_msg(PublicFunc.format_status_msg("(1/1)" + Constants.SAVING_DATA)) + self.progressbar.setValue(0) + QApplication.processEvents() + + # 保存 + # status, info = self.data.save() + total_rows = len(DataFrame(self.data.processed_data.reshape(-1))) + chunk_size = ConfigParams.PREPROCESS_SAVE_CHUNK_SIZE + with open(Config["Path"]["Save"], 'w') as f: + for start in range(0, total_rows, chunk_size): + end = min(start + chunk_size, total_rows) + chunk = DataFrame(self.data.processed_data.reshape(-1)).iloc[start:end] + status, info = self.data.save(chunk) + progress = int((end / total_rows) * 100) + self.progressbar.setValue(progress) + QApplication.processEvents() + + if not status: + PublicFunc.text_output(self.ui, "(1/1)" + info, Constants.TIPS_TYPE_ERROR) + PublicFunc.msgbox_output(self, info, Constants.MSGBOX_TYPE_ERROR) + self.finish_operation() + return + else: + PublicFunc.text_output(self.ui, "(1/1)" + info, Constants.TIPS_TYPE_INFO) + PublicFunc.msgbox_output(self, info, Constants.TIPS_TYPE_INFO) + + self.finish_operation() class Data: diff --git a/func/utils/ConfigParams.py b/func/utils/ConfigParams.py index df49c44..8605a96 100644 --- a/func/utils/ConfigParams.py +++ b/func/utils/ConfigParams.py @@ -18,6 +18,8 @@ class ConfigParams: } } UTF8_ENCODING: str = "utf-8" + # 目前用到这个编码的地方: + # 里的保存和读取csv文件的地方(注意的是,读取原始数据时依然使用UTF-8) GBK_ENCODING: str = "gbk" ENDSWITH_TXT: str = ".txt" ENDSWITH_CSV: str = ".csv" @@ -71,28 +73,41 @@ class ConfigParams: DETECT_JPEAK_SAVE_FILENAME: str = "JPeak_revise" DETECT_JPEAK_SAVE_CHUNK_SIZE: int = 100 + # ECG的R峰算法定位 + DETECT_RPEAK_CONFIG_FILE_PATH: str = "./config/Config_detect_Rpeak.yaml" + DETECT_RPEAK_CONFIG_NEW_CONTENT = { + "InputConfig": { + "Freq": 1000 + }, + "Filter": { + "BandPassLow": 2, + "BandPassHigh": 15 + }, + "PeaksValue": 200, + "DetectMethod": "" + } + DETECT_RPEAK_INPUT_ECG_FILENAME: str = "ECG_filter_" + DETECT_RPEAK_SAVE_FILENAME: str = "final_Rpeak" + DETECT_RPEAK_SAVE_CHUNK_SIZE: int = 100 + # 人工纠正 + + # 体动标注 # TODO:弃用 # 通用 - # 目前用到这个编码的地方: # 里的保存和读取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" @@ -108,67 +123,6 @@ class ConfigParams: APPROXIMATELY_ALIGN_BUTTERHIGHPASSFREQ_DEFAULT: float = 0.70 APPROXIMATELY_ALIGN_APPLYFREQ_DEFAULT: float = 5 - - # 预处理 - # PREPROCESS_INPUT_BCG_FILENAME: str = "orgBcg_Raw_" - # PREPROCESS_INPUT_ECG_FILENAME: str = "ECG I_" - # PREPROCESS_SAVE_BCG_FILENAME: str = "DSbcg_sig_" - # PREPROCESS_SAVE_ECG_FILENAME: str = "ECG_filter_" - - # PREPROCESS_INPUT_BCG_DEFAULT_FS: int = 1000 - # PREPROCESS_INPUT_BCG_SAVE_DEFAULT_FS: int = 1000 - # PREPROCESS_INPUT_ECG_DEFAULT_FS: int = 1000 - # PREPROCESS_INPUT_ECG_SAVE_DEFAULT_FS: int = 1000 - # - # PREPROCESS_BANDPASS_LOW_DEFAULT: int = 2 - # PREPROCESS_BANDPASS_HIGH_DEFAULT: int = 10 - # PREPROCESS_FILTER_ORDER_DEFAULT: int = 4 - # - # PREPROCESS_FILTER_BCG: str = "bandpass" - # PREPROCESS_FILTER_ECG: str = "bandpass" - - - # ECG的R峰算法定位 - DETECT_R_PEAK_INPUT_ECG_FILENAME: str = "ECG_filter_" - DETECT_R_PEAK_SAVE_RPEAK_FILENAME: str = "final_Rpeak" - - DETECT_R_PEAK_INPUT_ECG_DEFAULT_FS: int = 1000 - - DETECT_R_PEAK_PEAKS_VALUE_DEFAULT: int = 200 - DETECT_R_PEAK_BANDPASS_LOW_DEFAULT: int = 2 - DETECT_R_PEAK_BANDPASS_HIGH_DEFAULT: int = 15 - - DETECT_R_PEAK_DETECT_METHOD_PT: str = "pt" - DETECT_R_PEAK_DETECT_METHOD_TA: str = "ta" - DETECT_R_PEAK_DETECT_METHOD_WT: str = "Wt" - DETECT_R_PEAK_DETECT_METHOD_HAMILTON: str = "Hamilton" - DETECT_R_PEAK_DETECT_METHOD_ENGZEE: str = "Engzee" - - - # BCG的J峰算法定位 - DETECT_J_PEAK_INPUT_BCG_FILENAME: str = "DSbcg_sig_" - DETECT_J_PEAK_SAVE_JPEAK_FILENAME: str = "JPeak_revise" - - DETECT_J_PEAK_INPUT_BCG_DEFAULT_FS: int = 1000 - - DETECT_J_PEAK_BANDPASS_LOW_DEFAULT: int = 2 - DETECT_J_PEAK_BANDPASS_HIGH_DEFAULT: int = 10 - DETECT_J_PEAK_PEAKS_VALUE_DEFAULT: int = 100 - DETECT_J_PEAK_AMP_VALUE_DEFAULT: int = 5 - DETECT_J_PEAK_INTERVAL_LOW_DEFAULT: int = 50 - DETECT_J_PEAK_INTERVAL_HIGH_DEFAULT: int = 140 - - DETECT_J_PEAK_UNET_MODEL1_PKL_PATH: str = "./func/result/Fivelayer_Unet/1.pkl" - DETECT_J_PEAK_UNET_MODEL2_PKL_PATH: str = "./func/result/Fivelayer_Unet/2.pkl" - DETECT_J_PEAK_LSTMUNET_MODEL1_PKL_PATH: str = "./func/result/Fivelayer_Lstm_Unet/1.pkl" - DETECT_J_PEAK_LSTMUNET_MODEL2_PKL_PATH: str = "./func/result/Fivelayer_Lstm_Unet/2.pkl" - - DETECT_J_PEAK_UNET_MODEL1_NAME: str = "Fivelayer_Unet_1" - DETECT_J_PEAK_UNET_MODEL2_NAME: str = "Fivelayer_Unet_2" - DETECT_J_PEAK_LSTMUNET_MODEL1_NAME: str = "Fivelayer_Lstm_Unet_1" - DETECT_J_PEAK_LSTMUNET_MODEL2_NAME: str = "Fivelayer_Lstm_Unet_2" - - # 人工纠正 LABEL_CHECK_INPUT_BCG_FILENAME: str = "DSbcg_sig_" LABEL_CHECK_INPUT_JPEAK_FILENAME: str = "JPeak_revise" diff --git a/func/utils/Constants.py b/func/utils/Constants.py index 1ad6a46..6c9835d 100644 --- a/func/utils/Constants.py +++ b/func/utils/Constants.py @@ -15,10 +15,6 @@ class Constants: INPUT_FINISHED: str = "导入完成" INPUT_FAILURE: str = "导入失败" - LOADING_MODEL: str = "正在读取模型" - LOAD_FINISHED: str = "读取完成" - LOAD_FAILURE: str = "读取失败" - DRAWING_DATA: str = "正在绘制图形" DRAWING_FINISHED: str = "绘制完成" DRAWING_FAILURE: str = "绘制失败" @@ -31,7 +27,7 @@ class Constants: OPERATION_FAILURE: str = "操作失败" UNKNOWN_ERROR: str = "未知错误" - SHUTTING_DOWN: str = "正在关闭窗口" + SHUTTING_DOWN: str = "正在释放内存资源" QUESTION_TITLE: str = "警告:确认操作" QUESTION_CONTENT: str = "你确定要保存结果到" @@ -89,6 +85,10 @@ class Constants: PREPROCESS_OUTPUT_INPUT_AMP_OFFSET: int = 1850 # BCG的J峰算法定位 + DETECT_JPEAK_LOADING_MODEL: str = "正在读取模型" + DETECT_JPEAK_LOAD_FINISHED: str = "读取完成" + DETECT_JPEAK_LOAD_FAILURE: str = "读取失败" + DETECT_JPEAK_PROCESSING_DATA: str = "正在处理数据" DETECT_JPEAK_PROCESS_FINISHED: str = "处理完成" DETECT_JPEAK_PROCESS_FAILURE: str = "处理失败" @@ -103,7 +103,7 @@ class Constants: "Model_Path_Not_Exist": "(模型路径不存在)", "Model_File_Not_Exist": "(模型文件不存在)", "Read_Model_Exception": "(读取模型异常)", - "Predict_Exception": "(模型预测异常)", + "Predict_Exception": "(峰值预测异常)", "Raw_Data_Not_Exist": "(原始数据不存在)", "Filter_Exception": "(滤波器异常)", "Processed_Data_Not_Exist": "(处理后数据不存在)", @@ -111,12 +111,50 @@ class Constants: "Save_Exception": "(保存异常)" } - DETECT_J_PEAK_DATA_LENGTH_POINTS: str = "数据长度(点数):" - DETECT_J_PEAK_DURATION_MIN: str = "数据时长(分钟):" - DETECT_J_PEAK_JPEAK_AMOUNT: str = "J峰个数:" - DETECT_J_PEAK_PLOT_LABEL_BCG: str = "BCG_Processed" - DETECT_J_PEAK_PLOT_LABEL_J_PEAKS: str = "J_Peaks" - DETECT_J_PEAK_PLOT_LABEL_INTERVAL: str = "Interval" + DETECT_JPEAK_DATA_LENGTH_POINTS: str = "数据长度(点数):" + DETECT_JPEAK_DURATION_MIN: str = "数据时长(分钟):" + DETECT_JPEAK_PEAK_AMOUNT: str = "J峰个数:" + DETECT_JPEAK_PLOT_LABEL_BCG: str = "BCG_Processed" + DETECT_JPEAK_PLOT_LABEL_J_PEAKS: str = "J_Peaks" + DETECT_JPEAK_PLOT_LABEL_INTERVAL: str = "Interval" + + # ECG的R峰算法定位 + DETECT_RPEAK_LOADING_METHOD: str = "正在读取方法" + DETECT_RPEAK_LOAD_FINISHED: str = "读取完成" + DETECT_RPEAK_LOAD_FAILURE: str = "读取失败" + + DETECT_RPEAK_PROCESSING_DATA: str = "正在处理数据" + DETECT_RPEAK_PROCESS_FINISHED: str = "处理完成" + DETECT_RPEAK_PROCESS_FAILURE: str = "处理失败" + + DETECT_RPEAK_PREDICTING_PEAK: str = "正在预测峰值" + DETECT_RPEAK_PREDICT_FINISHED: str = "预测完成" + DETECT_RPEAK_PREDICT_FAILURE: str = "预测失败" + + DETECT_RPEAK_FAILURE_REASON = { + "Data_Path_Not_Exist": "(数据路径不存在)", + "Read_Data_Exception": "(读取数据异常)", + "Method_Not_Exist": "(检测方法不存在)", + "Read_Method_Exception": "(读取方法异常)", + "Predict_Exception": "(峰值预测异常)", + "Raw_Data_Not_Exist": "(原始数据不存在)", + "Filter_Exception": "(滤波器异常)", + "Processed_Data_Not_Exist": "(处理后数据不存在)", + "Peak_Not_Exist": "(预测的峰值不存在)", + "Save_Exception": "(保存异常)" + } + + DETECT_RPEAK_DATA_LENGTH_POINTS: str = "数据长度(点数):" + DETECT_RPEAK_DURATION_MIN: str = "数据时长(分钟):" + DETECT_RPEAK_PEAK_AMOUNT: str = "R峰个数:" + DETECT_RPEAK_PLOT_LABEL_RRIV: str = "RRIV" + DETECT_RPEAK_PLOT_LABEL_ECG: str = "ECG" + DETECT_RPEAK_PLOT_LABEL_R_PEAKS: str = "R_Peaks" + DETECT_RPEAK_PLOT_LABEL_INTERVAL: str = "Interval" + + # 人工纠正 + + # 体动标注 # TODO:弃用 @@ -124,7 +162,6 @@ class Constants: FOLDER_DIR_NOT_EXIST_THEN_CREATE: str = "检测到保存路径所指向的文件夹不存在,已创建相应文件夹" - # 菜单界面 MAINWINDOW_ROOT_PATH_NOT_EXIST: str = "根目录路径输入错误" MAINWINDOW_MSGBOX_TITLE: str = "消息" @@ -132,7 +169,6 @@ class Constants: 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}" @@ -140,21 +176,6 @@ class Constants: APPROXIMATELY_ALIGN_RUNNING: str = "开始执行任务<数据粗同步>" APPROXIMATELY_RECORD_NOT_FOUND: str = "没有保存记录" - # ECG的R峰算法定位 - DETECT_R_PEAK_FILES_NOT_FOUND: str = f"无法找到{ConfigParams.DETECT_R_PEAK_INPUT_ECG_FILENAME}{ConfigParams.ENDSWITH_TXT},无法执行" - DETECT_R_PEAK_FILES_FOUND: str = f"找到{ConfigParams.DETECT_R_PEAK_INPUT_ECG_FILENAME}{ConfigParams.ENDSWITH_TXT}" - - DETECT_R_PEAK_RUNNING: str = "开始执行任务" - DETECT_R_PEAK_PLOT_LABEL_RRIV: str = "RRIV" - DETECT_R_PEAK_PLOT_LABEL_ECG: str = "ECG" - DETECT_R_PEAK_PLOT_LABEL_R_PEAKS: str = "R_peaks" - DETECT_R_PEAK_PLOT_LABEL_INTERVAL: str = "Interval" - DETECT_R_PEAK_DATA_LENGTH_POINTS: str = "数据长度(点数):" - DETECT_R_PEAK_DURATION_MIN: str = "数据时长(分钟):" - DETECT_R_PEAK_RPEAK_AMOUNT: str = "R峰个数:" - - - # 人工纠正 LABEL_CHECK_FILES_BCG_NOT_FOUND: str = f"无法找到{ConfigParams.LABEL_CHECK_INPUT_BCG_FILENAME}{ConfigParams.ENDSWITH_TXT}或{ConfigParams.LABEL_CHECK_INPUT_JPEAK_FILENAME}{ConfigParams.ENDSWITH_TXT},无法执行" LABEL_CHECK_FILES_BCG_FOUND: str = f"找到{ConfigParams.LABEL_CHECK_INPUT_BCG_FILENAME}{ConfigParams.ENDSWITH_TXT}和{ConfigParams.LABEL_CHECK_INPUT_JPEAK_FILENAME}{ConfigParams.ENDSWITH_TXT}" diff --git a/func/utils/detect_Rpeak.py b/func/utils/detect_Rpeak.py index 8c91f3a..163cc72 100644 --- a/func/utils/detect_Rpeak.py +++ b/func/utils/detect_Rpeak.py @@ -29,31 +29,38 @@ def find_TPeak(data,peaks,th=50): return_peak.append(argmax(data[min_win:max_win])+min_win) return array(return_peak) -def Rpeak_Detection(raw_ecg,fs,low_cut,high_cut,th1,detector_method): - detectors = Detectors(sampling_frequency=fs) - method_dic = {'pt': detectors.pan_tompkins_detector, - 'ta': detectors.two_average_detector, - "Engzee": detectors.engzee_detector, - "Wt": detectors.swt_detector, - "Christov": detectors.christov_detector, - "Hamilton": detectors.hamilton_detector - } - detectormethods = method_dic[detector_method] +def preprocess(raw_ecg, fs, low_cut, high_cut): - # raw_ecg = raw_ecg[200*sample_rate:] preprocessing = BCG_Operation(sample_rate=fs) # 对ECG做了降采样处理 raw_ecg = preprocessing.Butterworth(raw_ecg, "bandpass", low_cut=low_cut, high_cut=high_cut, order=3) * 4 - #######################限制幅值处理############################################ - # for i in range(len(raw_ecg)): - # if raw_ecg[i] > 300 or raw_ecg[i] < -300: - # raw_ecg[i] = 0 - ############################################################################## + return raw_ecg - R_peak = array(detectormethods(raw_ecg)) - 100 - # R_peak = np.array(detectors.pan_tompkins_detector(raw_ecg))-100 +# 界面会通过这个函数获取方法列表,此函数的返回值务必和Rpeak_Detection()中的方法名称对应否则程序或许直接崩溃 +def get_method(): + return ["pt", "ta", "Engzee", "Wt", "Christov", "Hamilton"] - R_peak = find_TPeak(raw_ecg, R_peak, th=int(th1 * fs / 1000)) - R_peak = refinement(raw_ecg, R_peak) +def Rpeak_Detection(ecg,fs,th1,detector_method): + detectors = Detectors(sampling_frequency=fs) + + if detector_method == "pt": + detectormethods = detectors.pan_tompkins_detector + elif detector_method == "ta": + detectormethods = detectors.two_average_detector + elif detector_method == "Engzee": + detectormethods = detectors.engzee_detector + elif detector_method == "Wt": + detectormethods = detectors.swt_detector + elif detector_method == "Christov": + detectormethods = detectors.christov_detector + elif detector_method == "Hamilton": + detectormethods = detectors.hamilton_detector + else: + raise Exception + + R_peak = array(detectormethods(ecg)) - 100 + + R_peak = find_TPeak(ecg, R_peak, th=int(th1 * fs / 1000)) + R_peak = refinement(ecg, R_peak) RR_Interval = full(len(R_peak) - 1, nan) @@ -64,7 +71,7 @@ def Rpeak_Detection(raw_ecg,fs,low_cut,high_cut,th1,detector_method): for i in range(len(RR_Interval) - 1): RRIV[i] = RR_Interval[i + 1] - RR_Interval[i] - Interval = full(len(raw_ecg), nan) + Interval = full(len(ecg), nan) for i in range(len(R_peak) - 1): Interval[R_peak[i]: R_peak[i + 1]] = R_peak[i + 1] - R_peak[i] diff --git a/ui/MainWindow/MainWindow_artifact_label.py b/ui/MainWindow/MainWindow_artifact_label.py new file mode 100644 index 0000000..6f41df3 --- /dev/null +++ b/ui/MainWindow/MainWindow_artifact_label.py @@ -0,0 +1,706 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'MainWindow_artifact_label.ui' +## +## Created by: Qt User Interface Compiler version 6.8.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, + QFont, QFontDatabase, QGradient, QIcon, + QImage, QKeySequence, QLinearGradient, QPainter, + QPalette, QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QAbstractSpinBox, QApplication, QGridLayout, QGroupBox, + QHBoxLayout, QHeaderView, QLabel, QLineEdit, + QMainWindow, QPushButton, QRadioButton, QSizePolicy, + QSpacerItem, QSpinBox, QStatusBar, QTableWidget, + QTableWidgetItem, QVBoxLayout, QWidget) + +class Ui_MainWindow_artifact_label(object): + def setupUi(self, MainWindow_artifact_label): + if not MainWindow_artifact_label.objectName(): + MainWindow_artifact_label.setObjectName(u"MainWindow_artifact_label") + MainWindow_artifact_label.resize(1920, 1080) + self.centralwidget = QWidget(MainWindow_artifact_label) + self.centralwidget.setObjectName(u"centralwidget") + self.gridLayout = QGridLayout(self.centralwidget) + self.gridLayout.setObjectName(u"gridLayout") + self.groupBox_canvas = QGroupBox(self.centralwidget) + self.groupBox_canvas.setObjectName(u"groupBox_canvas") + font = QFont() + font.setPointSize(10) + self.groupBox_canvas.setFont(font) + self.verticalLayout = QVBoxLayout(self.groupBox_canvas) + self.verticalLayout.setObjectName(u"verticalLayout") + self.verticalLayout_canvas = QVBoxLayout() + self.verticalLayout_canvas.setObjectName(u"verticalLayout_canvas") + + self.verticalLayout.addLayout(self.verticalLayout_canvas) + + + self.gridLayout.addWidget(self.groupBox_canvas, 0, 1, 1, 1) + + self.groupBox_left = QGroupBox(self.centralwidget) + self.groupBox_left.setObjectName(u"groupBox_left") + self.groupBox_left.setFont(font) + self.verticalLayout_2 = QVBoxLayout(self.groupBox_left) + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.pushButton_input_setting = QPushButton(self.groupBox_left) + self.pushButton_input_setting.setObjectName(u"pushButton_input_setting") + sizePolicy = QSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_input_setting.sizePolicy().hasHeightForWidth()) + self.pushButton_input_setting.setSizePolicy(sizePolicy) + font1 = QFont() + font1.setPointSize(12) + self.pushButton_input_setting.setFont(font1) + + self.horizontalLayout.addWidget(self.pushButton_input_setting) + + self.pushButton_input = QPushButton(self.groupBox_left) + self.pushButton_input.setObjectName(u"pushButton_input") + sizePolicy.setHeightForWidth(self.pushButton_input.sizePolicy().hasHeightForWidth()) + self.pushButton_input.setSizePolicy(sizePolicy) + self.pushButton_input.setFont(font1) + + self.horizontalLayout.addWidget(self.pushButton_input) + + + self.verticalLayout_2.addLayout(self.horizontalLayout) + + self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding) + + self.verticalLayout_2.addItem(self.verticalSpacer) + + self.groupBox = QGroupBox(self.groupBox_left) + self.groupBox.setObjectName(u"groupBox") + self.gridLayout_2 = QGridLayout(self.groupBox) + self.gridLayout_2.setObjectName(u"gridLayout_2") + self.label_3 = QLabel(self.groupBox) + self.label_3.setObjectName(u"label_3") + sizePolicy1 = QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Minimum) + sizePolicy1.setHorizontalStretch(0) + sizePolicy1.setVerticalStretch(0) + sizePolicy1.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth()) + self.label_3.setSizePolicy(sizePolicy1) + self.label_3.setFont(font1) + + self.gridLayout_2.addWidget(self.label_3, 2, 0, 1, 1) + + self.label_4 = QLabel(self.groupBox) + self.label_4.setObjectName(u"label_4") + sizePolicy1.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth()) + self.label_4.setSizePolicy(sizePolicy1) + self.label_4.setFont(font1) + + self.gridLayout_2.addWidget(self.label_4, 3, 0, 1, 1) + + self.label = QLabel(self.groupBox) + self.label.setObjectName(u"label") + sizePolicy1.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth()) + self.label.setSizePolicy(sizePolicy1) + self.label.setFont(font1) + + self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1) + + self.label_5 = QLabel(self.groupBox) + self.label_5.setObjectName(u"label_5") + sizePolicy1.setHeightForWidth(self.label_5.sizePolicy().hasHeightForWidth()) + self.label_5.setSizePolicy(sizePolicy1) + self.label_5.setFont(font1) + + self.gridLayout_2.addWidget(self.label_5, 4, 0, 1, 1) + + self.label_2 = QLabel(self.groupBox) + self.label_2.setObjectName(u"label_2") + sizePolicy1.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth()) + self.label_2.setSizePolicy(sizePolicy1) + self.label_2.setFont(font1) + + self.gridLayout_2.addWidget(self.label_2, 1, 0, 1, 1) + + self.lineEdit_start_time = QLineEdit(self.groupBox) + self.lineEdit_start_time.setObjectName(u"lineEdit_start_time") + sizePolicy2 = QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum) + sizePolicy2.setHorizontalStretch(0) + sizePolicy2.setVerticalStretch(0) + sizePolicy2.setHeightForWidth(self.lineEdit_start_time.sizePolicy().hasHeightForWidth()) + self.lineEdit_start_time.setSizePolicy(sizePolicy2) + + self.gridLayout_2.addWidget(self.lineEdit_start_time, 2, 1, 1, 1) + + self.lineEdit_end_time = QLineEdit(self.groupBox) + self.lineEdit_end_time.setObjectName(u"lineEdit_end_time") + sizePolicy2.setHeightForWidth(self.lineEdit_end_time.sizePolicy().hasHeightForWidth()) + self.lineEdit_end_time.setSizePolicy(sizePolicy2) + + self.gridLayout_2.addWidget(self.lineEdit_end_time, 3, 1, 1, 1) + + self.lineEdit_energy_percent_orgBcg = QLineEdit(self.groupBox) + self.lineEdit_energy_percent_orgBcg.setObjectName(u"lineEdit_energy_percent_orgBcg") + self.lineEdit_energy_percent_orgBcg.setEnabled(False) + sizePolicy2.setHeightForWidth(self.lineEdit_energy_percent_orgBcg.sizePolicy().hasHeightForWidth()) + self.lineEdit_energy_percent_orgBcg.setSizePolicy(sizePolicy2) + + self.gridLayout_2.addWidget(self.lineEdit_energy_percent_orgBcg, 0, 1, 1, 1) + + self.lineEdit_energy_percent_BCG = QLineEdit(self.groupBox) + self.lineEdit_energy_percent_BCG.setObjectName(u"lineEdit_energy_percent_BCG") + self.lineEdit_energy_percent_BCG.setEnabled(False) + sizePolicy2.setHeightForWidth(self.lineEdit_energy_percent_BCG.sizePolicy().hasHeightForWidth()) + self.lineEdit_energy_percent_BCG.setSizePolicy(sizePolicy2) + + self.gridLayout_2.addWidget(self.lineEdit_energy_percent_BCG, 1, 1, 1, 1) + + self.lineEdit_duration = QLineEdit(self.groupBox) + self.lineEdit_duration.setObjectName(u"lineEdit_duration") + self.lineEdit_duration.setEnabled(False) + sizePolicy2.setHeightForWidth(self.lineEdit_duration.sizePolicy().hasHeightForWidth()) + self.lineEdit_duration.setSizePolicy(sizePolicy2) + + self.gridLayout_2.addWidget(self.lineEdit_duration, 4, 1, 1, 1) + + + self.verticalLayout_2.addWidget(self.groupBox) + + self.verticalSpacer_2 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding) + + self.verticalLayout_2.addItem(self.verticalSpacer_2) + + self.groupBox_2 = QGroupBox(self.groupBox_left) + self.groupBox_2.setObjectName(u"groupBox_2") + self.verticalLayout_3 = QVBoxLayout(self.groupBox_2) + self.verticalLayout_3.setObjectName(u"verticalLayout_3") + self.horizontalLayout_2 = QHBoxLayout() + self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") + self.pushButton_prev_move = QPushButton(self.groupBox_2) + self.pushButton_prev_move.setObjectName(u"pushButton_prev_move") + sizePolicy.setHeightForWidth(self.pushButton_prev_move.sizePolicy().hasHeightForWidth()) + self.pushButton_prev_move.setSizePolicy(sizePolicy) + self.pushButton_prev_move.setFont(font1) + + self.horizontalLayout_2.addWidget(self.pushButton_prev_move) + + self.pushButton_pause = QPushButton(self.groupBox_2) + self.pushButton_pause.setObjectName(u"pushButton_pause") + sizePolicy.setHeightForWidth(self.pushButton_pause.sizePolicy().hasHeightForWidth()) + self.pushButton_pause.setSizePolicy(sizePolicy) + self.pushButton_pause.setFont(font1) + + self.horizontalLayout_2.addWidget(self.pushButton_pause) + + self.pushButton_next_move = QPushButton(self.groupBox_2) + self.pushButton_next_move.setObjectName(u"pushButton_next_move") + sizePolicy.setHeightForWidth(self.pushButton_next_move.sizePolicy().hasHeightForWidth()) + self.pushButton_next_move.setSizePolicy(sizePolicy) + self.pushButton_next_move.setFont(font1) + + self.horizontalLayout_2.addWidget(self.pushButton_next_move) + + + self.verticalLayout_3.addLayout(self.horizontalLayout_2) + + self.verticalSpacer_4 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding) + + self.verticalLayout_3.addItem(self.verticalSpacer_4) + + self.groupBox_3 = QGroupBox(self.groupBox_2) + self.groupBox_3.setObjectName(u"groupBox_3") + self.verticalLayout_4 = QVBoxLayout(self.groupBox_3) + self.verticalLayout_4.setObjectName(u"verticalLayout_4") + self.gridLayout_3 = QGridLayout() + self.gridLayout_3.setObjectName(u"gridLayout_3") + self.label_moveLength_preset_1 = QLabel(self.groupBox_3) + self.label_moveLength_preset_1.setObjectName(u"label_moveLength_preset_1") + self.label_moveLength_preset_1.setFont(font1) + self.label_moveLength_preset_1.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_moveLength_preset_1, 1, 1, 1, 1) + + self.label_maxRange_preset_1 = QLabel(self.groupBox_3) + self.label_maxRange_preset_1.setObjectName(u"label_maxRange_preset_1") + self.label_maxRange_preset_1.setFont(font1) + self.label_maxRange_preset_1.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_maxRange_preset_1, 1, 2, 1, 1) + + self.radioButton_move_preset_1 = QRadioButton(self.groupBox_3) + self.radioButton_move_preset_1.setObjectName(u"radioButton_move_preset_1") + self.radioButton_move_preset_1.setFont(font1) + self.radioButton_move_preset_1.setChecked(True) + + self.gridLayout_3.addWidget(self.radioButton_move_preset_1, 1, 0, 1, 1) + + self.label_moveSpeed_preset_3 = QLabel(self.groupBox_3) + self.label_moveSpeed_preset_3.setObjectName(u"label_moveSpeed_preset_3") + self.label_moveSpeed_preset_3.setFont(font1) + self.label_moveSpeed_preset_3.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_moveSpeed_preset_3, 3, 3, 1, 1) + + self.spinBox_moveLength = QSpinBox(self.groupBox_3) + self.spinBox_moveLength.setObjectName(u"spinBox_moveLength") + self.spinBox_moveLength.setFont(font1) + self.spinBox_moveLength.setButtonSymbols(QAbstractSpinBox.ButtonSymbols.NoButtons) + + self.gridLayout_3.addWidget(self.spinBox_moveLength, 4, 1, 1, 1) + + self.radioButton_move_preset_2 = QRadioButton(self.groupBox_3) + self.radioButton_move_preset_2.setObjectName(u"radioButton_move_preset_2") + self.radioButton_move_preset_2.setFont(font1) + + self.gridLayout_3.addWidget(self.radioButton_move_preset_2, 2, 0, 1, 1) + + self.label_maxRange_preset_3 = QLabel(self.groupBox_3) + self.label_maxRange_preset_3.setObjectName(u"label_maxRange_preset_3") + self.label_maxRange_preset_3.setFont(font1) + self.label_maxRange_preset_3.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_maxRange_preset_3, 3, 2, 1, 1) + + self.label_maxRange_preset_2 = QLabel(self.groupBox_3) + self.label_maxRange_preset_2.setObjectName(u"label_maxRange_preset_2") + self.label_maxRange_preset_2.setFont(font1) + self.label_maxRange_preset_2.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_maxRange_preset_2, 2, 2, 1, 1) + + self.radioButton_move_preset_3 = QRadioButton(self.groupBox_3) + self.radioButton_move_preset_3.setObjectName(u"radioButton_move_preset_3") + self.radioButton_move_preset_3.setFont(font1) + + self.gridLayout_3.addWidget(self.radioButton_move_preset_3, 3, 0, 1, 1) + + self.label_moveLength_preset_3 = QLabel(self.groupBox_3) + self.label_moveLength_preset_3.setObjectName(u"label_moveLength_preset_3") + self.label_moveLength_preset_3.setFont(font1) + self.label_moveLength_preset_3.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_moveLength_preset_3, 3, 1, 1, 1) + + self.spinBox_maxRange = QSpinBox(self.groupBox_3) + self.spinBox_maxRange.setObjectName(u"spinBox_maxRange") + self.spinBox_maxRange.setFont(font1) + self.spinBox_maxRange.setButtonSymbols(QAbstractSpinBox.ButtonSymbols.NoButtons) + + self.gridLayout_3.addWidget(self.spinBox_maxRange, 4, 2, 1, 1) + + self.label_moveSpeed_preset_2 = QLabel(self.groupBox_3) + self.label_moveSpeed_preset_2.setObjectName(u"label_moveSpeed_preset_2") + self.label_moveSpeed_preset_2.setFont(font1) + self.label_moveSpeed_preset_2.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_moveSpeed_preset_2, 2, 3, 1, 1) + + self.spinBox_moveSpeed = QSpinBox(self.groupBox_3) + self.spinBox_moveSpeed.setObjectName(u"spinBox_moveSpeed") + self.spinBox_moveSpeed.setFont(font1) + self.spinBox_moveSpeed.setButtonSymbols(QAbstractSpinBox.ButtonSymbols.NoButtons) + + self.gridLayout_3.addWidget(self.spinBox_moveSpeed, 4, 3, 1, 1) + + self.label_moveLength_preset_2 = QLabel(self.groupBox_3) + self.label_moveLength_preset_2.setObjectName(u"label_moveLength_preset_2") + self.label_moveLength_preset_2.setFont(font1) + self.label_moveLength_preset_2.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_moveLength_preset_2, 2, 1, 1, 1) + + self.radioButton_move_custom = QRadioButton(self.groupBox_3) + self.radioButton_move_custom.setObjectName(u"radioButton_move_custom") + self.radioButton_move_custom.setFont(font1) + + self.gridLayout_3.addWidget(self.radioButton_move_custom, 4, 0, 1, 1) + + self.label_moveSpeed_preset_1 = QLabel(self.groupBox_3) + self.label_moveSpeed_preset_1.setObjectName(u"label_moveSpeed_preset_1") + self.label_moveSpeed_preset_1.setFont(font1) + self.label_moveSpeed_preset_1.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_moveSpeed_preset_1, 1, 3, 1, 1) + + self.label_7 = QLabel(self.groupBox_3) + self.label_7.setObjectName(u"label_7") + sizePolicy3 = QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Maximum) + sizePolicy3.setHorizontalStretch(0) + sizePolicy3.setVerticalStretch(0) + sizePolicy3.setHeightForWidth(self.label_7.sizePolicy().hasHeightForWidth()) + self.label_7.setSizePolicy(sizePolicy3) + self.label_7.setFont(font1) + self.label_7.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_7, 0, 1, 1, 1) + + self.label_6 = QLabel(self.groupBox_3) + self.label_6.setObjectName(u"label_6") + sizePolicy3.setHeightForWidth(self.label_6.sizePolicy().hasHeightForWidth()) + self.label_6.setSizePolicy(sizePolicy3) + self.label_6.setFont(font1) + self.label_6.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_6, 0, 2, 1, 1) + + self.label_8 = QLabel(self.groupBox_3) + self.label_8.setObjectName(u"label_8") + sizePolicy3.setHeightForWidth(self.label_8.sizePolicy().hasHeightForWidth()) + self.label_8.setSizePolicy(sizePolicy3) + self.label_8.setFont(font1) + self.label_8.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_8, 0, 3, 1, 1) + + self.gridLayout_3.setRowStretch(0, 1) + self.gridLayout_3.setRowStretch(1, 1) + self.gridLayout_3.setRowStretch(2, 1) + self.gridLayout_3.setRowStretch(3, 1) + self.gridLayout_3.setRowStretch(4, 1) + self.gridLayout_3.setColumnStretch(0, 1) + self.gridLayout_3.setColumnStretch(1, 1) + self.gridLayout_3.setColumnStretch(2, 1) + self.gridLayout_3.setColumnStretch(3, 1) + + self.verticalLayout_4.addLayout(self.gridLayout_3) + + self.verticalLayout_4.setStretch(0, 4) + + self.verticalLayout_3.addWidget(self.groupBox_3) + + self.verticalLayout_3.setStretch(0, 2) + self.verticalLayout_3.setStretch(1, 1) + self.verticalLayout_3.setStretch(2, 8) + + self.verticalLayout_2.addWidget(self.groupBox_2) + + self.verticalSpacer_3 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding) + + self.verticalLayout_2.addItem(self.verticalSpacer_3) + + self.pushButton = QPushButton(self.groupBox_left) + self.pushButton.setObjectName(u"pushButton") + sizePolicy.setHeightForWidth(self.pushButton.sizePolicy().hasHeightForWidth()) + self.pushButton.setSizePolicy(sizePolicy) + self.pushButton.setFont(font1) + + self.verticalLayout_2.addWidget(self.pushButton) + + self.verticalLayout_2.setStretch(0, 1) + self.verticalLayout_2.setStretch(1, 1) + self.verticalLayout_2.setStretch(2, 3) + self.verticalLayout_2.setStretch(3, 1) + self.verticalLayout_2.setStretch(4, 6) + self.verticalLayout_2.setStretch(5, 1) + self.verticalLayout_2.setStretch(6, 1) + + self.gridLayout.addWidget(self.groupBox_left, 0, 0, 1, 1) + + self.groupBox_right = QGroupBox(self.centralwidget) + self.groupBox_right.setObjectName(u"groupBox_right") + self.groupBox_right.setFont(font) + self.gridLayout_4 = QGridLayout(self.groupBox_right) + self.gridLayout_4.setObjectName(u"gridLayout_4") + self.spinBox_duration_type_3 = QSpinBox(self.groupBox_right) + self.spinBox_duration_type_3.setObjectName(u"spinBox_duration_type_3") + self.spinBox_duration_type_3.setFont(font1) + self.spinBox_duration_type_3.setButtonSymbols(QAbstractSpinBox.ButtonSymbols.NoButtons) + self.spinBox_duration_type_3.setMaximum(1000000000) + + self.gridLayout_4.addWidget(self.spinBox_duration_type_3, 5, 2, 1, 1) + + self.spinBox_duration_type_4 = QSpinBox(self.groupBox_right) + self.spinBox_duration_type_4.setObjectName(u"spinBox_duration_type_4") + self.spinBox_duration_type_4.setFont(font1) + self.spinBox_duration_type_4.setButtonSymbols(QAbstractSpinBox.ButtonSymbols.NoButtons) + self.spinBox_duration_type_4.setMaximum(1000000000) + + self.gridLayout_4.addWidget(self.spinBox_duration_type_4, 7, 2, 1, 1) + + self.verticalSpacer_5 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding) + + self.gridLayout_4.addItem(self.verticalSpacer_5, 10, 0, 1, 3) + + self.spinBox_duration_type_2 = QSpinBox(self.groupBox_right) + self.spinBox_duration_type_2.setObjectName(u"spinBox_duration_type_2") + self.spinBox_duration_type_2.setFont(font1) + self.spinBox_duration_type_2.setButtonSymbols(QAbstractSpinBox.ButtonSymbols.NoButtons) + self.spinBox_duration_type_2.setMaximum(1000000000) + + self.gridLayout_4.addWidget(self.spinBox_duration_type_2, 3, 2, 1, 1) + + self.pushButton_type_1 = QPushButton(self.groupBox_right) + self.pushButton_type_1.setObjectName(u"pushButton_type_1") + sizePolicy4 = QSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Preferred) + sizePolicy4.setHorizontalStretch(0) + sizePolicy4.setVerticalStretch(0) + sizePolicy4.setHeightForWidth(self.pushButton_type_1.sizePolicy().hasHeightForWidth()) + self.pushButton_type_1.setSizePolicy(sizePolicy4) + font2 = QFont() + font2.setPointSize(20) + self.pushButton_type_1.setFont(font2) + + self.gridLayout_4.addWidget(self.pushButton_type_1, 0, 0, 1, 1) + + self.tableWidget_type_1 = QTableWidget(self.groupBox_right) + if (self.tableWidget_type_1.columnCount() < 3): + self.tableWidget_type_1.setColumnCount(3) + self.tableWidget_type_1.setObjectName(u"tableWidget_type_1") + self.tableWidget_type_1.setFont(font) + self.tableWidget_type_1.setColumnCount(3) + self.tableWidget_type_1.horizontalHeader().setMinimumSectionSize(42) + self.tableWidget_type_1.horizontalHeader().setDefaultSectionSize(70) + + self.gridLayout_4.addWidget(self.tableWidget_type_1, 0, 1, 1, 2) + + self.spinBox_amount_type_3 = QSpinBox(self.groupBox_right) + self.spinBox_amount_type_3.setObjectName(u"spinBox_amount_type_3") + self.spinBox_amount_type_3.setFont(font1) + self.spinBox_amount_type_3.setButtonSymbols(QAbstractSpinBox.ButtonSymbols.NoButtons) + self.spinBox_amount_type_3.setMaximum(1000000000) + + self.gridLayout_4.addWidget(self.spinBox_amount_type_3, 5, 1, 1, 1) + + self.spinBox_duration_type_5 = QSpinBox(self.groupBox_right) + self.spinBox_duration_type_5.setObjectName(u"spinBox_duration_type_5") + self.spinBox_duration_type_5.setFont(font1) + self.spinBox_duration_type_5.setButtonSymbols(QAbstractSpinBox.ButtonSymbols.NoButtons) + self.spinBox_duration_type_5.setMaximum(1000000000) + + self.gridLayout_4.addWidget(self.spinBox_duration_type_5, 9, 2, 1, 1) + + self.spinBox_amount_type_1 = QSpinBox(self.groupBox_right) + self.spinBox_amount_type_1.setObjectName(u"spinBox_amount_type_1") + self.spinBox_amount_type_1.setFont(font1) + self.spinBox_amount_type_1.setButtonSymbols(QAbstractSpinBox.ButtonSymbols.NoButtons) + self.spinBox_amount_type_1.setMaximum(1000000000) + + self.gridLayout_4.addWidget(self.spinBox_amount_type_1, 1, 1, 1, 1) + + self.tableWidget_type_3 = QTableWidget(self.groupBox_right) + if (self.tableWidget_type_3.columnCount() < 3): + self.tableWidget_type_3.setColumnCount(3) + self.tableWidget_type_3.setObjectName(u"tableWidget_type_3") + self.tableWidget_type_3.setFont(font) + self.tableWidget_type_3.setColumnCount(3) + self.tableWidget_type_3.horizontalHeader().setMinimumSectionSize(42) + self.tableWidget_type_3.horizontalHeader().setDefaultSectionSize(70) + + self.gridLayout_4.addWidget(self.tableWidget_type_3, 4, 1, 1, 2) + + self.tableWidget_type_5 = QTableWidget(self.groupBox_right) + if (self.tableWidget_type_5.columnCount() < 3): + self.tableWidget_type_5.setColumnCount(3) + self.tableWidget_type_5.setObjectName(u"tableWidget_type_5") + self.tableWidget_type_5.setFont(font) + self.tableWidget_type_5.setColumnCount(3) + self.tableWidget_type_5.horizontalHeader().setMinimumSectionSize(42) + self.tableWidget_type_5.horizontalHeader().setDefaultSectionSize(70) + + self.gridLayout_4.addWidget(self.tableWidget_type_5, 8, 1, 1, 2) + + self.tableWidget_type_2 = QTableWidget(self.groupBox_right) + if (self.tableWidget_type_2.columnCount() < 3): + self.tableWidget_type_2.setColumnCount(3) + self.tableWidget_type_2.setObjectName(u"tableWidget_type_2") + self.tableWidget_type_2.setFont(font) + self.tableWidget_type_2.setColumnCount(3) + self.tableWidget_type_2.horizontalHeader().setMinimumSectionSize(42) + self.tableWidget_type_2.horizontalHeader().setDefaultSectionSize(70) + + self.gridLayout_4.addWidget(self.tableWidget_type_2, 2, 1, 1, 2) + + self.label_13 = QLabel(self.groupBox_right) + self.label_13.setObjectName(u"label_13") + self.label_13.setFont(font1) + + self.gridLayout_4.addWidget(self.label_13, 9, 0, 1, 1) + + self.label_9 = QLabel(self.groupBox_right) + self.label_9.setObjectName(u"label_9") + self.label_9.setFont(font1) + + self.gridLayout_4.addWidget(self.label_9, 1, 0, 1, 1) + + self.spinBox_amount_type_2 = QSpinBox(self.groupBox_right) + self.spinBox_amount_type_2.setObjectName(u"spinBox_amount_type_2") + self.spinBox_amount_type_2.setFont(font1) + self.spinBox_amount_type_2.setButtonSymbols(QAbstractSpinBox.ButtonSymbols.NoButtons) + self.spinBox_amount_type_2.setMaximum(1000000000) + + self.gridLayout_4.addWidget(self.spinBox_amount_type_2, 3, 1, 1, 1) + + self.pushButton_type_4 = QPushButton(self.groupBox_right) + self.pushButton_type_4.setObjectName(u"pushButton_type_4") + sizePolicy4.setHeightForWidth(self.pushButton_type_4.sizePolicy().hasHeightForWidth()) + self.pushButton_type_4.setSizePolicy(sizePolicy4) + self.pushButton_type_4.setFont(font2) + + self.gridLayout_4.addWidget(self.pushButton_type_4, 6, 0, 1, 1) + + self.spinBox_amount_type_4 = QSpinBox(self.groupBox_right) + self.spinBox_amount_type_4.setObjectName(u"spinBox_amount_type_4") + self.spinBox_amount_type_4.setFont(font1) + self.spinBox_amount_type_4.setButtonSymbols(QAbstractSpinBox.ButtonSymbols.NoButtons) + self.spinBox_amount_type_4.setMaximum(1000000000) + + self.gridLayout_4.addWidget(self.spinBox_amount_type_4, 7, 1, 1, 1) + + self.label_12 = QLabel(self.groupBox_right) + self.label_12.setObjectName(u"label_12") + self.label_12.setFont(font1) + + self.gridLayout_4.addWidget(self.label_12, 7, 0, 1, 1) + + self.spinBox_duration_type_1 = QSpinBox(self.groupBox_right) + self.spinBox_duration_type_1.setObjectName(u"spinBox_duration_type_1") + self.spinBox_duration_type_1.setFont(font1) + self.spinBox_duration_type_1.setButtonSymbols(QAbstractSpinBox.ButtonSymbols.NoButtons) + self.spinBox_duration_type_1.setMaximum(1000000000) + + self.gridLayout_4.addWidget(self.spinBox_duration_type_1, 1, 2, 1, 1) + + self.spinBox_amount_type_5 = QSpinBox(self.groupBox_right) + self.spinBox_amount_type_5.setObjectName(u"spinBox_amount_type_5") + self.spinBox_amount_type_5.setFont(font1) + self.spinBox_amount_type_5.setButtonSymbols(QAbstractSpinBox.ButtonSymbols.NoButtons) + self.spinBox_amount_type_5.setMaximum(1000000000) + + self.gridLayout_4.addWidget(self.spinBox_amount_type_5, 9, 1, 1, 1) + + self.label_10 = QLabel(self.groupBox_right) + self.label_10.setObjectName(u"label_10") + self.label_10.setFont(font1) + + self.gridLayout_4.addWidget(self.label_10, 3, 0, 1, 1) + + self.label_11 = QLabel(self.groupBox_right) + self.label_11.setObjectName(u"label_11") + self.label_11.setFont(font1) + + self.gridLayout_4.addWidget(self.label_11, 5, 0, 1, 1) + + self.pushButton_type_3 = QPushButton(self.groupBox_right) + self.pushButton_type_3.setObjectName(u"pushButton_type_3") + sizePolicy4.setHeightForWidth(self.pushButton_type_3.sizePolicy().hasHeightForWidth()) + self.pushButton_type_3.setSizePolicy(sizePolicy4) + self.pushButton_type_3.setFont(font2) + + self.gridLayout_4.addWidget(self.pushButton_type_3, 4, 0, 1, 1) + + self.pushButton_type_2 = QPushButton(self.groupBox_right) + self.pushButton_type_2.setObjectName(u"pushButton_type_2") + sizePolicy4.setHeightForWidth(self.pushButton_type_2.sizePolicy().hasHeightForWidth()) + self.pushButton_type_2.setSizePolicy(sizePolicy4) + self.pushButton_type_2.setFont(font2) + + self.gridLayout_4.addWidget(self.pushButton_type_2, 2, 0, 1, 1) + + self.tableWidget_type_4 = QTableWidget(self.groupBox_right) + if (self.tableWidget_type_4.columnCount() < 3): + self.tableWidget_type_4.setColumnCount(3) + self.tableWidget_type_4.setObjectName(u"tableWidget_type_4") + self.tableWidget_type_4.setFont(font) + self.tableWidget_type_4.setColumnCount(3) + self.tableWidget_type_4.horizontalHeader().setMinimumSectionSize(42) + self.tableWidget_type_4.horizontalHeader().setDefaultSectionSize(70) + + self.gridLayout_4.addWidget(self.tableWidget_type_4, 6, 1, 1, 2) + + self.pushButton_type_5 = QPushButton(self.groupBox_right) + self.pushButton_type_5.setObjectName(u"pushButton_type_5") + sizePolicy4.setHeightForWidth(self.pushButton_type_5.sizePolicy().hasHeightForWidth()) + self.pushButton_type_5.setSizePolicy(sizePolicy4) + self.pushButton_type_5.setFont(font2) + + self.gridLayout_4.addWidget(self.pushButton_type_5, 8, 0, 1, 1) + + self.pushButton_delete = QPushButton(self.groupBox_right) + self.pushButton_delete.setObjectName(u"pushButton_delete") + sizePolicy4.setHeightForWidth(self.pushButton_delete.sizePolicy().hasHeightForWidth()) + self.pushButton_delete.setSizePolicy(sizePolicy4) + self.pushButton_delete.setFont(font1) + + self.gridLayout_4.addWidget(self.pushButton_delete, 11, 0, 1, 3) + + self.gridLayout_4.setRowStretch(0, 3) + self.gridLayout_4.setRowStretch(1, 1) + self.gridLayout_4.setRowStretch(2, 3) + self.gridLayout_4.setRowStretch(3, 1) + self.gridLayout_4.setRowStretch(4, 3) + self.gridLayout_4.setRowStretch(5, 1) + self.gridLayout_4.setRowStretch(6, 3) + self.gridLayout_4.setRowStretch(7, 1) + self.gridLayout_4.setRowStretch(8, 3) + self.gridLayout_4.setRowStretch(9, 1) + self.gridLayout_4.setRowStretch(10, 1) + self.gridLayout_4.setRowStretch(11, 1) + + self.gridLayout.addWidget(self.groupBox_right, 0, 2, 1, 1) + + self.gridLayout.setColumnStretch(0, 2) + self.gridLayout.setColumnStretch(1, 6) + self.gridLayout.setColumnStretch(2, 2) + MainWindow_artifact_label.setCentralWidget(self.centralwidget) + self.statusbar = QStatusBar(MainWindow_artifact_label) + self.statusbar.setObjectName(u"statusbar") + MainWindow_artifact_label.setStatusBar(self.statusbar) + + self.retranslateUi(MainWindow_artifact_label) + + QMetaObject.connectSlotsByName(MainWindow_artifact_label) + # setupUi + + def retranslateUi(self, MainWindow_artifact_label): + MainWindow_artifact_label.setWindowTitle(QCoreApplication.translate("MainWindow_artifact_label", u"\u4f53\u52a8\u6807\u6ce8", None)) + self.groupBox_canvas.setTitle(QCoreApplication.translate("MainWindow_artifact_label", u"\u7ed8\u56fe\u533a", None)) + self.groupBox_left.setTitle(QCoreApplication.translate("MainWindow_artifact_label", u"\u4f53\u52a8\u6807\u6ce8", None)) + self.pushButton_input_setting.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u5bfc\u5165\u8bbe\u7f6e", None)) + self.pushButton_input.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u5f00\u59cb\u5bfc\u5165", None)) + self.groupBox.setTitle(QCoreApplication.translate("MainWindow_artifact_label", u"\u6807\u6ce8\u53c2\u6570", None)) + self.label_3.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u8d77\u59cb\u65f6\u95f4(ms)", None)) + self.label_4.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u7ec8\u6b62\u65f6\u95f4(ms)", None)) + self.label.setText(QCoreApplication.translate("MainWindow_artifact_label", u"orgBcg 20Hz\u4ee5\u4e0a\u80fd\u91cf\u5360\u6bd4", None)) + self.label_5.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u4f53\u52a8\u65f6\u957f(ms)", None)) + self.label_2.setText(QCoreApplication.translate("MainWindow_artifact_label", u"BCG 20Hz\u4ee5\u4e0a\u80fd\u91cf\u5360\u6bd4", None)) + self.groupBox_2.setTitle(QCoreApplication.translate("MainWindow_artifact_label", u"\u81ea\u52a8\u64ad\u653e", None)) + self.pushButton_prev_move.setText(QCoreApplication.translate("MainWindow_artifact_label", u"< <(A)", None)) + self.pushButton_pause.setText(QCoreApplication.translate("MainWindow_artifact_label", u"| |(S)", None)) + self.pushButton_next_move.setText(QCoreApplication.translate("MainWindow_artifact_label", u"> >(D)", None)) + self.groupBox_3.setTitle(QCoreApplication.translate("MainWindow_artifact_label", u"\u8bbe\u7f6e", None)) + self.label_moveLength_preset_1.setText(QCoreApplication.translate("MainWindow_artifact_label", u"10000", None)) + self.label_maxRange_preset_1.setText(QCoreApplication.translate("MainWindow_artifact_label", u"40000", None)) + self.radioButton_move_preset_1.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u9884\u8bbe1", None)) + self.label_moveSpeed_preset_3.setText(QCoreApplication.translate("MainWindow_artifact_label", u"500", None)) + self.radioButton_move_preset_2.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u9884\u8bbe2", None)) + self.label_maxRange_preset_3.setText(QCoreApplication.translate("MainWindow_artifact_label", u"100000", None)) + self.label_maxRange_preset_2.setText(QCoreApplication.translate("MainWindow_artifact_label", u"80000", None)) + self.radioButton_move_preset_3.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u9884\u8bbe3", None)) + self.label_moveLength_preset_3.setText(QCoreApplication.translate("MainWindow_artifact_label", u"25000", None)) + self.label_moveSpeed_preset_2.setText(QCoreApplication.translate("MainWindow_artifact_label", u"500", None)) + self.label_moveLength_preset_2.setText(QCoreApplication.translate("MainWindow_artifact_label", u"20000", None)) + self.radioButton_move_custom.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u81ea\u5b9a\u4e49", None)) + self.label_moveSpeed_preset_1.setText(QCoreApplication.translate("MainWindow_artifact_label", u"500", None)) + self.label_7.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u79fb\u52a8\u8ddd\u79bb", None)) + self.label_6.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u6700\u5927\u8303\u56f4", None)) + self.label_8.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u79fb\u52a8\u95f4\u9694(ms)", None)) + self.pushButton.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u5bfc\u51fa\u6807\u7b7e", None)) + self.groupBox_right.setTitle(QCoreApplication.translate("MainWindow_artifact_label", u"\u6807\u6ce8\u64cd\u4f5c\u548c\u4fe1\u606f", None)) + self.pushButton_type_1.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u5267\u70c8\u4f53\u52a8", None)) + self.label_13.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u4e2a\u6570&\u7d2f\u8ba1\u65f6\u957f(ms)", None)) + self.label_9.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u4e2a\u6570&\u7d2f\u8ba1\u65f6\u957f(ms)", None)) + self.pushButton_type_4.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u7591\u4f3c\u9f3e\u58f0", None)) + self.label_12.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u4e2a\u6570&\u7d2f\u8ba1\u65f6\u957f(ms)", None)) + self.label_10.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u4e2a\u6570&\u7d2f\u8ba1\u65f6\u957f(ms)", None)) + self.label_11.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u4e2a\u6570&\u7d2f\u8ba1\u65f6\u957f(ms)", None)) + self.pushButton_type_3.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u5e38\u89c4\u4f53\u52a8", None)) + self.pushButton_type_2.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u8109\u51b2\u4f53\u52a8", None)) + self.pushButton_type_5.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u79bb\u5e8a", None)) + self.pushButton_delete.setText(QCoreApplication.translate("MainWindow_artifact_label", u"\u5220\u9664\u6807\u7b7e", None)) + # retranslateUi + diff --git a/ui/MainWindow/MainWindow_artifact_label.ui b/ui/MainWindow/MainWindow_artifact_label.ui new file mode 100644 index 0000000..592a275 --- /dev/null +++ b/ui/MainWindow/MainWindow_artifact_label.ui @@ -0,0 +1,1138 @@ + + + MainWindow_artifact_label + + + + 0 + 0 + 1920 + 1080 + + + + 体动标注 + + + + + + + + 10 + + + + 绘图区 + + + + + + + + + + + + + 10 + + + + 体动标注 + + + + + + + + + 0 + 0 + + + + + 12 + + + + 导入设置 + + + + + + + + 0 + 0 + + + + + 12 + + + + 开始导入 + + + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + + + + 标注参数 + + + + + + + 0 + 0 + + + + + 12 + + + + 起始时间(ms) + + + + + + + + 0 + 0 + + + + + 12 + + + + 终止时间(ms) + + + + + + + + 0 + 0 + + + + + 12 + + + + orgBcg 20Hz以上能量占比 + + + + + + + + 0 + 0 + + + + + 12 + + + + 体动时长(ms) + + + + + + + + 0 + 0 + + + + + 12 + + + + BCG 20Hz以上能量占比 + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + + + + false + + + + 0 + 0 + + + + + + + + false + + + + 0 + 0 + + + + + + + + false + + + + 0 + 0 + + + + + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + + + + 自动播放 + + + + + + + + + 0 + 0 + + + + + 12 + + + + < <(A) + + + + + + + + 0 + 0 + + + + + 12 + + + + | |(S) + + + + + + + + 0 + 0 + + + + + 12 + + + + > >(D) + + + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + + + + 设置 + + + + + + + + + 12 + + + + 10000 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + 40000 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + 预设1 + + + true + + + + + + + + 12 + + + + 500 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + QAbstractSpinBox::ButtonSymbols::NoButtons + + + + + + + + 12 + + + + 预设2 + + + + + + + + 12 + + + + 100000 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + 80000 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + 预设3 + + + + + + + + 12 + + + + 25000 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + QAbstractSpinBox::ButtonSymbols::NoButtons + + + + + + + + 12 + + + + 500 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + QAbstractSpinBox::ButtonSymbols::NoButtons + + + + + + + + 12 + + + + 20000 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + 自定义 + + + + + + + + 12 + + + + 500 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 0 + 0 + + + + + 12 + + + + 移动距离 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 0 + 0 + + + + + 12 + + + + 最大范围 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 0 + 0 + + + + + 12 + + + + 移动间隔(ms) + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + + + + + 0 + 0 + + + + + 12 + + + + 导出标签 + + + + + + + + + + + 10 + + + + 标注操作和信息 + + + + + + + 12 + + + + QAbstractSpinBox::ButtonSymbols::NoButtons + + + 1000000000 + + + + + + + + 12 + + + + QAbstractSpinBox::ButtonSymbols::NoButtons + + + 1000000000 + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + + + + + 12 + + + + QAbstractSpinBox::ButtonSymbols::NoButtons + + + 1000000000 + + + + + + + + 0 + 0 + + + + + 20 + + + + 剧烈体动 + + + + + + + + 10 + + + + 3 + + + 42 + + + 70 + + + + + + + + + + + 12 + + + + QAbstractSpinBox::ButtonSymbols::NoButtons + + + 1000000000 + + + + + + + + 12 + + + + QAbstractSpinBox::ButtonSymbols::NoButtons + + + 1000000000 + + + + + + + + 12 + + + + QAbstractSpinBox::ButtonSymbols::NoButtons + + + 1000000000 + + + + + + + + 10 + + + + 3 + + + 42 + + + 70 + + + + + + + + + + + 10 + + + + 3 + + + 42 + + + 70 + + + + + + + + + + + 10 + + + + 3 + + + 42 + + + 70 + + + + + + + + + + + 12 + + + + 个数&累计时长(ms) + + + + + + + + 12 + + + + 个数&累计时长(ms) + + + + + + + + 12 + + + + QAbstractSpinBox::ButtonSymbols::NoButtons + + + 1000000000 + + + + + + + + 0 + 0 + + + + + 20 + + + + 疑似鼾声 + + + + + + + + 12 + + + + QAbstractSpinBox::ButtonSymbols::NoButtons + + + 1000000000 + + + + + + + + 12 + + + + 个数&累计时长(ms) + + + + + + + + 12 + + + + QAbstractSpinBox::ButtonSymbols::NoButtons + + + 1000000000 + + + + + + + + 12 + + + + QAbstractSpinBox::ButtonSymbols::NoButtons + + + 1000000000 + + + + + + + + 12 + + + + 个数&累计时长(ms) + + + + + + + + 12 + + + + 个数&累计时长(ms) + + + + + + + + 0 + 0 + + + + + 20 + + + + 常规体动 + + + + + + + + 0 + 0 + + + + + 20 + + + + 脉冲体动 + + + + + + + + 10 + + + + 3 + + + 42 + + + 70 + + + + + + + + + + + 0 + 0 + + + + + 20 + + + + 离床 + + + + + + + + 0 + 0 + + + + + 12 + + + + 删除标签 + + + + + + + + + + + + + diff --git a/ui/MainWindow/MainWindow_detect_Jpeak.py b/ui/MainWindow/MainWindow_detect_Jpeak.py index 3b269a3..7e699ac 100644 --- a/ui/MainWindow/MainWindow_detect_Jpeak.py +++ b/ui/MainWindow/MainWindow_detect_Jpeak.py @@ -51,6 +51,9 @@ class Ui_MainWindow_detect_Jpeak(object): self.gridLayout.setObjectName(u"gridLayout") self.groupBox_canvas = QGroupBox(self.centralwidget) self.groupBox_canvas.setObjectName(u"groupBox_canvas") + font2 = QFont() + font2.setPointSize(10) + self.groupBox_canvas.setFont(font2) self.verticalLayout_7 = QVBoxLayout(self.groupBox_canvas) self.verticalLayout_7.setObjectName(u"verticalLayout_7") self.verticalLayout_canvas = QVBoxLayout() @@ -63,8 +66,6 @@ class Ui_MainWindow_detect_Jpeak(object): self.groupBox_left = QGroupBox(self.centralwidget) self.groupBox_left.setObjectName(u"groupBox_left") - font2 = QFont() - font2.setPointSize(10) self.groupBox_left.setFont(font2) self.verticalLayout = QVBoxLayout(self.groupBox_left) self.verticalLayout.setObjectName(u"verticalLayout") @@ -287,9 +288,9 @@ class Ui_MainWindow_detect_Jpeak(object): self.gridLayout.setColumnStretch(0, 2) self.gridLayout.setColumnStretch(1, 8) MainWindow_detect_Jpeak.setCentralWidget(self.centralwidget) - self.statusBar = QStatusBar(MainWindow_detect_Jpeak) - self.statusBar.setObjectName(u"statusBar") - MainWindow_detect_Jpeak.setStatusBar(self.statusBar) + self.statusbar = QStatusBar(MainWindow_detect_Jpeak) + self.statusbar.setObjectName(u"statusbar") + MainWindow_detect_Jpeak.setStatusBar(self.statusbar) self.retranslateUi(MainWindow_detect_Jpeak) diff --git a/ui/MainWindow/MainWindow_detect_Jpeak.ui b/ui/MainWindow/MainWindow_detect_Jpeak.ui index 2d677b0..4ebbc38 100644 --- a/ui/MainWindow/MainWindow_detect_Jpeak.ui +++ b/ui/MainWindow/MainWindow_detect_Jpeak.ui @@ -31,6 +31,11 @@ + + + 10 + + 绘图区 @@ -402,7 +407,7 @@ - + 数据路径选择 diff --git a/ui/MainWindow/MainWindow_detect_Rpeak.py b/ui/MainWindow/MainWindow_detect_Rpeak.py new file mode 100644 index 0000000..0065a81 --- /dev/null +++ b/ui/MainWindow/MainWindow_detect_Rpeak.py @@ -0,0 +1,238 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'MainWindow_detect_Rpeak.ui' +## +## Created by: Qt User Interface Compiler version 6.8.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, + QFont, QFontDatabase, QGradient, QIcon, + QImage, QKeySequence, QLinearGradient, QPainter, + QPalette, QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QApplication, QComboBox, QDoubleSpinBox, QGridLayout, + QGroupBox, QHBoxLayout, QLabel, QMainWindow, + QPushButton, QSizePolicy, QSpacerItem, QSpinBox, + QStatusBar, QTextBrowser, QVBoxLayout, QWidget) + +class Ui_MainWindow_detect_Rpeak(object): + def setupUi(self, MainWindow_detect_Rpeak): + if not MainWindow_detect_Rpeak.objectName(): + MainWindow_detect_Rpeak.setObjectName(u"MainWindow_detect_Rpeak") + MainWindow_detect_Rpeak.resize(1920, 1080) + self.centralwidget = QWidget(MainWindow_detect_Rpeak) + self.centralwidget.setObjectName(u"centralwidget") + self.gridLayout = QGridLayout(self.centralwidget) + self.gridLayout.setObjectName(u"gridLayout") + self.groupBox_left = QGroupBox(self.centralwidget) + self.groupBox_left.setObjectName(u"groupBox_left") + font = QFont() + font.setPointSize(10) + self.groupBox_left.setFont(font) + self.verticalLayout = QVBoxLayout(self.groupBox_left) + self.verticalLayout.setObjectName(u"verticalLayout") + self.horizontalLayout_4 = QHBoxLayout() + self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") + self.pushButton_input_setting = QPushButton(self.groupBox_left) + self.pushButton_input_setting.setObjectName(u"pushButton_input_setting") + sizePolicy = QSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_input_setting.sizePolicy().hasHeightForWidth()) + self.pushButton_input_setting.setSizePolicy(sizePolicy) + font1 = QFont() + font1.setPointSize(12) + self.pushButton_input_setting.setFont(font1) + + self.horizontalLayout_4.addWidget(self.pushButton_input_setting) + + self.pushButton_input = QPushButton(self.groupBox_left) + self.pushButton_input.setObjectName(u"pushButton_input") + sizePolicy.setHeightForWidth(self.pushButton_input.sizePolicy().hasHeightForWidth()) + self.pushButton_input.setSizePolicy(sizePolicy) + self.pushButton_input.setFont(font1) + + self.horizontalLayout_4.addWidget(self.pushButton_input) + + + self.verticalLayout.addLayout(self.horizontalLayout_4) + + self.groupBox_args = QGroupBox(self.groupBox_left) + self.groupBox_args.setObjectName(u"groupBox_args") + self.verticalLayout_5 = QVBoxLayout(self.groupBox_args) + self.verticalLayout_5.setObjectName(u"verticalLayout_5") + self.groupBox_2 = QGroupBox(self.groupBox_args) + self.groupBox_2.setObjectName(u"groupBox_2") + self.horizontalLayout_5 = QHBoxLayout(self.groupBox_2) + self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") + self.label = QLabel(self.groupBox_2) + self.label.setObjectName(u"label") + self.label.setFont(font1) + + self.horizontalLayout_5.addWidget(self.label) + + self.doubleSpinBox_bandPassLow = QDoubleSpinBox(self.groupBox_2) + self.doubleSpinBox_bandPassLow.setObjectName(u"doubleSpinBox_bandPassLow") + self.doubleSpinBox_bandPassLow.setFont(font1) + self.doubleSpinBox_bandPassLow.setMaximum(100.000000000000000) + + self.horizontalLayout_5.addWidget(self.doubleSpinBox_bandPassLow) + + self.label_5 = QLabel(self.groupBox_2) + self.label_5.setObjectName(u"label_5") + self.label_5.setFont(font1) + self.label_5.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.horizontalLayout_5.addWidget(self.label_5) + + self.doubleSpinBox_bandPassHigh = QDoubleSpinBox(self.groupBox_2) + self.doubleSpinBox_bandPassHigh.setObjectName(u"doubleSpinBox_bandPassHigh") + self.doubleSpinBox_bandPassHigh.setFont(font1) + self.doubleSpinBox_bandPassHigh.setMaximum(100.000000000000000) + + self.horizontalLayout_5.addWidget(self.doubleSpinBox_bandPassHigh) + + + self.verticalLayout_5.addWidget(self.groupBox_2) + + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.label_2 = QLabel(self.groupBox_args) + self.label_2.setObjectName(u"label_2") + self.label_2.setFont(font1) + self.label_2.setAlignment(Qt.AlignmentFlag.AlignLeading|Qt.AlignmentFlag.AlignLeft|Qt.AlignmentFlag.AlignVCenter) + + self.horizontalLayout.addWidget(self.label_2) + + self.spinBox_peaksValue = QSpinBox(self.groupBox_args) + self.spinBox_peaksValue.setObjectName(u"spinBox_peaksValue") + self.spinBox_peaksValue.setFont(font1) + self.spinBox_peaksValue.setMinimum(1) + self.spinBox_peaksValue.setMaximum(10000) + + self.horizontalLayout.addWidget(self.spinBox_peaksValue) + + self.horizontalLayout.setStretch(0, 1) + self.horizontalLayout.setStretch(1, 1) + + self.verticalLayout_5.addLayout(self.horizontalLayout) + + self.groupBox_3 = QGroupBox(self.groupBox_args) + self.groupBox_3.setObjectName(u"groupBox_3") + self.verticalLayout_2 = QVBoxLayout(self.groupBox_3) + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.label_7 = QLabel(self.groupBox_3) + self.label_7.setObjectName(u"label_7") + self.label_7.setFont(font1) + self.label_7.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.verticalLayout_2.addWidget(self.label_7) + + self.comboBox_method = QComboBox(self.groupBox_3) + self.comboBox_method.setObjectName(u"comboBox_method") + self.comboBox_method.setFont(font1) + + self.verticalLayout_2.addWidget(self.comboBox_method) + + + self.verticalLayout_5.addWidget(self.groupBox_3) + + self.verticalLayout_5.setStretch(0, 1) + self.verticalLayout_5.setStretch(1, 1) + self.verticalLayout_5.setStretch(2, 3) + + self.verticalLayout.addWidget(self.groupBox_args) + + self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding) + + self.verticalLayout.addItem(self.verticalSpacer) + + self.horizontalLayout_3 = QHBoxLayout() + self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") + self.pushButton_view = QPushButton(self.groupBox_left) + self.pushButton_view.setObjectName(u"pushButton_view") + sizePolicy.setHeightForWidth(self.pushButton_view.sizePolicy().hasHeightForWidth()) + self.pushButton_view.setSizePolicy(sizePolicy) + self.pushButton_view.setFont(font1) + + self.horizontalLayout_3.addWidget(self.pushButton_view) + + self.pushButton_save = QPushButton(self.groupBox_left) + self.pushButton_save.setObjectName(u"pushButton_save") + sizePolicy.setHeightForWidth(self.pushButton_save.sizePolicy().hasHeightForWidth()) + self.pushButton_save.setSizePolicy(sizePolicy) + self.pushButton_save.setFont(font1) + + self.horizontalLayout_3.addWidget(self.pushButton_save) + + + self.verticalLayout.addLayout(self.horizontalLayout_3) + + self.groupBox = QGroupBox(self.groupBox_left) + self.groupBox.setObjectName(u"groupBox") + self.verticalLayout_6 = QVBoxLayout(self.groupBox) + self.verticalLayout_6.setObjectName(u"verticalLayout_6") + self.textBrowser_info = QTextBrowser(self.groupBox) + self.textBrowser_info.setObjectName(u"textBrowser_info") + + self.verticalLayout_6.addWidget(self.textBrowser_info) + + + self.verticalLayout.addWidget(self.groupBox) + + self.verticalLayout.setStretch(0, 1) + self.verticalLayout.setStretch(1, 4) + self.verticalLayout.setStretch(2, 4) + self.verticalLayout.setStretch(3, 1) + self.verticalLayout.setStretch(4, 5) + + self.gridLayout.addWidget(self.groupBox_left, 0, 0, 1, 1) + + self.groupBox_canvas = QGroupBox(self.centralwidget) + self.groupBox_canvas.setObjectName(u"groupBox_canvas") + self.groupBox_canvas.setFont(font) + self.verticalLayout_7 = QVBoxLayout(self.groupBox_canvas) + self.verticalLayout_7.setObjectName(u"verticalLayout_7") + self.verticalLayout_canvas = QVBoxLayout() + self.verticalLayout_canvas.setObjectName(u"verticalLayout_canvas") + + self.verticalLayout_7.addLayout(self.verticalLayout_canvas) + + + self.gridLayout.addWidget(self.groupBox_canvas, 0, 1, 1, 1) + + self.gridLayout.setColumnStretch(0, 2) + self.gridLayout.setColumnStretch(1, 8) + MainWindow_detect_Rpeak.setCentralWidget(self.centralwidget) + self.statusbar = QStatusBar(MainWindow_detect_Rpeak) + self.statusbar.setObjectName(u"statusbar") + MainWindow_detect_Rpeak.setStatusBar(self.statusbar) + + self.retranslateUi(MainWindow_detect_Rpeak) + + QMetaObject.connectSlotsByName(MainWindow_detect_Rpeak) + # setupUi + + def retranslateUi(self, MainWindow_detect_Rpeak): + MainWindow_detect_Rpeak.setWindowTitle(QCoreApplication.translate("MainWindow_detect_Rpeak", u"ECG\u7684R\u5cf0\u7b97\u6cd5\u5b9a\u4f4d", None)) + self.groupBox_left.setTitle(QCoreApplication.translate("MainWindow_detect_Rpeak", u"\u9884\u5904\u7406", None)) + self.pushButton_input_setting.setText(QCoreApplication.translate("MainWindow_detect_Rpeak", u"\u5bfc\u5165\u8bbe\u7f6e", None)) + self.pushButton_input.setText(QCoreApplication.translate("MainWindow_detect_Rpeak", u"\u5f00\u59cb\u5bfc\u5165", None)) + self.groupBox_args.setTitle(QCoreApplication.translate("MainWindow_detect_Rpeak", u"\u53c2\u6570\u8f93\u5165", None)) + self.groupBox_2.setTitle(QCoreApplication.translate("MainWindow_detect_Rpeak", u"ECG\u7684\u5e26\u901a\u6ee4\u6ce2", None)) + self.label.setText(QCoreApplication.translate("MainWindow_detect_Rpeak", u"\u622a\u6b62\u9891\u7387(Hz)\uff1a", None)) + self.label_5.setText(QCoreApplication.translate("MainWindow_detect_Rpeak", u"~", None)) + self.label_2.setText(QCoreApplication.translate("MainWindow_detect_Rpeak", u"\u5bfb\u5cf0\u9608\u503c(\u4e2a)", None)) + self.groupBox_3.setTitle(QCoreApplication.translate("MainWindow_detect_Rpeak", u"\u65b9\u6cd5\u8bbe\u7f6e", None)) + self.label_7.setText(QCoreApplication.translate("MainWindow_detect_Rpeak", u"\u68c0\u6d4b\u65b9\u6cd5\u9009\u62e9", None)) + self.pushButton_view.setText(QCoreApplication.translate("MainWindow_detect_Rpeak", u"\u67e5\u770b\u7ed3\u679c", None)) + self.pushButton_save.setText(QCoreApplication.translate("MainWindow_detect_Rpeak", u"\u4fdd\u5b58\u7ed3\u679c", None)) + self.groupBox.setTitle(QCoreApplication.translate("MainWindow_detect_Rpeak", u"\u65e5\u5fd7", None)) + self.groupBox_canvas.setTitle(QCoreApplication.translate("MainWindow_detect_Rpeak", u"\u7ed8\u56fe\u533a", None)) + # retranslateUi + diff --git a/ui/MainWindow/MainWindow_detect_Rpeak.ui b/ui/MainWindow/MainWindow_detect_Rpeak.ui new file mode 100644 index 0000000..06bbba1 --- /dev/null +++ b/ui/MainWindow/MainWindow_detect_Rpeak.ui @@ -0,0 +1,296 @@ + + + MainWindow_detect_Rpeak + + + + 0 + 0 + 1920 + 1080 + + + + ECG的R峰算法定位 + + + + + + + + 10 + + + + 预处理 + + + + + + + + + 0 + 0 + + + + + 12 + + + + 导入设置 + + + + + + + + 0 + 0 + + + + + 12 + + + + 开始导入 + + + + + + + + + 参数输入 + + + + + + ECG的带通滤波 + + + + + + + 12 + + + + 截止频率(Hz): + + + + + + + + 12 + + + + 100.000000000000000 + + + + + + + + 12 + + + + ~ + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + 100.000000000000000 + + + + + + + + + + + + + 12 + + + + 寻峰阈值(个) + + + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter + + + + + + + + 12 + + + + 1 + + + 10000 + + + + + + + + + 方法设置 + + + + + + + 12 + + + + 检测方法选择 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + + + + + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + + + + + + + 0 + 0 + + + + + 12 + + + + 查看结果 + + + + + + + + 0 + 0 + + + + + 12 + + + + 保存结果 + + + + + + + + + 日志 + + + + + + + + + + + + + + + + 10 + + + + 绘图区 + + + + + + + + + + + + + + + diff --git a/ui/MainWindow/MainWindow_label_check.py b/ui/MainWindow/MainWindow_label_check.py new file mode 100644 index 0000000..07be1b7 --- /dev/null +++ b/ui/MainWindow/MainWindow_label_check.py @@ -0,0 +1,493 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'MainWindow_label_check.ui' +## +## Created by: Qt User Interface Compiler version 6.8.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, + QFont, QFontDatabase, QGradient, QIcon, + QImage, QKeySequence, QLinearGradient, QPainter, + QPalette, QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QAbstractSpinBox, QApplication, QCheckBox, QDoubleSpinBox, + QGridLayout, QGroupBox, QHBoxLayout, QHeaderView, + QLabel, QMainWindow, QPushButton, QRadioButton, + QSizePolicy, QSpacerItem, QSpinBox, QStatusBar, + QTableWidget, QTableWidgetItem, QVBoxLayout, QWidget) + +class Ui_MainWindow(object): + def setupUi(self, MainWindow): + if not MainWindow.objectName(): + MainWindow.setObjectName(u"MainWindow") + MainWindow.resize(1920, 1080) + self.centralwidget = QWidget(MainWindow) + self.centralwidget.setObjectName(u"centralwidget") + self.gridLayout = QGridLayout(self.centralwidget) + self.gridLayout.setObjectName(u"gridLayout") + self.groupBox_canvas = QGroupBox(self.centralwidget) + self.groupBox_canvas.setObjectName(u"groupBox_canvas") + font = QFont() + font.setPointSize(10) + self.groupBox_canvas.setFont(font) + self.verticalLayout = QVBoxLayout(self.groupBox_canvas) + self.verticalLayout.setObjectName(u"verticalLayout") + self.verticalLayout_canvas = QVBoxLayout() + self.verticalLayout_canvas.setObjectName(u"verticalLayout_canvas") + + self.verticalLayout.addLayout(self.verticalLayout_canvas) + + + self.gridLayout.addWidget(self.groupBox_canvas, 0, 1, 1, 1) + + self.groupBox_left = QGroupBox(self.centralwidget) + self.groupBox_left.setObjectName(u"groupBox_left") + self.groupBox_left.setFont(font) + self.verticalLayout_2 = QVBoxLayout(self.groupBox_left) + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.pushButton_input_setting = QPushButton(self.groupBox_left) + self.pushButton_input_setting.setObjectName(u"pushButton_input_setting") + sizePolicy = QSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_input_setting.sizePolicy().hasHeightForWidth()) + self.pushButton_input_setting.setSizePolicy(sizePolicy) + font1 = QFont() + font1.setPointSize(12) + self.pushButton_input_setting.setFont(font1) + + self.horizontalLayout.addWidget(self.pushButton_input_setting) + + self.pushButton_input = QPushButton(self.groupBox_left) + self.pushButton_input.setObjectName(u"pushButton_input") + sizePolicy.setHeightForWidth(self.pushButton_input.sizePolicy().hasHeightForWidth()) + self.pushButton_input.setSizePolicy(sizePolicy) + self.pushButton_input.setFont(font1) + + self.horizontalLayout.addWidget(self.pushButton_input) + + + self.verticalLayout_2.addLayout(self.horizontalLayout) + + self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding) + + self.verticalLayout_2.addItem(self.verticalSpacer) + + self.groupBox = QGroupBox(self.groupBox_left) + self.groupBox.setObjectName(u"groupBox") + self.gridLayout_2 = QGridLayout(self.groupBox) + self.gridLayout_2.setObjectName(u"gridLayout_2") + self.label_4 = QLabel(self.groupBox) + self.label_4.setObjectName(u"label_4") + sizePolicy1 = QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Fixed) + sizePolicy1.setHorizontalStretch(0) + sizePolicy1.setVerticalStretch(0) + sizePolicy1.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth()) + self.label_4.setSizePolicy(sizePolicy1) + self.label_4.setFont(font1) + + self.gridLayout_2.addWidget(self.label_4, 0, 0, 1, 1) + + self.doubleSpinBox_findpeaks_min_interval = QDoubleSpinBox(self.groupBox) + self.doubleSpinBox_findpeaks_min_interval.setObjectName(u"doubleSpinBox_findpeaks_min_interval") + self.doubleSpinBox_findpeaks_min_interval.setFont(font1) + self.doubleSpinBox_findpeaks_min_interval.setMaximum(10000.000000000000000) + + self.gridLayout_2.addWidget(self.doubleSpinBox_findpeaks_min_interval, 0, 1, 1, 1) + + self.label_3 = QLabel(self.groupBox) + self.label_3.setObjectName(u"label_3") + sizePolicy1.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth()) + self.label_3.setSizePolicy(sizePolicy1) + self.label_3.setFont(font1) + + self.gridLayout_2.addWidget(self.label_3, 1, 0, 1, 1) + + self.doubleSpinBox_findpeaks_min_height = QDoubleSpinBox(self.groupBox) + self.doubleSpinBox_findpeaks_min_height.setObjectName(u"doubleSpinBox_findpeaks_min_height") + self.doubleSpinBox_findpeaks_min_height.setFont(font1) + self.doubleSpinBox_findpeaks_min_height.setMaximum(10000.000000000000000) + + self.gridLayout_2.addWidget(self.doubleSpinBox_findpeaks_min_height, 1, 1, 1, 1) + + + self.verticalLayout_2.addWidget(self.groupBox) + + self.verticalSpacer_2 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding) + + self.verticalLayout_2.addItem(self.verticalSpacer_2) + + self.groupBox_2 = QGroupBox(self.groupBox_left) + self.groupBox_2.setObjectName(u"groupBox_2") + self.verticalLayout_3 = QVBoxLayout(self.groupBox_2) + self.verticalLayout_3.setObjectName(u"verticalLayout_3") + self.horizontalLayout_2 = QHBoxLayout() + self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") + self.pushButton_prev_move = QPushButton(self.groupBox_2) + self.pushButton_prev_move.setObjectName(u"pushButton_prev_move") + sizePolicy.setHeightForWidth(self.pushButton_prev_move.sizePolicy().hasHeightForWidth()) + self.pushButton_prev_move.setSizePolicy(sizePolicy) + self.pushButton_prev_move.setFont(font1) + + self.horizontalLayout_2.addWidget(self.pushButton_prev_move) + + self.pushButton_pause = QPushButton(self.groupBox_2) + self.pushButton_pause.setObjectName(u"pushButton_pause") + sizePolicy.setHeightForWidth(self.pushButton_pause.sizePolicy().hasHeightForWidth()) + self.pushButton_pause.setSizePolicy(sizePolicy) + self.pushButton_pause.setFont(font1) + + self.horizontalLayout_2.addWidget(self.pushButton_pause) + + self.pushButton_next_move = QPushButton(self.groupBox_2) + self.pushButton_next_move.setObjectName(u"pushButton_next_move") + sizePolicy.setHeightForWidth(self.pushButton_next_move.sizePolicy().hasHeightForWidth()) + self.pushButton_next_move.setSizePolicy(sizePolicy) + self.pushButton_next_move.setFont(font1) + + self.horizontalLayout_2.addWidget(self.pushButton_next_move) + + + self.verticalLayout_3.addLayout(self.horizontalLayout_2) + + self.verticalSpacer_4 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding) + + self.verticalLayout_3.addItem(self.verticalSpacer_4) + + self.groupBox_3 = QGroupBox(self.groupBox_2) + self.groupBox_3.setObjectName(u"groupBox_3") + self.verticalLayout_4 = QVBoxLayout(self.groupBox_3) + self.verticalLayout_4.setObjectName(u"verticalLayout_4") + self.gridLayout_3 = QGridLayout() + self.gridLayout_3.setObjectName(u"gridLayout_3") + self.label_moveLength_preset_1 = QLabel(self.groupBox_3) + self.label_moveLength_preset_1.setObjectName(u"label_moveLength_preset_1") + self.label_moveLength_preset_1.setFont(font1) + self.label_moveLength_preset_1.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_moveLength_preset_1, 1, 1, 1, 1) + + self.label_maxRange_preset_1 = QLabel(self.groupBox_3) + self.label_maxRange_preset_1.setObjectName(u"label_maxRange_preset_1") + self.label_maxRange_preset_1.setFont(font1) + self.label_maxRange_preset_1.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_maxRange_preset_1, 1, 2, 1, 1) + + self.radioButton_move_preset_1 = QRadioButton(self.groupBox_3) + self.radioButton_move_preset_1.setObjectName(u"radioButton_move_preset_1") + self.radioButton_move_preset_1.setFont(font1) + self.radioButton_move_preset_1.setChecked(True) + + self.gridLayout_3.addWidget(self.radioButton_move_preset_1, 1, 0, 1, 1) + + self.label_moveSpeed_preset_3 = QLabel(self.groupBox_3) + self.label_moveSpeed_preset_3.setObjectName(u"label_moveSpeed_preset_3") + self.label_moveSpeed_preset_3.setFont(font1) + self.label_moveSpeed_preset_3.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_moveSpeed_preset_3, 3, 3, 1, 1) + + self.spinBox_moveLength = QSpinBox(self.groupBox_3) + self.spinBox_moveLength.setObjectName(u"spinBox_moveLength") + self.spinBox_moveLength.setFont(font1) + self.spinBox_moveLength.setButtonSymbols(QAbstractSpinBox.ButtonSymbols.NoButtons) + + self.gridLayout_3.addWidget(self.spinBox_moveLength, 4, 1, 1, 1) + + self.radioButton_move_preset_2 = QRadioButton(self.groupBox_3) + self.radioButton_move_preset_2.setObjectName(u"radioButton_move_preset_2") + self.radioButton_move_preset_2.setFont(font1) + + self.gridLayout_3.addWidget(self.radioButton_move_preset_2, 2, 0, 1, 1) + + self.label_maxRange_preset_3 = QLabel(self.groupBox_3) + self.label_maxRange_preset_3.setObjectName(u"label_maxRange_preset_3") + self.label_maxRange_preset_3.setFont(font1) + self.label_maxRange_preset_3.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_maxRange_preset_3, 3, 2, 1, 1) + + self.label_maxRange_preset_2 = QLabel(self.groupBox_3) + self.label_maxRange_preset_2.setObjectName(u"label_maxRange_preset_2") + self.label_maxRange_preset_2.setFont(font1) + self.label_maxRange_preset_2.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_maxRange_preset_2, 2, 2, 1, 1) + + self.radioButton_move_preset_3 = QRadioButton(self.groupBox_3) + self.radioButton_move_preset_3.setObjectName(u"radioButton_move_preset_3") + self.radioButton_move_preset_3.setFont(font1) + + self.gridLayout_3.addWidget(self.radioButton_move_preset_3, 3, 0, 1, 1) + + self.label_moveLength_preset_3 = QLabel(self.groupBox_3) + self.label_moveLength_preset_3.setObjectName(u"label_moveLength_preset_3") + self.label_moveLength_preset_3.setFont(font1) + self.label_moveLength_preset_3.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_moveLength_preset_3, 3, 1, 1, 1) + + self.spinBox_maxRange = QSpinBox(self.groupBox_3) + self.spinBox_maxRange.setObjectName(u"spinBox_maxRange") + self.spinBox_maxRange.setFont(font1) + self.spinBox_maxRange.setButtonSymbols(QAbstractSpinBox.ButtonSymbols.NoButtons) + + self.gridLayout_3.addWidget(self.spinBox_maxRange, 4, 2, 1, 1) + + self.label_moveSpeed_preset_2 = QLabel(self.groupBox_3) + self.label_moveSpeed_preset_2.setObjectName(u"label_moveSpeed_preset_2") + self.label_moveSpeed_preset_2.setFont(font1) + self.label_moveSpeed_preset_2.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_moveSpeed_preset_2, 2, 3, 1, 1) + + self.spinBox_moveSpeed = QSpinBox(self.groupBox_3) + self.spinBox_moveSpeed.setObjectName(u"spinBox_moveSpeed") + self.spinBox_moveSpeed.setFont(font1) + self.spinBox_moveSpeed.setButtonSymbols(QAbstractSpinBox.ButtonSymbols.NoButtons) + + self.gridLayout_3.addWidget(self.spinBox_moveSpeed, 4, 3, 1, 1) + + self.label_moveLength_preset_2 = QLabel(self.groupBox_3) + self.label_moveLength_preset_2.setObjectName(u"label_moveLength_preset_2") + self.label_moveLength_preset_2.setFont(font1) + self.label_moveLength_preset_2.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_moveLength_preset_2, 2, 1, 1, 1) + + self.radioButton_move_custom = QRadioButton(self.groupBox_3) + self.radioButton_move_custom.setObjectName(u"radioButton_move_custom") + self.radioButton_move_custom.setFont(font1) + + self.gridLayout_3.addWidget(self.radioButton_move_custom, 4, 0, 1, 1) + + self.label_moveSpeed_preset_1 = QLabel(self.groupBox_3) + self.label_moveSpeed_preset_1.setObjectName(u"label_moveSpeed_preset_1") + self.label_moveSpeed_preset_1.setFont(font1) + self.label_moveSpeed_preset_1.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_moveSpeed_preset_1, 1, 3, 1, 1) + + self.label_7 = QLabel(self.groupBox_3) + self.label_7.setObjectName(u"label_7") + sizePolicy2 = QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Maximum) + sizePolicy2.setHorizontalStretch(0) + sizePolicy2.setVerticalStretch(0) + sizePolicy2.setHeightForWidth(self.label_7.sizePolicy().hasHeightForWidth()) + self.label_7.setSizePolicy(sizePolicy2) + self.label_7.setFont(font1) + self.label_7.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_7, 0, 1, 1, 1) + + self.label_6 = QLabel(self.groupBox_3) + self.label_6.setObjectName(u"label_6") + sizePolicy2.setHeightForWidth(self.label_6.sizePolicy().hasHeightForWidth()) + self.label_6.setSizePolicy(sizePolicy2) + self.label_6.setFont(font1) + self.label_6.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_6, 0, 2, 1, 1) + + self.label_8 = QLabel(self.groupBox_3) + self.label_8.setObjectName(u"label_8") + sizePolicy2.setHeightForWidth(self.label_8.sizePolicy().hasHeightForWidth()) + self.label_8.setSizePolicy(sizePolicy2) + self.label_8.setFont(font1) + self.label_8.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_3.addWidget(self.label_8, 0, 3, 1, 1) + + self.gridLayout_3.setRowStretch(0, 1) + self.gridLayout_3.setRowStretch(1, 1) + self.gridLayout_3.setRowStretch(2, 1) + self.gridLayout_3.setRowStretch(3, 1) + self.gridLayout_3.setRowStretch(4, 1) + self.gridLayout_3.setColumnStretch(0, 1) + self.gridLayout_3.setColumnStretch(1, 1) + self.gridLayout_3.setColumnStretch(2, 1) + self.gridLayout_3.setColumnStretch(3, 1) + + self.verticalLayout_4.addLayout(self.gridLayout_3) + + self.verticalLayout_4.setStretch(0, 4) + + self.verticalLayout_3.addWidget(self.groupBox_3) + + self.verticalLayout_3.setStretch(0, 2) + self.verticalLayout_3.setStretch(1, 1) + self.verticalLayout_3.setStretch(2, 8) + + self.verticalLayout_2.addWidget(self.groupBox_2) + + self.verticalSpacer_3 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding) + + self.verticalLayout_2.addItem(self.verticalSpacer_3) + + self.horizontalLayout_3 = QHBoxLayout() + self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") + self.checkBox = QCheckBox(self.groupBox_left) + self.checkBox.setObjectName(u"checkBox") + self.checkBox.setFont(font1) + + self.horizontalLayout_3.addWidget(self.checkBox) + + self.pushButton = QPushButton(self.groupBox_left) + self.pushButton.setObjectName(u"pushButton") + sizePolicy.setHeightForWidth(self.pushButton.sizePolicy().hasHeightForWidth()) + self.pushButton.setSizePolicy(sizePolicy) + self.pushButton.setFont(font1) + + self.horizontalLayout_3.addWidget(self.pushButton) + + + self.verticalLayout_2.addLayout(self.horizontalLayout_3) + + self.verticalLayout_2.setStretch(0, 1) + self.verticalLayout_2.setStretch(1, 1) + self.verticalLayout_2.setStretch(2, 1) + self.verticalLayout_2.setStretch(3, 1) + self.verticalLayout_2.setStretch(4, 6) + self.verticalLayout_2.setStretch(5, 1) + self.verticalLayout_2.setStretch(6, 1) + + self.gridLayout.addWidget(self.groupBox_left, 0, 0, 1, 1) + + self.groupBox_right = QGroupBox(self.centralwidget) + self.groupBox_right.setObjectName(u"groupBox_right") + self.groupBox_right.setFont(font) + self.gridLayout_4 = QGridLayout(self.groupBox_right) + self.gridLayout_4.setObjectName(u"gridLayout_4") + self.label_9 = QLabel(self.groupBox_right) + self.label_9.setObjectName(u"label_9") + self.label_9.setFont(font1) + + self.gridLayout_4.addWidget(self.label_9, 0, 0, 1, 1) + + self.spinBox_data_length = QSpinBox(self.groupBox_right) + self.spinBox_data_length.setObjectName(u"spinBox_data_length") + self.spinBox_data_length.setEnabled(False) + self.spinBox_data_length.setFont(font1) + self.spinBox_data_length.setReadOnly(False) + self.spinBox_data_length.setButtonSymbols(QAbstractSpinBox.ButtonSymbols.NoButtons) + self.spinBox_data_length.setMaximum(1000000000) + + self.gridLayout_4.addWidget(self.spinBox_data_length, 0, 1, 1, 1) + + self.label_11 = QLabel(self.groupBox_right) + self.label_11.setObjectName(u"label_11") + self.label_11.setFont(font1) + self.label_11.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_4.addWidget(self.label_11, 2, 0, 1, 1) + + self.label_12 = QLabel(self.groupBox_right) + self.label_12.setObjectName(u"label_12") + self.label_12.setFont(font1) + self.label_12.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_4.addWidget(self.label_12, 2, 1, 1, 1) + + self.spinBox_peak_length_original = QSpinBox(self.groupBox_right) + self.spinBox_peak_length_original.setObjectName(u"spinBox_peak_length_original") + self.spinBox_peak_length_original.setEnabled(False) + self.spinBox_peak_length_original.setFont(font1) + self.spinBox_peak_length_original.setReadOnly(False) + self.spinBox_peak_length_original.setButtonSymbols(QAbstractSpinBox.ButtonSymbols.NoButtons) + self.spinBox_peak_length_original.setMaximum(1000000000) + + self.gridLayout_4.addWidget(self.spinBox_peak_length_original, 3, 0, 1, 1) + + self.spinBox_peak_length_corrected = QSpinBox(self.groupBox_right) + self.spinBox_peak_length_corrected.setObjectName(u"spinBox_peak_length_corrected") + self.spinBox_peak_length_corrected.setEnabled(False) + self.spinBox_peak_length_corrected.setFont(font1) + self.spinBox_peak_length_corrected.setReadOnly(False) + self.spinBox_peak_length_corrected.setButtonSymbols(QAbstractSpinBox.ButtonSymbols.NoButtons) + self.spinBox_peak_length_corrected.setMaximum(1000000000) + + self.gridLayout_4.addWidget(self.spinBox_peak_length_corrected, 3, 1, 1, 1) + + self.tableWidget_peak_original = QTableWidget(self.groupBox_right) + self.tableWidget_peak_original.setObjectName(u"tableWidget_peak_original") + self.tableWidget_peak_original.setFont(font1) + + self.gridLayout_4.addWidget(self.tableWidget_peak_original, 4, 0, 1, 1) + + self.tableWidget_peak_corrected = QTableWidget(self.groupBox_right) + self.tableWidget_peak_corrected.setObjectName(u"tableWidget_peak_corrected") + self.tableWidget_peak_corrected.setFont(font1) + + self.gridLayout_4.addWidget(self.tableWidget_peak_corrected, 4, 1, 1, 1) + + self.verticalSpacer_5 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding) + + self.gridLayout_4.addItem(self.verticalSpacer_5, 1, 0, 1, 2) + + self.gridLayout_4.setRowStretch(0, 1) + self.gridLayout_4.setRowStretch(1, 1) + self.gridLayout_4.setRowStretch(2, 1) + self.gridLayout_4.setRowStretch(3, 1) + self.gridLayout_4.setRowStretch(4, 20) + + self.gridLayout.addWidget(self.groupBox_right, 0, 2, 1, 1) + + self.gridLayout.setColumnStretch(0, 2) + self.gridLayout.setColumnStretch(1, 6) + self.gridLayout.setColumnStretch(2, 2) + MainWindow.setCentralWidget(self.centralwidget) + self.statusbar = QStatusBar(MainWindow) + self.statusbar.setObjectName(u"statusbar") + MainWindow.setStatusBar(self.statusbar) + + self.retranslateUi(MainWindow) + + QMetaObject.connectSlotsByName(MainWindow) + # setupUi + + def retranslateUi(self, MainWindow): + MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"\u4eba\u5de5\u7ea0\u6b63", None)) + self.groupBox_canvas.setTitle(QCoreApplication.translate("MainWindow", u"\u7ed8\u56fe\u533a", None)) + self.groupBox_left.setTitle(QCoreApplication.translate("MainWindow", u"\u4eba\u5de5\u7ea0\u6b63", None)) + self.pushButton_input_setting.setText(QCoreApplication.translate("MainWindow", u"\u5bfc\u5165\u8bbe\u7f6e", None)) + self.pushButton_input.setText(QCoreApplication.translate("MainWindow", u"\u5f00\u59cb\u5bfc\u5165", None)) + self.groupBox.setTitle(QCoreApplication.translate("MainWindow", u"\u5bfb\u5cf0\u53c2\u6570\u8bbe\u7f6e", None)) + self.label_4.setText(QCoreApplication.translate("MainWindow", u"\u6700\u5c0f\u95f4\u9694", None)) + self.label_3.setText(QCoreApplication.translate("MainWindow", u"\u6700\u5c0f\u9ad8\u5ea6", None)) + self.groupBox_2.setTitle(QCoreApplication.translate("MainWindow", u"\u81ea\u52a8\u64ad\u653e", None)) + self.pushButton_prev_move.setText(QCoreApplication.translate("MainWindow", u"< <(A)", None)) + self.pushButton_pause.setText(QCoreApplication.translate("MainWindow", u"| |(S)", None)) + self.pushButton_next_move.setText(QCoreApplication.translate("MainWindow", u"> >(D)", None)) + self.groupBox_3.setTitle(QCoreApplication.translate("MainWindow", u"\u8bbe\u7f6e", None)) + self.label_moveLength_preset_1.setText(QCoreApplication.translate("MainWindow", u"10000", None)) + self.label_maxRange_preset_1.setText(QCoreApplication.translate("MainWindow", u"40000", None)) + self.radioButton_move_preset_1.setText(QCoreApplication.translate("MainWindow", u"\u9884\u8bbe1", None)) + self.label_moveSpeed_preset_3.setText(QCoreApplication.translate("MainWindow", u"500", None)) + self.radioButton_move_preset_2.setText(QCoreApplication.translate("MainWindow", u"\u9884\u8bbe2", None)) + self.label_maxRange_preset_3.setText(QCoreApplication.translate("MainWindow", u"100000", None)) + self.label_maxRange_preset_2.setText(QCoreApplication.translate("MainWindow", u"80000", None)) + self.radioButton_move_preset_3.setText(QCoreApplication.translate("MainWindow", u"\u9884\u8bbe3", None)) + self.label_moveLength_preset_3.setText(QCoreApplication.translate("MainWindow", u"25000", None)) + self.label_moveSpeed_preset_2.setText(QCoreApplication.translate("MainWindow", u"500", None)) + self.label_moveLength_preset_2.setText(QCoreApplication.translate("MainWindow", u"20000", None)) + self.radioButton_move_custom.setText(QCoreApplication.translate("MainWindow", u"\u81ea\u5b9a\u4e49", None)) + self.label_moveSpeed_preset_1.setText(QCoreApplication.translate("MainWindow", u"500", None)) + self.label_7.setText(QCoreApplication.translate("MainWindow", u"\u79fb\u52a8\u8ddd\u79bb", None)) + self.label_6.setText(QCoreApplication.translate("MainWindow", u"\u6700\u5927\u8303\u56f4", None)) + self.label_8.setText(QCoreApplication.translate("MainWindow", u"\u79fb\u52a8\u95f4\u9694(ms)", None)) + self.checkBox.setText(QCoreApplication.translate("MainWindow", u"\u7ed8\u5236\u53c2\u8003\u7ebf", None)) + self.pushButton.setText(QCoreApplication.translate("MainWindow", u"\u5bfc\u51fa\u6807\u7b7e", None)) + self.groupBox_right.setTitle(QCoreApplication.translate("MainWindow", u"\u5cf0\u503c\u5750\u6807\u548c\u4fe1\u606f", None)) + self.label_9.setText(QCoreApplication.translate("MainWindow", u"\u6570\u636e\u957f\u5ea6(\u70b9\u6570)", None)) + self.label_11.setText(QCoreApplication.translate("MainWindow", u"\u7ea0\u6b63\u524d\u5cf0\u503c\u4e2a\u6570", None)) + self.label_12.setText(QCoreApplication.translate("MainWindow", u"\u7ea0\u6b63\u540e\u5cf0\u503c\u4e2a\u6570", None)) + # retranslateUi + diff --git a/ui/MainWindow/MainWindow_label_check.ui b/ui/MainWindow/MainWindow_label_check.ui new file mode 100644 index 0000000..3289935 --- /dev/null +++ b/ui/MainWindow/MainWindow_label_check.ui @@ -0,0 +1,765 @@ + + + MainWindow + + + + 0 + 0 + 1920 + 1080 + + + + 人工纠正 + + + + + + + + 10 + + + + 绘图区 + + + + + + + + + + + + + 10 + + + + 人工纠正 + + + + + + + + + 0 + 0 + + + + + 12 + + + + 导入设置 + + + + + + + + 0 + 0 + + + + + 12 + + + + 开始导入 + + + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + + + + 寻峰参数设置 + + + + + + + 0 + 0 + + + + + 12 + + + + 最小间隔 + + + + + + + + 12 + + + + 10000.000000000000000 + + + + + + + + 0 + 0 + + + + + 12 + + + + 最小高度 + + + + + + + + 12 + + + + 10000.000000000000000 + + + + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + + + + 自动播放 + + + + + + + + + 0 + 0 + + + + + 12 + + + + < <(A) + + + + + + + + 0 + 0 + + + + + 12 + + + + | |(S) + + + + + + + + 0 + 0 + + + + + 12 + + + + > >(D) + + + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + + + + 设置 + + + + + + + + + 12 + + + + 10000 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + 40000 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + 预设1 + + + true + + + + + + + + 12 + + + + 500 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + QAbstractSpinBox::ButtonSymbols::NoButtons + + + + + + + + 12 + + + + 预设2 + + + + + + + + 12 + + + + 100000 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + 80000 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + 预设3 + + + + + + + + 12 + + + + 25000 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + QAbstractSpinBox::ButtonSymbols::NoButtons + + + + + + + + 12 + + + + 500 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + QAbstractSpinBox::ButtonSymbols::NoButtons + + + + + + + + 12 + + + + 20000 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + 自定义 + + + + + + + + 12 + + + + 500 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 0 + 0 + + + + + 12 + + + + 移动距离 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 0 + 0 + + + + + 12 + + + + 最大范围 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 0 + 0 + + + + + 12 + + + + 移动间隔(ms) + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + + + + + + + 12 + + + + 绘制参考线 + + + + + + + + 0 + 0 + + + + + 12 + + + + 导出标签 + + + + + + + + + + + + + 10 + + + + 峰值坐标和信息 + + + + + + + 12 + + + + 数据长度(点数) + + + + + + + false + + + + 12 + + + + false + + + QAbstractSpinBox::ButtonSymbols::NoButtons + + + 1000000000 + + + + + + + + 12 + + + + 纠正前峰值个数 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + 纠正后峰值个数 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + false + + + + 12 + + + + false + + + QAbstractSpinBox::ButtonSymbols::NoButtons + + + 1000000000 + + + + + + + false + + + + 12 + + + + false + + + QAbstractSpinBox::ButtonSymbols::NoButtons + + + 1000000000 + + + + + + + + 12 + + + + + + + + + 12 + + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + diff --git a/ui/MainWindow/MainWindow_preprocess.py b/ui/MainWindow/MainWindow_preprocess.py index 2a178e3..0d6f1cd 100644 --- a/ui/MainWindow/MainWindow_preprocess.py +++ b/ui/MainWindow/MainWindow_preprocess.py @@ -50,6 +50,9 @@ class Ui_MainWindow_preprocess(object): self.gridLayout.setObjectName(u"gridLayout") self.groupBox_canvas = QGroupBox(self.centralwidget) self.groupBox_canvas.setObjectName(u"groupBox_canvas") + font2 = QFont() + font2.setPointSize(10) + self.groupBox_canvas.setFont(font2) self.verticalLayout_7 = QVBoxLayout(self.groupBox_canvas) self.verticalLayout_7.setObjectName(u"verticalLayout_7") self.verticalLayout_canvas = QVBoxLayout() @@ -62,8 +65,6 @@ class Ui_MainWindow_preprocess(object): self.groupBox_left = QGroupBox(self.centralwidget) self.groupBox_left.setObjectName(u"groupBox_left") - font2 = QFont() - font2.setPointSize(10) self.groupBox_left.setFont(font2) self.verticalLayout = QVBoxLayout(self.groupBox_left) self.verticalLayout.setObjectName(u"verticalLayout") @@ -209,9 +210,9 @@ class Ui_MainWindow_preprocess(object): self.gridLayout.setColumnStretch(0, 2) self.gridLayout.setColumnStretch(1, 8) MainWindow_preprocess.setCentralWidget(self.centralwidget) - self.statusBar = QStatusBar(MainWindow_preprocess) - self.statusBar.setObjectName(u"statusBar") - MainWindow_preprocess.setStatusBar(self.statusBar) + self.statusbar = QStatusBar(MainWindow_preprocess) + self.statusbar.setObjectName(u"statusbar") + MainWindow_preprocess.setStatusBar(self.statusbar) self.retranslateUi(MainWindow_preprocess) diff --git a/ui/MainWindow/MainWindow_preprocess.ui b/ui/MainWindow/MainWindow_preprocess.ui index fef23a7..f50fa87 100644 --- a/ui/MainWindow/MainWindow_preprocess.ui +++ b/ui/MainWindow/MainWindow_preprocess.ui @@ -31,6 +31,11 @@ + + + 10 + + 绘图区 @@ -275,7 +280,7 @@ - + 数据路径选择 diff --git a/ui/setting/artifact_label_input_setting.py b/ui/setting/artifact_label_input_setting.py new file mode 100644 index 0000000..d1d4d18 --- /dev/null +++ b/ui/setting/artifact_label_input_setting.py @@ -0,0 +1,175 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'artifact_label_input_setting.ui' +## +## Created by: Qt User Interface Compiler version 6.8.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, + QFont, QFontDatabase, QGradient, QIcon, + QImage, QKeySequence, QLinearGradient, QPainter, + QPalette, QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QApplication, QGridLayout, QGroupBox, QHBoxLayout, + QLabel, QMainWindow, QPlainTextEdit, QPushButton, + QSizePolicy, QSpinBox, QStatusBar, QVBoxLayout, + QWidget) + +class Ui_MainWindow_artifact_label_input_setting(object): + def setupUi(self, MainWindow_artifact_label_input_setting): + if not MainWindow_artifact_label_input_setting.objectName(): + MainWindow_artifact_label_input_setting.setObjectName(u"MainWindow_artifact_label_input_setting") + MainWindow_artifact_label_input_setting.resize(480, 800) + self.centralwidget = QWidget(MainWindow_artifact_label_input_setting) + self.centralwidget.setObjectName(u"centralwidget") + self.gridLayout = QGridLayout(self.centralwidget) + self.gridLayout.setObjectName(u"gridLayout") + self.pushButton_cancel = QPushButton(self.centralwidget) + self.pushButton_cancel.setObjectName(u"pushButton_cancel") + font = QFont() + font.setPointSize(12) + self.pushButton_cancel.setFont(font) + + self.gridLayout.addWidget(self.pushButton_cancel, 1, 3, 1, 1) + + self.groupBox = QGroupBox(self.centralwidget) + self.groupBox.setObjectName(u"groupBox") + font1 = QFont() + font1.setPointSize(10) + self.groupBox.setFont(font1) + self.verticalLayout_2 = QVBoxLayout(self.groupBox) + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.groupBox_file_path_input_orgBcg = QGroupBox(self.groupBox) + self.groupBox_file_path_input_orgBcg.setObjectName(u"groupBox_file_path_input_orgBcg") + self.verticalLayout_5 = QVBoxLayout(self.groupBox_file_path_input_orgBcg) + self.verticalLayout_5.setObjectName(u"verticalLayout_5") + self.horizontalLayout_2 = QHBoxLayout() + self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") + self.label_2 = QLabel(self.groupBox_file_path_input_orgBcg) + self.label_2.setObjectName(u"label_2") + self.label_2.setFont(font) + + self.horizontalLayout_2.addWidget(self.label_2) + + self.spinBox_input_freq_orgBcg = QSpinBox(self.groupBox_file_path_input_orgBcg) + self.spinBox_input_freq_orgBcg.setObjectName(u"spinBox_input_freq_orgBcg") + self.spinBox_input_freq_orgBcg.setFont(font) + self.spinBox_input_freq_orgBcg.setMinimum(1) + self.spinBox_input_freq_orgBcg.setMaximum(1000000) + + self.horizontalLayout_2.addWidget(self.spinBox_input_freq_orgBcg) + + + self.verticalLayout_5.addLayout(self.horizontalLayout_2) + + self.plainTextEdit_file_path_input_orgBcg = QPlainTextEdit(self.groupBox_file_path_input_orgBcg) + self.plainTextEdit_file_path_input_orgBcg.setObjectName(u"plainTextEdit_file_path_input_orgBcg") + + self.verticalLayout_5.addWidget(self.plainTextEdit_file_path_input_orgBcg) + + self.verticalLayout_5.setStretch(0, 1) + self.verticalLayout_5.setStretch(1, 2) + + self.verticalLayout_2.addWidget(self.groupBox_file_path_input_orgBcg) + + self.groupBox_file_path_input_BCG = QGroupBox(self.groupBox) + self.groupBox_file_path_input_BCG.setObjectName(u"groupBox_file_path_input_BCG") + self.verticalLayout_3 = QVBoxLayout(self.groupBox_file_path_input_BCG) + self.verticalLayout_3.setObjectName(u"verticalLayout_3") + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.label = QLabel(self.groupBox_file_path_input_BCG) + self.label.setObjectName(u"label") + self.label.setFont(font) + + self.horizontalLayout.addWidget(self.label) + + self.spinBox_input_freq_BCG = QSpinBox(self.groupBox_file_path_input_BCG) + self.spinBox_input_freq_BCG.setObjectName(u"spinBox_input_freq_BCG") + self.spinBox_input_freq_BCG.setFont(font) + self.spinBox_input_freq_BCG.setMinimum(1) + self.spinBox_input_freq_BCG.setMaximum(1000000) + + self.horizontalLayout.addWidget(self.spinBox_input_freq_BCG) + + + self.verticalLayout_3.addLayout(self.horizontalLayout) + + self.plainTextEdit_file_path_input_BCG = QPlainTextEdit(self.groupBox_file_path_input_BCG) + self.plainTextEdit_file_path_input_BCG.setObjectName(u"plainTextEdit_file_path_input_BCG") + + self.verticalLayout_3.addWidget(self.plainTextEdit_file_path_input_BCG) + + self.verticalLayout_3.setStretch(0, 1) + self.verticalLayout_3.setStretch(1, 2) + + self.verticalLayout_2.addWidget(self.groupBox_file_path_input_BCG) + + self.groupBox_file_path_save = QGroupBox(self.groupBox) + self.groupBox_file_path_save.setObjectName(u"groupBox_file_path_save") + self.verticalLayout_4 = QVBoxLayout(self.groupBox_file_path_save) + self.verticalLayout_4.setObjectName(u"verticalLayout_4") + self.plainTextEdit_file_path_save_a = QPlainTextEdit(self.groupBox_file_path_save) + self.plainTextEdit_file_path_save_a.setObjectName(u"plainTextEdit_file_path_save_a") + + self.verticalLayout_4.addWidget(self.plainTextEdit_file_path_save_a) + + self.plainTextEdit_file_path_save_b = QPlainTextEdit(self.groupBox_file_path_save) + self.plainTextEdit_file_path_save_b.setObjectName(u"plainTextEdit_file_path_save_b") + + self.verticalLayout_4.addWidget(self.plainTextEdit_file_path_save_b) + + self.plainTextEdit_file_path_save_c = QPlainTextEdit(self.groupBox_file_path_save) + self.plainTextEdit_file_path_save_c.setObjectName(u"plainTextEdit_file_path_save_c") + + self.verticalLayout_4.addWidget(self.plainTextEdit_file_path_save_c) + + + self.verticalLayout_2.addWidget(self.groupBox_file_path_save) + + self.verticalLayout_2.setStretch(0, 2) + self.verticalLayout_2.setStretch(1, 2) + self.verticalLayout_2.setStretch(2, 3) + + self.gridLayout.addWidget(self.groupBox, 0, 0, 1, 4) + + self.pushButton_confirm = QPushButton(self.centralwidget) + self.pushButton_confirm.setObjectName(u"pushButton_confirm") + self.pushButton_confirm.setFont(font) + + self.gridLayout.addWidget(self.pushButton_confirm, 1, 2, 1, 1) + + MainWindow_artifact_label_input_setting.setCentralWidget(self.centralwidget) + self.statusbar = QStatusBar(MainWindow_artifact_label_input_setting) + self.statusbar.setObjectName(u"statusbar") + MainWindow_artifact_label_input_setting.setStatusBar(self.statusbar) + + self.retranslateUi(MainWindow_artifact_label_input_setting) + + QMetaObject.connectSlotsByName(MainWindow_artifact_label_input_setting) + # setupUi + + def retranslateUi(self, MainWindow_artifact_label_input_setting): + MainWindow_artifact_label_input_setting.setWindowTitle(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u5bfc\u5165\u8bbe\u7f6e", None)) + self.pushButton_cancel.setText(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u53d6\u6d88", None)) + self.groupBox.setTitle(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u6587\u4ef6\u8def\u5f84", None)) + self.groupBox_file_path_input_orgBcg.setTitle(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u540c\u6b65\u540e\u7684orgBcg\u8def\u5f84", None)) + self.label_2.setText(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u91c7\u6837\u7387(Hz)\uff1a", None)) + self.plainTextEdit_file_path_input_orgBcg.setPlainText("") + self.plainTextEdit_file_path_input_orgBcg.setPlaceholderText(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u6587\u4ef6\u8def\u5f84", None)) + self.groupBox_file_path_input_BCG.setTitle(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u540c\u6b65\u540e\u7684BCG\u8def\u5f84", None)) + self.label.setText(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u91c7\u6837\u7387(Hz)\uff1a", None)) + self.plainTextEdit_file_path_input_BCG.setPlainText("") + self.plainTextEdit_file_path_input_BCG.setPlaceholderText(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u6587\u4ef6\u8def\u5f84", None)) + self.groupBox_file_path_save.setTitle(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u4f53\u52a8\u4fdd\u5b58\u8def\u5f84", None)) + self.plainTextEdit_file_path_save_a.setPlaceholderText(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u4fdd\u5b58\u8def\u5f84", None)) + self.plainTextEdit_file_path_save_b.setPlaceholderText(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u4fdd\u5b58\u8def\u5f84", None)) + self.plainTextEdit_file_path_save_c.setPlaceholderText(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u4fdd\u5b58\u8def\u5f84", None)) + self.pushButton_confirm.setText(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u786e\u5b9a", None)) + # retranslateUi + diff --git a/ui/setting/artifact_label_input_setting.ui b/ui/setting/artifact_label_input_setting.ui new file mode 100644 index 0000000..3bd74d6 --- /dev/null +++ b/ui/setting/artifact_label_input_setting.ui @@ -0,0 +1,192 @@ + + + MainWindow_artifact_label_input_setting + + + + 0 + 0 + 480 + 800 + + + + 导入设置 + + + + + + + + 12 + + + + 取消 + + + + + + + + 10 + + + + 文件路径 + + + + + + 同步后的orgBcg路径 + + + + + + + + + 12 + + + + 采样率(Hz): + + + + + + + + 12 + + + + 1 + + + 1000000 + + + + + + + + + + + + 文件路径 + + + + + + + + + + 同步后的BCG路径 + + + + + + + + + 12 + + + + 采样率(Hz): + + + + + + + + 12 + + + + 1 + + + 1000000 + + + + + + + + + + + + 文件路径 + + + + + + + + + + 体动保存路径 + + + + + + 保存路径 + + + + + + + 保存路径 + + + + + + + 保存路径 + + + + + + + + + + + + + + 12 + + + + 确定 + + + + + + + + + + diff --git a/ui/setting/detect_Jpeak_input_setting.py b/ui/setting/detect_Jpeak_input_setting.py index de90827..27b1fc4 100644 --- a/ui/setting/detect_Jpeak_input_setting.py +++ b/ui/setting/detect_Jpeak_input_setting.py @@ -23,7 +23,7 @@ class Ui_MainWindow_detect_Jpeak_input_setting(object): def setupUi(self, MainWindow_detect_Jpeak_input_setting): if not MainWindow_detect_Jpeak_input_setting.objectName(): MainWindow_detect_Jpeak_input_setting.setObjectName(u"MainWindow_detect_Jpeak_input_setting") - MainWindow_detect_Jpeak_input_setting.resize(487, 417) + MainWindow_detect_Jpeak_input_setting.resize(480, 420) self.centralwidget = QWidget(MainWindow_detect_Jpeak_input_setting) self.centralwidget.setObjectName(u"centralwidget") self.gridLayout = QGridLayout(self.centralwidget) @@ -38,6 +38,9 @@ class Ui_MainWindow_detect_Jpeak_input_setting(object): self.groupBox = QGroupBox(self.centralwidget) self.groupBox.setObjectName(u"groupBox") + font1 = QFont() + font1.setPointSize(10) + self.groupBox.setFont(font1) self.verticalLayout_2 = QVBoxLayout(self.groupBox) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.groupBox_file_path_input = QGroupBox(self.groupBox) diff --git a/ui/setting/detect_Jpeak_input_setting.ui b/ui/setting/detect_Jpeak_input_setting.ui index dfcec85..d0cabb1 100644 --- a/ui/setting/detect_Jpeak_input_setting.ui +++ b/ui/setting/detect_Jpeak_input_setting.ui @@ -6,8 +6,8 @@ 0 0 - 487 - 417 + 480 + 420 @@ -29,6 +29,11 @@ + + + 10 + + 文件路径 diff --git a/ui/setting/detect_Rpeak_input_setting.py b/ui/setting/detect_Rpeak_input_setting.py new file mode 100644 index 0000000..ff61e3e --- /dev/null +++ b/ui/setting/detect_Rpeak_input_setting.py @@ -0,0 +1,121 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'detect_Rpeak_input_setting.ui' +## +## Created by: Qt User Interface Compiler version 6.8.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, + QFont, QFontDatabase, QGradient, QIcon, + QImage, QKeySequence, QLinearGradient, QPainter, + QPalette, QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QApplication, QGridLayout, QGroupBox, QHBoxLayout, + QLabel, QMainWindow, QPlainTextEdit, QPushButton, + QSizePolicy, QSpinBox, QVBoxLayout, QWidget) + +class Ui_MainWindow_detect_Rpeak_input_setting(object): + def setupUi(self, MainWindow_detect_Rpeak_input_setting): + if not MainWindow_detect_Rpeak_input_setting.objectName(): + MainWindow_detect_Rpeak_input_setting.setObjectName(u"MainWindow_detect_Rpeak_input_setting") + MainWindow_detect_Rpeak_input_setting.resize(480, 320) + self.centralwidget = QWidget(MainWindow_detect_Rpeak_input_setting) + self.centralwidget.setObjectName(u"centralwidget") + self.gridLayout = QGridLayout(self.centralwidget) + self.gridLayout.setObjectName(u"gridLayout") + self.pushButton_cancel = QPushButton(self.centralwidget) + self.pushButton_cancel.setObjectName(u"pushButton_cancel") + font = QFont() + font.setPointSize(12) + self.pushButton_cancel.setFont(font) + + self.gridLayout.addWidget(self.pushButton_cancel, 2, 3, 1, 1) + + self.groupBox = QGroupBox(self.centralwidget) + self.groupBox.setObjectName(u"groupBox") + font1 = QFont() + font1.setPointSize(10) + self.groupBox.setFont(font1) + self.verticalLayout_2 = QVBoxLayout(self.groupBox) + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.groupBox_file_path_input = QGroupBox(self.groupBox) + self.groupBox_file_path_input.setObjectName(u"groupBox_file_path_input") + self.verticalLayout_3 = QVBoxLayout(self.groupBox_file_path_input) + self.verticalLayout_3.setObjectName(u"verticalLayout_3") + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.label = QLabel(self.groupBox_file_path_input) + self.label.setObjectName(u"label") + self.label.setFont(font) + + self.horizontalLayout.addWidget(self.label) + + self.spinBox_input_freq = QSpinBox(self.groupBox_file_path_input) + self.spinBox_input_freq.setObjectName(u"spinBox_input_freq") + self.spinBox_input_freq.setFont(font) + self.spinBox_input_freq.setMinimum(1) + self.spinBox_input_freq.setMaximum(1000000) + + self.horizontalLayout.addWidget(self.spinBox_input_freq) + + + self.verticalLayout_3.addLayout(self.horizontalLayout) + + self.plainTextEdit_file_path_input = QPlainTextEdit(self.groupBox_file_path_input) + self.plainTextEdit_file_path_input.setObjectName(u"plainTextEdit_file_path_input") + + self.verticalLayout_3.addWidget(self.plainTextEdit_file_path_input) + + self.verticalLayout_3.setStretch(0, 1) + self.verticalLayout_3.setStretch(1, 2) + + self.verticalLayout_2.addWidget(self.groupBox_file_path_input) + + self.groupBox_file_path_save = QGroupBox(self.groupBox) + self.groupBox_file_path_save.setObjectName(u"groupBox_file_path_save") + self.verticalLayout_4 = QVBoxLayout(self.groupBox_file_path_save) + self.verticalLayout_4.setObjectName(u"verticalLayout_4") + self.plainTextEdit_file_path_save = QPlainTextEdit(self.groupBox_file_path_save) + self.plainTextEdit_file_path_save.setObjectName(u"plainTextEdit_file_path_save") + + self.verticalLayout_4.addWidget(self.plainTextEdit_file_path_save) + + + self.verticalLayout_2.addWidget(self.groupBox_file_path_save) + + self.verticalLayout_2.setStretch(0, 1) + self.verticalLayout_2.setStretch(1, 1) + + self.gridLayout.addWidget(self.groupBox, 0, 0, 1, 4) + + self.pushButton_confirm = QPushButton(self.centralwidget) + self.pushButton_confirm.setObjectName(u"pushButton_confirm") + self.pushButton_confirm.setFont(font) + + self.gridLayout.addWidget(self.pushButton_confirm, 2, 2, 1, 1) + + MainWindow_detect_Rpeak_input_setting.setCentralWidget(self.centralwidget) + + self.retranslateUi(MainWindow_detect_Rpeak_input_setting) + + QMetaObject.connectSlotsByName(MainWindow_detect_Rpeak_input_setting) + # setupUi + + def retranslateUi(self, MainWindow_detect_Rpeak_input_setting): + MainWindow_detect_Rpeak_input_setting.setWindowTitle(QCoreApplication.translate("MainWindow_detect_Rpeak_input_setting", u"\u5bfc\u5165\u8bbe\u7f6e", None)) + self.pushButton_cancel.setText(QCoreApplication.translate("MainWindow_detect_Rpeak_input_setting", u"\u53d6\u6d88", None)) + self.groupBox.setTitle(QCoreApplication.translate("MainWindow_detect_Rpeak_input_setting", u"\u6587\u4ef6\u8def\u5f84", None)) + self.groupBox_file_path_input.setTitle(QCoreApplication.translate("MainWindow_detect_Rpeak_input_setting", u"\u6ee4\u6ce2\u540e\u7684ECG\u8def\u5f84", None)) + self.label.setText(QCoreApplication.translate("MainWindow_detect_Rpeak_input_setting", u"\u91c7\u6837\u7387(Hz)\uff1a", None)) + self.plainTextEdit_file_path_input.setPlainText("") + self.plainTextEdit_file_path_input.setPlaceholderText(QCoreApplication.translate("MainWindow_detect_Rpeak_input_setting", u"\u6587\u4ef6\u8def\u5f84", None)) + self.groupBox_file_path_save.setTitle(QCoreApplication.translate("MainWindow_detect_Rpeak_input_setting", u"\u7b97\u6cd5\u8bc6\u522b\u51fa\u7684R\u5cf0\u4fdd\u5b58\u8def\u5f84", None)) + self.plainTextEdit_file_path_save.setPlaceholderText(QCoreApplication.translate("MainWindow_detect_Rpeak_input_setting", u"\u4fdd\u5b58\u8def\u5f84", None)) + self.pushButton_confirm.setText(QCoreApplication.translate("MainWindow_detect_Rpeak_input_setting", u"\u786e\u5b9a", None)) + # retranslateUi + diff --git a/ui/setting/detect_Rpeak_input_setting.ui b/ui/setting/detect_Rpeak_input_setting.ui new file mode 100644 index 0000000..ccd7162 --- /dev/null +++ b/ui/setting/detect_Rpeak_input_setting.ui @@ -0,0 +1,127 @@ + + + MainWindow_detect_Rpeak_input_setting + + + + 0 + 0 + 480 + 320 + + + + 导入设置 + + + + + + + + 12 + + + + 取消 + + + + + + + + 10 + + + + 文件路径 + + + + + + 滤波后的ECG路径 + + + + + + + + + 12 + + + + 采样率(Hz): + + + + + + + + 12 + + + + 1 + + + 1000000 + + + + + + + + + + + + 文件路径 + + + + + + + + + + 算法识别出的R峰保存路径 + + + + + + 保存路径 + + + + + + + + + + + + + + 12 + + + + 确定 + + + + + + + + + diff --git a/ui/setting/label_check_input_setting.py b/ui/setting/label_check_input_setting.py new file mode 100644 index 0000000..8a3ab0e --- /dev/null +++ b/ui/setting/label_check_input_setting.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'label_check_input_setting.ui' +## +## Created by: Qt User Interface Compiler version 6.8.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, + QFont, QFontDatabase, QGradient, QIcon, + QImage, QKeySequence, QLinearGradient, QPainter, + QPalette, QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QApplication, QGridLayout, QGroupBox, QHBoxLayout, + QLabel, QMainWindow, QPlainTextEdit, QPushButton, + QSizePolicy, QSpinBox, QStatusBar, QVBoxLayout, + QWidget) + +class Ui_MainWindow_artifact_label_input_setting(object): + def setupUi(self, MainWindow_artifact_label_input_setting): + if not MainWindow_artifact_label_input_setting.objectName(): + MainWindow_artifact_label_input_setting.setObjectName(u"MainWindow_artifact_label_input_setting") + MainWindow_artifact_label_input_setting.resize(540, 540) + self.centralwidget = QWidget(MainWindow_artifact_label_input_setting) + self.centralwidget.setObjectName(u"centralwidget") + self.gridLayout = QGridLayout(self.centralwidget) + self.gridLayout.setObjectName(u"gridLayout") + self.pushButton_cancel = QPushButton(self.centralwidget) + self.pushButton_cancel.setObjectName(u"pushButton_cancel") + font = QFont() + font.setPointSize(12) + self.pushButton_cancel.setFont(font) + + self.gridLayout.addWidget(self.pushButton_cancel, 1, 3, 1, 1) + + self.groupBox = QGroupBox(self.centralwidget) + self.groupBox.setObjectName(u"groupBox") + font1 = QFont() + font1.setPointSize(10) + self.groupBox.setFont(font1) + self.verticalLayout_2 = QVBoxLayout(self.groupBox) + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.groupBox_file_path_input_signal = QGroupBox(self.groupBox) + self.groupBox_file_path_input_signal.setObjectName(u"groupBox_file_path_input_signal") + self.verticalLayout_5 = QVBoxLayout(self.groupBox_file_path_input_signal) + self.verticalLayout_5.setObjectName(u"verticalLayout_5") + self.horizontalLayout_2 = QHBoxLayout() + self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") + self.label_2 = QLabel(self.groupBox_file_path_input_signal) + self.label_2.setObjectName(u"label_2") + self.label_2.setFont(font) + + self.horizontalLayout_2.addWidget(self.label_2) + + self.spinBox_input_freq_signal = QSpinBox(self.groupBox_file_path_input_signal) + self.spinBox_input_freq_signal.setObjectName(u"spinBox_input_freq_signal") + self.spinBox_input_freq_signal.setFont(font) + self.spinBox_input_freq_signal.setMinimum(1) + self.spinBox_input_freq_signal.setMaximum(1000000) + + self.horizontalLayout_2.addWidget(self.spinBox_input_freq_signal) + + + self.verticalLayout_5.addLayout(self.horizontalLayout_2) + + self.groupBox_2 = QGroupBox(self.groupBox_file_path_input_signal) + self.groupBox_2.setObjectName(u"groupBox_2") + self.horizontalLayout = QHBoxLayout(self.groupBox_2) + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.label = QLabel(self.groupBox_2) + self.label.setObjectName(u"label") + self.label.setFont(font) + self.label.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.horizontalLayout.addWidget(self.label) + + self.spinBox_bandPassOrder = QSpinBox(self.groupBox_2) + self.spinBox_bandPassOrder.setObjectName(u"spinBox_bandPassOrder") + self.spinBox_bandPassOrder.setFont(font) + + self.horizontalLayout.addWidget(self.spinBox_bandPassOrder) + + self.label_3 = QLabel(self.groupBox_2) + self.label_3.setObjectName(u"label_3") + self.label_3.setFont(font) + self.label_3.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.horizontalLayout.addWidget(self.label_3) + + self.spinBox_bandPassLow = QSpinBox(self.groupBox_2) + self.spinBox_bandPassLow.setObjectName(u"spinBox_bandPassLow") + self.spinBox_bandPassLow.setFont(font) + + self.horizontalLayout.addWidget(self.spinBox_bandPassLow) + + self.label_4 = QLabel(self.groupBox_2) + self.label_4.setObjectName(u"label_4") + self.label_4.setFont(font) + self.label_4.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.horizontalLayout.addWidget(self.label_4) + + self.spinBox_bandPassHigh = QSpinBox(self.groupBox_2) + self.spinBox_bandPassHigh.setObjectName(u"spinBox_bandPassHigh") + self.spinBox_bandPassHigh.setFont(font) + + self.horizontalLayout.addWidget(self.spinBox_bandPassHigh) + + + self.verticalLayout_5.addWidget(self.groupBox_2) + + self.plainTextEdit_file_path_input_signal = QPlainTextEdit(self.groupBox_file_path_input_signal) + self.plainTextEdit_file_path_input_signal.setObjectName(u"plainTextEdit_file_path_input_signal") + + self.verticalLayout_5.addWidget(self.plainTextEdit_file_path_input_signal) + + self.verticalLayout_5.setStretch(0, 2) + self.verticalLayout_5.setStretch(1, 2) + self.verticalLayout_5.setStretch(2, 3) + + self.verticalLayout_2.addWidget(self.groupBox_file_path_input_signal) + + self.groupBox_file_path_input_peak = QGroupBox(self.groupBox) + self.groupBox_file_path_input_peak.setObjectName(u"groupBox_file_path_input_peak") + self.verticalLayout_3 = QVBoxLayout(self.groupBox_file_path_input_peak) + self.verticalLayout_3.setObjectName(u"verticalLayout_3") + self.plainTextEdit_file_path_input_peak = QPlainTextEdit(self.groupBox_file_path_input_peak) + self.plainTextEdit_file_path_input_peak.setObjectName(u"plainTextEdit_file_path_input_peak") + + self.verticalLayout_3.addWidget(self.plainTextEdit_file_path_input_peak) + + self.verticalLayout_3.setStretch(0, 2) + + self.verticalLayout_2.addWidget(self.groupBox_file_path_input_peak) + + self.groupBox_file_path_save = QGroupBox(self.groupBox) + self.groupBox_file_path_save.setObjectName(u"groupBox_file_path_save") + self.verticalLayout_4 = QVBoxLayout(self.groupBox_file_path_save) + self.verticalLayout_4.setObjectName(u"verticalLayout_4") + self.plainTextEdit_file_path_save = QPlainTextEdit(self.groupBox_file_path_save) + self.plainTextEdit_file_path_save.setObjectName(u"plainTextEdit_file_path_save") + + self.verticalLayout_4.addWidget(self.plainTextEdit_file_path_save) + + + self.verticalLayout_2.addWidget(self.groupBox_file_path_save) + + self.verticalLayout_2.setStretch(0, 4) + self.verticalLayout_2.setStretch(1, 2) + self.verticalLayout_2.setStretch(2, 2) + + self.gridLayout.addWidget(self.groupBox, 0, 0, 1, 4) + + self.pushButton_confirm = QPushButton(self.centralwidget) + self.pushButton_confirm.setObjectName(u"pushButton_confirm") + self.pushButton_confirm.setFont(font) + + self.gridLayout.addWidget(self.pushButton_confirm, 1, 2, 1, 1) + + MainWindow_artifact_label_input_setting.setCentralWidget(self.centralwidget) + self.statusbar = QStatusBar(MainWindow_artifact_label_input_setting) + self.statusbar.setObjectName(u"statusbar") + MainWindow_artifact_label_input_setting.setStatusBar(self.statusbar) + + self.retranslateUi(MainWindow_artifact_label_input_setting) + + QMetaObject.connectSlotsByName(MainWindow_artifact_label_input_setting) + # setupUi + + def retranslateUi(self, MainWindow_artifact_label_input_setting): + MainWindow_artifact_label_input_setting.setWindowTitle(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u5bfc\u5165\u8bbe\u7f6e", None)) + self.pushButton_cancel.setText(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u53d6\u6d88", None)) + self.groupBox.setTitle(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u6587\u4ef6\u8def\u5f84", None)) + self.groupBox_file_path_input_signal.setTitle(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u9884\u5904\u7406\u540e\u7684\u4fe1\u53f7\u8def\u5f84", None)) + self.label_2.setText(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u91c7\u6837\u7387(Hz)\uff1a", None)) + self.groupBox_2.setTitle(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u5e26\u901a\u6ee4\u6ce2\u8bbe\u7f6e", None)) + self.label.setText(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u9636\u6570", None)) + self.label_3.setText(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u622a\u6b62\u9891\u7387(Hz)", None)) + self.label_4.setText(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"~", None)) + self.plainTextEdit_file_path_input_signal.setPlainText("") + self.plainTextEdit_file_path_input_signal.setPlaceholderText(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u6587\u4ef6\u8def\u5f84", None)) + self.groupBox_file_path_input_peak.setTitle(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u7b97\u6cd5\u5b9a\u4f4d\u7684\u5cf0\u503c\u8def\u5f84", None)) + self.plainTextEdit_file_path_input_peak.setPlainText("") + self.plainTextEdit_file_path_input_peak.setPlaceholderText(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u6587\u4ef6\u8def\u5f84", None)) + self.groupBox_file_path_save.setTitle(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u4eba\u5de5\u7ea0\u6b63\u540e\u7684\u5cf0\u503c\u4fdd\u5b58\u8def\u5f84", None)) + self.plainTextEdit_file_path_save.setPlaceholderText(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u4fdd\u5b58\u8def\u5f84", None)) + self.pushButton_confirm.setText(QCoreApplication.translate("MainWindow_artifact_label_input_setting", u"\u786e\u5b9a", None)) + # retranslateUi + diff --git a/ui/setting/label_check_input_setting.ui b/ui/setting/label_check_input_setting.ui new file mode 100644 index 0000000..59b7cb6 --- /dev/null +++ b/ui/setting/label_check_input_setting.ui @@ -0,0 +1,228 @@ + + + MainWindow_artifact_label_input_setting + + + + 0 + 0 + 540 + 540 + + + + 导入设置 + + + + + + + + 12 + + + + 取消 + + + + + + + + 10 + + + + 文件路径 + + + + + + 预处理后的信号路径 + + + + + + + + + 12 + + + + 采样率(Hz): + + + + + + + + 12 + + + + 1 + + + 1000000 + + + + + + + + + 带通滤波设置 + + + + + + + 12 + + + + 阶数 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + + + + + + 12 + + + + 截止频率(Hz) + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + + + + + + 12 + + + + ~ + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + 12 + + + + + + + + + + + + + + 文件路径 + + + + + + + + + + 算法定位的峰值路径 + + + + + + + + + 文件路径 + + + + + + + + + + 人工纠正后的峰值保存路径 + + + + + + 保存路径 + + + + + + + + + + + + + + 12 + + + + 确定 + + + + + + + + + + diff --git a/ui/setting/preprocess_input_setting.py b/ui/setting/preprocess_input_setting.py index 29593dc..509af36 100644 --- a/ui/setting/preprocess_input_setting.py +++ b/ui/setting/preprocess_input_setting.py @@ -23,7 +23,7 @@ class Ui_MainWindow_preprocess_input_setting(object): def setupUi(self, MainWindow_preprocess_input_setting): if not MainWindow_preprocess_input_setting.objectName(): MainWindow_preprocess_input_setting.setObjectName(u"MainWindow_preprocess_input_setting") - MainWindow_preprocess_input_setting.resize(487, 373) + MainWindow_preprocess_input_setting.resize(480, 320) self.centralwidget = QWidget(MainWindow_preprocess_input_setting) self.centralwidget.setObjectName(u"centralwidget") self.gridLayout = QGridLayout(self.centralwidget) @@ -38,6 +38,9 @@ class Ui_MainWindow_preprocess_input_setting(object): self.groupBox = QGroupBox(self.centralwidget) self.groupBox.setObjectName(u"groupBox") + font1 = QFont() + font1.setPointSize(10) + self.groupBox.setFont(font1) self.verticalLayout_2 = QVBoxLayout(self.groupBox) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.groupBox_file_path_input = QGroupBox(self.groupBox) diff --git a/ui/setting/preprocess_input_setting.ui b/ui/setting/preprocess_input_setting.ui index 03a6972..718c3a8 100644 --- a/ui/setting/preprocess_input_setting.ui +++ b/ui/setting/preprocess_input_setting.ui @@ -6,8 +6,8 @@ 0 0 - 487 - 373 + 480 + 320 @@ -29,6 +29,11 @@ + + + 10 + + 文件路径