class Ui_Plots(object): def setupUi(self, MainWindow2): MainWindow2.setObjectName("MainWindow2") #MainWindow2.setGeometry(100, 100, 890, 750) #MainWindow2.setFixedSize(1091, 770) #MainWindow2.resize(1091, 770) MainWindow2.setMinimumSize(QtCore.QSize(705, 518)) MainWindow2.setStyleSheet("") MainWindow2.setTabShape(QtWidgets.QTabWidget.Rounded) self.centralwidget = QtWidgets.QWidget(MainWindow2) self.centralwidget.setObjectName("centralwidget") self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) self.gridLayout.setObjectName("gridLayout") self.Layout_graphs = QtWidgets.QGridLayout() self.Layout_graphs.setObjectName("Layout_graphs") self.plt = GraphicsLayoutWidget(self.centralwidget) self.pltB = GraphicsLayoutWidget(self.centralwidget) self.plt.setAutoFillBackground(False) self.plt.setStyleSheet("border: 0px;") self.plt.setFrameShape(QtWidgets.QFrame.StyledPanel) self.plt.setFrameShadow(QtWidgets.QFrame.Plain) self.plt.setLineWidth(0) self.plt.setObjectName("plt") self.pltB.setAutoFillBackground(False) self.pltB.setStyleSheet("border: 0px;") self.pltB.setFrameShape(QtWidgets.QFrame.StyledPanel) self.pltB.setFrameShadow(QtWidgets.QFrame.Plain) self.pltB.setLineWidth(0) self.pltB.setObjectName("pltB") self.label = QtWidgets.QLabel() self.Layout_graphs.addWidget(self.label, 0, 0, 1, 1) def link1(linkStr): QtGui.QDesktopServices.openUrl(QtCore.QUrl(linkStr)) self.label.linkActivated.connect(link1) self.label.setText( '<a href="https://openqcm.com/"> <font color=#000000 >Open-source Python application for displaying, processing and storing real-time data from openQCM Q-1 Device</font> </a>' ) self.Layout_graphs.addWidget(self.plt, 1, 0, 1, 1) self.Layout_graphs.addWidget(self.pltB, 2, 0, 1, 1) self.gridLayout.addLayout(self.Layout_graphs, 3, 1, 1, 1) MainWindow2.setCentralWidget(self.centralwidget) self.retranslateUi(MainWindow2) QtCore.QMetaObject.connectSlotsByName(MainWindow2) def retranslateUi(self, MainWindow2): _translate = QtCore.QCoreApplication.translate MainWindow2.setWindowIcon(QtGui.QIcon('favicon.ico')) #.png MainWindow2.setWindowTitle( _translate("MainWindow2", "OPENQCM Q-1 - Real-Time Plot GUI 2.1"))
class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(1056, 730) MainWindow.setMinimumSize(QtCore.QSize(500, 500)) MainWindow.setMaximumSize(QtCore.QSize(1920, 1080)) MainWindow.setStyleSheet( "background-color: qlineargradient(spread:pad, x1:0.502975, y1:0, x2:0.473, y2:1, stop:0 rgba(2, 11, 16, 255), stop:1 rgba(4, 26, 37, 255));" ) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.gridLayout_2 = QtWidgets.QGridLayout(self.centralwidget) self.gridLayout_2.setObjectName("gridLayout_2") self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.testProfileView = GraphicsLayoutWidget(self.centralwidget) self.testProfileView.setMinimumSize(QtCore.QSize(750, 1)) self.testProfileView.setMaximumSize(QtCore.QSize(16777215, 16777215)) self.testProfileView.setStyleSheet("color: white;\n" "border: 1px solid #4589b2;") self.testProfileView.setFrameShape(QtWidgets.QFrame.StyledPanel) self.testProfileView.setFrameShadow(QtWidgets.QFrame.Plain) self.testProfileView.setLineWidth(0) self.testProfileView.setMidLineWidth(0) self.testProfileView.setObjectName("testProfileView") self.horizontalLayout.addWidget(self.testProfileView) self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setSizeConstraint( QtWidgets.QLayout.SetNoConstraint) self.verticalLayout_2.setSpacing(0) self.verticalLayout_2.setObjectName("verticalLayout_2") self.widget_5 = QtWidgets.QWidget(self.centralwidget) self.widget_5.setMinimumSize(QtCore.QSize(273, 1)) self.widget_5.setMaximumSize(QtCore.QSize(273, 999)) self.widget_5.setStyleSheet("background: transparent;") self.widget_5.setObjectName("widget_5") self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.widget_5) self.verticalLayout_3.setContentsMargins(0, 0, 0, 0) self.verticalLayout_3.setObjectName("verticalLayout_3") self.gridLayout_9 = QtWidgets.QGridLayout() self.gridLayout_9.setObjectName("gridLayout_9") self.label_23 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(10) self.label_23.setFont(font) self.label_23.setStyleSheet( "color: white;background-color: transparent;") self.label_23.setAlignment(QtCore.Qt.AlignCenter) self.label_23.setObjectName("label_23") self.gridLayout_9.addWidget(self.label_23, 0, 0, 1, 1) self.A_del_slide = QtWidgets.QSlider(self.widget_5) self.A_del_slide.setStyleSheet( "QSlider{\n" " background-color: transparent;\n" "} \n" "QSlider::groove:horizontal {\n" " border: 0px solid #999999;\n" " height: 8px;\n" " background: rgba(78, 96, 131, 50);\n" " margin: 2px 0;\n" " }\n" "\n" "QSlider::groove:horizontal:hover {\n" " background-color: rgba(255,255,255,.2);\n" " }\n" "\n" " QSlider::handle:horizontal {\n" " background: transparent;\n" " border: 1px solid #4589b2;\n" " width: 18px;\n" " margin: -2px 0;\n" " border-radius: 3px;\n" " }\n" "\n" " QSlider::handle:horizontal:hover {\n" " background-color: rgba(255,255,255,.2);\n" " border: 1px solid #00ce35;\n" " }") self.A_del_slide.setOrientation(QtCore.Qt.Horizontal) self.A_del_slide.setObjectName("A_del_slide") self.gridLayout_9.addWidget(self.A_del_slide, 0, 2, 1, 1) self.A_del = QtWidgets.QDoubleSpinBox(self.widget_5) self.A_del.setStyleSheet("QDoubleSpinBox{\n" " color: white;\n" " background-color: transparent;\n" " border: 1px solid #4589b2;\n" " padding: 1px;\n" "}\n" "\n" "\n" "\n" "QDoubleSpinBox::hover{\n" " border: 1px solid #00ce35;\n" " background-color: rgba(0,0,0,.3);\n" "}") self.A_del.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) self.A_del.setObjectName("A_del") self.gridLayout_9.addWidget(self.A_del, 0, 3, 1, 1) self.label_24 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(11) self.label_24.setFont(font) self.label_24.setStyleSheet( "color: white;background-color: transparent;") self.label_24.setAlignment(QtCore.Qt.AlignCenter) self.label_24.setObjectName("label_24") self.gridLayout_9.addWidget(self.label_24, 0, 4, 1, 1) self.label_29 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(10) self.label_29.setFont(font) self.label_29.setStyleSheet( "color: white;background-color: transparent;") self.label_29.setAlignment(QtCore.Qt.AlignCenter) self.label_29.setObjectName("label_29") self.gridLayout_9.addWidget(self.label_29, 0, 1, 1, 1) self.verticalLayout_3.addLayout(self.gridLayout_9) self.gridLayout = QtWidgets.QGridLayout() self.gridLayout.setObjectName("gridLayout") self.label_17 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(10) self.label_17.setFont(font) self.label_17.setStyleSheet( "color: white;background-color: transparent;") self.label_17.setAlignment(QtCore.Qt.AlignCenter) self.label_17.setObjectName("label_17") self.gridLayout.addWidget(self.label_17, 0, 0, 1, 1) self.A_dur = QtWidgets.QDoubleSpinBox(self.widget_5) self.A_dur.setStyleSheet("QDoubleSpinBox{\n" " color: white;\n" " background-color: transparent;\n" " border: 1px solid #4589b2;\n" " padding: 1px;\n" "}\n" "\n" "\n" "\n" "QDoubleSpinBox::hover{\n" " border: 1px solid #00ce35;\n" " background-color: rgba(0,0,0,.3);\n" "}") self.A_dur.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) self.A_dur.setObjectName("A_dur") self.gridLayout.addWidget(self.A_dur, 0, 3, 1, 1) self.label_21 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(11) self.label_21.setFont(font) self.label_21.setStyleSheet( "color: white;background-color: transparent;") self.label_21.setAlignment(QtCore.Qt.AlignCenter) self.label_21.setObjectName("label_21") self.gridLayout.addWidget(self.label_21, 0, 4, 1, 1) self.A_dur_slide = QtWidgets.QSlider(self.widget_5) self.A_dur_slide.setStyleSheet( "QSlider{\n" " background-color: transparent;\n" "} \n" "QSlider::groove:horizontal {\n" " border: 0px solid #999999;\n" " height: 8px;\n" " background: rgba(78, 96, 131, 50);\n" " margin: 2px 0;\n" " }\n" "\n" "QSlider::groove:horizontal:hover {\n" " background-color: rgba(255,255,255,.2);\n" " }\n" "\n" " QSlider::handle:horizontal {\n" " background: transparent;\n" " border: 1px solid #4589b2;\n" " width: 18px;\n" " margin: -2px 0;\n" " border-radius: 3px;\n" " }\n" "\n" " QSlider::handle:horizontal:hover {\n" " background-color: rgba(255,255,255,.2);\n" " border: 1px solid #00ce35;\n" " }") self.A_dur_slide.setOrientation(QtCore.Qt.Horizontal) self.A_dur_slide.setObjectName("A_dur_slide") self.gridLayout.addWidget(self.A_dur_slide, 0, 2, 1, 1) self.label_30 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(10) self.label_30.setFont(font) self.label_30.setStyleSheet( "color: white;background-color: transparent;") self.label_30.setAlignment(QtCore.Qt.AlignCenter) self.label_30.setObjectName("label_30") self.gridLayout.addWidget(self.label_30, 0, 1, 1, 1) self.verticalLayout_3.addLayout(self.gridLayout) self.gridLayout_12 = QtWidgets.QGridLayout() self.gridLayout_12.setObjectName("gridLayout_12") self.label_31 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(10) self.label_31.setFont(font) self.label_31.setStyleSheet( "color: white;background-color: transparent;") self.label_31.setAlignment(QtCore.Qt.AlignCenter) self.label_31.setObjectName("label_31") self.gridLayout_12.addWidget(self.label_31, 0, 0, 1, 1) self.B_del = QtWidgets.QDoubleSpinBox(self.widget_5) self.B_del.setStyleSheet("QDoubleSpinBox{\n" " color: white;\n" " background-color: transparent;\n" " border: 1px solid #4589b2;\n" " padding: 1px;\n" "}\n" "\n" "\n" "\n" "QDoubleSpinBox::hover{\n" " border: 1px solid #00ce35;\n" " background-color: rgba(0,0,0,.3);\n" "}") self.B_del.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) self.B_del.setObjectName("B_del") self.gridLayout_12.addWidget(self.B_del, 0, 3, 1, 1) self.B_del_slide = QtWidgets.QSlider(self.widget_5) self.B_del_slide.setStyleSheet( "QSlider{\n" " background-color: transparent;\n" "} \n" "QSlider::groove:horizontal {\n" " border: 0px solid #999999;\n" " height: 8px;\n" " background: rgba(78, 96, 131, 50);\n" " margin: 2px 0;\n" " }\n" "\n" "QSlider::groove:horizontal:hover {\n" " background-color: rgba(255,255,255,.2);\n" " }\n" "\n" " QSlider::handle:horizontal {\n" " background: transparent;\n" " border: 1px solid #4589b2;\n" " width: 18px;\n" " margin: -2px 0;\n" " border-radius: 3px;\n" " }\n" "\n" " QSlider::handle:horizontal:hover {\n" " background-color: rgba(255,255,255,.2);\n" " border: 1px solid #00ce35;\n" " }") self.B_del_slide.setOrientation(QtCore.Qt.Horizontal) self.B_del_slide.setObjectName("B_del_slide") self.gridLayout_12.addWidget(self.B_del_slide, 0, 2, 1, 1) self.label_32 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(11) self.label_32.setFont(font) self.label_32.setStyleSheet( "color: white;background-color: transparent;") self.label_32.setAlignment(QtCore.Qt.AlignCenter) self.label_32.setObjectName("label_32") self.gridLayout_12.addWidget(self.label_32, 0, 4, 1, 1) self.label_33 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(10) self.label_33.setFont(font) self.label_33.setStyleSheet( "color: white;background-color: transparent;") self.label_33.setAlignment(QtCore.Qt.AlignCenter) self.label_33.setObjectName("label_33") self.gridLayout_12.addWidget(self.label_33, 0, 1, 1, 1) self.verticalLayout_3.addLayout(self.gridLayout_12) self.gridLayout_13 = QtWidgets.QGridLayout() self.gridLayout_13.setObjectName("gridLayout_13") self.label_34 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(10) self.label_34.setFont(font) self.label_34.setStyleSheet( "color: white;background-color: transparent;") self.label_34.setAlignment(QtCore.Qt.AlignCenter) self.label_34.setObjectName("label_34") self.gridLayout_13.addWidget(self.label_34, 0, 0, 1, 1) self.B_dur = QtWidgets.QDoubleSpinBox(self.widget_5) self.B_dur.setStyleSheet("QDoubleSpinBox{\n" " color: white;\n" " background-color: transparent;\n" " border: 1px solid #4589b2;\n" " padding: 1px;\n" "}\n" "\n" "\n" "\n" "QDoubleSpinBox::hover{\n" " border: 1px solid #00ce35;\n" " background-color: rgba(0,0,0,.3);\n" "}") self.B_dur.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) self.B_dur.setObjectName("B_dur") self.gridLayout_13.addWidget(self.B_dur, 0, 3, 1, 1) self.B_dur_slide = QtWidgets.QSlider(self.widget_5) self.B_dur_slide.setStyleSheet( "QSlider{\n" " background-color: transparent;\n" "} \n" "QSlider::groove:horizontal {\n" " border: 0px solid #999999;\n" " height: 8px;\n" " background: rgba(78, 96, 131, 50);\n" " margin: 2px 0;\n" " }\n" "\n" "QSlider::groove:horizontal:hover {\n" " background-color: rgba(255,255,255,.2);\n" " }\n" "\n" " QSlider::handle:horizontal {\n" " background: transparent;\n" " border: 1px solid #4589b2;\n" " width: 18px;\n" " margin: -2px 0;\n" " border-radius: 3px;\n" " }\n" "\n" " QSlider::handle:horizontal:hover {\n" " background-color: rgba(255,255,255,.2);\n" " border: 1px solid #00ce35;\n" " }") self.B_dur_slide.setOrientation(QtCore.Qt.Horizontal) self.B_dur_slide.setObjectName("B_dur_slide") self.gridLayout_13.addWidget(self.B_dur_slide, 0, 2, 1, 1) self.label_35 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(11) self.label_35.setFont(font) self.label_35.setStyleSheet( "color: white;background-color: transparent;") self.label_35.setAlignment(QtCore.Qt.AlignCenter) self.label_35.setObjectName("label_35") self.gridLayout_13.addWidget(self.label_35, 0, 4, 1, 1) self.label_36 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(10) self.label_36.setFont(font) self.label_36.setStyleSheet( "color: white;background-color: transparent;") self.label_36.setAlignment(QtCore.Qt.AlignCenter) self.label_36.setObjectName("label_36") self.gridLayout_13.addWidget(self.label_36, 0, 1, 1, 1) self.verticalLayout_3.addLayout(self.gridLayout_13) self.gridLayout_14 = QtWidgets.QGridLayout() self.gridLayout_14.setObjectName("gridLayout_14") self.label_37 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(10) self.label_37.setFont(font) self.label_37.setStyleSheet( "color: white;background-color: transparent;") self.label_37.setAlignment(QtCore.Qt.AlignCenter) self.label_37.setObjectName("label_37") self.gridLayout_14.addWidget(self.label_37, 0, 0, 1, 1) self.I_del = QtWidgets.QDoubleSpinBox(self.widget_5) self.I_del.setStyleSheet("QDoubleSpinBox{\n" " color: white;\n" " background-color: transparent;\n" " border: 1px solid #4589b2;\n" " padding: 1px;\n" "}\n" "\n" "\n" "\n" "QDoubleSpinBox::hover{\n" " border: 1px solid #00ce35;\n" " background-color: rgba(0,0,0,.3);\n" "}") self.I_del.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) self.I_del.setObjectName("I_del") self.gridLayout_14.addWidget(self.I_del, 0, 3, 1, 1) self.I_del_slide = QtWidgets.QSlider(self.widget_5) self.I_del_slide.setStyleSheet( "QSlider{\n" " background-color: transparent;\n" "} \n" "QSlider::groove:horizontal {\n" " border: 0px solid #999999;\n" " height: 8px;\n" " background: rgba(78, 96, 131, 50);\n" " margin: 2px 0;\n" " }\n" "\n" "QSlider::groove:horizontal:hover {\n" " background-color: rgba(255,255,255,.2);\n" " }\n" "\n" " QSlider::handle:horizontal {\n" " background: transparent;\n" " border: 1px solid #4589b2;\n" " width: 18px;\n" " margin: -2px 0;\n" " border-radius: 3px;\n" " }\n" "\n" " QSlider::handle:horizontal:hover {\n" " background-color: rgba(255,255,255,.2);\n" " border: 1px solid #00ce35;\n" " }") self.I_del_slide.setOrientation(QtCore.Qt.Horizontal) self.I_del_slide.setObjectName("I_del_slide") self.gridLayout_14.addWidget(self.I_del_slide, 0, 2, 1, 1) self.label_38 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(11) self.label_38.setFont(font) self.label_38.setStyleSheet( "color: white;background-color: transparent;") self.label_38.setAlignment(QtCore.Qt.AlignCenter) self.label_38.setObjectName("label_38") self.gridLayout_14.addWidget(self.label_38, 0, 4, 1, 1) self.label_39 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(10) self.label_39.setFont(font) self.label_39.setStyleSheet( "color: white;background-color: transparent;") self.label_39.setAlignment(QtCore.Qt.AlignCenter) self.label_39.setObjectName("label_39") self.gridLayout_14.addWidget(self.label_39, 0, 1, 1, 1) self.verticalLayout_3.addLayout(self.gridLayout_14) self.gridLayout_15 = QtWidgets.QGridLayout() self.gridLayout_15.setObjectName("gridLayout_15") self.label_40 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(10) self.label_40.setFont(font) self.label_40.setStyleSheet( "color: white;background-color: transparent;") self.label_40.setAlignment(QtCore.Qt.AlignCenter) self.label_40.setObjectName("label_40") self.gridLayout_15.addWidget(self.label_40, 0, 0, 1, 1) self.I_dur = QtWidgets.QDoubleSpinBox(self.widget_5) self.I_dur.setStyleSheet("QDoubleSpinBox{\n" " color: white;\n" " background-color: transparent;\n" " border: 1px solid #4589b2;\n" " padding: 1px;\n" "}\n" "\n" "\n" "\n" "QDoubleSpinBox::hover{\n" " border: 1px solid #00ce35;\n" " background-color: rgba(0,0,0,.3);\n" "}") self.I_dur.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) self.I_dur.setObjectName("I_dur") self.gridLayout_15.addWidget(self.I_dur, 0, 3, 1, 1) self.I_dur_slide = QtWidgets.QSlider(self.widget_5) self.I_dur_slide.setStyleSheet( "QSlider{\n" " background-color: transparent;\n" "} \n" "QSlider::groove:horizontal {\n" " border: 0px solid #999999;\n" " height: 8px;\n" " background: rgba(78, 96, 131, 50);\n" " margin: 2px 0;\n" " }\n" "\n" "QSlider::groove:horizontal:hover {\n" " background-color: rgba(255,255,255,.2);\n" " }\n" "\n" " QSlider::handle:horizontal {\n" " background: transparent;\n" " border: 1px solid #4589b2;\n" " width: 18px;\n" " margin: -2px 0;\n" " border-radius: 3px;\n" " }\n" "\n" " QSlider::handle:horizontal:hover {\n" " background-color: rgba(255,255,255,.2);\n" " border: 1px solid #00ce35;\n" " }") self.I_dur_slide.setMaximum(99) self.I_dur_slide.setOrientation(QtCore.Qt.Horizontal) self.I_dur_slide.setTickPosition(QtWidgets.QSlider.NoTicks) self.I_dur_slide.setObjectName("I_dur_slide") self.gridLayout_15.addWidget(self.I_dur_slide, 0, 2, 1, 1) self.label_41 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(11) self.label_41.setFont(font) self.label_41.setStyleSheet( "color: white;background-color: transparent;") self.label_41.setAlignment(QtCore.Qt.AlignCenter) self.label_41.setObjectName("label_41") self.gridLayout_15.addWidget(self.label_41, 0, 4, 1, 1) self.label_42 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(10) self.label_42.setFont(font) self.label_42.setStyleSheet( "color: white;background-color: transparent;") self.label_42.setAlignment(QtCore.Qt.AlignCenter) self.label_42.setObjectName("label_42") self.gridLayout_15.addWidget(self.label_42, 0, 1, 1, 1) self.verticalLayout_3.addLayout(self.gridLayout_15) self.gridLayout_17 = QtWidgets.QGridLayout() self.gridLayout_17.setObjectName("gridLayout_17") self.label_44 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(11) self.label_44.setFont(font) self.label_44.setStyleSheet( "color: white;background-color: transparent;") self.label_44.setAlignment(QtCore.Qt.AlignCenter) self.label_44.setObjectName("label_44") self.gridLayout_17.addWidget(self.label_44, 0, 4, 1, 1) self.label_45 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(10) self.label_45.setFont(font) self.label_45.setStyleSheet( "color: white;background-color: transparent;") self.label_45.setAlignment(QtCore.Qt.AlignCenter) self.label_45.setObjectName("label_45") self.gridLayout_17.addWidget(self.label_45, 0, 1, 1, 1) self.R_dur = QtWidgets.QDoubleSpinBox(self.widget_5) self.R_dur.setStyleSheet("QDoubleSpinBox{\n" " color: white;\n" " background-color: transparent;\n" " border: 1px solid #4589b2;\n" " padding: 1px;\n" "}\n" "\n" "\n" "\n" "QDoubleSpinBox::hover{\n" " border: 1px solid #00ce35;\n" " background-color: rgba(0,0,0,.3);\n" "}") self.R_dur.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) self.R_dur.setObjectName("R_dur") self.gridLayout_17.addWidget(self.R_dur, 0, 3, 1, 1) self.label_43 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("HUN-din 1451") font.setPointSize(10) self.label_43.setFont(font) self.label_43.setStyleSheet( "color: white;background-color: transparent;") self.label_43.setAlignment(QtCore.Qt.AlignCenter) self.label_43.setObjectName("label_43") self.gridLayout_17.addWidget(self.label_43, 0, 0, 1, 1) self.R_dur_slide = QtWidgets.QSlider(self.widget_5) self.R_dur_slide.setStyleSheet( "QSlider{\n" " background-color: transparent;\n" "} \n" "QSlider::groove:horizontal {\n" " border: 0px solid #999999;\n" " height: 8px;\n" " background: rgba(78, 96, 131, 50);\n" " margin: 2px 0;\n" " }\n" "\n" "QSlider::groove:horizontal:hover {\n" " background-color: rgba(255,255,255,.2);\n" " }\n" "\n" " QSlider::handle:horizontal {\n" " background: transparent;\n" " border: 1px solid #4589b2;\n" " width: 18px;\n" " margin: -2px 0;\n" " border-radius: 3px;\n" " }\n" "\n" " QSlider::handle:horizontal:hover {\n" " background-color: rgba(255,255,255,.2);\n" " border: 1px solid #00ce35;\n" " }") self.R_dur_slide.setMaximum(99) self.R_dur_slide.setOrientation(QtCore.Qt.Horizontal) self.R_dur_slide.setTickPosition(QtWidgets.QSlider.NoTicks) self.R_dur_slide.setObjectName("R_dur_slide") self.gridLayout_17.addWidget(self.R_dur_slide, 0, 2, 1, 1) self.verticalLayout_3.addLayout(self.gridLayout_17) self.regulatorSetup = QtWidgets.QPushButton(self.widget_5) font = QtGui.QFont() font.setFamily("Futura BQ") font.setPointSize(9) self.regulatorSetup.setFont(font) self.regulatorSetup.setStyleSheet( "QPushButton{\n" " color: white;\n" " background-color: transparent;\n" " border: 1px solid #4589b2;\n" " padding: 5px;\n" "}\n" "\n" "QPushButton::hover{\n" " background-color: rgba(255,255,255,.2);\n" "}\n" "\n" "QPushButton::pressed{\n" " border: 1px solid #00ce35;\n" " background-color: rgba(0,0,0,.3);\n" "}") self.regulatorSetup.setObjectName("regulatorSetup") self.verticalLayout_3.addWidget(self.regulatorSetup) self.widget_4 = QtWidgets.QWidget(self.widget_5) self.widget_4.setObjectName("widget_4") self.gridLayout_6 = QtWidgets.QGridLayout(self.widget_4) self.gridLayout_6.setContentsMargins(0, 0, 0, 0) self.gridLayout_6.setObjectName("gridLayout_6") self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setSizeConstraint( QtWidgets.QLayout.SetNoConstraint) self.verticalLayout.setObjectName("verticalLayout") self.label_16 = QtWidgets.QLabel(self.widget_4) font = QtGui.QFont() font.setFamily("Futura BQ") font.setPointSize(11) self.label_16.setFont(font) self.label_16.setStyleSheet( "color: white;background-color: transparent;") self.label_16.setAlignment(QtCore.Qt.AlignCenter) self.label_16.setObjectName("label_16") self.verticalLayout.addWidget(self.label_16) self.testNotes = QtWidgets.QPlainTextEdit(self.widget_4) font = QtGui.QFont() font.setFamily("GOST Common") font.setPointSize(8) self.testNotes.setFont(font) self.testNotes.setStyleSheet("color: white;\n" "background-color: transparent;\n" "border: 1px solid #4589b2;\n" "padding: 5px;") self.testNotes.setObjectName("testNotes") self.verticalLayout.addWidget(self.testNotes) self.gridLayout_6.addLayout(self.verticalLayout, 2, 0, 1, 1) self.verticalLayout_3.addWidget(self.widget_4) self.widget_3 = QtWidgets.QWidget(self.widget_5) self.widget_3.setStyleSheet("background: transparent;") self.widget_3.setObjectName("widget_3") self.gridLayout_4 = QtWidgets.QGridLayout(self.widget_3) self.gridLayout_4.setContentsMargins(0, 0, 0, 0) self.gridLayout_4.setObjectName("gridLayout_4") self.label_15 = QtWidgets.QLabel(self.widget_3) font = QtGui.QFont() font.setFamily("Futura BQ") font.setPointSize(11) self.label_15.setFont(font) self.label_15.setStyleSheet("color: white;") self.label_15.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.label_15.setObjectName("label_15") self.gridLayout_4.addWidget(self.label_15, 0, 0, 1, 1) self.cancelButton = QtWidgets.QPushButton(self.widget_3) font = QtGui.QFont() font.setFamily("Futura BQ") font.setPointSize(9) self.cancelButton.setFont(font) self.cancelButton.setStyleSheet( "QPushButton{\n" " color: white;\n" " background-color: transparent;\n" " border: 1px solid #4589b2;\n" " padding: 5px;\n" "}\n" "\n" "QPushButton::hover{\n" " background-color: rgba(255,255,255,.2);\n" "}\n" "\n" "QPushButton::pressed{\n" " border: 1px solid #00ce35;\n" " background-color: rgba(0,0,0,.3);\n" "}") self.cancelButton.setObjectName("cancelButton") self.gridLayout_4.addWidget(self.cancelButton, 1, 0, 1, 1) self.uploadButton = QtWidgets.QPushButton(self.widget_3) font = QtGui.QFont() font.setFamily("Futura BQ") font.setPointSize(9) self.uploadButton.setFont(font) self.uploadButton.setStyleSheet( "QPushButton{\n" " color: white;\n" " background-color: transparent;\n" " border: 1px solid #4589b2;\n" " padding: 5px;\n" "}\n" "\n" "QPushButton::hover{\n" " background-color: rgba(255,255,255,.2);\n" "}\n" "\n" "QPushButton::pressed{\n" " border: 1px solid #00ce35;\n" " background-color: rgba(0,0,0,.3);\n" "}") self.uploadButton.setObjectName("uploadButton") self.gridLayout_4.addWidget(self.uploadButton, 1, 1, 1, 1) self.tminus = QtWidgets.QDoubleSpinBox(self.widget_3) font = QtGui.QFont() font.setFamily("Futura BQ") font.setPointSize(9) self.tminus.setFont(font) self.tminus.setStyleSheet("QDoubleSpinBox{\n" " color: white;\n" " background-color: transparent;\n" " border: 1px solid #4589b2;\n" " padding: 5px;\n" "}\n" "\n" "\n" "\n" "QDoubleSpinBox::hover{\n" " border: 1px solid #00ce35;\n" " background-color: rgba(0,0,0,.3);\n" "}") self.tminus.setAlignment(QtCore.Qt.AlignCenter) self.tminus.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) self.tminus.setMaximum(32767.0) self.tminus.setSingleStep(0.01) self.tminus.setProperty("value", 20.0) self.tminus.setObjectName("tminus") self.gridLayout_4.addWidget(self.tminus, 0, 1, 1, 1) self.verticalLayout_3.addWidget(self.widget_3) self.verticalLayout_2.addWidget(self.widget_5) self.horizontalLayout.addLayout(self.verticalLayout_2) self.gridLayout_2.addLayout(self.horizontalLayout, 0, 0, 1, 1) self.frame_4 = QtWidgets.QFrame(self.centralwidget) self.frame_4.setStyleSheet("background-color:transparent;") self.frame_4.setFrameShape(QtWidgets.QFrame.Box) self.frame_4.setFrameShadow(QtWidgets.QFrame.Plain) self.frame_4.setLineWidth(0) self.frame_4.setMidLineWidth(0) self.frame_4.setObjectName("frame_4") self.gridLayout_5 = QtWidgets.QGridLayout(self.frame_4) self.gridLayout_5.setContentsMargins(0, 0, 0, 0) self.gridLayout_5.setObjectName("gridLayout_5") self.gridLayout_2.addWidget(self.frame_4, 1, 0, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.menuBar = QtWidgets.QMenuBar(MainWindow) self.menuBar.setGeometry(QtCore.QRect(0, 0, 1056, 34)) font = QtGui.QFont() font.setFamily("GOST Common") self.menuBar.setFont(font) self.menuBar.setStyleSheet("color:white;\n" "background: rgba(255,255,255,.2);\n" "padding:5px;") self.menuBar.setDefaultUp(False) self.menuBar.setNativeMenuBar(True) self.menuBar.setObjectName("menuBar") self.menuSave = QtWidgets.QMenu(self.menuBar) self.menuSave.setObjectName("menuSave") MainWindow.setMenuBar(self.menuBar) self.openFile = QtWidgets.QAction(MainWindow) font = QtGui.QFont() font.setFamily("GOST Common") self.openFile.setFont(font) self.openFile.setObjectName("openFile") self.actionSave_Definition = QtWidgets.QAction(MainWindow) font = QtGui.QFont() font.setFamily("GOST Common") self.actionSave_Definition.setFont(font) self.actionSave_Definition.setObjectName("actionSave_Definition") self.menuSave.addAction(self.openFile) self.menuBar.addAction(self.menuSave.menuAction()) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): _translate = QtCore.QCoreApplication.translate MainWindow.setWindowTitle( _translate("MainWindow", "Test Definition Dialog")) self.label_23.setText(_translate("MainWindow", "a")) self.label_24.setText(_translate("MainWindow", "sec")) self.label_29.setText(_translate("MainWindow", "delay")) self.label_17.setText(_translate("MainWindow", "a")) self.label_21.setText(_translate("MainWindow", "sec")) self.label_30.setText(_translate("MainWindow", "durat")) self.label_31.setText(_translate("MainWindow", "b")) self.label_32.setText(_translate("MainWindow", "sec")) self.label_33.setText(_translate("MainWindow", "delay")) self.label_34.setText(_translate("MainWindow", "b")) self.label_35.setText(_translate("MainWindow", "sec")) self.label_36.setText(_translate("MainWindow", "durat")) self.label_37.setText(_translate("MainWindow", "i")) self.label_38.setText(_translate("MainWindow", "sec")) self.label_39.setText(_translate("MainWindow", "delay")) self.label_40.setText(_translate("MainWindow", "i")) self.label_41.setText(_translate("MainWindow", "sec")) self.label_42.setText(_translate("MainWindow", "durat")) self.label_44.setText(_translate("MainWindow", "sec")) self.label_45.setText(_translate("MainWindow", "durat")) self.label_43.setText(_translate("MainWindow", "r")) self.regulatorSetup.setText(_translate("MainWindow", "REGULATOR SETUP")) self.label_16.setText(_translate("MainWindow", "TEST NOTES")) self.label_15.setText(_translate("MainWindow", "START AT T -")) self.cancelButton.setText(_translate("MainWindow", "CANCEL")) self.uploadButton.setText(_translate("MainWindow", "UPLOAD")) self.menuSave.setTitle(_translate("MainWindow", "File")) self.openFile.setText(_translate("MainWindow", "Open Definition File")) self.actionSave_Definition.setText( _translate("MainWindow", "Save Definition"))
class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName(_fromUtf8("MainWindow")) MainWindow.resize(704, 558) MainWindow.setMinimumSize(QtCore.QSize(0, 0)) MainWindow.setStyleSheet(_fromUtf8("\n" "/*\n" " Android Material Dark\n" " COLOR_DARK = #212121 Grey 900\n" " COLOR_MEDIUM = #424242 Grey 800\n" " COLOR_MEDLIGHT = #757575 Grey 600\n" " COLOR_LIGHT = #DDDDDD White\n" " COLOR_ACCENT = #3F51B5 Indigo 500\n" "*/\n" "\n" "* {\n" " background: #212121;\n" " color: #DDDDDD;\n" " border: 1px solid #757575;\n" "}\n" "\n" "QWidget::item:selected {\n" " background: #3F51B5;\n" "}\n" "\n" "QCheckBox, QRadioButton {\n" " border: none;\n" "}\n" "\n" "QRadioButton::indicator, QCheckBox::indicator {\n" " width: 13px;\n" " height: 13px;\n" "}\n" "\n" "QRadioButton::indicator::unchecked, QCheckBox::indicator::unchecked {\n" " border: 1px solid #757575;\n" " background: none;\n" "}\n" "\n" "QRadioButton::indicator:unchecked:hover, QCheckBox::indicator:unchecked:hover {\n" " border: 1px solid #DDDDDD;\n" "}\n" "\n" "QRadioButton::indicator::checked, QCheckBox::indicator::checked {\n" " border: 1px solid #757575;\n" " background: #757575;\n" "}\n" "\n" "QRadioButton::indicator:checked:hover, QCheckBox::indicator:checked:hover {\n" " border: 1px solid #DDDDDD;\n" " background: #DDDDDD;\n" "}\n" "\n" "QGroupBox {\n" " margin-top: 6px;\n" "}\n" "\n" "QGroupBox::title {\n" " top: -7px;\n" " left: 7px;\n" "}\n" "\n" "QScrollBar {\n" " border: 1px solid #757575;\n" " background: #212121;\n" "}\n" "\n" "QScrollBar:horizontal {\n" " height: 15px;\n" " margin: 0px 0px 0px 32px;\n" "}\n" "\n" "QScrollBar:vertical {\n" " width: 15px;\n" " margin: 32px 0px 0px 0px;\n" "}\n" "\n" "QScrollBar::handle {\n" " background: #424242;\n" " border: 1px solid #757575;\n" "}\n" "\n" "QScrollBar::handle:horizontal {\n" " border-width: 0px 1px 0px 1px;\n" "}\n" "\n" "QScrollBar::handle:vertical {\n" " border-width: 1px 0px 1px 0px;\n" "}\n" "\n" "QScrollBar::handle:horizontal {\n" " min-width: 20px;\n" "}\n" "\n" "QScrollBar::handle:vertical {\n" " min-height: 20px;\n" "}\n" "\n" "QScrollBar::add-line, QScrollBar::sub-line {\n" " background:#424242;\n" " border: 1px solid #757575;\n" " subcontrol-origin: margin;\n" "}\n" "\n" "QScrollBar::add-line {\n" " position: absolute;\n" "}\n" "\n" "QScrollBar::add-line:horizontal {\n" " width: 15px;\n" " subcontrol-position: left;\n" " left: 15px;\n" "}\n" "\n" "QScrollBar::add-line:vertical {\n" " height: 15px;\n" " subcontrol-position: top;\n" " top: 15px;\n" "}\n" "\n" "QScrollBar::sub-line:horizontal {\n" " width: 15px;\n" " subcontrol-position: top left;\n" "}\n" "\n" "QScrollBar::sub-line:vertical {\n" " height: 15px;\n" " subcontrol-position: top;\n" "}\n" "\n" "QScrollBar:left-arrow, QScrollBar::right-arrow, QScrollBar::up-arrow, QScrollBar::down-arrow {\n" " border: 1px solid #757575;\n" " width: 3px;\n" " height: 3px;\n" "}\n" "\n" "QScrollBar::add-page, QScrollBar::sub-page {\n" " background: none;\n" "}\n" "\n" "QAbstractButton:hover {\n" " background: #424242;\n" "}\n" "\n" "QAbstractButton:pressed {\n" " background: #757575;\n" "}\n" "\n" "QAbstractItemView {\n" " show-decoration-selected: 1;\n" " selection-background-color: #3F51B5;\n" " selection-color: #DDDDDD;\n" " alternate-background-color: #424242;\n" "}\n" "\n" "QHeaderView {\n" " border: 1px solid #757575;\n" "}\n" "\n" "QHeaderView::section {\n" " background: #212121;\n" " border: 1px solid #757575;\n" " padding: 4px;\n" "}\n" "\n" "QHeaderView::section:selected, QHeaderView::section::checked {\n" " background: #424242;\n" "}\n" "\n" "QTableView {\n" " gridline-color: #757575;\n" "}\n" "\n" "QTabBar {\n" " margin-left: 2px;\n" "}\n" "\n" "QTabBar::tab {\n" " border-radius: 0px;\n" " padding: 4px;\n" " margin: 4px;\n" "}\n" "\n" "QTabBar::tab:selected {\n" " background: #424242;\n" "}\n" "\n" "QComboBox::down-arrow {\n" " border: 1px solid #757575;\n" " background: #424242;\n" "}\n" "\n" "QComboBox::drop-down {\n" " border: 1px solid #757575;\n" " background: #424242;\n" "}\n" "\n" "QComboBox::down-arrow {\n" " width: 3px;\n" " height: 3px;\n" " border: 1px solid #757575;\n" "}\n" "\n" "QAbstractSpinBox {\n" " padding-right: 15px;\n" "}\n" "\n" "QAbstractSpinBox::up-button, QAbstractSpinBox::down-button {\n" " border: 1px solid #757575;\n" " background: #424242;\n" " subcontrol-origin: border;\n" "}\n" "\n" "QAbstractSpinBox::up-arrow, QAbstractSpinBox::down-arrow {\n" " width: 3px;\n" " height: 3px;\n" " border: 1px solid #757575;\n" "}\n" "\n" "QSlider {\n" " border: none;\n" "}\n" "\n" "QSlider::groove:horizontal {\n" " height: 5px;\n" " margin: 4px 0px 4px 0px;\n" "}\n" "\n" "QSlider::groove:vertical {\n" " width: 5px;\n" " margin: 0px 4px 0px 4px;\n" "}\n" "\n" "QSlider::handle {\n" " border: 1px solid #757575;\n" " background: #424242;\n" "}\n" "\n" "QSlider::handle:horizontal {\n" " width: 15px;\n" " margin: -4px 0px -4px 0px;\n" "}\n" "\n" "QSlider::handle:vertical {\n" " height: 15px;\n" " margin: 0px -4px 0px -4px;\n" "}\n" "\n" "QSlider::add-page:vertical, QSlider::sub-page:horizontal {\n" " background: #3F51B5;\n" "}\n" "\n" "QSlider::sub-page:vertical, QSlider::add-page:horizontal {\n" " background: #424242;\n" "}\n" "\n" "QLabel {\n" " border: none;\n" "}\n" "\n" "QProgressBar {\n" " text-align: center;\n" "}\n" "\n" "QProgressBar::chunk {\n" " width: 1px;\n" " background-color: #3F51B5;\n" "}\n" "\n" "QMenu::separator {\n" " background: #424242;\n" "}\n" "\n" "QStatusBar {\n" " border: 1px;\n" " color: #3F51B5;\n" "}")) MainWindow.setTabShape(QtGui.QTabWidget.Rounded) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName(_fromUtf8("centralwidget")) self.gridLayout = QtGui.QGridLayout(self.centralwidget) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.Layout_controls2 = QtGui.QGridLayout() self.Layout_controls2.setObjectName(_fromUtf8("Layout_controls2")) spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.Layout_controls2.addItem(spacerItem, 0, 1, 1, 1) self.chBox_export = QtGui.QCheckBox(self.centralwidget) self.chBox_export.setObjectName(_fromUtf8("chBox_export")) self.Layout_controls2.addWidget(self.chBox_export, 0, 0, 1, 1) self.gridLayout.addLayout(self.Layout_controls2, 9, 1, 1, 1) self.Layout_controls = QtGui.QGridLayout() self.Layout_controls.setObjectName(_fromUtf8("Layout_controls")) self.cBox_Speed = QtGui.QComboBox(self.centralwidget) self.cBox_Speed.setObjectName(_fromUtf8("cBox_Speed")) self.Layout_controls.addWidget(self.cBox_Speed, 0, 1, 1, 1) self.cBox_Port = QtGui.QComboBox(self.centralwidget) self.cBox_Port.setObjectName(_fromUtf8("cBox_Port")) self.Layout_controls.addWidget(self.cBox_Port, 0, 0, 1, 1) self.pButton_Start = QtGui.QPushButton(self.centralwidget) self.pButton_Start.setMinimumSize(QtCore.QSize(0, 0)) self.pButton_Start.setObjectName(_fromUtf8("pButton_Start")) self.Layout_controls.addWidget(self.pButton_Start, 1, 0, 1, 1) self.pButton_Stop = QtGui.QPushButton(self.centralwidget) self.pButton_Stop.setObjectName(_fromUtf8("pButton_Stop")) self.Layout_controls.addWidget(self.pButton_Stop, 1, 1, 1, 1) self.gridLayout.addLayout(self.Layout_controls, 7, 0, 1, 2) self.Layout_graphs = QtGui.QGridLayout() self.Layout_graphs.setObjectName(_fromUtf8("Layout_graphs")) self.plt = GraphicsLayoutWidget(self.centralwidget) self.plt.setAutoFillBackground(False) self.plt.setStyleSheet(_fromUtf8("border: 0px;")) self.plt.setFrameShape(QtGui.QFrame.StyledPanel) self.plt.setFrameShadow(QtGui.QFrame.Plain) self.plt.setLineWidth(0) self.plt.setObjectName(_fromUtf8("plt")) self.Layout_graphs.addWidget(self.plt, 0, 0, 1, 1) self.gridLayout.addLayout(self.Layout_graphs, 2, 1, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.statusbar = QtGui.QStatusBar(MainWindow) self.statusbar.setSizeGripEnabled(False) self.statusbar.setObjectName(_fromUtf8("statusbar")) MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(_translate("MainWindow", "RTGraph", None)) self.chBox_export.setText(_translate("MainWindow", "Export to CSV", None)) self.pButton_Start.setText(_translate("MainWindow", "Start", None)) self.pButton_Stop.setText(_translate("MainWindow", "Stop", None))
class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(704, 558) MainWindow.setMinimumSize(QtCore.QSize(0, 0)) MainWindow.setStyleSheet("") MainWindow.setTabShape(QtWidgets.QTabWidget.Rounded) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) self.gridLayout.setObjectName("gridLayout") self.Layout_controls = QtWidgets.QGridLayout() self.Layout_controls.setObjectName("Layout_controls") self.cBox_Speed = QtWidgets.QComboBox(self.centralwidget) self.cBox_Speed.setEditable(True) self.cBox_Speed.setObjectName("cBox_Speed") self.Layout_controls.addWidget(self.cBox_Speed, 1, 1, 1, 1) self.pButton_Stop = QtWidgets.QPushButton(self.centralwidget) self.pButton_Stop.setObjectName("pButton_Stop") self.Layout_controls.addWidget(self.pButton_Stop, 1, 3, 1, 1) self.cBox_Port = QtWidgets.QComboBox(self.centralwidget) self.cBox_Port.setEditable(True) self.cBox_Port.setObjectName("cBox_Port") self.Layout_controls.addWidget(self.cBox_Port, 0, 1, 1, 1) self.cBox_Source = QtWidgets.QComboBox(self.centralwidget) self.cBox_Source.setObjectName("cBox_Source") self.Layout_controls.addWidget(self.cBox_Source, 0, 0, 1, 1) self.pButton_Start = QtWidgets.QPushButton(self.centralwidget) self.pButton_Start.setMinimumSize(QtCore.QSize(0, 0)) self.pButton_Start.setObjectName("pButton_Start") self.Layout_controls.addWidget(self.pButton_Start, 0, 3, 1, 1) self.sBox_Samples = QtWidgets.QSpinBox(self.centralwidget) self.sBox_Samples.setMinimum(1) self.sBox_Samples.setMaximum(100000) self.sBox_Samples.setProperty("value", 500) self.sBox_Samples.setObjectName("sBox_Samples") self.Layout_controls.addWidget(self.sBox_Samples, 0, 2, 1, 1) self.chBox_export = QtWidgets.QCheckBox(self.centralwidget) self.chBox_export.setEnabled(True) self.chBox_export.setObjectName("chBox_export") self.Layout_controls.addWidget(self.chBox_export, 1, 2, 1, 1) self.gridLayout.addLayout(self.Layout_controls, 7, 0, 1, 2) self.Layout_graphs = QtWidgets.QGridLayout() self.Layout_graphs.setObjectName("Layout_graphs") self.plt = GraphicsLayoutWidget(self.centralwidget) self.plt.setAutoFillBackground(False) self.plt.setStyleSheet("border: 0px;") self.plt.setFrameShape(QtWidgets.QFrame.StyledPanel) self.plt.setFrameShadow(QtWidgets.QFrame.Plain) self.plt.setLineWidth(0) self.plt.setObjectName("plt") self.Layout_graphs.addWidget(self.plt, 0, 0, 1, 1) self.gridLayout.addLayout(self.Layout_graphs, 2, 1, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): _translate = QtCore.QCoreApplication.translate MainWindow.setWindowTitle(_translate("MainWindow", "RTGraph")) self.pButton_Stop.setText(_translate("MainWindow", "Stop")) self.pButton_Start.setText(_translate("MainWindow", "Start")) self.sBox_Samples.setSuffix(_translate("MainWindow", " samples")) self.sBox_Samples.setPrefix(_translate("MainWindow", "Show ")) self.chBox_export.setText(_translate("MainWindow", "Export to CSV"))
class main_ui(object): def setup_ui(self, MainWindow): MainWindow.setObjectName('MainWindow') MainWindow.resize(800, 600) # create central widget and layout self.central_widget = QtWidgets.QWidget(MainWindow) self.central_widget.setObjectName("central_widget") self.central_layout = QtWidgets.QHBoxLayout(self.central_widget) self.central_layout.setObjectName("central_layout") # create main layout self.main_layout = QtWidgets.QVBoxLayout() self.main_layout.setObjectName("main_layout") self.main_layout.addWidget(QtWidgets.QLabel("mBCI Lab v0.0.1")) # main layout: plot widget self.plt = GraphicsLayoutWidget() self.plt.setAutoFillBackground(False) self.plt.setStyleSheet("border: 1px;") self.plt.setFrameShape(QtWidgets.QFrame.StyledPanel) self.plt.setFrameShadow(QtWidgets.QFrame.Plain) self.plt.setLineWidth(0) self.plt.setMinimumWidth(600) self.plt.setObjectName("plt") self.main_layout.addWidget(self.plt) # main layout: console log self.tBrowser_Log = QtWidgets.QTextBrowser() self.tBrowser_Log.setFixedHeight(120) self.tBrowser_Log.setObjectName("tBrowser_Log") self.main_layout.addWidget(self.tBrowser_Log) self.tBrowser_Log.append("mBCI Lab is a fork of RTGraph and a real-time graphing program for the mBCI project.\nIts purpose is to plot neural signals in real time.\nIt can also be used for any single-time-domain, serial-port device.\nLink to mBCI project: https://github.com/chanhakim/mbci") self.tBrowser_Log.append("-------------------------") # create control layout self.control_layout = QtWidgets.QVBoxLayout() self.control_layout.setObjectName("control_layout") empty = QtWidgets.QLabel() empty.setFixedWidth(140) self.control_layout.addWidget(empty) # control layout: view options label self.qLabel_ViewOptions = QtWidgets.QLabel("View Options") self.qLabel_ViewOptions.setObjectName("qLabel_ViewOptions") self.qLabel_ViewOptions.setAlignment(QtCore.Qt.AlignCenter) self.control_layout.addWidget(self.qLabel_ViewOptions) # control layout: start button self.pButton_Start = QtWidgets.QPushButton("Start") self.pButton_Start.setObjectName("pButton_Start") self.control_layout.addWidget(self.pButton_Start) # control layout: stop button self.pButton_Stop = QtWidgets.QPushButton("Stop") self.pButton_Stop.setObjectName("pButton_Stop") self.control_layout.addWidget(self.pButton_Stop) self.control_layout.addWidget(_qline()) # hline separator # control layout: record options label self.qLabel_RecordOptions = QtWidgets.QLabel("Record Options") self.qLabel_RecordOptions.setObjectName("qLabel_RecordOptions") self.qLabel_RecordOptions.setAlignment(QtCore.Qt.AlignCenter) self.control_layout.addWidget(self.qLabel_RecordOptions) # control layout: plot sample no. spin box self.sBox_Seconds = QtWidgets.QSpinBox() self.sBox_Seconds.setObjectName("sBox_Seconds") self.sBox_Seconds.setMinimum(0) self.sBox_Seconds.setMaximum(3600) self.sBox_Seconds.setProperty('value', 0) self.control_layout.addWidget(self.sBox_Seconds) # control layout: record button self.pButton_Record = QtWidgets.QPushButton("Record") self.pButton_Record.setObjectName("pButton_Record") self.control_layout.addWidget(self.pButton_Record) # control layout: save button self.pButton_Save = QtWidgets.QPushButton("Save") self.pButton_Save.setObjectName("pButton_Save") self.control_layout.addWidget(self.pButton_Save) self.control_layout.addWidget(_qline()) # hline separator # control layout: BCI options label self.qLabel_BCIOptions = QtWidgets.QLabel("BCI/Plot Options") self.qLabel_BCIOptions.setObjectName("qLabel_BCIOptions") self.qLabel_BCIOptions.setAlignment(QtCore.Qt.AlignCenter) self.control_layout.addWidget(self.qLabel_BCIOptions) # control layout: port id combo box self.cBox_Port = QtWidgets.QComboBox() self.cBox_Port.setObjectName("cBox_Ports") self.cBox_Port.addItem("Ports (Refresh)") self.cBox_Port.setFixedWidth(140) self.control_layout.addWidget(self.cBox_Port) # control layout: baud rate combo box self.cBox_BaudRate = QtWidgets.QComboBox() self.cBox_BaudRate.setObjectName("cBox_BaudRate") self.cBox_BaudRate.addItems([str(num) for num in ["Baud Rate", 9600, 14400, 19200, 38400, 115200]]) self.cBox_BaudRate.setFixedWidth(140) self.control_layout.addWidget(self.cBox_BaudRate) # control layout: plot sample no. spin box self.sBox_Samples = QtWidgets.QSpinBox() self.sBox_Samples.setObjectName("sBox_Samples") self.sBox_Samples.setMinimum(2) self.sBox_Samples.setMaximum(100000) self.sBox_Samples.setProperty('value', 1000) self.control_layout.addWidget(self.sBox_Samples) self.control_layout.addWidget(_qline()) # hline separator # control layout: record button self.pButton_Help = QtWidgets.QPushButton("Help") self.pButton_Help.setObjectName("pButton_Help") self.control_layout.addWidget(self.pButton_Help) self.control_layout.addStretch() # add stretch to bottom of controls # add main and control widgets to central self.central_layout.addLayout(self.main_layout) self.central_layout.addLayout(self.control_layout) MainWindow.setCentralWidget(self.central_widget) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): _translate = QtCore.QCoreApplication.translate MainWindow.setWindowTitle(_translate("MainWindow", "mbci_lab")) self.pButton_Start.setText(_translate("MainWindow", "Start")) self.pButton_Stop.setText(_translate("MainWindow", "Stop")) self.pButton_Record.setText(_translate("MainWindow", "Record")) self.pButton_Help.setText(_translate("MainWindow", "Help")) self.pButton_Save.setText(_translate("MainWindow", "Save")) self.sBox_Samples.setSuffix(_translate("MainWindow", " Samples")) self.sBox_Seconds.setSuffix(_translate("MainWindow", " Seconds"))
class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName(_fromUtf8("MainWindow")) MainWindow.resize(999, 732) MainWindow.setMinimumSize(QtCore.QSize(0, 0)) MainWindow.setStyleSheet( _fromUtf8( "\n" "/*\n" " Android Material Dark\n" " COLOR_DARK = #212121 Grey 900\n" " COLOR_MEDIUM = #424242 Grey 800\n" " COLOR_MEDLIGHT = #757575 Grey 600\n" " COLOR_LIGHT = #DDDDDD White\n" " COLOR_ACCENT = #3F51B5 Indigo 500\n" "*/\n" "\n" "* {\n" " background: #212121;\n" " color: #DDDDDD;\n" " border: 1px solid #757575;\n" "}\n" "\n" "QWidget::item:selected {\n" " background: #3F51B5;\n" "}\n" "\n" "QCheckBox, QRadioButton {\n" " border: none;\n" "}\n" "\n" "QRadioButton::indicator, QCheckBox::indicator {\n" " width: 13px;\n" " height: 13px;\n" "}\n" "\n" "QRadioButton::indicator::unchecked, QCheckBox::indicator::unchecked {\n" " border: 1px solid #757575;\n" " background: none;\n" "}\n" "\n" "QRadioButton::indicator:unchecked:hover, QCheckBox::indicator:unchecked:hover {\n" " border: 1px solid #DDDDDD;\n" "}\n" "\n" "QRadioButton::indicator::checked, QCheckBox::indicator::checked {\n" " border: 1px solid #757575;\n" " background: #757575;\n" "}\n" "\n" "QRadioButton::indicator:checked:hover, QCheckBox::indicator:checked:hover {\n" " border: 1px solid #DDDDDD;\n" " background: #DDDDDD;\n" "}\n" "\n" "QGroupBox {\n" " margin-top: 6px;\n" "}\n" "\n" "QGroupBox::title {\n" " top: -7px;\n" " left: 7px;\n" "}\n" "\n" "QScrollBar {\n" " border: 1px solid #757575;\n" " background: #212121;\n" "}\n" "\n" "QScrollBar:horizontal {\n" " height: 15px;\n" " margin: 0px 0px 0px 32px;\n" "}\n" "\n" "QScrollBar:vertical {\n" " width: 15px;\n" " margin: 32px 0px 0px 0px;\n" "}\n" "\n" "QScrollBar::handle {\n" " background: #424242;\n" " border: 1px solid #757575;\n" "}\n" "\n" "QScrollBar::handle:horizontal {\n" " border-width: 0px 1px 0px 1px;\n" "}\n" "\n" "QScrollBar::handle:vertical {\n" " border-width: 1px 0px 1px 0px;\n" "}\n" "\n" "QScrollBar::handle:horizontal {\n" " min-width: 20px;\n" "}\n" "\n" "QScrollBar::handle:vertical {\n" " min-height: 20px;\n" "}\n" "\n" "QScrollBar::add-line, QScrollBar::sub-line {\n" " background:#424242;\n" " border: 1px solid #757575;\n" " subcontrol-origin: margin;\n" "}\n" "\n" "QScrollBar::add-line {\n" " position: absolute;\n" "}\n" "\n" "QScrollBar::add-line:horizontal {\n" " width: 15px;\n" " subcontrol-position: left;\n" " left: 15px;\n" "}\n" "\n" "QScrollBar::add-line:vertical {\n" " height: 15px;\n" " subcontrol-position: top;\n" " top: 15px;\n" "}\n" "\n" "QScrollBar::sub-line:horizontal {\n" " width: 15px;\n" " subcontrol-position: top left;\n" "}\n" "\n" "QScrollBar::sub-line:vertical {\n" " height: 15px;\n" " subcontrol-position: top;\n" "}\n" "\n" "QScrollBar:left-arrow, QScrollBar::right-arrow, QScrollBar::up-arrow, QScrollBar::down-arrow {\n" " border: 1px solid #757575;\n" " width: 3px;\n" " height: 3px;\n" "}\n" "\n" "QScrollBar::add-page, QScrollBar::sub-page {\n" " background: none;\n" "}\n" "\n" "QAbstractButton:hover {\n" " background: #424242;\n" "}\n" "\n" "QAbstractButton:pressed {\n" " background: #757575;\n" "}\n" "\n" "QAbstractItemView {\n" " show-decoration-selected: 1;\n" " selection-background-color: #3F51B5;\n" " selection-color: #DDDDDD;\n" " alternate-background-color: #424242;\n" "}\n" "\n" "QHeaderView {\n" " border: 1px solid #757575;\n" "}\n" "\n" "QHeaderView::section {\n" " background: #212121;\n" " border: 1px solid #757575;\n" " padding: 4px;\n" "}\n" "\n" "QHeaderView::section:selected, QHeaderView::section::checked {\n" " background: #424242;\n" "}\n" "\n" "QTableView {\n" " gridline-color: #757575;\n" "}\n" "\n" "QTabBar {\n" " margin-left: 2px;\n" "}\n" "\n" "QTabBar::tab {\n" " border-radius: 0px;\n" " padding: 4px;\n" " margin: 4px;\n" "}\n" "\n" "QTabBar::tab:selected {\n" " background: #424242;\n" "}\n" "\n" "QComboBox::down-arrow {\n" " border: 1px solid #757575;\n" " background: #424242;\n" "}\n" "\n" "QComboBox::drop-down {\n" " border: 1px solid #757575;\n" " background: #424242;\n" "}\n" "\n" "QComboBox::down-arrow {\n" " width: 3px;\n" " height: 3px;\n" " border: 1px solid #757575;\n" "}\n" "\n" "QAbstractSpinBox {\n" " padding-right: 15px;\n" "}\n" "\n" "QAbstractSpinBox::up-button, QAbstractSpinBox::down-button {\n" " border: 1px solid #757575;\n" " background: #424242;\n" " subcontrol-origin: border;\n" "}\n" "\n" "QAbstractSpinBox::up-arrow, QAbstractSpinBox::down-arrow {\n" " width: 3px;\n" " height: 3px;\n" " border: 1px solid #757575;\n" "}\n" "\n" "QSlider {\n" " border: none;\n" "}\n" "\n" "QSlider::groove:horizontal {\n" " height: 5px;\n" " margin: 4px 0px 4px 0px;\n" "}\n" "\n" "QSlider::groove:vertical {\n" " width: 5px;\n" " margin: 0px 4px 0px 4px;\n" "}\n" "\n" "QSlider::handle {\n" " border: 1px solid #757575;\n" " background: #424242;\n" "}\n" "\n" "QSlider::handle:horizontal {\n" " width: 15px;\n" " margin: -4px 0px -4px 0px;\n" "}\n" "\n" "QSlider::handle:vertical {\n" " height: 15px;\n" " margin: 0px -4px 0px -4px;\n" "}\n" "\n" "QSlider::add-page:vertical, QSlider::sub-page:horizontal {\n" " background: #3F51B5;\n" "}\n" "\n" "QSlider::sub-page:vertical, QSlider::add-page:horizontal {\n" " background: #424242;\n" "}\n" "\n" "QLabel {\n" " border: none;\n" "}\n" "\n" "QProgressBar {\n" " text-align: center;\n" "}\n" "\n" "QProgressBar::chunk {\n" " width: 1px;\n" " background-color: #3F51B5;\n" "}\n" "\n" "QMenu::separator {\n" " background: #424242;\n" "}\n" "\n" "QStatusBar {\n" " border: 1px;\n" " color: #3F51B5;\n" "}")) MainWindow.setTabShape(QtGui.QTabWidget.Rounded) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName(_fromUtf8("centralwidget")) self.gridLayout = QtGui.QGridLayout(self.centralwidget) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.Layout_graphs = QtGui.QGridLayout() self.Layout_graphs.setObjectName(_fromUtf8("Layout_graphs")) self.horizontalLayout_5 = QtGui.QHBoxLayout() self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5")) self.lblSensorPos = QtGui.QLabel(self.centralwidget) self.lblSensorPos.setObjectName(_fromUtf8("lblSensorPos")) self.horizontalLayout_5.addWidget(self.lblSensorPos) self.sensorConfFile = QtGui.QLineEdit(self.centralwidget) self.sensorConfFile.setObjectName(_fromUtf8("sensorConfFile")) self.horizontalLayout_5.addWidget(self.sensorConfFile) self.sensorLoadbtn = QtGui.QPushButton(self.centralwidget) self.sensorLoadbtn.setObjectName(_fromUtf8("sensorLoadbtn")) self.horizontalLayout_5.addWidget(self.sensorLoadbtn) self.horizontalLayout_10 = QtGui.QHBoxLayout() self.horizontalLayout_10.setObjectName( _fromUtf8("horizontalLayout_10")) self.horizontalLayout_5.addLayout(self.horizontalLayout_10) self.lblSetupGeneral = QtGui.QLabel(self.centralwidget) self.lblSetupGeneral.setObjectName(_fromUtf8("lblSetupGeneral")) self.horizontalLayout_5.addWidget(self.lblSetupGeneral) self.setupGeneralFile = QtGui.QLineEdit(self.centralwidget) self.setupGeneralFile.setObjectName(_fromUtf8("setupGeneralFile")) self.horizontalLayout_5.addWidget(self.setupGeneralFile) self.setupLoadbtn = QtGui.QPushButton(self.centralwidget) self.setupLoadbtn.setObjectName(_fromUtf8("setupLoadbtn")) self.horizontalLayout_5.addWidget(self.setupLoadbtn) self.Layout_graphs.addLayout(self.horizontalLayout_5, 4, 0, 1, 1) self.Layout_controls = QtGui.QGridLayout() self.Layout_controls.setObjectName(_fromUtf8("Layout_controls")) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.intCheckBox = QtGui.QCheckBox(self.centralwidget) self.intCheckBox.setObjectName(_fromUtf8("intCheckBox")) self.horizontalLayout.addWidget(self.intCheckBox) self.numIntSpinBox = QtGui.QSpinBox(self.centralwidget) self.numIntSpinBox.setMaximum(1000) self.numIntSpinBox.setProperty("value", 100) self.numIntSpinBox.setObjectName(_fromUtf8("numIntSpinBox")) self.horizontalLayout.addWidget(self.numIntSpinBox) self.label_2 = QtGui.QLabel(self.centralwidget) self.label_2.setObjectName(_fromUtf8("label_2")) self.horizontalLayout.addWidget(self.label_2) self.Layout_controls.addLayout(self.horizontalLayout, 4, 2, 1, 1) self.pButton_Stop = QtGui.QPushButton(self.centralwidget) self.pButton_Stop.setObjectName(_fromUtf8("pButton_Stop")) self.Layout_controls.addWidget(self.pButton_Stop, 0, 2, 1, 1) self.pButton_Start = QtGui.QPushButton(self.centralwidget) self.pButton_Start.setMinimumSize(QtCore.QSize(0, 0)) self.pButton_Start.setObjectName(_fromUtf8("pButton_Start")) self.Layout_controls.addWidget(self.pButton_Start, 0, 0, 1, 1) self.label = QtGui.QLabel(self.centralwidget) self.label.setObjectName(_fromUtf8("label")) self.Layout_controls.addWidget(self.label, 4, 0, 1, 1) self.cmdLineEdit = QtGui.QLineEdit(self.centralwidget) self.cmdLineEdit.setObjectName(_fromUtf8("cmdLineEdit")) self.Layout_controls.addWidget(self.cmdLineEdit, 4, 1, 1, 1) self.Layout_graphs.addLayout(self.Layout_controls, 3, 0, 1, 1) self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.Layout_graphs.addLayout(self.verticalLayout, 1, 0, 1, 1) self.plt = GraphicsLayoutWidget(self.centralwidget) self.plt.setAutoFillBackground(False) self.plt.setStyleSheet(_fromUtf8("border: 0px;")) self.plt.setFrameShape(QtGui.QFrame.StyledPanel) self.plt.setFrameShadow(QtGui.QFrame.Plain) self.plt.setLineWidth(0) self.plt.setObjectName(_fromUtf8("plt")) self.Layout_graphs.addWidget(self.plt, 0, 0, 1, 1) self.gridLayout.addLayout(self.Layout_graphs, 2, 0, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.statusbar = QtGui.QStatusBar(MainWindow) self.statusbar.setSizeGripEnabled(False) self.statusbar.setObjectName(_fromUtf8("statusbar")) MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(_translate("MainWindow", "RTGraph", None)) self.lblSensorPos.setText( _translate("MainWindow", "Sensor position file:", None)) self.sensorConfFile.setText( _translate("MainWindow", "sensors_pos.csv", None)) self.sensorLoadbtn.setText(_translate("MainWindow", "Load", None)) self.lblSetupGeneral.setText( _translate("MainWindow", "Setup file:", None)) self.setupGeneralFile.setText( _translate("MainWindow", "setup_examples/setup_general.txt", None)) self.setupLoadbtn.setText(_translate("MainWindow", "Load", None)) self.intCheckBox.setText( _translate("MainWindow", "Integrate over", None)) self.label_2.setText(_translate("MainWindow", "acquisitions", None)) self.pButton_Stop.setText(_translate("MainWindow", "Stop", None)) self.pButton_Start.setText(_translate("MainWindow", "Start", None)) self.label.setText( _translate("MainWindow", "Command to execute:", None)) self.cmdLineEdit.setText( _translate("MainWindow", "/home/lphe/usbBoard/Builds/test.sh", None))
class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(555, 273) MainWindow.setMinimumSize(QtCore.QSize(0, 0)) MainWindow.setMaximumSize(QtCore.QSize(16777215, 16777215)) MainWindow.setStyleSheet("background-color: qlineargradient(spread:pad, x1:0.502975, y1:0, x2:0.473, y2:1, stop:0 rgba(2, 11, 16, 255), stop:1 rgba(4, 26, 37, 255));") self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.gridLayout_16 = QtWidgets.QGridLayout(self.centralwidget) self.gridLayout_16.setObjectName("gridLayout_16") self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.regProfileView = GraphicsLayoutWidget(self.centralwidget) self.regProfileView.setMinimumSize(QtCore.QSize(0, 0)) self.regProfileView.setMaximumSize(QtCore.QSize(16777215, 16777215)) self.regProfileView.setStyleSheet("color: white;\n" "border: 1px solid #4589b2;") self.regProfileView.setFrameShape(QtWidgets.QFrame.StyledPanel) self.regProfileView.setFrameShadow(QtWidgets.QFrame.Plain) self.regProfileView.setLineWidth(0) self.regProfileView.setMidLineWidth(0) self.regProfileView.setObjectName("regProfileView") self.horizontalLayout.addWidget(self.regProfileView) self.widget_5 = QtWidgets.QWidget(self.centralwidget) self.widget_5.setMinimumSize(QtCore.QSize(0, 0)) self.widget_5.setMaximumSize(QtCore.QSize(16777215, 16777215)) self.widget_5.setStyleSheet("background: transparent;") self.widget_5.setObjectName("widget_5") self.gridLayout_7 = QtWidgets.QGridLayout(self.widget_5) self.gridLayout_7.setContentsMargins(0, 0, 0, 0) self.gridLayout_7.setObjectName("gridLayout_7") self.label_16 = QtWidgets.QLabel(self.widget_5) font = QtGui.QFont() font.setFamily("Futura BQ") font.setPointSize(11) self.label_16.setFont(font) self.label_16.setStyleSheet("color: white;background-color: transparent;") self.label_16.setAlignment(QtCore.Qt.AlignCenter) self.label_16.setObjectName("label_16") self.gridLayout_7.addWidget(self.label_16, 0, 1, 1, 1) self.textEdit = QtWidgets.QTextEdit(self.widget_5) font = QtGui.QFont() font.setFamily("Courier New") font.setPointSize(9) self.textEdit.setFont(font) self.textEdit.setStyleSheet("color: white;\n" "background: rgba(255,255,255,.2);\n" "padding: 5px;") self.textEdit.setFrameShape(QtWidgets.QFrame.NoFrame) self.textEdit.setObjectName("textEdit") self.gridLayout_7.addWidget(self.textEdit, 2, 1, 1, 1) self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.set = QtWidgets.QPushButton(self.widget_5) font = QtGui.QFont() font.setFamily("Futura BQ") font.setPointSize(9) self.set.setFont(font) self.set.setStyleSheet("QPushButton{\n" " color: white;\n" " background-color: transparent;\n" " border: 1px solid #4589b2;\n" " padding: 5px;\n" "}\n" "\n" "QPushButton::hover{\n" " background-color: rgba(255,255,255,.2);\n" "}\n" "\n" "QPushButton::pressed{\n" " border: 1px solid #00ce35;\n" " background-color: rgba(0,0,0,.3);\n" "}") self.set.setObjectName("set") self.horizontalLayout_2.addWidget(self.set) self.syntaxState = QtWidgets.QLabel(self.widget_5) self.syntaxState.setMaximumSize(QtCore.QSize(30, 16777215)) font = QtGui.QFont() font.setFamily("Arial") font.setPointSize(10) self.syntaxState.setFont(font) self.syntaxState.setStyleSheet("background-color: #00ce35;\n" "border-radius: 15px;") self.syntaxState.setText("") self.syntaxState.setAlignment(QtCore.Qt.AlignCenter) self.syntaxState.setObjectName("syntaxState") self.horizontalLayout_2.addWidget(self.syntaxState) self.gridLayout_7.addLayout(self.horizontalLayout_2, 4, 1, 1, 1) self.horizontalLayout.addWidget(self.widget_5) self.gridLayout_16.addLayout(self.horizontalLayout, 1, 0, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): _translate = QtCore.QCoreApplication.translate MainWindow.setWindowTitle(_translate("MainWindow", "Test Definition Dialog")) self.label_16.setText(_translate("MainWindow", "REGULATOR SCRIPT")) self.textEdit.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" "p, li { white-space: pre-wrap; }\n" "</style></head><body style=\" font-family:\'Courier New\'; font-size:9pt; font-weight:400; font-style:normal;\">\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" color:#ffffff;\">import math</span></p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" color:#ffffff;\">end=5</span></p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'MS Shell Dlg 2\'; font-size:8pt; color:#ffffff;\">if t >= 0 and t<end:</span></p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'MS Shell Dlg 2\'; font-size:8pt; color:#ffffff;\"> return math.exp(-t)</span></p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'MS Shell Dlg 2\'; font-size:8pt; color:#ffffff;\">if t >= 5:</span></p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'MS Shell Dlg 2\'; font-size:8pt; color:#ffffff;\"> return 0</span></p></body></html>")) self.set.setText(_translate("MainWindow", "SET"))
class mainWindow(QMainWindow): # Metodo constructor de la clase def __init__(self): #Inicia el objeto QMainWindow QMainWindow.__init__(self) #carga la configuracion del archivo .ui en el objeto loadUi("mainWindowPPG.ui", self) # Loads everything about mainWindowPPG configuration self.setupUI() # Shared variables, initial values self.queue = Queue(N_SAMPLES) self.dataR = deque([], maxlen=N_SAMPLES) self.dataIR = deque([], maxlen=N_SAMPLES) self.TIME = deque([], maxlen=N_SAMPLES) self._plt = None self._timer_plot = None self.plot_colors = ['#0072bd', '#d95319'] # configures self._configure_plot() self._configure_timers() self._configure_signals() # Loads everything about mainWindowPPG configuration def setupUI(self): """ Configures everything about the mainWindow """ self.plt = GraphicsLayoutWidget( self.centralwidget) # Bringing my plot wiindow as plt self.plt.setAutoFillBackground(False) self.plt.setStyleSheet("border: 0px;") self.plt.setFrameShape(QtWidgets.QFrame.StyledPanel) self.plt.setFrameShadow(QtWidgets.QFrame.Plain) self.plt.setLineWidth(0) self.Layout_graphs.addWidget(self.plt, 0, 0, 1, 1) # Set the plotting squared graph def _configure_plot(self): """ Configures specific elements of the PyQtGraph plots. :return: """ self.plt.setBackground(background=None) self.plt.setAntialiasing(True) self._plt = self.plt.addPlot(row=1, col=1) self._plt.setLabel('bottom', "Time", "s") pass def _configure_timers(self): """ Configures specific elements of the QTimers. :return: """ self._timer_plot = QtCore.QTimer( self) # gives _timer_plot the attribute of QtCore.QTimer self._timer_plot.timeout.connect( self._update_plot) # connects with _update_plot method pass def _update_plot(self): """ Updates and redraws the graphics in the plot. This function us connected to the timeout signal of a QTimer. :return: """ # Spo2 signal parameters f = 2 amp1 = 0.5 # amplitud for Sine signal zeroDes1 = 0.5413 # Desplacement from zero for Sine signal amp2 = 0.5 # amplitud for Cosine signal zeroDes2 = 1.5413 # Desplacement from zero for Cosine signal # generate the time tsignal = time() - self.timestamp # Sine signal function sR = zeroDes1 + amp1 * 0.8 * np.sin(2 * np.pi * tsignal * 3 * f) # Cosine signal function sIR = zeroDes2 + amp2 * 0.8 * np.cos(2 * np.pi * tsignal * 3 * f) # put the data generate (time & signal) into queue self.queue.put([tsignal, sR, sIR]) # get the data generate into queue data = self.queue.get(True, 1) # store data into variables self.TIME.append(data[0]) self.dataR.append(data[1]) self.dataIR.append(data[2]) # Draw new data self._plt.clear() self._plt.plot(x=list(self.TIME)[-PLOT_UPDATE_POINTS:], y=list(self.dataR)[-PLOT_UPDATE_POINTS:], pen=self.plot_colors[1]) self._plt.plot(x=list(self.TIME)[-PLOT_UPDATE_POINTS:], y=list(self.dataIR)[-PLOT_UPDATE_POINTS:], pen=self.plot_colors[0]) def _configure_signals(self): """ Configures the connections between signals and UI elements. :return: """ self.startButton.clicked.connect(self.start) self.stopButton.clicked.connect(self.stop) def start(self): """ Starts the acquisition of the selected serial port. This function is connected to the clicked signal of the Start button. :return: """ self.timestamp = time() self._timer_plot.start(16) def stop(self): """ Stops the acquisition of the selected serial port. This function is connected to the clicked signal of the Stop button. :return: """ self._timer_plot.stop() # stop the Qt timer self.reset_buffers() # Go to reset the vector containing values def reset_buffers(self): self.dataR.clear() self.dataIR.clear() self.TIME.clear()