diff --git a/.gitignore b/.gitignore index 2429834..27b055e 100644 --- a/.gitignore +++ b/.gitignore @@ -91,6 +91,11 @@ ipython_config.py # Remove previous ipynb_checkpoints # git rm -r .ipynb_checkpoints/ +bcg_quality_label/ +logs/* +.idea/* +!./logs + # ---> Python # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/MainWindow.py b/MainWindow.py new file mode 100644 index 0000000..b32886b --- /dev/null +++ b/MainWindow.py @@ -0,0 +1,910 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'MainWindow.ui' +# +# Created by: PyQt5 UI code generator 5.15.9 +# +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_MainWindow(object): + def setupUi(self, MainWindow): + MainWindow.setObjectName("MainWindow") + MainWindow.resize(1920, 1105) + self.centralwidget = QtWidgets.QWidget(MainWindow) + self.centralwidget.setObjectName("centralwidget") + self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) + self.gridLayout.setObjectName("gridLayout") + self.verticalLayout_left = QtWidgets.QVBoxLayout() + self.verticalLayout_left.setObjectName("verticalLayout_left") + self.horizontalLayout_up = QtWidgets.QHBoxLayout() + self.horizontalLayout_up.setObjectName("horizontalLayout_up") + self.groupBox_inputSetting = QtWidgets.QGroupBox(self.centralwidget) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.groupBox_inputSetting.sizePolicy().hasHeightForWidth()) + self.groupBox_inputSetting.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(10) + self.groupBox_inputSetting.setFont(font) + self.groupBox_inputSetting.setObjectName("groupBox_inputSetting") + self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox_inputSetting) + self.gridLayout_4.setObjectName("gridLayout_4") + self.pushButton_savepath_open = QtWidgets.QPushButton(self.groupBox_inputSetting) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_savepath_open.sizePolicy().hasHeightForWidth()) + self.pushButton_savepath_open.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.pushButton_savepath_open.setFont(font) + self.pushButton_savepath_open.setObjectName("pushButton_savepath_open") + self.gridLayout_4.addWidget(self.pushButton_savepath_open, 6, 3, 1, 1) + self.lineEdit_datapath = QtWidgets.QLineEdit(self.groupBox_inputSetting) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.lineEdit_datapath.sizePolicy().hasHeightForWidth()) + self.lineEdit_datapath.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("Times New Roman") + font.setPointSize(10) + self.lineEdit_datapath.setFont(font) + self.lineEdit_datapath.setText("") + self.lineEdit_datapath.setPlaceholderText("") + self.lineEdit_datapath.setObjectName("lineEdit_datapath") + self.gridLayout_4.addWidget(self.lineEdit_datapath, 4, 1, 1, 2) + self.pushButton_datapath_open = QtWidgets.QPushButton(self.groupBox_inputSetting) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_datapath_open.sizePolicy().hasHeightForWidth()) + self.pushButton_datapath_open.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.pushButton_datapath_open.setFont(font) + self.pushButton_datapath_open.setObjectName("pushButton_datapath_open") + self.gridLayout_4.addWidget(self.pushButton_datapath_open, 4, 3, 1, 1) + self.lineEdit_artifactpath = QtWidgets.QLineEdit(self.groupBox_inputSetting) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.lineEdit_artifactpath.sizePolicy().hasHeightForWidth()) + self.lineEdit_artifactpath.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("Times New Roman") + font.setPointSize(10) + self.lineEdit_artifactpath.setFont(font) + self.lineEdit_artifactpath.setText("") + self.lineEdit_artifactpath.setPlaceholderText("") + self.lineEdit_artifactpath.setObjectName("lineEdit_artifactpath") + self.gridLayout_4.addWidget(self.lineEdit_artifactpath, 5, 1, 1, 2) + self.lineEdit_savepath = QtWidgets.QLineEdit(self.groupBox_inputSetting) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.lineEdit_savepath.sizePolicy().hasHeightForWidth()) + self.lineEdit_savepath.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("Times New Roman") + font.setPointSize(10) + self.lineEdit_savepath.setFont(font) + self.lineEdit_savepath.setText("") + self.lineEdit_savepath.setPlaceholderText("") + self.lineEdit_savepath.setObjectName("lineEdit_savepath") + self.gridLayout_4.addWidget(self.lineEdit_savepath, 6, 1, 1, 2) + self.pushButton_artifactpath_open = QtWidgets.QPushButton(self.groupBox_inputSetting) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_artifactpath_open.sizePolicy().hasHeightForWidth()) + self.pushButton_artifactpath_open.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.pushButton_artifactpath_open.setFont(font) + self.pushButton_artifactpath_open.setObjectName("pushButton_artifactpath_open") + self.gridLayout_4.addWidget(self.pushButton_artifactpath_open, 5, 3, 1, 1) + self.pushButton_dataInput = QtWidgets.QPushButton(self.groupBox_inputSetting) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_dataInput.sizePolicy().hasHeightForWidth()) + self.pushButton_dataInput.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.pushButton_dataInput.setFont(font) + self.pushButton_dataInput.setObjectName("pushButton_dataInput") + self.gridLayout_4.addWidget(self.pushButton_dataInput, 6, 5, 1, 1) + self.lineEdit_rootpath = QtWidgets.QLineEdit(self.groupBox_inputSetting) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.lineEdit_rootpath.sizePolicy().hasHeightForWidth()) + self.lineEdit_rootpath.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("Times New Roman") + font.setPointSize(10) + self.lineEdit_rootpath.setFont(font) + self.lineEdit_rootpath.setText("") + self.lineEdit_rootpath.setPlaceholderText("") + self.lineEdit_rootpath.setObjectName("lineEdit_rootpath") + self.gridLayout_4.addWidget(self.lineEdit_rootpath, 3, 1, 1, 2) + self.groupBox_display_mode = QtWidgets.QGroupBox(self.groupBox_inputSetting) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.groupBox_display_mode.sizePolicy().hasHeightForWidth()) + self.groupBox_display_mode.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(10) + self.groupBox_display_mode.setFont(font) + self.groupBox_display_mode.setObjectName("groupBox_display_mode") + self.gridLayout_9 = QtWidgets.QGridLayout(self.groupBox_display_mode) + self.gridLayout_9.setObjectName("gridLayout_9") + self.radioButton_10s_mode = QtWidgets.QRadioButton(self.groupBox_display_mode) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.radioButton_10s_mode.sizePolicy().hasHeightForWidth()) + self.radioButton_10s_mode.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.radioButton_10s_mode.setFont(font) + self.radioButton_10s_mode.setObjectName("radioButton_10s_mode") + self.gridLayout_9.addWidget(self.radioButton_10s_mode, 0, 0, 1, 1) + self.radioButton_30s_mode = QtWidgets.QRadioButton(self.groupBox_display_mode) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.radioButton_30s_mode.sizePolicy().hasHeightForWidth()) + self.radioButton_30s_mode.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.radioButton_30s_mode.setFont(font) + self.radioButton_30s_mode.setObjectName("radioButton_30s_mode") + self.gridLayout_9.addWidget(self.radioButton_30s_mode, 1, 0, 1, 1) + self.gridLayout_4.addWidget(self.groupBox_display_mode, 0, 5, 6, 1) + self.pushButton_rootpath_open = QtWidgets.QPushButton(self.groupBox_inputSetting) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_rootpath_open.sizePolicy().hasHeightForWidth()) + self.pushButton_rootpath_open.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.pushButton_rootpath_open.setFont(font) + self.pushButton_rootpath_open.setObjectName("pushButton_rootpath_open") + self.gridLayout_4.addWidget(self.pushButton_rootpath_open, 3, 3, 1, 1) + self.radioButton_inputMode_manual = QtWidgets.QRadioButton(self.groupBox_inputSetting) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.radioButton_inputMode_manual.sizePolicy().hasHeightForWidth()) + self.radioButton_inputMode_manual.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.radioButton_inputMode_manual.setFont(font) + self.radioButton_inputMode_manual.setObjectName("radioButton_inputMode_manual") + self.gridLayout_4.addWidget(self.radioButton_inputMode_manual, 0, 2, 1, 2) + self.label_6 = QtWidgets.QLabel(self.groupBox_inputSetting) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.label_6.setFont(font) + self.label_6.setObjectName("label_6") + self.gridLayout_4.addWidget(self.label_6, 3, 0, 1, 1) + self.label_7 = QtWidgets.QLabel(self.groupBox_inputSetting) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.label_7.setFont(font) + self.label_7.setObjectName("label_7") + self.gridLayout_4.addWidget(self.label_7, 4, 0, 1, 1) + self.label_8 = QtWidgets.QLabel(self.groupBox_inputSetting) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.label_8.setFont(font) + self.label_8.setObjectName("label_8") + self.gridLayout_4.addWidget(self.label_8, 5, 0, 1, 1) + self.label_9 = QtWidgets.QLabel(self.groupBox_inputSetting) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.label_9.setFont(font) + self.label_9.setObjectName("label_9") + self.gridLayout_4.addWidget(self.label_9, 6, 0, 1, 1) + self.radioButton_inputMode_auto = QtWidgets.QRadioButton(self.groupBox_inputSetting) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.radioButton_inputMode_auto.sizePolicy().hasHeightForWidth()) + self.radioButton_inputMode_auto.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.radioButton_inputMode_auto.setFont(font) + self.radioButton_inputMode_auto.setObjectName("radioButton_inputMode_auto") + self.gridLayout_4.addWidget(self.radioButton_inputMode_auto, 0, 0, 1, 2) + self.horizontalLayout_up.addWidget(self.groupBox_inputSetting) + self.groupBox_artifact_type = QtWidgets.QGroupBox(self.centralwidget) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.groupBox_artifact_type.sizePolicy().hasHeightForWidth()) + self.groupBox_artifact_type.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(10) + self.groupBox_artifact_type.setFont(font) + self.groupBox_artifact_type.setObjectName("groupBox_artifact_type") + self.gridLayout_8 = QtWidgets.QGridLayout(self.groupBox_artifact_type) + self.gridLayout_8.setObjectName("gridLayout_8") + self.checkBox_type4 = QtWidgets.QCheckBox(self.groupBox_artifact_type) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.checkBox_type4.setFont(font) + self.checkBox_type4.setObjectName("checkBox_type4") + self.gridLayout_8.addWidget(self.checkBox_type4, 3, 1, 1, 1) + self.checkBox_type3 = QtWidgets.QCheckBox(self.groupBox_artifact_type) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.checkBox_type3.setFont(font) + self.checkBox_type3.setObjectName("checkBox_type3") + self.gridLayout_8.addWidget(self.checkBox_type3, 2, 1, 1, 1) + self.checkBox_type5 = QtWidgets.QCheckBox(self.groupBox_artifact_type) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.checkBox_type5.setFont(font) + self.checkBox_type5.setObjectName("checkBox_type5") + self.gridLayout_8.addWidget(self.checkBox_type5, 4, 1, 1, 1) + self.checkBox_type2 = QtWidgets.QCheckBox(self.groupBox_artifact_type) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.checkBox_type2.setFont(font) + self.checkBox_type2.setObjectName("checkBox_type2") + self.gridLayout_8.addWidget(self.checkBox_type2, 1, 1, 1, 1) + self.checkBox_type1 = QtWidgets.QCheckBox(self.groupBox_artifact_type) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.checkBox_type1.setFont(font) + self.checkBox_type1.setObjectName("checkBox_type1") + self.gridLayout_8.addWidget(self.checkBox_type1, 0, 1, 1, 1) + self.checkBox_allin = QtWidgets.QCheckBox(self.groupBox_artifact_type) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.checkBox_allin.setFont(font) + self.checkBox_allin.setObjectName("checkBox_allin") + self.gridLayout_8.addWidget(self.checkBox_allin, 2, 0, 1, 1) + self.horizontalLayout_up.addWidget(self.groupBox_artifact_type) + self.groupBox_status = QtWidgets.QGroupBox(self.centralwidget) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.groupBox_status.sizePolicy().hasHeightForWidth()) + self.groupBox_status.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(10) + self.groupBox_status.setFont(font) + self.groupBox_status.setObjectName("groupBox_status") + self.gridLayout_19 = QtWidgets.QGridLayout(self.groupBox_status) + self.gridLayout_19.setObjectName("gridLayout_19") + self.label_10 = QtWidgets.QLabel(self.groupBox_status) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.label_10.setFont(font) + self.label_10.setObjectName("label_10") + self.gridLayout_19.addWidget(self.label_10, 1, 0, 1, 1) + self.label_5 = QtWidgets.QLabel(self.groupBox_status) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.label_5.setFont(font) + self.label_5.setObjectName("label_5") + self.gridLayout_19.addWidget(self.label_5, 3, 0, 1, 1) + self.label_4 = QtWidgets.QLabel(self.groupBox_status) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.label_4.setFont(font) + self.label_4.setObjectName("label_4") + self.gridLayout_19.addWidget(self.label_4, 2, 0, 1, 1) + self.label_3 = QtWidgets.QLabel(self.groupBox_status) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.label_3.setFont(font) + self.label_3.setObjectName("label_3") + self.gridLayout_19.addWidget(self.label_3, 0, 0, 1, 1) + self.lineEdit_data_part_num = QtWidgets.QLineEdit(self.groupBox_status) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.lineEdit_data_part_num.sizePolicy().hasHeightForWidth()) + self.lineEdit_data_part_num.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.lineEdit_data_part_num.setFont(font) + self.lineEdit_data_part_num.setReadOnly(False) + self.lineEdit_data_part_num.setObjectName("lineEdit_data_part_num") + self.gridLayout_19.addWidget(self.lineEdit_data_part_num, 1, 1, 1, 1) + self.lineEdit_longest_continuous_time = QtWidgets.QLineEdit(self.groupBox_status) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.lineEdit_longest_continuous_time.sizePolicy().hasHeightForWidth()) + self.lineEdit_longest_continuous_time.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.lineEdit_longest_continuous_time.setFont(font) + self.lineEdit_longest_continuous_time.setObjectName("lineEdit_longest_continuous_time") + self.gridLayout_19.addWidget(self.lineEdit_longest_continuous_time, 2, 1, 1, 1) + self.lineEdit_artifact_time_percentage = QtWidgets.QLineEdit(self.groupBox_status) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.lineEdit_artifact_time_percentage.sizePolicy().hasHeightForWidth()) + self.lineEdit_artifact_time_percentage.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.lineEdit_artifact_time_percentage.setFont(font) + self.lineEdit_artifact_time_percentage.setObjectName("lineEdit_artifact_time_percentage") + self.gridLayout_19.addWidget(self.lineEdit_artifact_time_percentage, 3, 1, 1, 1) + self.lineEdit_current_part_time = QtWidgets.QLineEdit(self.groupBox_status) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.lineEdit_current_part_time.sizePolicy().hasHeightForWidth()) + self.lineEdit_current_part_time.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.lineEdit_current_part_time.setFont(font) + self.lineEdit_current_part_time.setReadOnly(False) + self.lineEdit_current_part_time.setObjectName("lineEdit_current_part_time") + self.gridLayout_19.addWidget(self.lineEdit_current_part_time, 0, 1, 1, 1) + self.horizontalLayout_up.addWidget(self.groupBox_status) + self.groupBox_function = QtWidgets.QGroupBox(self.centralwidget) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.groupBox_function.sizePolicy().hasHeightForWidth()) + self.groupBox_function.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(10) + self.groupBox_function.setFont(font) + self.groupBox_function.setObjectName("groupBox_function") + self.gridLayout_3 = QtWidgets.QGridLayout(self.groupBox_function) + self.gridLayout_3.setObjectName("gridLayout_3") + self.pushButton_invalid_signal_label = QtWidgets.QPushButton(self.groupBox_function) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_invalid_signal_label.sizePolicy().hasHeightForWidth()) + self.pushButton_invalid_signal_label.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(12) + self.pushButton_invalid_signal_label.setFont(font) + self.pushButton_invalid_signal_label.setObjectName("pushButton_invalid_signal_label") + self.gridLayout_3.addWidget(self.pushButton_invalid_signal_label, 1, 0, 1, 1) + self.pushButton_Ctype_signal_label = QtWidgets.QPushButton(self.groupBox_function) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_Ctype_signal_label.sizePolicy().hasHeightForWidth()) + self.pushButton_Ctype_signal_label.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(12) + self.pushButton_Ctype_signal_label.setFont(font) + self.pushButton_Ctype_signal_label.setObjectName("pushButton_Ctype_signal_label") + self.gridLayout_3.addWidget(self.pushButton_Ctype_signal_label, 2, 0, 1, 1) + self.gridLayout_3.setColumnStretch(0, 1) + self.horizontalLayout_up.addWidget(self.groupBox_function) + self.groupBox_operation = QtWidgets.QGroupBox(self.centralwidget) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.groupBox_operation.sizePolicy().hasHeightForWidth()) + self.groupBox_operation.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(10) + self.groupBox_operation.setFont(font) + self.groupBox_operation.setObjectName("groupBox_operation") + self.gridLayout_5 = QtWidgets.QGridLayout(self.groupBox_operation) + self.gridLayout_5.setObjectName("gridLayout_5") + self.lineEdit_remark = QtWidgets.QLineEdit(self.groupBox_operation) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.lineEdit_remark.sizePolicy().hasHeightForWidth()) + self.lineEdit_remark.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.lineEdit_remark.setFont(font) + self.lineEdit_remark.setObjectName("lineEdit_remark") + self.gridLayout_5.addWidget(self.lineEdit_remark, 2, 1, 1, 1) + self.checkBox_display_afterfilter = QtWidgets.QCheckBox(self.groupBox_operation) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.checkBox_display_afterfilter.sizePolicy().hasHeightForWidth()) + self.checkBox_display_afterfilter.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.checkBox_display_afterfilter.setFont(font) + self.checkBox_display_afterfilter.setObjectName("checkBox_display_afterfilter") + self.gridLayout_5.addWidget(self.checkBox_display_afterfilter, 0, 1, 1, 1) + self.checkBox_highlight_longest_continuous = QtWidgets.QCheckBox(self.groupBox_operation) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.checkBox_highlight_longest_continuous.sizePolicy().hasHeightForWidth()) + self.checkBox_highlight_longest_continuous.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.checkBox_highlight_longest_continuous.setFont(font) + self.checkBox_highlight_longest_continuous.setObjectName("checkBox_highlight_longest_continuous") + self.gridLayout_5.addWidget(self.checkBox_highlight_longest_continuous, 0, 0, 1, 1) + self.label_11 = QtWidgets.QLabel(self.groupBox_operation) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.label_11.setFont(font) + self.label_11.setAlignment(QtCore.Qt.AlignCenter) + self.label_11.setObjectName("label_11") + self.gridLayout_5.addWidget(self.label_11, 2, 0, 1, 1) + self.checkBox_examine_tobeLabeled = QtWidgets.QCheckBox(self.groupBox_operation) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.checkBox_examine_tobeLabeled.sizePolicy().hasHeightForWidth()) + self.checkBox_examine_tobeLabeled.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.checkBox_examine_tobeLabeled.setFont(font) + self.checkBox_examine_tobeLabeled.setObjectName("checkBox_examine_tobeLabeled") + self.gridLayout_5.addWidget(self.checkBox_examine_tobeLabeled, 1, 0, 1, 1) + self.pushButton_left = QtWidgets.QPushButton(self.groupBox_operation) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_left.sizePolicy().hasHeightForWidth()) + self.pushButton_left.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(20) + self.pushButton_left.setFont(font) + self.pushButton_left.setObjectName("pushButton_left") + self.gridLayout_5.addWidget(self.pushButton_left, 3, 0, 1, 1) + self.pushButton_right = QtWidgets.QPushButton(self.groupBox_operation) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_right.sizePolicy().hasHeightForWidth()) + self.pushButton_right.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(20) + self.pushButton_right.setFont(font) + self.pushButton_right.setObjectName("pushButton_right") + self.gridLayout_5.addWidget(self.pushButton_right, 3, 1, 1, 1) + self.gridLayout_5.setColumnStretch(0, 1) + self.gridLayout_5.setColumnStretch(1, 1) + self.gridLayout_5.setRowStretch(0, 1) + self.gridLayout_5.setRowStretch(1, 1) + self.gridLayout_5.setRowStretch(2, 2) + self.gridLayout_5.setRowStretch(3, 2) + self.horizontalLayout_up.addWidget(self.groupBox_operation) + self.horizontalLayout_up.setStretch(0, 8) + self.horizontalLayout_up.setStretch(1, 2) + self.horizontalLayout_up.setStretch(2, 5) + self.horizontalLayout_up.setStretch(3, 1) + self.horizontalLayout_up.setStretch(4, 6) + self.verticalLayout_left.addLayout(self.horizontalLayout_up) + self.verticalLayout_canvas = QtWidgets.QVBoxLayout() + self.verticalLayout_canvas.setObjectName("verticalLayout_canvas") + self.verticalLayout_left.addLayout(self.verticalLayout_canvas) + self.verticalLayout_left.setStretch(1, 9) + self.gridLayout.addLayout(self.verticalLayout_left, 0, 0, 1, 1) + self.horizontalLayout_right = QtWidgets.QHBoxLayout() + self.horizontalLayout_right.setObjectName("horizontalLayout_right") + self.verticalLayout_right = QtWidgets.QVBoxLayout() + self.verticalLayout_right.setObjectName("verticalLayout_right") + self.groupBox_labelDisplay_10s = QtWidgets.QGroupBox(self.centralwidget) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.groupBox_labelDisplay_10s.sizePolicy().hasHeightForWidth()) + self.groupBox_labelDisplay_10s.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(10) + self.groupBox_labelDisplay_10s.setFont(font) + self.groupBox_labelDisplay_10s.setObjectName("groupBox_labelDisplay_10s") + self.gridLayout_56 = QtWidgets.QGridLayout(self.groupBox_labelDisplay_10s) + self.gridLayout_56.setObjectName("gridLayout_56") + self.pushButton_label10s_b = QtWidgets.QPushButton(self.groupBox_labelDisplay_10s) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_label10s_b.sizePolicy().hasHeightForWidth()) + self.pushButton_label10s_b.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(48) + self.pushButton_label10s_b.setFont(font) + self.pushButton_label10s_b.setObjectName("pushButton_label10s_b") + self.gridLayout_56.addWidget(self.pushButton_label10s_b, 0, 2, 1, 1) + self.pushButton_label10s_f = QtWidgets.QPushButton(self.groupBox_labelDisplay_10s) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_label10s_f.sizePolicy().hasHeightForWidth()) + self.pushButton_label10s_f.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(16) + self.pushButton_label10s_f.setFont(font) + self.pushButton_label10s_f.setObjectName("pushButton_label10s_f") + self.gridLayout_56.addWidget(self.pushButton_label10s_f, 2, 1, 1, 1) + self.tableWidget_label10s_c = QtWidgets.QTableWidget(self.groupBox_labelDisplay_10s) + font = QtGui.QFont() + font.setFamily("Times New Roman") + font.setPointSize(14) + self.tableWidget_label10s_c.setFont(font) + self.tableWidget_label10s_c.setColumnCount(1) + self.tableWidget_label10s_c.setObjectName("tableWidget_label10s_c") + self.tableWidget_label10s_c.setRowCount(0) + self.gridLayout_56.addWidget(self.tableWidget_label10s_c, 1, 3, 1, 1) + self.pushButton_label10s_a = QtWidgets.QPushButton(self.groupBox_labelDisplay_10s) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_label10s_a.sizePolicy().hasHeightForWidth()) + self.pushButton_label10s_a.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(48) + self.pushButton_label10s_a.setFont(font) + self.pushButton_label10s_a.setObjectName("pushButton_label10s_a") + self.gridLayout_56.addWidget(self.pushButton_label10s_a, 0, 1, 1, 1) + self.tableWidget_label10s_tobeLabeled = QtWidgets.QTableWidget(self.groupBox_labelDisplay_10s) + font = QtGui.QFont() + font.setFamily("Times New Roman") + font.setPointSize(14) + self.tableWidget_label10s_tobeLabeled.setFont(font) + self.tableWidget_label10s_tobeLabeled.setRowCount(0) + self.tableWidget_label10s_tobeLabeled.setColumnCount(1) + self.tableWidget_label10s_tobeLabeled.setObjectName("tableWidget_label10s_tobeLabeled") + self.tableWidget_label10s_tobeLabeled.horizontalHeader().setCascadingSectionResizes(False) + self.tableWidget_label10s_tobeLabeled.verticalHeader().setVisible(True) + self.tableWidget_label10s_tobeLabeled.verticalHeader().setStretchLastSection(False) + self.gridLayout_56.addWidget(self.tableWidget_label10s_tobeLabeled, 2, 2, 1, 2) + self.tableWidget_label10s_b = QtWidgets.QTableWidget(self.groupBox_labelDisplay_10s) + font = QtGui.QFont() + font.setFamily("Times New Roman") + font.setPointSize(14) + self.tableWidget_label10s_b.setFont(font) + self.tableWidget_label10s_b.setRowCount(0) + self.tableWidget_label10s_b.setColumnCount(1) + self.tableWidget_label10s_b.setObjectName("tableWidget_label10s_b") + self.tableWidget_label10s_b.horizontalHeader().setCascadingSectionResizes(False) + self.tableWidget_label10s_b.verticalHeader().setVisible(True) + self.tableWidget_label10s_b.verticalHeader().setStretchLastSection(False) + self.gridLayout_56.addWidget(self.tableWidget_label10s_b, 1, 2, 1, 1) + self.tableWidget_label10s_a = QtWidgets.QTableWidget(self.groupBox_labelDisplay_10s) + font = QtGui.QFont() + font.setFamily("Times New Roman") + font.setPointSize(14) + self.tableWidget_label10s_a.setFont(font) + self.tableWidget_label10s_a.setRowCount(0) + self.tableWidget_label10s_a.setColumnCount(1) + self.tableWidget_label10s_a.setObjectName("tableWidget_label10s_a") + self.tableWidget_label10s_a.horizontalHeader().setCascadingSectionResizes(False) + self.tableWidget_label10s_a.verticalHeader().setVisible(True) + self.tableWidget_label10s_a.verticalHeader().setStretchLastSection(False) + self.gridLayout_56.addWidget(self.tableWidget_label10s_a, 1, 1, 1, 1) + self.pushButton_label10s_c = QtWidgets.QPushButton(self.groupBox_labelDisplay_10s) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_label10s_c.sizePolicy().hasHeightForWidth()) + self.pushButton_label10s_c.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(48) + self.pushButton_label10s_c.setFont(font) + self.pushButton_label10s_c.setObjectName("pushButton_label10s_c") + self.gridLayout_56.addWidget(self.pushButton_label10s_c, 0, 3, 1, 1) + self.gridLayout_56.setRowStretch(0, 3) + self.gridLayout_56.setRowStretch(1, 7) + self.gridLayout_56.setRowStretch(2, 3) + self.verticalLayout_right.addWidget(self.groupBox_labelDisplay_10s) + self.groupBox_labelDisplay_30s = QtWidgets.QGroupBox(self.centralwidget) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.groupBox_labelDisplay_30s.sizePolicy().hasHeightForWidth()) + self.groupBox_labelDisplay_30s.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(10) + self.groupBox_labelDisplay_30s.setFont(font) + self.groupBox_labelDisplay_30s.setObjectName("groupBox_labelDisplay_30s") + self.gridLayout_55 = QtWidgets.QGridLayout(self.groupBox_labelDisplay_30s) + self.gridLayout_55.setObjectName("gridLayout_55") + self.pushButton_label30s_b2 = QtWidgets.QPushButton(self.groupBox_labelDisplay_30s) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_label30s_b2.sizePolicy().hasHeightForWidth()) + self.pushButton_label30s_b2.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(48) + self.pushButton_label30s_b2.setFont(font) + self.pushButton_label30s_b2.setObjectName("pushButton_label30s_b2") + self.gridLayout_55.addWidget(self.pushButton_label30s_b2, 4, 0, 1, 1) + self.tableWidget_label30s_b2 = QtWidgets.QTableWidget(self.groupBox_labelDisplay_30s) + font = QtGui.QFont() + font.setFamily("Times New Roman") + font.setPointSize(14) + self.tableWidget_label30s_b2.setFont(font) + self.tableWidget_label30s_b2.setColumnCount(1) + self.tableWidget_label30s_b2.setObjectName("tableWidget_label30s_b2") + self.tableWidget_label30s_b2.setRowCount(0) + self.gridLayout_55.addWidget(self.tableWidget_label30s_b2, 4, 1, 1, 1) + self.tableWidget_label30s_c = QtWidgets.QTableWidget(self.groupBox_labelDisplay_30s) + font = QtGui.QFont() + font.setFamily("Times New Roman") + font.setPointSize(14) + self.tableWidget_label30s_c.setFont(font) + self.tableWidget_label30s_c.setColumnCount(1) + self.tableWidget_label30s_c.setObjectName("tableWidget_label30s_c") + self.tableWidget_label30s_c.setRowCount(0) + self.gridLayout_55.addWidget(self.tableWidget_label30s_c, 6, 1, 1, 1) + self.tableWidget_label30s_a2 = QtWidgets.QTableWidget(self.groupBox_labelDisplay_30s) + font = QtGui.QFont() + font.setFamily("Times New Roman") + font.setPointSize(14) + self.tableWidget_label30s_a2.setFont(font) + self.tableWidget_label30s_a2.setColumnCount(1) + self.tableWidget_label30s_a2.setObjectName("tableWidget_label30s_a2") + self.tableWidget_label30s_a2.setRowCount(0) + self.gridLayout_55.addWidget(self.tableWidget_label30s_a2, 1, 1, 1, 1) + self.tableWidget_label30s_a1 = QtWidgets.QTableWidget(self.groupBox_labelDisplay_30s) + font = QtGui.QFont() + font.setFamily("Times New Roman") + font.setPointSize(14) + self.tableWidget_label30s_a1.setFont(font) + self.tableWidget_label30s_a1.setRowCount(0) + self.tableWidget_label30s_a1.setColumnCount(1) + self.tableWidget_label30s_a1.setObjectName("tableWidget_label30s_a1") + self.tableWidget_label30s_a1.horizontalHeader().setCascadingSectionResizes(False) + self.tableWidget_label30s_a1.verticalHeader().setVisible(True) + self.tableWidget_label30s_a1.verticalHeader().setStretchLastSection(False) + self.gridLayout_55.addWidget(self.tableWidget_label30s_a1, 0, 1, 1, 1) + self.pushButton_label30s_a1 = QtWidgets.QPushButton(self.groupBox_labelDisplay_30s) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_label30s_a1.sizePolicy().hasHeightForWidth()) + self.pushButton_label30s_a1.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(48) + self.pushButton_label30s_a1.setFont(font) + self.pushButton_label30s_a1.setObjectName("pushButton_label30s_a1") + self.gridLayout_55.addWidget(self.pushButton_label30s_a1, 0, 0, 1, 1) + self.pushButton_label30s_c = QtWidgets.QPushButton(self.groupBox_labelDisplay_30s) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_label30s_c.sizePolicy().hasHeightForWidth()) + self.pushButton_label30s_c.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(48) + self.pushButton_label30s_c.setFont(font) + self.pushButton_label30s_c.setObjectName("pushButton_label30s_c") + self.gridLayout_55.addWidget(self.pushButton_label30s_c, 6, 0, 1, 1) + self.tableWidget_label30s_b1 = QtWidgets.QTableWidget(self.groupBox_labelDisplay_30s) + font = QtGui.QFont() + font.setFamily("Times New Roman") + font.setPointSize(14) + self.tableWidget_label30s_b1.setFont(font) + self.tableWidget_label30s_b1.setRowCount(0) + self.tableWidget_label30s_b1.setColumnCount(1) + self.tableWidget_label30s_b1.setObjectName("tableWidget_label30s_b1") + self.tableWidget_label30s_b1.horizontalHeader().setCascadingSectionResizes(False) + self.tableWidget_label30s_b1.verticalHeader().setVisible(True) + self.tableWidget_label30s_b1.verticalHeader().setStretchLastSection(False) + self.gridLayout_55.addWidget(self.tableWidget_label30s_b1, 3, 1, 1, 1) + self.pushButton_label30s_a2 = QtWidgets.QPushButton(self.groupBox_labelDisplay_30s) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_label30s_a2.sizePolicy().hasHeightForWidth()) + self.pushButton_label30s_a2.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(48) + self.pushButton_label30s_a2.setFont(font) + self.pushButton_label30s_a2.setObjectName("pushButton_label30s_a2") + self.gridLayout_55.addWidget(self.pushButton_label30s_a2, 1, 0, 1, 1) + self.pushButton_label30s_b1 = QtWidgets.QPushButton(self.groupBox_labelDisplay_30s) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_label30s_b1.sizePolicy().hasHeightForWidth()) + self.pushButton_label30s_b1.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(48) + self.pushButton_label30s_b1.setFont(font) + self.pushButton_label30s_b1.setObjectName("pushButton_label30s_b1") + self.gridLayout_55.addWidget(self.pushButton_label30s_b1, 3, 0, 1, 1) + self.tableWidget_label30s_tobeLabeled = QtWidgets.QTableWidget(self.groupBox_labelDisplay_30s) + font = QtGui.QFont() + font.setFamily("Times New Roman") + font.setPointSize(14) + self.tableWidget_label30s_tobeLabeled.setFont(font) + self.tableWidget_label30s_tobeLabeled.setRowCount(0) + self.tableWidget_label30s_tobeLabeled.setColumnCount(1) + self.tableWidget_label30s_tobeLabeled.setObjectName("tableWidget_label30s_tobeLabeled") + self.tableWidget_label30s_tobeLabeled.horizontalHeader().setCascadingSectionResizes(False) + self.tableWidget_label30s_tobeLabeled.verticalHeader().setVisible(True) + self.tableWidget_label30s_tobeLabeled.verticalHeader().setStretchLastSection(False) + self.gridLayout_55.addWidget(self.tableWidget_label30s_tobeLabeled, 7, 1, 1, 1) + self.pushButton_label30s_f = QtWidgets.QPushButton(self.groupBox_labelDisplay_30s) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pushButton_label30s_f.sizePolicy().hasHeightForWidth()) + self.pushButton_label30s_f.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(16) + self.pushButton_label30s_f.setFont(font) + self.pushButton_label30s_f.setObjectName("pushButton_label30s_f") + self.gridLayout_55.addWidget(self.pushButton_label30s_f, 7, 0, 1, 1) + self.gridLayout_55.setColumnStretch(0, 5) + self.gridLayout_55.setColumnStretch(1, 3) + self.verticalLayout_right.addWidget(self.groupBox_labelDisplay_30s) + self.groupBox_info = QtWidgets.QGroupBox(self.centralwidget) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.groupBox_info.sizePolicy().hasHeightForWidth()) + self.groupBox_info.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(10) + self.groupBox_info.setFont(font) + self.groupBox_info.setObjectName("groupBox_info") + self.gridLayout_64 = QtWidgets.QGridLayout(self.groupBox_info) + self.gridLayout_64.setObjectName("gridLayout_64") + self.textBrowser_infoOutput = QtWidgets.QTextBrowser(self.groupBox_info) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(10) + self.textBrowser_infoOutput.setFont(font) + self.textBrowser_infoOutput.setObjectName("textBrowser_infoOutput") + self.gridLayout_64.addWidget(self.textBrowser_infoOutput, 0, 0, 1, 2) + self.gridLayout_64.setColumnStretch(0, 1) + self.verticalLayout_right.addWidget(self.groupBox_info) + self.verticalLayout_right.setStretch(0, 8) + self.verticalLayout_right.setStretch(1, 8) + self.verticalLayout_right.setStretch(2, 2) + self.horizontalLayout_right.addLayout(self.verticalLayout_right) + self.horizontalLayout_right.setStretch(0, 2) + self.gridLayout.addLayout(self.horizontalLayout_right, 0, 1, 1, 1) + self.gridLayout.setColumnStretch(0, 30) + self.gridLayout.setColumnStretch(1, 7) + MainWindow.setCentralWidget(self.centralwidget) + self.action_selectPath = QtWidgets.QAction(MainWindow) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.action_selectPath.setFont(font) + self.action_selectPath.setObjectName("action_selectPath") + self.action = QtWidgets.QAction(MainWindow) + font = QtGui.QFont() + font.setFamily("黑体") + font.setPointSize(14) + self.action.setFont(font) + self.action.setObjectName("action") + + self.retranslateUi(MainWindow) + QtCore.QMetaObject.connectSlotsByName(MainWindow) + + def retranslateUi(self, MainWindow): + _translate = QtCore.QCoreApplication.translate + MainWindow.setWindowTitle(_translate("MainWindow", "BCG_Quality_Label")) + self.groupBox_inputSetting.setTitle(_translate("MainWindow", "导入操作")) + self.pushButton_savepath_open.setText(_translate("MainWindow", "浏览")) + self.pushButton_datapath_open.setText(_translate("MainWindow", "浏览")) + self.pushButton_artifactpath_open.setText(_translate("MainWindow", "浏览")) + self.pushButton_dataInput.setText(_translate("MainWindow", "导入")) + self.groupBox_display_mode.setTitle(_translate("MainWindow", "显示模式")) + self.radioButton_10s_mode.setText(_translate("MainWindow", "10s模式")) + self.radioButton_30s_mode.setText(_translate("MainWindow", "30s模式")) + self.pushButton_rootpath_open.setText(_translate("MainWindow", "浏览")) + self.radioButton_inputMode_manual.setText(_translate("MainWindow", "手动输入路径")) + self.label_6.setText(_translate("MainWindow", "根目录路径")) + self.label_7.setText(_translate("MainWindow", "BCG信号路径")) + self.label_8.setText(_translate("MainWindow", "体动路径")) + self.label_9.setText(_translate("MainWindow", "保存路径")) + self.radioButton_inputMode_auto.setText(_translate("MainWindow", "输入数据根目录自动识别")) + self.groupBox_artifact_type.setTitle(_translate("MainWindow", "体动类型")) + self.checkBox_type4.setText(_translate("MainWindow", "类型4")) + self.checkBox_type3.setText(_translate("MainWindow", "类型3")) + self.checkBox_type5.setText(_translate("MainWindow", "类型5")) + self.checkBox_type2.setText(_translate("MainWindow", "类型2")) + self.checkBox_type1.setText(_translate("MainWindow", "类型1")) + self.checkBox_allin.setText(_translate("MainWindow", "全选")) + self.groupBox_status.setTitle(_translate("MainWindow", "运行状态")) + self.label_10.setText(_translate("MainWindow", "当前片段/片段总数")) + self.label_5.setText(_translate("MainWindow", "体动时间占比")) + self.label_4.setText(_translate("MainWindow", "最长连续时间")) + self.label_3.setText(_translate("MainWindow", "当前片段时间")) + self.groupBox_function.setTitle(_translate("MainWindow", "功能")) + self.pushButton_invalid_signal_label.setText(_translate("MainWindow", "无效信号打标")) + self.pushButton_Ctype_signal_label.setText(_translate("MainWindow", "C类信号打标")) + self.groupBox_operation.setTitle(_translate("MainWindow", "操作")) + self.checkBox_display_afterfilter.setText(_translate("MainWindow", "去除工频噪声")) + self.checkBox_highlight_longest_continuous.setText(_translate("MainWindow", "高亮最长连续")) + self.label_11.setText(_translate("MainWindow", "输入备注")) + self.checkBox_examine_tobeLabeled.setText(_translate("MainWindow", "仅查未标片段")) + self.pushButton_left.setText(_translate("MainWindow", "<(A)")) + self.pushButton_right.setText(_translate("MainWindow", ">(D)")) + self.groupBox_labelDisplay_10s.setTitle(_translate("MainWindow", "标签记录")) + self.pushButton_label10s_b.setText(_translate("MainWindow", "b")) + self.pushButton_label10s_f.setText(_translate("MainWindow", "删除标签")) + self.pushButton_label10s_a.setText(_translate("MainWindow", "a")) + self.pushButton_label10s_c.setText(_translate("MainWindow", "c")) + self.groupBox_labelDisplay_30s.setTitle(_translate("MainWindow", "标签记录")) + self.pushButton_label30s_b2.setText(_translate("MainWindow", "b2")) + self.pushButton_label30s_a1.setText(_translate("MainWindow", "a1")) + self.pushButton_label30s_c.setText(_translate("MainWindow", "c")) + self.pushButton_label30s_a2.setText(_translate("MainWindow", "a2")) + self.pushButton_label30s_b1.setText(_translate("MainWindow", "b1")) + self.pushButton_label30s_f.setText(_translate("MainWindow", "删除标签")) + self.groupBox_info.setTitle(_translate("MainWindow", "信息")) + self.action_selectPath.setText(_translate("MainWindow", "数据路径选择")) + self.action.setText(_translate("MainWindow", "加载存档")) diff --git a/MainWindow.ui b/MainWindow.ui new file mode 100644 index 0000000..2b585ce --- /dev/null +++ b/MainWindow.ui @@ -0,0 +1,1341 @@ + + + MainWindow + + + + 0 + 0 + 1920 + 1105 + + + + BCG_Quality_Label + + + + + + + + + + + + 0 + 0 + + + + + 黑体 + 10 + + + + 导入操作 + + + + + + + 0 + 0 + + + + + 黑体 + 14 + + + + 浏览 + + + + + + + + 0 + 0 + + + + + Times New Roman + 10 + + + + + + + + + + + + + + + 0 + 0 + + + + + 黑体 + 14 + + + + 浏览 + + + + + + + + 0 + 0 + + + + + Times New Roman + 10 + + + + + + + + + + + + + + + 0 + 0 + + + + + Times New Roman + 10 + + + + + + + + + + + + + + + 0 + 0 + + + + + 黑体 + 14 + + + + 浏览 + + + + + + + + 0 + 0 + + + + + 黑体 + 14 + + + + 导入 + + + + + + + + 0 + 0 + + + + + Times New Roman + 10 + + + + + + + + + + + + + + + 0 + 0 + + + + + 黑体 + 10 + + + + 显示模式 + + + + + + + 0 + 0 + + + + + 黑体 + 14 + + + + 10s模式 + + + + + + + + 0 + 0 + + + + + 黑体 + 14 + + + + 30s模式 + + + + + + + + + + + 0 + 0 + + + + + 黑体 + 14 + + + + 浏览 + + + + + + + + 0 + 0 + + + + + 黑体 + 14 + + + + 手动输入路径 + + + + + + + + 黑体 + 14 + + + + 根目录路径 + + + + + + + + 黑体 + 14 + + + + BCG信号路径 + + + + + + + + 黑体 + 14 + + + + 体动路径 + + + + + + + + 黑体 + 14 + + + + 保存路径 + + + + + + + + 0 + 0 + + + + + 黑体 + 14 + + + + 输入数据根目录自动识别 + + + + + + + + + + + 0 + 0 + + + + + 黑体 + 10 + + + + 体动类型 + + + + + + + 黑体 + 14 + + + + 类型4 + + + + + + + + 黑体 + 14 + + + + 类型3 + + + + + + + + 黑体 + 14 + + + + 类型5 + + + + + + + + 黑体 + 14 + + + + 类型2 + + + + + + + + 黑体 + 14 + + + + 类型1 + + + + + + + + 黑体 + 14 + + + + 全选 + + + + + + + + + + + 0 + 0 + + + + + 黑体 + 10 + + + + 运行状态 + + + + + + + 黑体 + 14 + + + + 当前片段/片段总数 + + + + + + + + 黑体 + 14 + + + + 体动时间占比 + + + + + + + + 黑体 + 14 + + + + 最长连续时间 + + + + + + + + 黑体 + 14 + + + + 当前片段时间 + + + + + + + + 0 + 0 + + + + + 黑体 + 14 + + + + false + + + + + + + + 0 + 0 + + + + + 黑体 + 14 + + + + + + + + + 0 + 0 + + + + + 黑体 + 14 + + + + + + + + + 0 + 0 + + + + + 黑体 + 14 + + + + false + + + + + + + + + + + 0 + 0 + + + + + 黑体 + 10 + + + + 功能 + + + + + + + 0 + 0 + + + + + 黑体 + 12 + + + + 无效信号打标 + + + + + + + + 0 + 0 + + + + + 黑体 + 12 + + + + C类信号打标 + + + + + + + + + + + 0 + 0 + + + + + 黑体 + 10 + + + + 操作 + + + + + + + 0 + 0 + + + + + 黑体 + 14 + + + + + + + + + 0 + 0 + + + + + 黑体 + 14 + + + + 去除工频噪声 + + + + + + + + 0 + 0 + + + + + 黑体 + 14 + + + + 高亮最长连续 + + + + + + + + 黑体 + 14 + + + + 输入备注 + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 黑体 + 14 + + + + 仅查未标片段 + + + + + + + + 0 + 0 + + + + + 黑体 + 20 + + + + <(A) + + + + + + + + 0 + 0 + + + + + 黑体 + 20 + + + + >(D) + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + + 黑体 + 10 + + + + 标签记录 + + + + + + + 0 + 0 + + + + + 黑体 + 48 + + + + b + + + + + + + + 0 + 0 + + + + + 黑体 + 16 + + + + 删除标签 + + + + + + + + Times New Roman + 14 + + + + 1 + + + + + + + + + 0 + 0 + + + + + 黑体 + 48 + + + + a + + + + + + + + Times New Roman + 14 + + + + 0 + + + 1 + + + false + + + true + + + false + + + + + + + + + Times New Roman + 14 + + + + 0 + + + 1 + + + false + + + true + + + false + + + + + + + + + Times New Roman + 14 + + + + 0 + + + 1 + + + false + + + true + + + false + + + + + + + + + 0 + 0 + + + + + 黑体 + 48 + + + + c + + + + + + + + + + + 0 + 0 + + + + + 黑体 + 10 + + + + 标签记录 + + + + + + + 0 + 0 + + + + + 黑体 + 48 + + + + b2 + + + + + + + + Times New Roman + 14 + + + + 1 + + + + + + + + + Times New Roman + 14 + + + + 1 + + + + + + + + + Times New Roman + 14 + + + + 1 + + + + + + + + + Times New Roman + 14 + + + + 0 + + + 1 + + + false + + + true + + + false + + + + + + + + + 0 + 0 + + + + + 黑体 + 48 + + + + a1 + + + + + + + + 0 + 0 + + + + + 黑体 + 48 + + + + c + + + + + + + + Times New Roman + 14 + + + + 0 + + + 1 + + + false + + + true + + + false + + + + + + + + + 0 + 0 + + + + + 黑体 + 48 + + + + a2 + + + + + + + + 0 + 0 + + + + + 黑体 + 48 + + + + b1 + + + + + + + + Times New Roman + 14 + + + + 0 + + + 1 + + + false + + + true + + + false + + + + + + + + + 0 + 0 + + + + + 黑体 + 16 + + + + 删除标签 + + + + + + + + + + + 0 + 0 + + + + + 黑体 + 10 + + + + 信息 + + + + + + + 黑体 + 10 + + + + + + + + + + + + + + + + 数据路径选择 + + + + 黑体 + 14 + + + + + + 加载存档 + + + + 黑体 + 14 + + + + + + + diff --git a/README.md b/README.md index c64aa66..637a2ad 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,14 @@ -# bcg_quality_label +# bcg_quality_label——BCG信号质量打标程序 -BCG质量标注 \ No newline at end of file +``` +项目作者信息 +@author:Yosa +@email:2023025086@m.scnu.edu.cn +@time:2025/2/10 +``` + +本程序提供符合用户直接的操作界面,用于对BCG信号片段的质量进行打标。 + +## TODO + +编写说明文档 \ No newline at end of file diff --git a/bcg_quality_label.py b/bcg_quality_label.py new file mode 100644 index 0000000..17a5303 --- /dev/null +++ b/bcg_quality_label.py @@ -0,0 +1,1181 @@ +""" +@author:Yosa +@file:bcg_quality_label.py +@email:2023025086@m.scnu.edu.cn +@time:2025/2/11 +""" + +import sys +from logging import NOTSET, getLogger, FileHandler, Formatter, StreamHandler, info, error, debug +from time import time, strftime, localtime + +import numpy as np +from PyQt5.QtGui import QFont, QDoubleValidator, QIntValidator +from pandas import DataFrame, read_csv, read_excel, Series, concat +from matplotlib.ticker import FuncFormatter +from numpy import load, nan, zeros, append, linspace, place +from matplotlib import use +from matplotlib import pyplot as plt, gridspec +from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT +from datetime import datetime +from pathlib import Path +from PyQt5.QtCore import QCoreApplication, QTimer +from PyQt5.QtWidgets import QFileDialog, QMainWindow, QMessageBox, QButtonGroup, QApplication, QTableWidgetItem, \ + QLineEdit, QAction, QTableWidget +from scipy import signal +from scipy.signal import butter, filtfilt, find_peaks + +from MainWindow import Ui_MainWindow + +use("Qt5Agg") # 声明使用 QT5 + +# 设置日志 +logger = getLogger() +logger.setLevel(NOTSET) +realtime = strftime('%Y%m%d', localtime(time())) +if not Path("logs").exists(): + Path("logs").mkdir(exist_ok=True) +fh = FileHandler(Path("logs") / (realtime + ".log"), mode='a') +fh.setLevel(NOTSET) +fh.setFormatter(Formatter("%(asctime)s: %(message)s")) +logger.addHandler(fh) + +ch = StreamHandler() +ch.setLevel(NOTSET) +ch.setFormatter(Formatter("%(asctime)s: %(message)s")) +logger.addHandler(ch) +getLogger('matplotlib.font_manager').disabled = True +info("------------------------------------") +info("--------bcg_quality_label.py--------") + +class MainWindow(QMainWindow, Ui_MainWindow): + + # 全局变量初始化 + data = np.array([]) + data = data.astype(np.float64) + artifact = np.array([]) + artifact = artifact.astype(np.int64) + last_data_idx = -1 + current_data_idx = 0 + data_part_num = 0 + current_part_num = 1 + artifact_number = np.array([]) + artifact_number = artifact_number.astype(np.int64) + artifact_type = np.array([]) + artifact_type = artifact_type.astype(np.int64) + artifact_mask = np.array([]) + artifact_mask = artifact_mask.astype(np.int64) + longest_continuous_time = 0 + artifact_time_percentage = 0 + label = np.array([]) + label = label.astype(np.str_) + + # 程序初始化操作 + def __init__(self): + super(MainWindow, self).__init__() + self.setupUi(self) + + # 设置画框 + self.figure = plt.figure(figsize=(12, 6), dpi=150) + self.ax0 = self.figure.add_subplot(111) + self.ax0.xaxis.set_major_formatter(FuncFormatter(lambda x, p: f"{x:.0f}")) + self.canvas = FigureCanvasQTAgg(self.figure) + self.figToolbar = NavigationToolbar2QT(self.canvas) + self.verticalLayout_canvas.addWidget(self.canvas) + self.verticalLayout_canvas.addWidget(self.figToolbar) + + # 画框子图初始化 + plt.margins(0, 0) + plt.tight_layout() + + # 界面状态初始化 + self.radioButton_inputMode_auto.setChecked(True) + self.lineEdit_rootpath.setEnabled(False) + self.lineEdit_datapath.setEnabled(False) + self.lineEdit_artifactpath.setEnabled(False) + self.lineEdit_savepath.setEnabled(False) + self.lineEdit_current_part_time.setEnabled(False) + self.lineEdit_data_part_num.setEnabled(False) + self.lineEdit_longest_continuous_time.setEnabled(False) + self.lineEdit_artifact_time_percentage.setEnabled(False) + self.pushButton_datapath_open.setEnabled(False) + self.pushButton_artifactpath_open.setEnabled(False) + self.pushButton_savepath_open.setEnabled(False) + self.groupBox_artifact_type.setEnabled(False) + self.groupBox_status.setEnabled(False) + self.groupBox_function.setEnabled(False) + self.groupBox_operation.setEnabled(False) + self.groupBox_labelDisplay_10s.setVisible(False) + self.groupBox_labelDisplay_30s.setVisible(False) + self.checkBox_highlight_longest_continuous.setChecked(True) + + # 初始化按钮快捷键 + self.pushButton_left.setShortcut(QCoreApplication.translate("MainWindow", "A")) + self.pushButton_right.setShortcut(QCoreApplication.translate("MainWindow", "D")) + + # 设置表格属性 + self.tableWidget_label10s_a.setHorizontalHeaderLabels(['a']) + self.tableWidget_label10s_b.setHorizontalHeaderLabels(['b']) + self.tableWidget_label10s_c.setHorizontalHeaderLabels(['c']) + self.tableWidget_label10s_tobeLabeled.setHorizontalHeaderLabels(['未打标']) + self.tableWidget_label30s_a1.setHorizontalHeaderLabels(['a1']) + self.tableWidget_label30s_a2.setHorizontalHeaderLabels(['a2']) + self.tableWidget_label30s_b1.setHorizontalHeaderLabels(['b1']) + self.tableWidget_label30s_b2.setHorizontalHeaderLabels(['b2']) + self.tableWidget_label30s_c.setHorizontalHeaderLabels(['c']) + self.tableWidget_label30s_tobeLabeled.setHorizontalHeaderLabels(['未打标']) + self.tableWidget_label10s_a.setEditTriggers(QTableWidget.NoEditTriggers) + self.tableWidget_label10s_b.setEditTriggers(QTableWidget.NoEditTriggers) + self.tableWidget_label10s_c.setEditTriggers(QTableWidget.NoEditTriggers) + self.tableWidget_label10s_tobeLabeled.setEditTriggers(QTableWidget.NoEditTriggers) + self.tableWidget_label30s_a1.setEditTriggers(QTableWidget.NoEditTriggers) + self.tableWidget_label30s_a2.setEditTriggers(QTableWidget.NoEditTriggers) + self.tableWidget_label30s_b1.setEditTriggers(QTableWidget.NoEditTriggers) + self.tableWidget_label30s_b2.setEditTriggers(QTableWidget.NoEditTriggers) + self.tableWidget_label30s_c.setEditTriggers(QTableWidget.NoEditTriggers) + self.tableWidget_label30s_tobeLabeled.setEditTriggers(QTableWidget.NoEditTriggers) + self.tableWidget_label10s_a.horizontalHeader().setStretchLastSection(True) + self.tableWidget_label10s_a.horizontalHeader().setSectionResizeMode(1) + self.tableWidget_label10s_b.horizontalHeader().setStretchLastSection(True) + self.tableWidget_label10s_b.horizontalHeader().setSectionResizeMode(1) + self.tableWidget_label10s_c.horizontalHeader().setStretchLastSection(True) + self.tableWidget_label10s_c.horizontalHeader().setSectionResizeMode(1) + self.tableWidget_label10s_tobeLabeled.horizontalHeader().setStretchLastSection(True) + self.tableWidget_label10s_tobeLabeled.horizontalHeader().setSectionResizeMode(1) + self.tableWidget_label30s_a1.horizontalHeader().setStretchLastSection(True) + self.tableWidget_label30s_a1.horizontalHeader().setSectionResizeMode(1) + self.tableWidget_label30s_a2.horizontalHeader().setStretchLastSection(True) + self.tableWidget_label30s_a2.horizontalHeader().setSectionResizeMode(1) + self.tableWidget_label30s_b1.horizontalHeader().setStretchLastSection(True) + self.tableWidget_label30s_b1.horizontalHeader().setSectionResizeMode(1) + self.tableWidget_label30s_b2.horizontalHeader().setStretchLastSection(True) + self.tableWidget_label30s_b2.horizontalHeader().setSectionResizeMode(1) + self.tableWidget_label30s_c.horizontalHeader().setStretchLastSection(True) + self.tableWidget_label30s_c.horizontalHeader().setSectionResizeMode(1) + self.tableWidget_label30s_tobeLabeled.horizontalHeader().setStretchLastSection(True) + self.tableWidget_label30s_tobeLabeled.horizontalHeader().setSectionResizeMode(1) + + # 单选框组件分组 + self.buttonGroup_displayMode = QButtonGroup() + self.buttonGroup_displayMode.addButton(self.radioButton_10s_mode) + self.buttonGroup_displayMode.addButton(self.radioButton_30s_mode) + + # 槽函数连接控件初始化 + self.pushButton_rootpath_open.clicked.connect(self.slot_btn_selectPath) + self.pushButton_datapath_open.clicked.connect(self.slot_btn_selectPath) + self.pushButton_artifactpath_open.clicked.connect(self.slot_btn_selectPath) + self.pushButton_savepath_open.clicked.connect(self.slot_btn_selectPath) + self.pushButton_dataInput.clicked.connect(self.slot_btn_dataInput) + self.radioButton_inputMode_auto.clicked.connect(self.slot_radioBtn_inputMode_auto) + self.radioButton_inputMode_manual.clicked.connect(self.slot_radioBtn_inputMode_manual) + self.checkBox_allin.clicked.connect(self.slot_checkBox_allin) + self.checkBox_type1.clicked.connect(self.slot_checkBox_type1) + self.checkBox_type2.clicked.connect(self.slot_checkBox_type2) + self.checkBox_type3.clicked.connect(self.slot_checkBox_type3) + self.checkBox_type4.clicked.connect(self.slot_checkBox_type4) + self.checkBox_type5.clicked.connect(self.slot_checkBox_type5) + self.pushButton_left.clicked.connect(self.slot_btn_left) + self.pushButton_right.clicked.connect(self.slot_btn_right) + self.pushButton_label10s_a.clicked.connect(self.slot_btn_label) + self.pushButton_label10s_b.clicked.connect(self.slot_btn_label) + self.pushButton_label10s_c.clicked.connect(self.slot_btn_label) + self.pushButton_label10s_f.clicked.connect(self.slot_btn_label) + self.pushButton_label30s_a1.clicked.connect(self.slot_btn_label) + self.pushButton_label30s_a2.clicked.connect(self.slot_btn_label) + self.pushButton_label30s_b1.clicked.connect(self.slot_btn_label) + self.pushButton_label30s_b2.clicked.connect(self.slot_btn_label) + self.pushButton_label30s_c.clicked.connect(self.slot_btn_label) + self.pushButton_label30s_f.clicked.connect(self.slot_btn_label) + self.pushButton_invalid_signal_label.clicked.connect(self.slot_btn_invalid_signal_label) + self.pushButton_Ctype_signal_label.clicked.connect(self.slot_btn_Ctype_signal_label) + self.checkBox_highlight_longest_continuous.clicked.connect(self.slot_checkBox_highlight_longest_continuous) + self.checkBox_display_afterfilter.clicked.connect(self.slot_checkBox_display_afterfilter) + self.checkBox_examine_tobeLabeled.clicked.connect(self.slot_checkBox_examine_tobeLabeled) + self.tableWidget_label10s_a.cellDoubleClicked.connect(self.slot_tableWidget_label10s_a_on_cell_double_clicked) + self.tableWidget_label10s_b.cellDoubleClicked.connect(self.slot_tableWidget_label10s_b_on_cell_double_clicked) + self.tableWidget_label10s_c.cellDoubleClicked.connect(self.slot_tableWidget_label10s_c_on_cell_double_clicked) + self.tableWidget_label10s_tobeLabeled.cellDoubleClicked.connect(self.slot_tableWidget_label10s_tobeLabeled_on_cell_double_clicked) + self.tableWidget_label30s_a1.cellDoubleClicked.connect(self.slot_tableWidget_label30s_a1_on_cell_double_clicked) + self.tableWidget_label30s_a2.cellDoubleClicked.connect(self.slot_tableWidget_label30s_a2_on_cell_double_clicked) + self.tableWidget_label30s_b1.cellDoubleClicked.connect(self.slot_tableWidget_label30s_b1_on_cell_double_clicked) + self.tableWidget_label30s_b2.cellDoubleClicked.connect(self.slot_tableWidget_label30s_b2_on_cell_double_clicked) + self.tableWidget_label30s_c.cellDoubleClicked.connect(self.slot_tableWidget_label30s_c_on_cell_double_clicked) + self.tableWidget_label30s_tobeLabeled.cellDoubleClicked.connect(self.slot_tableWidget_label30s_tobeLabeled_on_cell_double_clicked) + + # 消息弹窗初始化 + self.msgBox = QMessageBox() + self.msgBox.setWindowTitle("消息") + + def slot_btn_selectPath(self): + fileDialog = QFileDialog() + if self.sender() == self.pushButton_rootpath_open: + fileDialog.setFileMode(QFileDialog.Directory) + fileDialog.setOption(QFileDialog.ShowDirsOnly, True) + if fileDialog.exec_() == QFileDialog.Accepted: + file_path = fileDialog.selectedFiles()[0] + if not file_path: + error("Root Path not Exist...") + self.textBrowser_update("操作:根目录路径输入错误") + self.msgBox.setText("根目录路径输入错误") + self.msgBox.setIcon(QMessageBox.Critical) + self.msgBox.exec() + return + + self.lineEdit_rootpath.setText(file_path) + file_path = Path(file_path) + info("Loading Root Path...") + self.data_and_artifact_Path = file_path / "Align" + data_path = self.data_and_artifact_Path / "BCG_sync.txt" + artifact_path = self.data_and_artifact_Path / "Artifact_a.txt" + + # 检查路径下的BCG_sync.txt和Artifact_a.txt文件是否存在 + if self.data_and_artifact_Path.exists() and data_path.exists() and artifact_path.exists(): + # 更新数据路径文本框 + self.lineEdit_datapath.setText(str(data_path)) + self.lineEdit_artifactpath.setText(str(artifact_path)) + self.lineEdit_savepath.setText(str(self.data_and_artifact_Path)) + + info("Successfully Loaded Root Path.") + self.textBrowser_update("操作:根目录路径选择成功") + else: + info("Failed to Load Root Path.") + self.textBrowser_update("操作:根目录路径选择错误,缺乏必要数据文件") + self.msgBox.setText("根目录路径选择错误,缺乏必要数据文件") + self.msgBox.setIcon(QMessageBox.Critical) + self.msgBox.exec() + return + else: + info("Canceled Loading Root Path.") + self.textBrowser_update("提示:根目录路径选择取消") + self.msgBox.setText("根目录路径选择取消") + self.msgBox.setIcon(QMessageBox.Warning) + self.msgBox.exec() + elif self.sender() == self.pushButton_savepath_open: + fileDialog.setFileMode(QFileDialog.Directory) + fileDialog.setOption(QFileDialog.ShowDirsOnly, True) + if fileDialog.exec_() == QFileDialog.Accepted: + file_path = fileDialog.selectedFiles()[0] + self.lineEdit_savepath.setText(str(Path(file_path))) + info("Successfully Loaded Save Path.") + self.textBrowser_update("操作:保存路径选择成功") + else: + info("Canceled Loading Save Path.") + self.textBrowser_update("提示:保存路径选择取消") + self.msgBox.setText("保存路径选择取消") + self.msgBox.setIcon(QMessageBox.Warning) + self.msgBox.exec() + else: + fileDialog.setFileMode(QFileDialog.ExistingFile) + fileDialog.setOption(QFileDialog.ReadOnly, True) + fileDialog.setNameFilter("Text Files (*.txt)") + if fileDialog.exec_() == QFileDialog.Accepted: + file_path = fileDialog.selectedFiles()[0] + if self.sender() == self.pushButton_datapath_open: + self.lineEdit_datapath.setText(file_path) + elif self.sender() == self.pushButton_artifactpath_open: + self.lineEdit_artifactpath.setText(file_path) + info("Successfully Loaded Data Path.") + self.textBrowser_update("操作:数据路径选择成功") + else: + info("Canceled Loading Data Path.") + self.textBrowser_update("提示:数据路径选择取消") + self.msgBox.setText("数据路径选择取消") + self.msgBox.setIcon(QMessageBox.Warning) + self.msgBox.exec() + + def slot_btn_dataInput(self): + if (self.lineEdit_datapath.text() != "" or self.lineEdit_artifactpath.text() != "" or self.lineEdit_savepath.text() != "") and (self.radioButton_30s_mode.isChecked() == True or self.radioButton_10s_mode.isChecked() == True): + info("Inputing Data...") + self.textBrowser_update("提示:开始导入数据") + + # 导入数据 + self.artifact = np.array([]) + file = open(str(self.lineEdit_datapath.text()), 'r') + self.data = file.readlines() + self.data = list(map(float, self.data)) + + self.data_without_industrialFrequencyNoise = self.wipe_industrialFrequencyNoise(self.data, 1000) + file = open(str(self.lineEdit_artifactpath.text()), 'r') + self.artifact = np.array(file.readlines()) + self.data = np.array(self.data) + self.data = self.data.astype(np.float64) + self.data_without_industrialFrequencyNoise = np.array([self.data_without_industrialFrequencyNoise]) + self.data_without_industrialFrequencyNoise = self.data_without_industrialFrequencyNoise.astype(np.float64)[0] + self.artifact = self.artifact.astype(np.int64) + + # 获取信号的段数,检查数据长度正确性 + if self.radioButton_10s_mode.isChecked(): + self.data_part_num = len(self.data) // 10000 + self.groupBox_labelDisplay_10s.setVisible(True) + self.lineEdit_savepath.setText(str(self.data_and_artifact_Path / "SQ_label_10s.csv")) + elif self.radioButton_30s_mode.isChecked(): + self.data_part_num = len(self.data) // 30000 + self.groupBox_labelDisplay_30s.setVisible(True) + self.lineEdit_savepath.setText(str(self.data_and_artifact_Path / "SQ_label_30s.csv")) + if self.data_part_num == 0: + info("Failed to Input Data!") + self.textBrowser_update("操作:导入数据失败,请检查数据长度") + self.msgBox.setText("导入失败,请检查数据长度") + self.msgBox.setIcon(QMessageBox.Critical) + self.msgBox.exec() + return + + # 检查体动标签正确性 + if len(self.artifact) % 4 == 0: + for i in range(1, len(self.artifact), 4): + if self.artifact[i] not in [1, 2, 3, 4, 5]: + info(f"Failed to Input Artifact! Error in Artifact[{i}] not in [1, 2, 3, 4, 5].") + self.textBrowser_update("操作:导入体动失败,请检查体动标签格式") + self.msgBox.setText("导入失败,请检查体动标签格式") + self.msgBox.setIcon(QMessageBox.Critical) + self.msgBox.exec() + return + else: + info("Failed to Input Artifact!") + self.textBrowser_update("操作:导入体动失败,请检查体动长度是否为4的倍数") + self.msgBox.setText("导入失败,请检查体动长度是否为4的倍数") + self.msgBox.setIcon(QMessageBox.Critical) + self.msgBox.exec() + return + + # 定义绘制体动所需要的数组 + artifact_start = np.array([]) + artifact_start = artifact_start.astype(np.int64) + artifact_end = np.array([]) + artifact_end = artifact_end.astype(np.int64) + for i in range(0, len(self.artifact), 4): + self.artifact_number = np.append(self.artifact_number, self.artifact[i]) + for i in range(1, len(self.artifact), 4): + self.artifact_type = np.append(self.artifact_type, self.artifact[i]) + for i in range(2, len(self.artifact), 4): + artifact_start = np.append(artifact_start, self.artifact[i]) + for i in range(3, len(self.artifact), 4): + artifact_end = np.append(artifact_end, self.artifact[i]) + self.artifact_mask = np.zeros(len(self.data)) + for i in range(0, len(self.artifact_number)): + if self.artifact_type[i] == 1: + self.artifact_mask[artifact_start[i]: artifact_end[i] + 1] = 1 + elif self.artifact_type[i] == 2: + self.artifact_mask[artifact_start[i]: artifact_end[i] + 1] = 2 + elif self.artifact_type[i] == 3: + self.artifact_mask[artifact_start[i]: artifact_end[i] + 1] = 3 + elif self.artifact_type[i] == 4: + self.artifact_mask[artifact_start[i]: artifact_end[i] + 1] = 4 + elif self.artifact_type[i] == 5: + self.artifact_mask[artifact_start[i]: artifact_end[i] + 1] = 5 + + # 尝试获取之前打标的存档,若不存在存档,则创建新存档 + if self.radioButton_10s_mode.isChecked() == True: + self.pushButton_Ctype_signal_label.setEnabled(True) + if not Path(self.data_and_artifact_Path / "SQ_label_10s.csv").exists(): + self.label = np.full(self.data_part_num, "f") + self.df_label = DataFrame(columns=["label", "remark"]) + self.df_label["label"] = self.label + self.df_label["remark"] = "" + self.df_label["label"] = self.df_label["label"].astype(str) + self.df_label["remark"] = self.df_label["remark"].astype(str) + else: + self.df_label = read_csv(self.data_and_artifact_Path / "SQ_label_10s.csv", encoding="gbk") + self.label = self.df_label["label"].astype(str) + self.df_label.to_csv(self.data_and_artifact_Path / "SQ_label_10s.csv", index=False, encoding="gbk") + self.lineEdit_savepath.setText(str(self.data_and_artifact_Path / "SQ_label_10s.csv")) + elif self.radioButton_30s_mode.isChecked() == True: + self.pushButton_Ctype_signal_label.setEnabled(False) + if not Path(self.data_and_artifact_Path / "SQ_label_30s.csv").exists(): + self.label = np.full(self.data_part_num, "f") + self.df_label = DataFrame(columns=["label", "remark"]) + self.df_label["label"] = self.label + self.df_label["remark"] = "" + self.df_label["label"] = self.df_label["label"].astype(str) + self.df_label["remark"] = self.df_label["remark"].astype(str) + else: + self.df_label = read_csv(self.data_and_artifact_Path / "SQ_label_30s.csv", encoding="gbk") + self.label = self.df_label["label"].astype(str) + self.df_label.to_csv(self.data_and_artifact_Path / "SQ_label_30s.csv", index=False, encoding="gbk") + self.lineEdit_savepath.setText(str(self.data_and_artifact_Path / "SQ_label_30s.csv")) + + # 界面状态更新 + self.groupBox_inputSetting.setEnabled(False) + self.groupBox_artifact_type.setEnabled(True) + self.groupBox_status.setEnabled(True) + self.groupBox_function.setEnabled(True) + self.groupBox_operation.setEnabled(True) + MainWindow.setWindowTitle(self, QCoreApplication.translate("MainWindow", + "BCG_Quality_Label - Data Path: " + self.lineEdit_rootpath.text())) + + self.update_status() + self.plot_data_and_artifact() + self.update_tableWidget() + + info("Finished Input Data.") + self.textBrowser_update("提示:导入数据完成") + elif self.radioButton_30s_mode.isChecked() == False and self.radioButton_10s_mode.isChecked() == False: + info("Failed to Input Data!") + self.textBrowser_update("操作:导入数据失败") + self.msgBox.setText("导入失败,请选择显示模式") + self.msgBox.setIcon(QMessageBox.Critical) + self.msgBox.exec() + else: + info("Failed to Input Data!") + self.textBrowser_update("操作:导入数据失败") + self.msgBox.setText("导入失败,请正确输入路径") + self.msgBox.setIcon(QMessageBox.Critical) + self.msgBox.exec() + + def slot_radioBtn_inputMode_auto(self): + self.pushButton_rootpath_open.setEnabled(True) + self.pushButton_datapath_open.setEnabled(False) + self.pushButton_artifactpath_open.setEnabled(False) + self.pushButton_savepath_open.setEnabled(False) + + def slot_radioBtn_inputMode_manual(self): + self.pushButton_rootpath_open.setEnabled(False) + self.pushButton_datapath_open.setEnabled(True) + self.pushButton_artifactpath_open.setEnabled(True) + self.pushButton_savepath_open.setEnabled(True) + + def slot_btn_left(self): + if self.current_part_num == 1: + info(f"Viewing the First Part.") + self.msgBox.setText("你正在查看第1段信号") + self.msgBox.setIcon(QMessageBox.Information) + self.msgBox.exec() + else: + self.last_data_idx = self.current_data_idx + self.current_part_num -= 1 + while self.checkBox_examine_tobeLabeled.isChecked() == True and self.df_label.at[self.current_part_num - 1, "label"] != "f": + self.current_part_num -= 1 + if self.current_part_num == 0: + self.current_part_num = 1 + info(f"All Parts of Left are Labeled, Jumped to the First Part.") + self.msgBox.setText("前面的片段都被打标,将跳转至第1段信号") + self.msgBox.setIcon(QMessageBox.Information) + self.msgBox.exec() + break + if self.radioButton_10s_mode.isChecked() == True: + self.current_data_idx -= 10000 + elif self.radioButton_30s_mode.isChecked() == True: + self.current_data_idx -= 30000 + + # 更新备注内容 + if not str(self.df_label.at[self.current_part_num - 1, "remark"]) == "nan": + self.lineEdit_remark.setText(str(self.df_label.at[self.current_part_num - 1, "remark"])) + else: + self.lineEdit_remark.setText("") + + # 更新按钮颜色 + self.change_labelBtn_color() + + if (self.df_label["label"] != "f").all(): + self.textBrowser_update(f"提示:该份数据打标已全部完成") + self.update_status() + self.plot_data_and_artifact() + info(f"Viewing the {self.current_part_num} Part.") + self.textBrowser_update(f"操作:上一段信号,第{self.current_part_num}段") + + def slot_btn_right(self): + if self.current_part_num == self.data_part_num: + info(f"Viewing the Last Part.") + self.msgBox.setText("你正在查看最后1段信号") + self.msgBox.setIcon(QMessageBox.Information) + self.msgBox.exec() + else: + self.last_data_idx = self.current_data_idx + self.current_part_num += 1 + while self.checkBox_examine_tobeLabeled.isChecked() == True and self.df_label.at[self.current_part_num - 1, "label"] != "f": + self.current_part_num += 1 + if self.current_part_num == self.data_part_num + 1: + self.current_part_num = self.data_part_num + info(f"All Parts of Right are Labeled, Jumped to the Last Part.") + self.msgBox.setText("后面的片段都被打标,将跳转至最后1段信号") + self.msgBox.setIcon(QMessageBox.Information) + self.msgBox.exec() + break + if self.radioButton_10s_mode.isChecked() == True: + self.current_data_idx += 10000 + elif self.radioButton_30s_mode.isChecked() == True: + self.current_data_idx += 30000 + + # 更新备注内容 + if not str(self.df_label.at[self.current_part_num - 1, "remark"]) == "nan": + self.lineEdit_remark.setText(str(self.df_label.at[self.current_part_num - 1, "remark"])) + else: + self.lineEdit_remark.setText("") + + # 更新按钮颜色 + self.change_labelBtn_color() + + if (self.df_label["label"] != "f").all(): + self.textBrowser_update(f"提示:该份数据打标已全部完成") + self.update_status() + self.plot_data_and_artifact() + info(f"Viewing the {self.current_part_num} Part.") + self.textBrowser_update(f"操作:下一段信号,第{self.current_part_num}段") + + def slot_checkBox_allin(self): + if self.checkBox_allin.isChecked() == True: + self.checkBox_type1.setChecked(True) + self.checkBox_type2.setChecked(True) + self.checkBox_type3.setChecked(True) + self.checkBox_type4.setChecked(True) + self.checkBox_type5.setChecked(True) + else: + self.checkBox_type1.setChecked(False) + self.checkBox_type2.setChecked(False) + self.checkBox_type3.setChecked(False) + self.checkBox_type4.setChecked(False) + self.checkBox_type5.setChecked(False) + self.plot_data_and_artifact() + + def slot_checkBox_type1(self): + if self.checkBox_type1.isChecked() == False: + self.checkBox_allin.setChecked(False) + self.plot_data_and_artifact() + if self.checkBox_type1.isChecked() == True and self.checkBox_type2.isChecked() == True and self.checkBox_type3.isChecked() == True and self.checkBox_type4.isChecked() == True and self.checkBox_type5.isChecked() == True: + self.checkBox_allin.setChecked(True) + + def slot_checkBox_type2(self): + if self.checkBox_type2.isChecked() == False: + self.checkBox_allin.setChecked(False) + self.plot_data_and_artifact() + if self.checkBox_type1.isChecked() == True and self.checkBox_type2.isChecked() == True and self.checkBox_type3.isChecked() == True and self.checkBox_type4.isChecked() == True and self.checkBox_type5.isChecked() == True: + self.checkBox_allin.setChecked(True) + + def slot_checkBox_type3(self): + if self.checkBox_type3.isChecked() == False: + self.checkBox_allin.setChecked(False) + self.plot_data_and_artifact() + if self.checkBox_type1.isChecked() == True and self.checkBox_type2.isChecked() == True and self.checkBox_type3.isChecked() == True and self.checkBox_type4.isChecked() == True and self.checkBox_type5.isChecked() == True: + self.checkBox_allin.setChecked(True) + + def slot_checkBox_type4(self): + if self.checkBox_type4.isChecked() == False: + self.checkBox_allin.setChecked(False) + self.plot_data_and_artifact() + if self.checkBox_type1.isChecked() == True and self.checkBox_type2.isChecked() == True and self.checkBox_type3.isChecked() == True and self.checkBox_type4.isChecked() == True and self.checkBox_type5.isChecked() == True: + self.checkBox_allin.setChecked(True) + + def slot_checkBox_type5(self): + if self.checkBox_type5.isChecked() == False: + self.checkBox_allin.setChecked(False) + self.plot_data_and_artifact() + if self.checkBox_type1.isChecked() == True and self.checkBox_type2.isChecked() == True and self.checkBox_type3.isChecked() == True and self.checkBox_type4.isChecked() == True and self.checkBox_type5.isChecked() == True: + self.checkBox_allin.setChecked(True) + + def slot_checkBox_highlight_longest_continuous(self): + self.plot_data_and_artifact() + info("Clicked checkBox_highlight_longest_continuous.") + self.textBrowser_update("操作:点击了高亮最长连续") + + def slot_checkBox_display_afterfilter(self): + self.plot_data_and_artifact() + info("Clicked checkBox_display_afterfilter.") + self.msgBox.setText("操作:点击了去除工频噪声") + + def slot_checkBox_examine_tobeLabeled(self): + info("Clicked checkBox_examine_tobeLabeled.") + self.msgBox.setText("操作:点击了仅查未标片段") + + def wipe_industrialFrequencyNoise(self, data, fs): + # 设计带阻滤波器(Notch Filter)来滤除49-51Hz的噪声 + nyq = 0.5 * fs # 奈奎斯特频率 + low = 49 / nyq + high = 51 / nyq + b, a = signal.iirfilter(4, [low, high], btype='bandstop', ftype='butter') # 4阶巴特沃斯带阻滤波器 + return signal.lfilter(b, a, data) + + def update_status(self): + if self.radioButton_10s_mode.isChecked() == True: + hour = int(((self.current_data_idx + 10000) / 1000) // 3600) + min = int((((self.current_data_idx + 10000) / 1000) % 3600) // 60) + sec = int((((self.current_data_idx + 10000) / 1000) % 3600) % 60) + elif self.radioButton_30s_mode.isChecked() == True: + hour = int(((self.current_data_idx + 30000) / 1000) // 3600) + min = int((((self.current_data_idx + 30000) / 1000) % 3600) // 60) + sec = int((((self.current_data_idx + 30000) / 1000) % 3600) % 60) + self.lineEdit_current_part_time.setText(str(hour) + "时" + str(min) + "分" + str(sec) + "秒") + self.lineEdit_data_part_num.setText(str(self.current_part_num) + "/" + str(self.data_part_num)) + + # 更新表格 + def update_tableWidget(self): + if self.radioButton_10s_mode.isChecked() == True: + label_a = np.where(self.label == "a")[0] + 1 + label_b = np.where(self.label == "b")[0] + 1 + label_c = np.where(self.label == "c")[0] + 1 + label_tobeLabeled = np.where(self.label == "f")[0] + 1 + + self.tableWidget_label10s_a.setRowCount(label_a.__len__()) + self.tableWidget_label10s_b.setRowCount(label_b.__len__()) + self.tableWidget_label10s_c.setRowCount(label_c.__len__()) + self.tableWidget_label10s_tobeLabeled.setRowCount(label_tobeLabeled.__len__()) + + for row, value in enumerate(label_a): + item = QTableWidgetItem(str(value).strip()) + self.tableWidget_label10s_a.setItem(row, 0, item) + for row, value in enumerate(label_b): + item = QTableWidgetItem(str(value).strip()) + self.tableWidget_label10s_b.setItem(row, 0, item) + for row, value in enumerate(label_c): + item = QTableWidgetItem(str(value).strip()) + self.tableWidget_label10s_c.setItem(row, 0, item) + for row, value in enumerate(label_tobeLabeled): + item = QTableWidgetItem(str(value).strip()) + self.tableWidget_label10s_tobeLabeled.setItem(row, 0, item) + + self.tableWidget_label10s_a.verticalScrollBar().setValue(self.tableWidget_label10s_a.verticalScrollBar().maximum()) + self.tableWidget_label10s_b.verticalScrollBar().setValue(self.tableWidget_label10s_b.verticalScrollBar().maximum()) + self.tableWidget_label10s_c.verticalScrollBar().setValue(self.tableWidget_label10s_c.verticalScrollBar().maximum()) + + elif self.radioButton_30s_mode.isChecked() == True: + label_a1 = np.where(self.label == "a")[0] + 1 + label_a2 = np.where(self.label == "b")[0] + 1 + label_b1 = np.where(self.label == "c")[0] + 1 + label_b2 = np.where(self.label == "d")[0] + 1 + label_c = np.where(self.label == "e")[0] + 1 + label_tobeLabeled = np.where(self.label == "f")[0] + 1 + + self.tableWidget_label30s_a1.setRowCount(label_a1.__len__()) + self.tableWidget_label30s_a2.setRowCount(label_a2.__len__()) + self.tableWidget_label30s_b1.setRowCount(label_b1.__len__()) + self.tableWidget_label30s_b2.setRowCount(label_b2.__len__()) + self.tableWidget_label30s_c.setRowCount(label_c.__len__()) + self.tableWidget_label30s_tobeLabeled.setRowCount(label_tobeLabeled.__len__()) + + for row, value in enumerate(label_a1): + item = QTableWidgetItem(str(value).strip()) + self.tableWidget_label30s_a1.setItem(row, 0, item) + for row, value in enumerate(label_a2): + item = QTableWidgetItem(str(value).strip()) + self.tableWidget_label30s_a2.setItem(row, 0, item) + for row, value in enumerate(label_b1): + item = QTableWidgetItem(str(value).strip()) + self.tableWidget_label30s_b1.setItem(row, 0, item) + for row, value in enumerate(label_b2): + item = QTableWidgetItem(str(value).strip()) + self.tableWidget_label30s_b2.setItem(row, 0, item) + for row, value in enumerate(label_c): + item = QTableWidgetItem(str(value).strip()) + self.tableWidget_label30s_c.setItem(row, 0, item) + for row, value in enumerate(label_tobeLabeled): + item = QTableWidgetItem(str(value).strip()) + self.tableWidget_label30s_tobeLabeled.setItem(row, 0, item) + + self.tableWidget_label30s_a1.verticalScrollBar().setValue(self.tableWidget_label30s_a1.verticalScrollBar().maximum()) + self.tableWidget_label30s_a2.verticalScrollBar().setValue(self.tableWidget_label30s_a2.verticalScrollBar().maximum()) + self.tableWidget_label30s_b1.verticalScrollBar().setValue(self.tableWidget_label30s_b1.verticalScrollBar().maximum()) + self.tableWidget_label30s_b2.verticalScrollBar().setValue(self.tableWidget_label30s_b2.verticalScrollBar().maximum()) + self.tableWidget_label30s_c.verticalScrollBar().setValue(self.tableWidget_label30s_c.verticalScrollBar().maximum()) + + def slot_tableWidget_label10s_a_on_cell_double_clicked(self, row, column): + self.last_data_idx = self.current_data_idx + self.current_part_num = int(self.tableWidget_label10s_a.item(row, column).text()) + self.current_data_idx = (self.current_part_num - 1) * 10000 + + # 更新备注内容 + if not str(self.df_label.at[self.current_part_num - 1, "remark"]) == "nan": + self.lineEdit_remark.setText(str(self.df_label.at[self.current_part_num - 1, "remark"])) + else: + self.lineEdit_remark.setText("") + + # 更新按钮颜色 + self.change_labelBtn_color() + + if (self.df_label["label"] != "f").all(): + self.textBrowser_update(f"提示:该份数据打标已全部完成") + self.update_status() + self.plot_data_and_artifact() + info(f"Jumped to the {self.current_part_num} Part.") + self.textBrowser_update(f"操作:跳转到目标片段,第{self.current_part_num}段") + + def slot_tableWidget_label10s_b_on_cell_double_clicked(self, row, column): + self.last_data_idx = self.current_data_idx + self.current_part_num = int(self.tableWidget_label10s_b.item(row, column).text()) + self.current_data_idx = (self.current_part_num - 1) * 10000 + + # 更新备注内容 + if not str(self.df_label.at[self.current_part_num - 1, "remark"]) == "nan": + self.lineEdit_remark.setText(str(self.df_label.at[self.current_part_num - 1, "remark"])) + else: + self.lineEdit_remark.setText("") + + # 更新按钮颜色 + self.change_labelBtn_color() + + if (self.df_label["label"] != "f").all(): + self.textBrowser_update(f"提示:该份数据打标已全部完成") + self.update_status() + self.plot_data_and_artifact() + info(f"Jumped to the {self.current_part_num} Part.") + self.textBrowser_update(f"操作:跳转到目标片段,第{self.current_part_num}段") + + def slot_tableWidget_label10s_c_on_cell_double_clicked(self, row, column): + self.last_data_idx = self.current_data_idx + self.current_part_num = int(self.tableWidget_label10s_c.item(row, column).text()) + self.current_data_idx = (self.current_part_num - 1) * 10000 + + # 更新备注内容 + if not str(self.df_label.at[self.current_part_num - 1, "remark"]) == "nan": + self.lineEdit_remark.setText(str(self.df_label.at[self.current_part_num - 1, "remark"])) + else: + self.lineEdit_remark.setText("") + + # 更新按钮颜色 + self.change_labelBtn_color() + + if (self.df_label["label"] != "f").all(): + self.textBrowser_update(f"提示:该份数据打标已全部完成") + self.update_status() + self.plot_data_and_artifact() + info(f"Jumped to the {self.current_part_num} Part.") + self.textBrowser_update(f"操作:跳转到目标片段,第{self.current_part_num}段") + + def slot_tableWidget_label10s_tobeLabeled_on_cell_double_clicked(self, row, column): + self.last_data_idx = self.current_data_idx + self.current_part_num = int(self.tableWidget_label10s_tobeLabeled.item(row, column).text()) + self.current_data_idx = (self.current_part_num - 1) * 10000 + + # 更新备注内容 + if not str(self.df_label.at[self.current_part_num - 1, "remark"]) == "nan": + self.lineEdit_remark.setText(str(self.df_label.at[self.current_part_num - 1, "remark"])) + else: + self.lineEdit_remark.setText("") + + # 更新按钮颜色 + self.change_labelBtn_color() + + if (self.df_label["label"] != "f").all(): + self.textBrowser_update(f"提示:该份数据打标已全部完成") + self.update_status() + self.plot_data_and_artifact() + info(f"Jumped to the {self.current_part_num} Part.") + self.textBrowser_update(f"操作:跳转到目标片段,第{self.current_part_num}段") + + def slot_tableWidget_label30s_a1_on_cell_double_clicked(self, row, column): + self.last_data_idx = self.current_data_idx + self.current_part_num = int(self.tableWidget_label30s_a1.item(row, column).text()) + self.current_data_idx = (self.current_part_num - 1) * 30000 + + # 更新备注内容 + if not str(self.df_label.at[self.current_part_num - 1, "remark"]) == "nan": + self.lineEdit_remark.setText(str(self.df_label.at[self.current_part_num - 1, "remark"])) + else: + self.lineEdit_remark.setText("") + + # 更新按钮颜色 + self.change_labelBtn_color() + + if (self.df_label["label"] != "f").all(): + self.textBrowser_update(f"提示:该份数据打标已全部完成") + self.update_status() + self.plot_data_and_artifact() + info(f"Jumped to the {self.current_part_num} Part.") + self.textBrowser_update(f"操作:跳转到目标片段,第{self.current_part_num}段") + + def slot_tableWidget_label30s_a2_on_cell_double_clicked(self, row, column): + self.last_data_idx = self.current_data_idx + self.current_part_num = int(self.tableWidget_label30s_a2.item(row, column).text()) + self.current_data_idx = (self.current_part_num - 1) * 30000 + + # 更新备注内容 + if not str(self.df_label.at[self.current_part_num - 1, "remark"]) == "nan": + self.lineEdit_remark.setText(str(self.df_label.at[self.current_part_num - 1, "remark"])) + else: + self.lineEdit_remark.setText("") + + # 更新按钮颜色 + self.change_labelBtn_color() + + if (self.df_label["label"] != "f").all(): + self.textBrowser_update(f"提示:该份数据打标已全部完成") + self.update_status() + self.plot_data_and_artifact() + info(f"Jumped to the {self.current_part_num} Part.") + self.textBrowser_update(f"操作:跳转到目标片段,第{self.current_part_num}段") + + def slot_tableWidget_label30s_b1_on_cell_double_clicked(self, row, column): + self.last_data_idx = self.current_data_idx + self.current_part_num = int(self.tableWidget_label30s_b1.item(row, column).text()) + self.current_data_idx = (self.current_part_num - 1) * 30000 + + # 更新备注内容 + if not str(self.df_label.at[self.current_part_num - 1, "remark"]) == "nan": + self.lineEdit_remark.setText(str(self.df_label.at[self.current_part_num - 1, "remark"])) + else: + self.lineEdit_remark.setText("") + + # 更新按钮颜色 + self.change_labelBtn_color() + + if (self.df_label["label"] != "f").all(): + self.textBrowser_update(f"提示:该份数据打标已全部完成") + self.update_status() + self.plot_data_and_artifact() + info(f"Jumped to the {self.current_part_num} Part.") + self.textBrowser_update(f"操作:跳转到目标片段,第{self.current_part_num}段") + + def slot_tableWidget_label30s_b2_on_cell_double_clicked(self, row, column): + self.last_data_idx = self.current_data_idx + self.current_part_num = int(self.tableWidget_label30s_b2.item(row, column).text()) + self.current_data_idx = (self.current_part_num - 1) * 30000 + + # 更新备注内容 + if not str(self.df_label.at[self.current_part_num - 1, "remark"]) == "nan": + self.lineEdit_remark.setText(str(self.df_label.at[self.current_part_num - 1, "remark"])) + else: + self.lineEdit_remark.setText("") + + # 更新按钮颜色 + self.change_labelBtn_color() + + if (self.df_label["label"] != "f").all(): + self.textBrowser_update(f"提示:该份数据打标已全部完成") + self.update_status() + self.plot_data_and_artifact() + info(f"Jumped to the {self.current_part_num} Part.") + self.textBrowser_update(f"操作:跳转到目标片段,第{self.current_part_num}段") + + def slot_tableWidget_label30s_c_on_cell_double_clicked(self, row, column): + self.last_data_idx = self.current_data_idx + self.current_part_num = int(self.tableWidget_label30s_c.item(row, column).text()) + self.current_data_idx = (self.current_part_num - 1) * 30000 + + # 更新备注内容 + if not str(self.df_label.at[self.current_part_num - 1, "remark"]) == "nan": + self.lineEdit_remark.setText(str(self.df_label.at[self.current_part_num - 1, "remark"])) + else: + self.lineEdit_remark.setText("") + + # 更新按钮颜色 + self.change_labelBtn_color() + + if (self.df_label["label"] != "f").all(): + self.textBrowser_update(f"提示:该份数据打标已全部完成") + self.update_status() + self.plot_data_and_artifact() + info(f"Jumped to the {self.current_part_num} Part.") + self.textBrowser_update(f"操作:跳转到目标片段,第{self.current_part_num}段") + + def slot_tableWidget_label30s_tobeLabeled_on_cell_double_clicked(self, row, column): + self.last_data_idx = self.current_data_idx + self.current_part_num = int(self.tableWidget_label30s_tobeLabeled.item(row, column).text()) + self.current_data_idx = (self.current_part_num - 1) * 30000 + + # 更新备注内容 + if not str(self.df_label.at[self.current_part_num - 1, "remark"]) == "nan": + self.lineEdit_remark.setText(str(self.df_label.at[self.current_part_num - 1, "remark"])) + else: + self.lineEdit_remark.setText("") + + # 更新按钮颜色 + self.change_labelBtn_color() + + if (self.df_label["label"] != "f").all(): + self.textBrowser_update(f"提示:该份数据打标已全部完成") + self.update_status() + self.plot_data_and_artifact() + info(f"Jumped to the {self.current_part_num} Part.") + self.textBrowser_update(f"操作:跳转到目标片段,第{self.current_part_num}段") + + def slot_btn_label(self): + if self.sender() == self.pushButton_label10s_a: + self.label[self.current_part_num - 1] = "a" + if self.sender() == self.pushButton_label10s_b: + self.label[self.current_part_num - 1] = "b" + if self.sender() == self.pushButton_label10s_c: + self.label[self.current_part_num - 1] = "c" + if self.sender() == self.pushButton_label10s_f: + self.label[self.current_part_num - 1] = "f" + if self.sender() == self.pushButton_label30s_a1: + self.label[self.current_part_num - 1] = "a" + if self.sender() == self.pushButton_label30s_a2: + self.label[self.current_part_num - 1] = "b" + if self.sender() == self.pushButton_label30s_b1: + self.label[self.current_part_num - 1] = "c" + if self.sender() == self.pushButton_label30s_b2: + self.label[self.current_part_num - 1] = "d" + if self.sender() == self.pushButton_label30s_c: + self.label[self.current_part_num - 1] = "e" + if self.sender() == self.pushButton_label30s_f: + self.label[self.current_part_num - 1] = "f" + self.df_label["label"] = self.label + self.df_label.at[self.current_part_num - 1, "remark"] = self.lineEdit_remark.text() + self.df_label.to_csv(self.lineEdit_savepath.text(), index=False, encoding="gbk") + self.slot_btn_right() + self.update_tableWidget() + + def slot_btn_invalid_signal_label(self): + info(f"Asked whether Label All Parts to Type C.") + self.textBrowser_update(f"警告:询问是否将所有片段标记为类型C") + reply = QMessageBox.question(self, "警告:确认操作", "你确定要将所有片段标记为类型C吗?", QMessageBox.Yes | QMessageBox.No, QMessageBox.No) + if reply == QMessageBox.Yes: + if self.radioButton_10s_mode.isChecked() == True: + self.label = np.full(self.label.shape, "c", dtype="str") + elif self.radioButton_30s_mode.isChecked() == True: + self.label = np.full(self.label.shape, "e", dtype="str") + self.df_label["label"] = self.label + self.df_label.to_csv(self.lineEdit_savepath.text(), index=False, encoding="gbk") + self.update_tableWidget() + info(f"Labeled All Parts to Type C.") + self.textBrowser_update(f"操作:已将所有片段标记为类型C") + self.msgBox.setText("已将所有片段标记为类型C") + self.msgBox.setIcon(QMessageBox.Information) + self.msgBox.exec() + else: + info(f"Operation Canceled.") + self.textBrowser_update(f"提示:操作已取消") + + def slot_btn_Ctype_signal_label(self): + info(f"Asked whether Label All Parts with Artifact to Type C.") + self.textBrowser_update(f"警告:询问是否将所有带有体动的片段标记为类型C") + reply = QMessageBox.question(self, "警告:确认操作", "你确定要将所有片段标记为类型C吗?", QMessageBox.Yes | QMessageBox.No, QMessageBox.No) + if reply == QMessageBox.Yes: + artifact_mask = self.artifact_mask[:10000 * int(len(self.data) // 10000)] + sub_artifact_mask = np.split(artifact_mask, len(artifact_mask) // 10000) + for index, array in enumerate(sub_artifact_mask): + if 1 in array or 2 in array or 3 in array or 4 in array or 5 in array: + self.label[index] = "c" + self.df_label["label"] = self.label + self.df_label.to_csv(self.lineEdit_savepath.text(), index=False, encoding="gbk") + self.update_tableWidget() + info(f"Labeled Parts With Artifact to Type C.") + self.textBrowser_update(f"操作:已将所有带有体动的片段标记为类型C") + self.msgBox.setText("已将所有带有体动的片段标记为类型C") + self.msgBox.setIcon(QMessageBox.Information) + self.msgBox.exec() + else: + info(f"Operation Canceled.") + self.textBrowser_update(f"提示:操作已取消") + + def plot_data_and_artifact(self): + self.ax0.clear() + artifact_type_seq = np.array([]) + artifact_type_seq = artifact_type_seq.astype(np.int64) + if self.checkBox_type1.isChecked(): + artifact_type_seq = np.append(artifact_type_seq, 1) + if self.checkBox_type2.isChecked(): + artifact_type_seq = np.append(artifact_type_seq, 2) + if self.checkBox_type3.isChecked(): + artifact_type_seq = np.append(artifact_type_seq, 3) + if self.checkBox_type4.isChecked(): + artifact_type_seq = np.append(artifact_type_seq, 4) + if self.checkBox_type5.isChecked(): + artifact_type_seq = np.append(artifact_type_seq, 5) + + # 是否显示去除工频噪声 + if self.checkBox_display_afterfilter.isChecked(): + display_data = self.data_without_industrialFrequencyNoise + else: + display_data = self.data + + # 绘制数据和体动 + if self.radioButton_10s_mode.isChecked() == True: + mask = np.array([np.arange(10000), np.arange(10000), np.arange(10000), np.arange(10000), np.arange(10000), np.arange(10000)]) + mask = mask.astype('float') + if self.current_data_idx != self.last_data_idx: + self.data_plot, = self.ax0.plot(np.arange(self.current_data_idx, self.current_data_idx + 10000), display_data[self.current_data_idx: self.current_data_idx + 10000], label="bcg_data", color='r') + for i in artifact_type_seq: + mask[i] = self.artifact_mask[self.current_data_idx: self.current_data_idx + 10000] == i + mask[i] = (display_data[self.current_data_idx: self.current_data_idx + 10000] * mask[i]).astype('float') + np.place(mask[i], mask[i] == 0, nan) + self.artifact_plot, = self.ax0.plot(np.arange(self.current_data_idx, self.current_data_idx + 10000), mask[i], color='g', linestyle="-") + + isArtifact = mask[~np.all(mask == range(0, 10000), axis=1)] + isArtifact = ~np.isnan(isArtifact).all(axis=0) + + # 计算最长连续时间并更新信息 + longest_continuous_max_length = 0 + longest_continuous_last_length = 0 + longest_continuous_current_length = 0 + longest_continuous_start = 0 + longest_continuous_end = 0 + for index, value in enumerate(isArtifact): + if value == False: + longest_continuous_current_length += 1 + if longest_continuous_current_length > longest_continuous_max_length: + longest_continuous_end = index + longest_continuous_max_length = max(longest_continuous_max_length, longest_continuous_current_length) + else: + longest_continuous_current_length = 0 + longest_continuous_start = longest_continuous_end - longest_continuous_max_length + 1 + if self.checkBox_highlight_longest_continuous.isChecked(): + self.longest_continuous_plot, = self.ax0.plot(np.arange(self.current_data_idx + longest_continuous_start, self.current_data_idx + longest_continuous_end), display_data[self.current_data_idx + longest_continuous_start: self.current_data_idx + longest_continuous_end], color='m', linestyle="-", zorder=3) + self.lineEdit_longest_continuous_time.setText(str(round(longest_continuous_max_length / 1000, 2)) + "秒") + + # 计算体动时间占比并更新信息 + self.lineEdit_artifact_time_percentage.setText(str(round(100 * np.count_nonzero(isArtifact) / len(isArtifact), 2)) + "%") + + elif self.radioButton_30s_mode.isChecked() == True: + mask = np.array([np.arange(30000), np.arange(30000), np.arange(30000), np.arange(30000), np.arange(30000), np.arange(30000)]) + mask = mask.astype('float') + if self.current_data_idx != self.last_data_idx: + self.data_plot, = self.ax0.plot(np.arange(self.current_data_idx, self.current_data_idx + 30000), display_data[self.current_data_idx: self.current_data_idx + 30000], label="bcg_data", color='r') + for i in artifact_type_seq: + mask[i] = self.artifact_mask[self.current_data_idx: self.current_data_idx + 30000] == i + mask[i] = (display_data[self.current_data_idx: self.current_data_idx + 30000] * mask[i]).astype('float') + np.place(mask[i], mask[i] == 0, nan) + self.artifact_plot, = self.ax0.plot(np.arange(self.current_data_idx, self.current_data_idx + 30000), mask[i], color='g', linestyle="-") + + isArtifact = mask[~np.all(mask == range(0, 30000), axis=1)] + isArtifact = ~np.isnan(isArtifact).all(axis=0) + + # 计算最长连续时间并更新信息 + longest_continuous_max_length = 0 + longest_continuous_last_length = 0 + longest_continuous_current_length = 0 + longest_continuous_start = 0 + longest_continuous_end = 0 + for index, value in enumerate(isArtifact): + if value == False: + longest_continuous_current_length += 1 + if longest_continuous_current_length > longest_continuous_max_length: + longest_continuous_end = index + longest_continuous_max_length = max(longest_continuous_max_length, longest_continuous_current_length) + else: + longest_continuous_current_length = 0 + longest_continuous_start = longest_continuous_end - longest_continuous_max_length + 1 + if self.checkBox_highlight_longest_continuous.isChecked(): + self.longest_continuous_plot, = self.ax0.plot(np.arange(self.current_data_idx + longest_continuous_start, self.current_data_idx + longest_continuous_end), display_data[self.current_data_idx+ longest_continuous_start: self.current_data_idx + longest_continuous_end], color='m', linestyle="-", zorder=3) + self.lineEdit_longest_continuous_time.setText(str(round(longest_continuous_max_length / 1000, 2)) + "秒") + + # 计算体动时间占比并更新信息 + self.lineEdit_artifact_time_percentage.setText(str(round(100 * np.count_nonzero(isArtifact) / len(isArtifact), 2)) + "%") + self.ax0.grid(True) + self.canvas.draw() + + def change_labelBtn_color(self): + if self.df_label.at[self.current_part_num - 1, "label"] == "a": + self.pushButton_label10s_a.setStyleSheet(""" + QPushButton { + background-color: orange; /* 设置背景颜色 */ + padding: 10px; /* 设置内边距 */ + border: 2px solid darkblue; /* 设置边框 */ + border-radius: 10px; /* 设置圆角 */ + } + QPushButton:hover { + background-color: yellow; /* 鼠标悬停时的背景颜色 */ + }""") + self.pushButton_label10s_b.setStyleSheet("") + self.pushButton_label10s_c.setStyleSheet("") + self.pushButton_label30s_a1.setStyleSheet(""" + QPushButton { + background-color: orange; /* 设置背景颜色 */ + padding: 10px; /* 设置内边距 */ + border: 2px solid darkblue; /* 设置边框 */ + border-radius: 10px; /* 设置圆角 */ + } + QPushButton:hover { + background-color: yellow; /* 鼠标悬停时的背景颜色 */ + }""") + self.pushButton_label30s_a2.setStyleSheet("") + self.pushButton_label30s_b1.setStyleSheet("") + self.pushButton_label30s_b2.setStyleSheet("") + self.pushButton_label30s_c.setStyleSheet("") + elif self.df_label.at[self.current_part_num - 1, "label"] == "b": + self.pushButton_label10s_a.setStyleSheet("") + self.pushButton_label10s_b.setStyleSheet(""" + QPushButton { + background-color: orange; /* 设置背景颜色 */ + padding: 10px; /* 设置内边距 */ + border: 2px solid darkblue; /* 设置边框 */ + border-radius: 10px; /* 设置圆角 */ + } + QPushButton:hover { + background-color: yellow; /* 鼠标悬停时的背景颜色 */ + }""") + self.pushButton_label10s_c.setStyleSheet("") + self.pushButton_label30s_a1.setStyleSheet("") + self.pushButton_label30s_a2.setStyleSheet(""" + QPushButton { + background-color: orange; /* 设置背景颜色 */ + padding: 10px; /* 设置内边距 */ + border: 2px solid darkblue; /* 设置边框 */ + border-radius: 10px; /* 设置圆角 */ + } + QPushButton:hover { + background-color: yellow; /* 鼠标悬停时的背景颜色 */ + }""") + self.pushButton_label30s_b1.setStyleSheet("") + self.pushButton_label30s_b2.setStyleSheet("") + self.pushButton_label30s_c.setStyleSheet("") + elif self.df_label.at[self.current_part_num - 1, "label"] == "c": + self.pushButton_label10s_a.setStyleSheet("") + self.pushButton_label10s_b.setStyleSheet("") + self.pushButton_label10s_c.setStyleSheet(""" + QPushButton { + background-color: orange; /* 设置背景颜色 */ + padding: 10px; /* 设置内边距 */ + border: 2px solid darkblue; /* 设置边框 */ + border-radius: 10px; /* 设置圆角 */ + } + QPushButton:hover { + background-color: yellow; /* 鼠标悬停时的背景颜色 */ + }""") + self.pushButton_label30s_a1.setStyleSheet("") + self.pushButton_label30s_a2.setStyleSheet("") + self.pushButton_label30s_b1.setStyleSheet(""" + QPushButton { + background-color: orange; /* 设置背景颜色 */ + padding: 10px; /* 设置内边距 */ + border: 2px solid darkblue; /* 设置边框 */ + border-radius: 10px; /* 设置圆角 */ + } + QPushButton:hover { + background-color: yellow; /* 鼠标悬停时的背景颜色 */ + }""") + self.pushButton_label30s_b2.setStyleSheet("") + self.pushButton_label30s_c.setStyleSheet("") + elif self.df_label.at[self.current_part_num - 1, "label"] == "d": + self.pushButton_label10s_a.setStyleSheet("") + self.pushButton_label10s_b.setStyleSheet("") + self.pushButton_label10s_c.setStyleSheet("") + self.pushButton_label30s_a1.setStyleSheet("") + self.pushButton_label30s_a2.setStyleSheet("") + self.pushButton_label30s_b1.setStyleSheet("") + self.pushButton_label30s_b2.setStyleSheet(""" + QPushButton { + background-color: orange; /* 设置背景颜色 */ + padding: 10px; /* 设置内边距 */ + border: 2px solid darkblue; /* 设置边框 */ + border-radius: 10px; /* 设置圆角 */ + } + QPushButton:hover { + background-color: yellow; /* 鼠标悬停时的背景颜色 */ + }""") + self.pushButton_label30s_c.setStyleSheet("") + elif self.df_label.at[self.current_part_num - 1, "label"] == "e": + self.pushButton_label10s_a.setStyleSheet("") + self.pushButton_label10s_b.setStyleSheet("") + self.pushButton_label10s_c.setStyleSheet("") + self.pushButton_label30s_a1.setStyleSheet("") + self.pushButton_label30s_a2.setStyleSheet("") + self.pushButton_label30s_b1.setStyleSheet("") + self.pushButton_label30s_b2.setStyleSheet("") + self.pushButton_label30s_c.setStyleSheet(""" + QPushButton { + background-color: orange; /* 设置背景颜色 */ + padding: 10px; /* 设置内边距 */ + border: 2px solid darkblue; /* 设置边框 */ + border-radius: 10px; /* 设置圆角 */ + } + QPushButton:hover { + background-color: yellow; /* 鼠标悬停时的背景颜色 */ + }""") + elif self.df_label.at[self.current_part_num - 1, "label"] == "f": + self.pushButton_label10s_a.setStyleSheet("") + self.pushButton_label10s_b.setStyleSheet("") + self.pushButton_label10s_c.setStyleSheet("") + self.pushButton_label30s_a1.setStyleSheet("") + self.pushButton_label30s_a2.setStyleSheet("") + self.pushButton_label30s_b1.setStyleSheet("") + self.pushButton_label30s_b2.setStyleSheet("") + self.pushButton_label30s_c.setStyleSheet("") + + def textBrowser_update(self, message): + self.textBrowser_infoOutput.append(str(datetime.now().strftime("%H:%M:%S")) + ": " + message) + +# 主函数 +if __name__ == '__main__': + app = QApplication(sys.argv) + mainWindow = MainWindow() + mainWindow.show() + sys.exit(app.exec_()) \ No newline at end of file