示例#1
0
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"))
示例#2
0
class Ui_Plot(object):
    def setupUi(self, Plot):
        Plot.setObjectName("Plot")
        Plot.resize(600, 600)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("graphics/icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        Plot.setWindowIcon(icon)
        Plot.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(Plot)
        self.centralwidget.setObjectName("centralwidget")
        self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
        self.gridLayout.setObjectName("gridLayout")
        self.graphicsView = GraphicsLayoutWidget(self.centralwidget)
        self.graphicsView.setStyleSheet("background-color:rgb(230, 230, 230);\n"
"color: white;\n"
"border: 1px solid white;")
        self.graphicsView.setObjectName("graphicsView")
        self.gridLayout.addWidget(self.graphicsView, 0, 0, 1, 1)
        self.horizontalSlider = QtWidgets.QSlider(self.centralwidget)
        self.horizontalSlider.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::handle:horizontal {\n"
"     background: #999999;\n"
"     border: 1px solid #5c5c5c;\n"
"     width: 18px;\n"
"     margin: -2px 0;\n"
"     border-radius: 3px;\n"
" }")
        self.horizontalSlider.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider.setObjectName("horizontalSlider")
        self.gridLayout.addWidget(self.horizontalSlider, 1, 0, 1, 1)
        Plot.setCentralWidget(self.centralwidget)

        self.retranslateUi(Plot)
        QtCore.QMetaObject.connectSlotsByName(Plot)

    def retranslateUi(self, Plot):
        _translate = QtCore.QCoreApplication.translate
        Plot.setWindowTitle(_translate("Plot", "Plot"))
示例#3
0
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"))
示例#4
0
class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(1000, 700)
        MainWindow.setStyleSheet(_fromUtf8(""))
        self.centralwidget = QtGui.QWidget(MainWindow)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.centralwidget.sizePolicy().hasHeightForWidth())
        self.centralwidget.setSizePolicy(sizePolicy)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.gridLayout = QtGui.QGridLayout(self.centralwidget)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.sidebarLeft = QtGui.QVBoxLayout()
        self.sidebarLeft.setObjectName(_fromUtf8("sidebarLeft"))
        self.simulationsBox = QtGui.QComboBox(self.centralwidget)
        self.simulationsBox.setObjectName(_fromUtf8("simulationsBox"))
        self.sidebarLeft.addWidget(self.simulationsBox)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
                                       QtGui.QSizePolicy.Expanding)
        self.sidebarLeft.addItem(spacerItem)
        self.gridLayout.addLayout(self.sidebarLeft, 0, 0, 2, 1)
        self.graphicsLayout = GraphicsLayoutWidget(self.centralwidget)
        self.graphicsLayout.setStyleSheet(_fromUtf8(""))
        self.graphicsLayout.setObjectName(_fromUtf8("graphicsLayout"))
        self.gridLayout.addWidget(self.graphicsLayout, 0, 1, 1, 1)
        self.controlbarDown = QtGui.QWidget(self.centralwidget)
        self.controlbarDown.setObjectName(_fromUtf8("controlbarDown"))
        self.controlbar = QtGui.QHBoxLayout(self.controlbarDown)
        self.controlbar.setObjectName(_fromUtf8("controlbar"))
        self.startButton = QtGui.QPushButton(self.controlbarDown)
        self.startButton.setObjectName(_fromUtf8("startButton"))
        self.controlbar.addWidget(self.startButton)
        self.stopButton = QtGui.QPushButton(self.controlbarDown)
        self.stopButton.setObjectName(_fromUtf8("stopButton"))
        self.controlbar.addWidget(self.stopButton)
        self.saveButton = QtGui.QPushButton(self.controlbarDown)
        self.saveButton.setObjectName(_fromUtf8("saveButton"))
        self.controlbar.addWidget(self.saveButton)
        self.gridLayout.addWidget(self.controlbarDown, 1, 1, 1, 1)
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1000, 25))
        self.menubar.setObjectName(_fromUtf8("menubar"))
        self.simulationMenu = QtGui.QMenu(self.menubar)
        self.simulationMenu.setObjectName(_fromUtf8("simulationMenu"))
        self.visualisationMenu = QtGui.QMenu(self.menubar)
        self.visualisationMenu.setObjectName(_fromUtf8("visualisationMenu"))
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        MainWindow.setStatusBar(self.statusbar)
        self.actionSave = QtGui.QAction(MainWindow)
        self.actionSave.setObjectName(_fromUtf8("actionSave"))
        self.actionOpen = QtGui.QAction(MainWindow)
        self.actionOpen.setObjectName(_fromUtf8("actionOpen"))
        self.actionDensity = QtGui.QAction(MainWindow)
        self.actionDensity.setObjectName(_fromUtf8("actionDensity"))
        self.actionNavigation = QtGui.QAction(MainWindow)
        self.actionNavigation.setObjectName(_fromUtf8("actionNavigation"))
        self.actionNew = QtGui.QAction(MainWindow)
        self.actionNew.setObjectName(_fromUtf8("actionNew"))
        self.simulationMenu.addAction(self.actionOpen)
        self.simulationMenu.addAction(self.actionSave)
        self.visualisationMenu.addAction(self.actionDensity)
        self.visualisationMenu.addAction(self.actionNavigation)
        self.menubar.addAction(self.simulationMenu.menuAction())
        self.menubar.addAction(self.visualisationMenu.menuAction())

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(
            _translate("MainWindow", "Crowd Dynamics", None))
        self.startButton.setText(_translate("MainWindow", "Start", None))
        self.stopButton.setText(_translate("MainWindow", "Stop", None))
        self.saveButton.setText(_translate("MainWindow", "Save", None))
        self.simulationMenu.setTitle(
            _translate("MainWindow", "Simulation", None))
        self.visualisationMenu.setTitle(
            _translate("MainWindow", "Visualisation", None))
        self.actionSave.setText(_translate("MainWindow", "Save As", None))
        self.actionOpen.setText(_translate("MainWindow", "Open", None))
        self.actionDensity.setText(_translate("MainWindow", "Density", None))
        self.actionNavigation.setText(
            _translate("MainWindow", "Navigation", None))
        self.actionNew.setText(_translate("MainWindow", "New", None))
示例#5
0
class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.setEnabled(True)
        MainWindow.resize(944, 590)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            MainWindow.sizePolicy().hasHeightForWidth())
        MainWindow.setSizePolicy(sizePolicy)
        MainWindow.setMinimumSize(QtCore.QSize(0, 0))
        MainWindow.setMaximumSize(QtCore.QSize(16777215, 16777215))
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("graphics/icon.png"), QtGui.QIcon.Normal,
                       QtGui.QIcon.Off)
        MainWindow.setWindowIcon(icon)
        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 = QtWidgets.QGridLayout(self.centralwidget)
        self.gridLayout.setObjectName("gridLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.graphicsView = GraphicsLayoutWidget(self.centralwidget)
        self.graphicsView.setStyleSheet(
            "background-color:rgb(230, 230, 230);\n"
            "color: white;\n"
            "border: 1px solid white;")
        self.graphicsView.setObjectName("graphicsView")
        self.horizontalLayout.addWidget(self.graphicsView)
        self.tableView = QtWidgets.QTableView(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Roboto")
        font.setPointSize(8)
        self.tableView.setFont(font)
        self.tableView.setStyleSheet(
            "QAbstractItemView{    \n"
            "    background: #C7CCC5;\n"
            "}\n"
            "QAbstractItemView::QScrollBar:vertical {              \n"
            "    border: 1px solid #999999;\n"
            "    background:white;\n"
            "    width:10px;    \n"
            "    margin: 0px 0px 0px 0px;\n"
            "}\n"
            "QAbstractItemView::QScrollBar::handle:vertical {\n"
            "    background: #4589b2;\n"
            "    min-height: 0px;\n"
            "}\n"
            "QAbstractItemView::QScrollBar::add-line:vertical {\n"
            "    background: #4589b2;\n"
            "    height: 0px;\n"
            "    subcontrol-position: bottom;\n"
            "    subcontrol-origin: margin;\n"
            "}\n"
            "QAbstractItemView::QScrollBar::sub-line:vertical {\n"
            "    background: #4589b2;\n"
            "    height: 0 px;\n"
            "    subcontrol-position: top;\n"
            "    subcontrol-origin: margin;\n"
            "}")
        self.tableView.setGridStyle(QtCore.Qt.NoPen)
        self.tableView.setObjectName("tableView")
        self.tableView.horizontalHeader().setDefaultSectionSize(49)
        self.tableView.verticalHeader().setDefaultSectionSize(30)
        self.horizontalLayout.addWidget(self.tableView)
        self.gridLayout.addLayout(self.horizontalLayout, 0, 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", "Debriefer"))
示例#6
0
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))
示例#7
0
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"))
示例#8
0
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"))
示例#9
0
class centralWidget(QtWidgets.QWidget):
    def __init__(self, timeData, voltsData):
        super(centralWidget, self).__init__()
        # first generating the widgets of the tab
        self.generateUiWidgets()
        # initializing important variables for plotting
        self.timeData = timeData
        self.originalVoltsData = voltsData
        self.editedVoltsData = voltsData
        self.plot = None  # original Plot
        self.plot1 = None  # plot After Editing

        self.xRangeStack = []
        self.yRangeStack = []

        self.sampleTime = timeData[1] - timeData[0]
        yrange = voltsData[len(voltsData) - 1] - voltsData[0]
        self.scrollStep_x = 100 * self.sampleTime
        self.scrollStep_y = yrange / 10

        # sliders values
        for i in range(1, 11):
            setattr(self, "_value" + str(i), 1)  # self._value[1-10] = 1

        #Pallete of spectrogram *viridis as deafult
        self.RGB_Pallete_1 = (0, 182, 188, 255)
        self.RGB_Pallete_2 = (246, 111, 0, 255)
        self.RGB_Pallete_3 = (75, 0, 113, 255)

        #set labels text
        ft = fourierTransform(self.originalVoltsData, int(1 / self.sampleTime))
        ranges = ft.rangesOfFrequancy

        for i in range(10):
            getattr(getattr(self, "label" + str(i + 1)),
                    "setText")(str(ranges[i][0] / 1000) + " Khz : \n" +
                               str(ranges[i][1] / 1000) + " Khz")

        self.HorizontalLabel1.setText("Set Minimun Frequancy")
        self.HorizontalLabel2.setText("Set Maximum Frequancy")

        # values of range of spectrogram
        self.minFreqOfSpectrogram = 0
        self.maxFreqOfSpectrogram = ranges[-1][1]

        self.horizontalSlider1.setMinimum(self.minFreqOfSpectrogram)
        self.horizontalSlider1.setMaximum(self.maxFreqOfSpectrogram)
        self.horizontalSlider1.setTickInterval(self.maxFreqOfSpectrogram / 10)

        self.horizontalSlider2.setMinimum(self.minFreqOfSpectrogram)
        self.horizontalSlider2.setMaximum(self.maxFreqOfSpectrogram)
        self.horizontalSlider2.setSliderPosition(self.maxFreqOfSpectrogram)
        self.horizontalSlider2.setTickInterval(self.maxFreqOfSpectrogram / 10)

        self.SpectrogramViewer.clear()
        self.drawSpectrogram()

        self.xRangeOfSignal = None  # [from , to]
        self.yRangeOfSignal = None

        #start plotting the data
        self.startPlotting()
        # get range of view of the plots
        self.xRangeOfSignal = [0.0, list(self.timeData)[-1]]  # [from , to]
        self.yRangeOfSignal = self.plot.viewRange()[1]

    def startPlotting(self):
        # plot original signal
        self.plot = self.OriginalSignalViewer.addPlot()
        self.plot.plot(self.timeData, self.originalVoltsData)
        # plot data After Editing
        self.plot1 = self.EditedSignalViewer.addPlot()
        self.plot1.plot(self.timeData, self.editedVoltsData)
        # range edit
        self.plot.setXRange(0.0, list(self.timeData)[-1], 0)
        self.plot1.setXRange(0.0, list(self.timeData)[-1], 0)

    def minSliderOfSpectrogram(self, value):
        self.minFreqOfSpectrogram = value
        self.SpectrogramViewer.clear()
        self.drawSpectrogram()

    def maxSliderOfSpectrogram(self, value):
        self.maxFreqOfSpectrogram = value
        self.SpectrogramViewer.clear()
        self.drawSpectrogram()

    def drawSpectrogram(self, minFreq=1, maxFreq=1):
        minFreq_Slider = self.minFreqOfSpectrogram
        maxFreq_Slider = self.maxFreqOfSpectrogram
        freq = 1 / self.sampleTime
        ft = fourierTransform(self.editedVoltsData, int(freq))
        ft.deleteRangeOfFrequancy(0, minFreq_Slider)
        ft.deleteRangeOfFrequancy(maxFreq_Slider, int(freq / 2))
        realsAfterEdit = ft.fn_InverceFourier(ft.data_fft)
        frequancyArr, timeArr, Sxx = signal.spectrogram(
            np.array(realsAfterEdit), freq)
        pyqtgraph.setConfigOptions(imageAxisOrder='row-major')

        win = self.SpectrogramViewer
        p1 = win.addPlot()

        img = pyqtgraph.ImageItem()
        p1.addItem(img)
        hist = pyqtgraph.HistogramLUTItem()
        hist.setImageItem(img)
        win.addItem(hist)
        hist.setLevels(np.min(Sxx), np.max(Sxx))
        hist.gradient.restoreState({
            'mode':
            'rgb',
            'ticks': [(0.5, self.RGB_Pallete_1), (1.0, self.RGB_Pallete_2),
                      (0.0, self.RGB_Pallete_3)]
        })
        img.setImage(Sxx)
        img.scale(timeArr[-1] / np.size(Sxx, axis=1),
                  frequancyArr[-1] / np.size(Sxx, axis=0))
        p1.setLimits(xMin=0, xMax=timeArr[-1], yMin=0, yMax=frequancyArr[-1])
        p1.setLabel('bottom', "Time", units='s')
        p1.setLabel('left', "Frequency", units='Hz')

    def generateUiWidgets(self):
        font = QtGui.QFont()
        font.setFamily("Arial Unicode MS")
        font.setPointSize(10)
        font.setBold(False)
        font.setItalic(False)
        font.setUnderline(False)
        font.setWeight(50)
        font.setStrikeOut(False)
        font.setKerning(True)
        self.setFont(font)
        self.setTabletTracking(False)
        self.gridLayout_6 = QtWidgets.QGridLayout(self)
        self.gridLayout_6.setObjectName("gridLayout_6")
        self.gridLayout_4 = QtWidgets.QGridLayout()
        self.gridLayout_4.setObjectName("gridLayout_4")
        self.SpectrogramGroupBox = QtWidgets.QGroupBox(self)
        font = QtGui.QFont()
        font.setFamily("Arial Unicode MS")
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.SpectrogramGroupBox.setFont(font)
        self.SpectrogramGroupBox.setStyleSheet(
            "border-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(255, 255, 255, 255));"
        )
        self.SpectrogramGroupBox.setObjectName("SpectrogramGroupBox")
        self.gridLayout_2 = QtWidgets.QGridLayout(self.SpectrogramGroupBox)
        self.gridLayout_2.setObjectName("gridLayout_2")

        self.horizontalSlider2 = QtWidgets.QSlider(self.SpectrogramGroupBox)
        font = QtGui.QFont()
        font.setPointSize(7)
        self.horizontalSlider2.setFont(font)
        self.horizontalSlider2.setCursor(
            QtGui.QCursor(QtCore.Qt.ClosedHandCursor))
        self.horizontalSlider2.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider2.setTickPosition(QtWidgets.QSlider.TicksBelow)
        self.horizontalSlider2.setTickInterval(1)
        self.horizontalSlider2.setObjectName("horizontalSlider2")
        self.gridLayout_2.addWidget(self.horizontalSlider2, 3, 0, 1, 1)

        self.SpectrogramViewer = GraphicsLayoutWidget(self.SpectrogramGroupBox)
        self.SpectrogramViewer.viewport().setProperty(
            "cursor", QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.SpectrogramViewer.setStyleSheet("background-color:rgb(0,0,0)")
        self.SpectrogramViewer.setObjectName("SpectrogramViewer")
        self.gridLayout_2.addWidget(self.SpectrogramViewer, 0, 0, 1, 1)

        self.horizontalSlider1 = QtWidgets.QSlider(self.SpectrogramGroupBox)
        self.horizontalSlider1.setCursor(
            QtGui.QCursor(QtCore.Qt.ClosedHandCursor))
        self.horizontalSlider1.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider1.setTickPosition(QtWidgets.QSlider.TicksBelow)
        self.horizontalSlider1.setTickInterval(1)
        self.horizontalSlider1.setObjectName("horizontalSlider1")
        self.gridLayout_2.addWidget(self.horizontalSlider1, 1, 0, 1, 1)
        self.HorizontalLabel1 = QtWidgets.QLabel(self.SpectrogramGroupBox)
        font = QtGui.QFont()
        font.setPointSize(7)
        self.HorizontalLabel1.setFont(font)
        self.HorizontalLabel1.setAlignment(QtCore.Qt.AlignCenter)
        self.HorizontalLabel1.setObjectName("HorizontalLabel1")
        self.gridLayout_2.addWidget(self.HorizontalLabel1, 2, 0, 1, 1)
        self.HorizontalLabel2 = QtWidgets.QLabel(self.SpectrogramGroupBox)
        self.HorizontalLabel2.setAlignment(QtCore.Qt.AlignCenter)
        self.HorizontalLabel2.setObjectName("HorizontalLabel2")
        self.gridLayout_2.addWidget(self.HorizontalLabel2, 4, 0, 1, 1)

        self.gridLayout_4.addWidget(self.SpectrogramGroupBox, 0, 1, 3, 1)
        self.OriginalSignalGroupbox = QtWidgets.QGroupBox(self)
        font = QtGui.QFont()
        font.setFamily("Arial Unicode MS")
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.OriginalSignalGroupbox.setFont(font)
        self.OriginalSignalGroupbox.setObjectName("OriginalSignalGroupbox")
        self.gridLayout_5 = QtWidgets.QGridLayout(self.OriginalSignalGroupbox)
        self.gridLayout_5.setObjectName("gridLayout_5")
        self.OriginalSignalViewer = GraphicsLayoutWidget(
            self.OriginalSignalGroupbox)
        self.OriginalSignalViewer.viewport().setProperty(
            "cursor", QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.OriginalSignalViewer.setStyleSheet(
            "background-color: rgb(0, 0, 0);")
        self.OriginalSignalViewer.setObjectName("OriginalSignalViewer")
        self.gridLayout_5.addWidget(self.OriginalSignalViewer, 0, 0, 1, 1)
        self.gridLayout_4.addWidget(self.OriginalSignalGroupbox, 0, 0, 1, 1)
        self.EditedSignalGroupBox = QtWidgets.QGroupBox(self)
        font = QtGui.QFont()
        font.setFamily("Arial Unicode MS")
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.EditedSignalGroupBox.setFont(font)
        self.EditedSignalGroupBox.setObjectName("EditedSignalGroupBox")
        self.gridLayout_3 = QtWidgets.QGridLayout(self.EditedSignalGroupBox)
        self.gridLayout_3.setObjectName("gridLayout_3")
        self.EditedSignalViewer = GraphicsLayoutWidget(
            self.EditedSignalGroupBox)
        self.EditedSignalViewer.viewport().setProperty(
            "cursor", QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.EditedSignalViewer.setStyleSheet("background-color:rgb(0,0,0)")
        self.EditedSignalViewer.setObjectName("EditedSignalViewer")
        self.gridLayout_3.addWidget(self.EditedSignalViewer, 0, 0, 1, 1)
        self.gridLayout_4.addWidget(self.EditedSignalGroupBox, 2, 0, 1, 1)
        self.SignalEditorGroupBox = QtWidgets.QGroupBox(self)
        font = QtGui.QFont()
        font.setFamily("Arial Unicode MS")
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.SignalEditorGroupBox.setFont(font)
        self.SignalEditorGroupBox.setObjectName("SignalEditorGroupBox")
        self.gridLayout = QtWidgets.QGridLayout(self.SignalEditorGroupBox)
        self.gridLayout.setObjectName("gridLayout")
        self.gridLayout_7 = QtWidgets.QGridLayout()
        self.gridLayout_7.setObjectName("gridLayout_7")

        # add 10 labels for 10 sliders
        for i in range(10):
            setattr(
                self, "label" + str(i + 1),
                QtWidgets.QLabel(self.SignalEditorGroupBox)
            )  # self.label[1-10] = QtWidgets.QLabel(self.SignalEditorGroupBox)
            font = QtGui.QFont()
            font.setPointSize(5)
            font.setBold(False)
            font.setWeight(50)
            getattr(getattr(self, "label" + str(i + 1)),
                    "setFont")(font)  #self.label1.setFont(font)
            getattr(getattr(self, "label" + str(i + 1)), "setObjectName")(
                "label" +
                str(i + 1))  #self.label[1-10].setObjectName("label[1-10]")
            getattr(getattr(self, "gridLayout_7"), "addWidget")(
                getattr(self, "label" + str(i + 1)), 0, i, 1,
                1)  #self.gridLayout_7.addWidget(self.label1, 0, 0, 1, 1)

        self.gridLayout.addLayout(self.gridLayout_7, 1, 0, 1, 10)

        # add 10 sliders to gui
        for i in range(10):
            setattr(
                self, "slider" + str(i + 1),
                Slider(parent=self.SignalEditorGroupBox,
                       objectName="Slider" + str(i + 1)))
            Slid = getattr(self, "slider" + str(i + 1))
            getattr(getattr(self, "gridLayout"), "addWidget")(Slid, 0, i, 1, 1)
            # link slider to the trigger function
            Slid.valueChanged.connect(lambda v: self.fn_sliderValue(v))

        self.gridLayout_4.addWidget(self.SignalEditorGroupBox, 1, 0, 1, 1)
        self.gridLayout_6.addLayout(self.gridLayout_4, 0, 0, 1, 1)

        self.horizontalSlider1.valueChanged[int].connect(
            self.minSliderOfSpectrogram)
        self.horizontalSlider2.valueChanged[int].connect(
            self.maxSliderOfSpectrogram)
        QtCore.QMetaObject.connectSlotsByName(self)

    def fn_sliderValue(self, value):
        objectName = str(self.sender().objectName())
        sliderNumber = re.search("[0-9]+", objectName).group()
        setattr(self, "_value" + sliderNumber, value)
        self.process()

    def process(self):  #(freq,complex_data,reals,time,np.abs(complex_data))
        ft = fourierTransform(
            list(self.originalVoltsData).copy(), 1 / self.sampleTime)
        complex_data = ft.gain(self._value1, self._value2, self._value3,
                               self._value4, self._value5, self._value6,
                               self._value7, self._value8, self._value9,
                               self._value10)
        reals = ft.fn_InverceFourier(complex_data)
        #update Plot
        self.EditedSignalViewer.clear()
        self.plot1 = self.EditedSignalViewer.addPlot()
        self.plot1.plot(self.timeData, reals)
        self.plot1.setXRange(self.xRangeOfSignal[0], self.xRangeOfSignal[1], 0)
        self.plot1.setYRange(self.yRangeOfSignal[0], self.yRangeOfSignal[1], 0)
        self.editedVoltsData = np.array(reals)
        # update spectrogram
        self.SpectrogramViewer.clear()
        self.drawSpectrogram()

    def playSound(self):
        ft = fourierTransform(
            list(self.editedVoltsData).copy(), 1 / self.sampleTime)
        complex_data = ft.gain(self._value1, self._value2, self._value3,
                               self._value4, self._value5, self._value6,
                               self._value7, self._value8, self._value9,
                               self._value10)
        reals = ft.fn_InverceFourier(complex_data)
        sound = soundfileUtility()
        sound.fn_CreateSoundFile(list(reals), int(1 / self.sampleTime))
        sound.fn_PlaySoundFile()
class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1920, 1080)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            MainWindow.sizePolicy().hasHeightForWidth())
        MainWindow.setSizePolicy(sizePolicy)
        MainWindow.setMinimumSize(QtCore.QSize(1920, 1080))
        MainWindow.setMaximumSize(QtCore.QSize(1920, 1080))
        MainWindow.setStyleSheet("")
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.background = QtWidgets.QLabel(self.centralwidget)
        self.background.setGeometry(QtCore.QRect(0, 0, 1920, 1080))
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.background.sizePolicy().hasHeightForWidth())
        self.background.setSizePolicy(sizePolicy)
        self.background.setMinimumSize(QtCore.QSize(1920, 1080))
        self.background.setMaximumSize(QtCore.QSize(1920, 720))
        self.background.setStyleSheet("background:#1F2429")
        self.background.setText("")
        self.background.setObjectName("background")
        self.title_1 = QtWidgets.QLabel(self.centralwidget)
        self.title_1.setGeometry(QtCore.QRect(670, 10, 161, 61))
        self.title_1.setStyleSheet("color:#1885FE;\n" "font: 30pt \"幼圆\";")
        self.title_1.setObjectName("title_1")
        self.ans_label = ClickLabel(self.centralwidget)
        self.ans_label.setGeometry(QtCore.QRect(120, 80, 1200, 700))
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.ans_label.sizePolicy().hasHeightForWidth())
        self.ans_label.setSizePolicy(sizePolicy)
        self.ans_label.setMinimumSize(QtCore.QSize(1200, 700))
        self.ans_label.setMaximumSize(QtCore.QSize(1200, 700))
        self.ans_label.setStyleSheet("background:black;")
        self.ans_label.setText("")
        self.ans_label.setObjectName("ans_label")
        self.title_2 = QtWidgets.QLabel(self.centralwidget)
        self.title_2.setGeometry(QtCore.QRect(1530, 10, 171, 51))
        self.title_2.setStyleSheet("color:#1885FE;\n" "font: 30pt \"幼圆\";")
        self.title_2.setObjectName("title_2")
        self.illegalImg1 = QtWidgets.QLabel(self.centralwidget)
        self.illegalImg1.setGeometry(QtCore.QRect(1440, 150, 350, 190))
        self.illegalImg1.setMinimumSize(QtCore.QSize(350, 190))
        self.illegalImg1.setMaximumSize(QtCore.QSize(350, 190))
        self.illegalImg1.setStyleSheet("background:black;")
        self.illegalImg1.setText("")
        self.illegalImg1.setObjectName("illegalImg1")
        self.statistic1 = QtWidgets.QLabel(self.centralwidget)
        self.statistic1.setGeometry(QtCore.QRect(120, 790, 141, 41))
        self.statistic1.setStyleSheet("color:rgb(23, 118, 147);\n"
                                      "font: 9pt \"微软雅黑\";")
        self.statistic1.setObjectName("statistic1")
        self.statistic2 = QtWidgets.QLabel(self.centralwidget)
        self.statistic2.setGeometry(QtCore.QRect(770, 790, 191, 51))
        self.statistic2.setStyleSheet("color:rgb(23, 118, 147);\n"
                                      "font: 9pt \"微软雅黑\";")
        self.statistic2.setObjectName("statistic2")
        self.plugnum1 = QtWidgets.QLabel(self.centralwidget)
        self.plugnum1.setGeometry(QtCore.QRect(110, 830, 231, 121))
        self.plugnum1.setStyleSheet("image:url(mainUI/frame2.png)")
        self.plugnum1.setText("")
        self.plugnum1.setObjectName("plugnum1")
        self.plugnum2 = QtWidgets.QLabel(self.centralwidget)
        self.plugnum2.setGeometry(QtCore.QRect(760, 830, 241, 121))
        self.plugnum2.setStyleSheet("image:url(mainUI/frame2.png)")
        self.plugnum2.setText("")
        self.plugnum2.setObjectName("plugnum2")
        self.carCountLabel = QtWidgets.QLabel(self.centralwidget)
        self.carCountLabel.setGeometry(QtCore.QRect(130, 860, 171, 51))
        self.carCountLabel.setStyleSheet(
            "background:black;color:white; text-align:center; font-size:32px; font-weight:bold;"
        )
        self.carCountLabel.setText("")
        self.carCountLabel.setObjectName("carCountLabel")
        self.peopleCountLabel = QtWidgets.QLabel(self.centralwidget)
        self.peopleCountLabel.setGeometry(QtCore.QRect(780, 860, 191, 51))
        self.peopleCountLabel.setStyleSheet(
            "background:black; color:white; text-align:center; font-size:32px; font-weight:bold;"
        )
        self.peopleCountLabel.setText("")
        self.peopleCountLabel.setObjectName("peopleCountLabel")
        self.carCountImg = GraphicsLayoutWidget(self.centralwidget)
        self.carCountImg.setGeometry(QtCore.QRect(380, 810, 250, 150))
        self.carCountImg.setMinimumSize(QtCore.QSize(250, 150))
        self.carCountImg.setMaximumSize(QtCore.QSize(251, 150))
        self.carCountImg.setStyleSheet("background:black; padding-left:0;")
        self.carCountImg.setObjectName("carCountImg")
        self.peopleCountImg = GraphicsLayoutWidget(self.centralwidget)
        self.peopleCountImg.setGeometry(QtCore.QRect(1070, 810, 250, 150))
        self.peopleCountImg.setMinimumSize(QtCore.QSize(250, 150))
        self.peopleCountImg.setMaximumSize(QtCore.QSize(250, 150))
        self.peopleCountImg.setStyleSheet("background:black;")
        self.peopleCountImg.setObjectName("peopleCountImg")
        self.label_3 = QtWidgets.QLabel(self.centralwidget)
        self.label_3.setGeometry(QtCore.QRect(1410, 120, 400, 250))
        self.label_3.setMinimumSize(QtCore.QSize(400, 250))
        self.label_3.setMaximumSize(QtCore.QSize(400, 250))
        self.label_3.setStyleSheet("image:url(mainUI/frame3.png)")
        self.label_3.setText("")
        self.label_3.setObjectName("label_3")
        self.label_4 = QtWidgets.QLabel(self.centralwidget)
        self.label_4.setGeometry(QtCore.QRect(1410, 410, 400, 250))
        self.label_4.setMinimumSize(QtCore.QSize(400, 250))
        self.label_4.setMaximumSize(QtCore.QSize(400, 250))
        self.label_4.setStyleSheet("image:url(mainUI/frame3.png)")
        self.label_4.setText("")
        self.label_4.setObjectName("label_4")
        self.label_5 = QtWidgets.QLabel(self.centralwidget)
        self.label_5.setGeometry(QtCore.QRect(1410, 710, 400, 250))
        self.label_5.setMinimumSize(QtCore.QSize(400, 250))
        self.label_5.setMaximumSize(QtCore.QSize(400, 250))
        self.label_5.setStyleSheet("image:url(mainUI/frame3.png)")
        self.label_5.setText("")
        self.label_5.setObjectName("label_5")
        self.illegalImg2 = QtWidgets.QLabel(self.centralwidget)
        self.illegalImg2.setGeometry(QtCore.QRect(1440, 440, 350, 190))
        self.illegalImg2.setMinimumSize(QtCore.QSize(350, 190))
        self.illegalImg2.setMaximumSize(QtCore.QSize(350, 190))
        self.illegalImg2.setStyleSheet("background:black;")
        self.illegalImg2.setText("")
        self.illegalImg2.setObjectName("illegalImg2")
        self.illegalImg3 = QtWidgets.QLabel(self.centralwidget)
        self.illegalImg3.setGeometry(QtCore.QRect(1440, 740, 350, 190))
        self.illegalImg3.setMinimumSize(QtCore.QSize(350, 190))
        self.illegalImg3.setMaximumSize(QtCore.QSize(350, 190))
        self.illegalImg3.setStyleSheet("background:balck;")
        self.illegalImg3.setText("")
        self.illegalImg3.setObjectName("illegalImg3")
        self.start_Button = QtWidgets.QPushButton(self.centralwidget)
        self.start_Button.setGeometry(QtCore.QRect(0, 940, 70, 70))
        self.start_Button.setMinimumSize(QtCore.QSize(70, 70))
        self.start_Button.setMaximumSize(QtCore.QSize(70, 70))
        self.start_Button.setStyleSheet("image:url(mainUI/left.png);\n"
                                        "background: transparent;\n"
                                        "border-radius:40px;")
        self.start_Button.setText("")
        self.start_Button.setObjectName("start_Button")
        MainWindow.setCentralWidget(self.centralwidget)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.title_1.setText(
            _translate(
                "MainWindow",
                "<html><head/><body><p><span style=\" font-weight:600;\">交通检测</span></p></body></html>"
            ))
        self.title_2.setText(
            _translate(
                "MainWindow",
                "<html><head/><body><p><span style=\" font-weight:600;\">违章检测</span></p></body></html>"
            ))
        self.statistic1.setText(
            _translate(
                "MainWindow",
                "<html><head/><body><p><span style=\" font-size:12pt;\">&gt;&gt;当前车流量</span></p></body></html>"
            ))
        self.statistic2.setText(
            _translate(
                "MainWindow",
                "<html><head/><body><p><span style=\" font-size:12pt;\">&gt;&gt;当前人流量</span></p></body></html>"
            ))
示例#11
0
文件: gui.py 项目: tnorth/RTGraph
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))
示例#12
0
class Ui_SingleWindow(object):
    def setupUi(self, MainWindow):
        if MainWindow.objectName():
            MainWindow.setObjectName(u"MainWindow")
        MainWindow.resize(760, 900)
        sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            MainWindow.sizePolicy().hasHeightForWidth())
        MainWindow.setSizePolicy(sizePolicy)
        icon = QIcon()
        icon.addFile(u"../src/ui/icons/wood.svg", QSize(), QIcon.Normal,
                     QIcon.Off)
        MainWindow.setWindowIcon(icon)
        self.centralwidget = QWidget(MainWindow)
        self.centralwidget.setObjectName(u"centralwidget")
        self.centralwidget.setMinimumSize(QSize(0, 0))
        self.centralwidget.setStyleSheet(
            u"background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(62, 101, 190, 255), stop:1 rgba(81, 47, 154, 255));\n"
            "border-radius: 10px;")
        self.verticalLayout = QVBoxLayout(self.centralwidget)
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.frame = QFrame(self.centralwidget)
        self.frame.setObjectName(u"frame")
        self.frame.setStyleSheet(u"background-color: rgba(255, 255, 255, 0);")
        self.frame.setFrameShape(QFrame.StyledPanel)
        self.frame.setFrameShadow(QFrame.Raised)
        self.verticalLayout_2 = QVBoxLayout(self.frame)
        self.verticalLayout_2.setSpacing(6)
        self.verticalLayout_2.setObjectName(u"verticalLayout_2")
        self.verticalLayout_2.setContentsMargins(18, 18, 18, 18)
        self.title_label = QLabel(self.frame)
        self.title_label.setObjectName(u"title_label")
        sizePolicy1 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        sizePolicy1.setHorizontalStretch(0)
        sizePolicy1.setVerticalStretch(0)
        sizePolicy1.setHeightForWidth(
            self.title_label.sizePolicy().hasHeightForWidth())
        self.title_label.setSizePolicy(sizePolicy1)
        font = QFont()
        font.setFamily(u"Segoe UI Light")
        font.setPointSize(16)
        font.setBold(True)
        font.setWeight(75)
        self.title_label.setFont(font)
        self.title_label.setStyleSheet(u"background-color: rgba(0, 0, 0, 0);\n"
                                       "color: rgb(255, 255, 255);\n"
                                       "font-size: 16pt;\n"
                                       'font-family: "Segoe UI Light";')

        self.verticalLayout_2.addWidget(self.title_label)

        self.message_label = QLabel(self.frame)
        self.message_label.setObjectName(u"message_label")
        sizePolicy1.setHeightForWidth(
            self.message_label.sizePolicy().hasHeightForWidth())
        self.message_label.setSizePolicy(sizePolicy1)
        self.message_label.setStyleSheet(
            u"background-color: rgba(0, 0, 0, 0);\n"
            "color: rgb(255, 255, 255);\n"
            "font-size: 14pt;\n"
            'font-family: "Segoe UI Light";')

        self.verticalLayout_2.addWidget(self.message_label)

        self.frame_3 = QFrame(self.frame)
        self.frame_3.setObjectName(u"frame_3")
        self.frame_3.setStyleSheet(u"background-color: rgb(255, 255, 255);\n"
                                   "border-radius: 17.0px;\n"
                                   "margin-top: 15px;\n"
                                   "margin-bottom: 15px;")
        self.frame_3.setFrameShape(QFrame.StyledPanel)
        self.frame_3.setFrameShadow(QFrame.Raised)
        self.verticalLayout_3 = QVBoxLayout(self.frame_3)
        self.verticalLayout_3.setSpacing(0)
        self.verticalLayout_3.setObjectName(u"verticalLayout_3")
        self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
        self.plot_view = GraphicsLayoutWidget(self.frame_3)
        self.plot_view.setObjectName(u"plot_view")
        self.plot_view.setStyleSheet(u"")

        self.verticalLayout_3.addWidget(self.plot_view)

        self.results_label = QLabel(self.frame_3)
        self.results_label.setObjectName(u"results_label")
        sizePolicy1.setHeightForWidth(
            self.results_label.sizePolicy().hasHeightForWidth())
        self.results_label.setSizePolicy(sizePolicy1)
        self.results_label.setStyleSheet(u"color: rgb(0, 0, 0);\n"
                                         "font-size: 14pt;\n"
                                         'font-family: "Segoe UI Light";')

        self.verticalLayout_3.addWidget(self.results_label, 0, Qt.AlignHCenter)

        self.verticalLayout_2.addWidget(self.frame_3)

        self.frame_2 = QFrame(self.frame)
        self.frame_2.setObjectName(u"frame_2")
        sizePolicy1.setHeightForWidth(
            self.frame_2.sizePolicy().hasHeightForWidth())
        self.frame_2.setSizePolicy(sizePolicy1)
        self.frame_2.setFrameShape(QFrame.StyledPanel)
        self.frame_2.setFrameShadow(QFrame.Raised)
        self.horizontalLayout = QHBoxLayout(self.frame_2)
        self.horizontalLayout.setObjectName(u"horizontalLayout")
        self.horizontalLayout.setContentsMargins(0, -1, 0, -1)
        self.close_button = QPushButton(self.frame_2)
        self.close_button.setObjectName(u"close_button")
        self.close_button.setStyleSheet(
            u"QPushButton {\n"
            "color: #ffffff;\n"
            "background-color: rgb(255, 0, 127);\n"
            "height: 30px;\n"
            "padding-left: 10px;\n"
            "padding-bottom: 5px;\n"
            "border-radius: 17.0px;\n"
            "font-size: 12pt;\n"
            'font-family: "Segoe UI Light";\n'
            "}\n"
            "\n"
            "QPushButton:hover {\n"
            "border: 2px solid rgb(255, 255, 255)\n"
            "}\n"
            "\n"
            "QPushButton:pressed {\n"
            "color: rgba(255, 255, 255, 0.5);\n"
            "background-color: rgba(255, 0, 127, 0.5);\n"
            "}")

        self.horizontalLayout.addWidget(self.close_button)

        self.browse_button = QPushButton(self.frame_2)
        self.browse_button.setObjectName(u"browse_button")
        self.browse_button.setStyleSheet(
            u"QPushButton {\n"
            "color: #ffffff;\n"
            "background-color: rgb(0, 221, 51);\n"
            "height: 30px;\n"
            "padding-left: 10px;\n"
            "padding-bottom: 5px;\n"
            "border-radius: 17.0px;\n"
            "font-size: 12pt;\n"
            'font-family: "Segoe UI Light";\n'
            "}\n"
            "\n"
            "QPushButton:hover {\n"
            "border: 2px solid rgb(255, 255, 255)\n"
            "}\n"
            "\n"
            "QPushButton:pressed {\n"
            "color: rgba(255, 255, 255, 0.5);\n"
            "background-color: rgba(0, 221, 51, 0.5);\n"
            "}")

        self.horizontalLayout.addWidget(self.browse_button)

        self.verticalLayout_2.addWidget(self.frame_2)

        self.verticalLayout.addWidget(self.frame)

        self.footer = QLabel(self.centralwidget)
        self.footer.setObjectName(u"footer")
        sizePolicy.setHeightForWidth(
            self.footer.sizePolicy().hasHeightForWidth())
        self.footer.setSizePolicy(sizePolicy)
        self.footer.setStyleSheet(
            u"background-color: rgba(255, 255, 255, 0);\n"
            "color: rgb(255, 255, 255);")

        self.verticalLayout.addWidget(self.footer, 0, Qt.AlignHCenter)

        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)

        QMetaObject.connectSlotsByName(MainWindow)

    # setupUi

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(
            QCoreApplication.translate("MainWindow",
                                       u"HARDIS | Single analysis", None))
        self.title_label.setText(
            QCoreApplication.translate("MainWindow", u"Single analysis", None))
        self.message_label.setText(
            QCoreApplication.translate(
                "MainWindow", u"Upload a file and select a cutting range",
                None))
        self.results_label.setText("")
        self.close_button.setText(
            QCoreApplication.translate("MainWindow", u"Close", None))
        self.browse_button.setText(
            QCoreApplication.translate("MainWindow", u"Browse", None))
        self.footer.setText(
            QCoreApplication.translate(
                "MainWindow",
                u"All Rights Reserved \u00a9 2021 Kompetenzzentrum Holz GmbH",
                None,
            ))
示例#13
0
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 &gt;= 0 and t&lt;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 &gt;= 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"))
示例#14
0
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()