Beispiel #1
0
class Ui_CalibWindow(QtGui.QMainWindow):
    def setupUi(self, CalibWindow):
        CalibWindow.setObjectName(_fromUtf8("CalibWindow"))
        CalibWindow.resize(800, 600)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(CalibWindow.sizePolicy().hasHeightForWidth())
        CalibWindow.setSizePolicy(sizePolicy)
        self.centralwidget = QtGui.QWidget(CalibWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.gridLayout_2 = QtGui.QGridLayout(self.centralwidget)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.setButton = QtGui.QPushButton(self.centralwidget)
        self.setButton.setObjectName(_fromUtf8("setButton"))
        self.gridLayout_2.addWidget(self.setButton, 0, 0, 1, 1)
        self.playButton = QtGui.QPushButton(self.centralwidget)
        self.playButton.setObjectName(_fromUtf8("playButton"))
        self.gridLayout_2.addWidget(self.playButton, 0, 1, 1, 1)
        self.calibButton = QtGui.QPushButton(self.centralwidget)
        self.calibButton.setObjectName(_fromUtf8("calibButton"))
        self.gridLayout_2.addWidget(self.calibButton, 0, 2, 1, 1)
        self.saveButton = QtGui.QPushButton(self.centralwidget)
        self.saveButton.setObjectName(_fromUtf8("saveButton"))
        self.gridLayout_2.addWidget(self.saveButton, 0, 3, 1, 1)
        self.mplCanvas = MplCanvas(self.centralwidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.mplCanvas.sizePolicy().hasHeightForWidth())
        self.mplCanvas.setSizePolicy(sizePolicy)
        self.mplCanvas.setObjectName(_fromUtf8("mplCanvas"))
        self.gridLayout_2.addWidget(self.mplCanvas, 1, 0, 1, 4)
        CalibWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(CalibWindow)
        self.menubar.setEnabled(False)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 23))
        self.menubar.setObjectName(_fromUtf8("menubar"))
        CalibWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(CalibWindow)
        self.statusbar.setEnabled(False)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        CalibWindow.setStatusBar(self.statusbar)

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

    def retranslateUi(self, CalibWindow):
        CalibWindow.setWindowTitle(_translate("CalibWindow", "Python标定程序", None))
        self.setButton.setText(_translate("CalibWindow", "Set", None))
        self.playButton.setText(_translate("CalibWindow", "Play", None))
        self.calibButton.setText(_translate("CalibWindow", "Calibrate", None))
        self.saveButton.setText(_translate("CalibWindow", "Save", None))
Beispiel #2
0
    def __init__(self):
        super().__init__()
        self.mui = Ui_mWin()
        self.mui.setupUi(self)
        self.setFixedSize(730, 450)
        self.setWindowIcon(QIcon('app.png'))

        self.plot_canvas = MplCanvas()
        self.navTBar = NavTBar(self.plot_canvas, self)
        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(self.navTBar)
        layout.addWidget(self.plot_canvas)
        self.mui.wgPlot.setLayout(layout)

        self.mui.btnSolve.clicked.connect(self.solve)
Beispiel #3
0
    def setupGUI_Iots(self):
        self.mqttc = mqtt.Client()
        self.mqttc.on_message = self.on_iot_message
        self.mqttc.on_publish = self.on_iot_publish
        self.mqttc.connect("127.0.0.1", 1883, 60)
        self.mqttc.subscribe("demo/test", qos=0)
        self.mqttc.loop_start()

        self.iot_canvas = MplCanvas(self.ui.iot_widget,
                                    width=8.0,
                                    height=1.6,
                                    dpi=100)
        self.ui.temp_label.setStyleSheet("color: red")
        self.ui.humid_label.setStyleSheet("color: blue")

        self.timer_alarm = QTimer(self)
        self.timer_alarm.timeout.connect(self.alarming_message)
        self.timer_alarm.setInterval(3000)
        self.timer_alarm.start()
Beispiel #4
0
    def __init__(self):
        super(base_summary, self).__init__()
        self.setupUi(self)

        r = requests.get('http://%s:%s/get_results/' %
                         (globals.server_ip, globals.server_port))
        if r.status_code == 200:
            results = r.json()
            results = sorted(results.items(),
                             key=lambda item: item[1],
                             reverse=True)

            results_keys = []
            results_values = []
            for result in results:
                results_keys.append('《' + result[0] + '》')
                results_values.append(result[1])

            if len(results_keys) < 5:
                for i in range(5 - len(results_keys)):
                    results_keys.append('')
                    results_values.append(0)

            print(results_keys)
            print(results_values)

            x_list = (list(range(len(results_keys))))
            sc = MplCanvas(self.widget,
                           width=globals.screen_width * 3 / 4,
                           height=globals.screen_height * 4 / 5,
                           dpi=100)
            sc_width = globals.screen_width * 5 / 6
            sc_height = globals.screen_height * 5 / 6
            sc.setGeometry((globals.screen_width - sc_width) / 2,
                           (globals.screen_height - sc_height) / 2, sc_width,
                           sc_height)
            sc.axes.set_position([0.1, 0.1, 0.8, 0.8])
            sc.axes.set_yticks(x_list)
            sc.axes.set_yticklabels(results_keys)
            for i, v in enumerate(results_values):
                sc.axes.text(v + .2,
                             i + .25,
                             str(v),
                             color='blue',
                             fontweight='bold')
            sc.axes.invert_yaxis()
            bar_list = sc.axes.barh(x_list, results_values)
            bar_list[0].set_color('orangered')
            bar_list[1].set_color('yellow')
            bar_list[2].set_color('cyan')
            self.widget.setGeometry(0, 0, globals.screen_width,
                                    globals.screen_height)
            sc.setParent(self.widget)
Beispiel #5
0
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1186, 929)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.centralwidget)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_3.setSizeConstraint(
            QtWidgets.QLayout.SetMinimumSize)
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.widget_6 = QtWidgets.QWidget(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.widget_6.sizePolicy().hasHeightForWidth())
        self.widget_6.setSizePolicy(sizePolicy)
        self.widget_6.setMaximumSize(QtCore.QSize(16777215, 80))
        self.widget_6.setObjectName("widget_6")
        self.layoutWidget = QtWidgets.QWidget(self.widget_6)
        self.layoutWidget.setGeometry(QtCore.QRect(0, 0, 1161, 51))
        self.layoutWidget.setObjectName("layoutWidget")
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.layoutWidget)
        self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.label = QtWidgets.QLabel(self.layoutWidget)
        self.label.setMaximumSize(QtCore.QSize(200, 16777215))
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(16)
        self.label.setFont(font)
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName("label")
        self.horizontalLayout_4.addWidget(self.label)
        self.label_2 = QtWidgets.QLabel(self.layoutWidget)
        self.label_2.setMaximumSize(QtCore.QSize(150, 16777215))
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(16)
        self.label_2.setFont(font)
        self.label_2.setAlignment(QtCore.Qt.AlignCenter)
        self.label_2.setObjectName("label_2")
        self.horizontalLayout_4.addWidget(self.label_2)
        self.plane_1_label = QtWidgets.QLabel(self.layoutWidget)
        self.plane_1_label.setMaximumSize(QtCore.QSize(196, 16777215))
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(16)
        self.plane_1_label.setFont(font)
        self.plane_1_label.setAlignment(QtCore.Qt.AlignCenter)
        self.plane_1_label.setObjectName("plane_1_label")
        self.horizontalLayout_4.addWidget(self.plane_1_label)
        self.plane_2_label = QtWidgets.QLabel(self.layoutWidget)
        self.plane_2_label.setMaximumSize(QtCore.QSize(196, 16777215))
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(16)
        self.plane_2_label.setFont(font)
        self.plane_2_label.setAlignment(QtCore.Qt.AlignCenter)
        self.plane_2_label.setObjectName("plane_2_label")
        self.horizontalLayout_4.addWidget(self.plane_2_label)
        self.plane_3_label = QtWidgets.QLabel(self.layoutWidget)
        self.plane_3_label.setMaximumSize(QtCore.QSize(196, 16777215))
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(16)
        self.plane_3_label.setFont(font)
        self.plane_3_label.setAlignment(QtCore.Qt.AlignCenter)
        self.plane_3_label.setObjectName("plane_3_label")
        self.horizontalLayout_4.addWidget(self.plane_3_label)
        self.mixed_plane_label = QtWidgets.QLabel(self.layoutWidget)
        self.mixed_plane_label.setMaximumSize(QtCore.QSize(196, 16777215))
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(16)
        self.mixed_plane_label.setFont(font)
        self.mixed_plane_label.setAlignment(QtCore.Qt.AlignCenter)
        self.mixed_plane_label.setObjectName("mixed_plane_label")
        self.horizontalLayout_4.addWidget(self.mixed_plane_label)
        self.horizontalLayout_3.addWidget(self.widget_6)
        self.verticalLayout.addLayout(self.horizontalLayout_3)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.raw = MplCanvas(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.raw.sizePolicy().hasHeightForWidth())
        self.raw.setSizePolicy(sizePolicy)
        self.raw.setMaximumSize(QtCore.QSize(200, 250))
        self.raw.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.raw.setObjectName("raw")
        self.horizontalLayout.addWidget(self.raw)
        self.widget_4 = QtWidgets.QWidget(self.centralwidget)
        self.widget_4.setMaximumSize(QtCore.QSize(149, 250))
        self.widget_4.setObjectName("widget_4")
        self.layoutWidget1 = QtWidgets.QWidget(self.widget_4)
        self.layoutWidget1.setGeometry(QtCore.QRect(0, 0, 141, 221))
        self.layoutWidget1.setObjectName("layoutWidget1")
        self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.layoutWidget1)
        self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.rgbBtn = QtWidgets.QRadioButton(self.layoutWidget1)
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(16)
        self.rgbBtn.setFont(font)
        self.rgbBtn.setChecked(True)
        self.rgbBtn.setObjectName("rgbBtn")
        self.plane_btns = QtWidgets.QButtonGroup(MainWindow)
        self.plane_btns.setObjectName("plane_btns")
        self.plane_btns.addButton(self.rgbBtn)
        self.verticalLayout_3.addWidget(self.rgbBtn)
        self.cmyBtn = QtWidgets.QRadioButton(self.layoutWidget1)
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(16)
        self.cmyBtn.setFont(font)
        self.cmyBtn.setObjectName("cmyBtn")
        self.plane_btns.addButton(self.cmyBtn)
        self.verticalLayout_3.addWidget(self.cmyBtn)
        self.hsiBtn = QtWidgets.QRadioButton(self.layoutWidget1)
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(16)
        self.hsiBtn.setFont(font)
        self.hsiBtn.setObjectName("hsiBtn")
        self.plane_btns.addButton(self.hsiBtn)
        self.verticalLayout_3.addWidget(self.hsiBtn)
        self.xyzBtn = QtWidgets.QRadioButton(self.layoutWidget1)
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(16)
        self.xyzBtn.setFont(font)
        self.xyzBtn.setObjectName("xyzBtn")
        self.plane_btns.addButton(self.xyzBtn)
        self.verticalLayout_3.addWidget(self.xyzBtn)
        self.labBtn = QtWidgets.QRadioButton(self.layoutWidget1)
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(16)
        self.labBtn.setFont(font)
        self.labBtn.setObjectName("labBtn")
        self.plane_btns.addButton(self.labBtn)
        self.verticalLayout_3.addWidget(self.labBtn)
        self.yuvBtn = QtWidgets.QRadioButton(self.layoutWidget1)
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(16)
        self.yuvBtn.setFont(font)
        self.yuvBtn.setObjectName("yuvBtn")
        self.plane_btns.addButton(self.yuvBtn)
        self.verticalLayout_3.addWidget(self.yuvBtn)
        self.apply_1 = QtWidgets.QPushButton(self.layoutWidget1)
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(14)
        self.apply_1.setFont(font)
        self.apply_1.setObjectName("apply_1")
        self.verticalLayout_3.addWidget(self.apply_1)
        self.horizontalLayout.addWidget(self.widget_4)
        self.plane1 = MplCanvas(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.plane1.sizePolicy().hasHeightForWidth())
        self.plane1.setSizePolicy(sizePolicy)
        self.plane1.setMaximumSize(QtCore.QSize(196, 250))
        self.plane1.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.plane1.setObjectName("plane1")
        self.horizontalLayout.addWidget(self.plane1)
        self.plane2 = MplCanvas(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.plane2.sizePolicy().hasHeightForWidth())
        self.plane2.setSizePolicy(sizePolicy)
        self.plane2.setMaximumSize(QtCore.QSize(196, 250))
        self.plane2.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.plane2.setObjectName("plane2")
        self.horizontalLayout.addWidget(self.plane2)
        self.plane3 = MplCanvas(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.plane3.sizePolicy().hasHeightForWidth())
        self.plane3.setSizePolicy(sizePolicy)
        self.plane3.setMaximumSize(QtCore.QSize(196, 250))
        self.plane3.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.plane3.setObjectName("plane3")
        self.horizontalLayout.addWidget(self.plane3)
        self.mixed_plane = MplCanvas(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.mixed_plane.sizePolicy().hasHeightForWidth())
        self.mixed_plane.setSizePolicy(sizePolicy)
        self.mixed_plane.setMaximumSize(QtCore.QSize(196, 250))
        self.mixed_plane.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.mixed_plane.setObjectName("mixed_plane")
        self.horizontalLayout.addWidget(self.mixed_plane)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.horizontalLayout_8 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_8.setObjectName("horizontalLayout_8")
        self.pseudo_processed = MplCanvas(self.centralwidget)
        self.pseudo_processed.setMaximumSize(QtCore.QSize(200, 250))
        self.pseudo_processed.setObjectName("pseudo_processed")
        self.horizontalLayout_8.addWidget(self.pseudo_processed)
        self.widget_7 = QtWidgets.QWidget(self.centralwidget)
        self.widget_7.setMaximumSize(QtCore.QSize(150, 16777215))
        self.widget_7.setObjectName("widget_7")
        self.layoutWidget_3 = QtWidgets.QWidget(self.widget_7)
        self.layoutWidget_3.setGeometry(QtCore.QRect(0, 0, 143, 211))
        self.layoutWidget_3.setObjectName("layoutWidget_3")
        self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.layoutWidget_3)
        self.verticalLayout_5.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout_5.setObjectName("verticalLayout_5")
        self.autumn = QtWidgets.QRadioButton(self.layoutWidget_3)
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(16)
        self.autumn.setFont(font)
        self.autumn.setChecked(True)
        self.autumn.setObjectName("autumn")
        self.pseudo_group = QtWidgets.QButtonGroup(MainWindow)
        self.pseudo_group.setObjectName("pseudo_group")
        self.pseudo_group.addButton(self.autumn)
        self.verticalLayout_5.addWidget(self.autumn)
        self.jet = QtWidgets.QRadioButton(self.layoutWidget_3)
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(16)
        self.jet.setFont(font)
        self.jet.setObjectName("jet")
        self.pseudo_group.addButton(self.jet)
        self.verticalLayout_5.addWidget(self.jet)
        self.rainbow = QtWidgets.QRadioButton(self.layoutWidget_3)
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(16)
        self.rainbow.setFont(font)
        self.rainbow.setObjectName("rainbow")
        self.pseudo_group.addButton(self.rainbow)
        self.verticalLayout_5.addWidget(self.rainbow)
        self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_5.setObjectName("horizontalLayout_5")
        self.radioButton = QtWidgets.QRadioButton(self.layoutWidget_3)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.radioButton.sizePolicy().hasHeightForWidth())
        self.radioButton.setSizePolicy(sizePolicy)
        self.radioButton.setMaximumSize(QtCore.QSize(70, 28))
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(12)
        self.radioButton.setFont(font)
        self.radioButton.setObjectName("radioButton")
        self.pseudo_group.addButton(self.radioButton)
        self.horizontalLayout_5.addWidget(self.radioButton)
        self.color_widget_1 = QtWidgets.QWidget(self.layoutWidget_3)
        self.color_widget_1.setMaximumSize(QtCore.QSize(15, 28))
        self.color_widget_1.setStyleSheet(
            "background-color: rgb(255, 255, 255);")
        self.color_widget_1.setObjectName("color_widget_1")
        self.horizontalLayout_5.addWidget(self.color_widget_1)
        self.color_widget_2 = QtWidgets.QWidget(self.layoutWidget_3)
        self.color_widget_2.setMaximumSize(QtCore.QSize(15, 28))
        self.color_widget_2.setStyleSheet("background-color: rgb(0, 0, 0);")
        self.color_widget_2.setObjectName("color_widget_2")
        self.horizontalLayout_5.addWidget(self.color_widget_2)
        self.verticalLayout_5.addLayout(self.horizontalLayout_5)
        self.c_level = QtWidgets.QSpinBox(self.layoutWidget_3)
        self.c_level.setMaximumSize(QtCore.QSize(122, 28))
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(16)
        self.c_level.setFont(font)
        self.c_level.setMinimum(2)
        self.c_level.setMaximum(5)
        self.c_level.setProperty("value", 2)
        self.c_level.setObjectName("c_level")
        self.verticalLayout_5.addWidget(self.c_level)
        self.apply_2 = QtWidgets.QPushButton(self.layoutWidget_3)
        self.apply_2.setMaximumSize(QtCore.QSize(16777215, 28))
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(16)
        self.apply_2.setFont(font)
        self.apply_2.setObjectName("apply_2")
        self.verticalLayout_5.addWidget(self.apply_2)
        self.horizontalLayout_8.addWidget(self.widget_7)
        self.pseudo1 = MplCanvas(self.centralwidget)
        self.pseudo1.setMaximumSize(QtCore.QSize(196, 250))
        self.pseudo1.setObjectName("pseudo1")
        self.horizontalLayout_8.addWidget(self.pseudo1)
        self.pseudo2 = MplCanvas(self.centralwidget)
        self.pseudo2.setMaximumSize(QtCore.QSize(196, 250))
        self.pseudo2.setObjectName("pseudo2")
        self.horizontalLayout_8.addWidget(self.pseudo2)
        self.pseudo3 = MplCanvas(self.centralwidget)
        self.pseudo3.setMaximumSize(QtCore.QSize(196, 250))
        self.pseudo3.setObjectName("pseudo3")
        self.horizontalLayout_8.addWidget(self.pseudo3)
        self.mixed_pseudo = MplCanvas(self.centralwidget)
        self.mixed_pseudo.setMaximumSize(QtCore.QSize(196, 250))
        self.mixed_pseudo.setObjectName("mixed_pseudo")
        self.horizontalLayout_8.addWidget(self.mixed_pseudo)
        self.verticalLayout.addLayout(self.horizontalLayout_8)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.kmeans_processed = MplCanvas(self.centralwidget)
        self.kmeans_processed.setMaximumSize(QtCore.QSize(200, 250))
        self.kmeans_processed.setObjectName("kmeans_processed")
        self.horizontalLayout_2.addWidget(self.kmeans_processed)
        self.widget_3 = QtWidgets.QWidget(self.centralwidget)
        self.widget_3.setMaximumSize(QtCore.QSize(150, 16777215))
        self.widget_3.setObjectName("widget_3")
        self.layoutWidget_2 = QtWidgets.QWidget(self.widget_3)
        self.layoutWidget_2.setGeometry(QtCore.QRect(0, 0, 141, 231))
        self.layoutWidget_2.setObjectName("layoutWidget_2")
        self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.layoutWidget_2)
        self.verticalLayout_4.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout_4.setObjectName("verticalLayout_4")
        self.rgbBtn_3 = QtWidgets.QRadioButton(self.layoutWidget_2)
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(12)
        self.rgbBtn_3.setFont(font)
        self.rgbBtn_3.setChecked(True)
        self.rgbBtn_3.setObjectName("rgbBtn_3")
        self.btns_2 = QtWidgets.QButtonGroup(MainWindow)
        self.btns_2.setObjectName("btns_2")
        self.btns_2.addButton(self.rgbBtn_3)
        self.verticalLayout_4.addWidget(self.rgbBtn_3)
        self.cmyBtn_3 = QtWidgets.QRadioButton(self.layoutWidget_2)
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(12)
        self.cmyBtn_3.setFont(font)
        self.cmyBtn_3.setObjectName("cmyBtn_3")
        self.btns_2.addButton(self.cmyBtn_3)
        self.verticalLayout_4.addWidget(self.cmyBtn_3)
        self.hsiBtn_3 = QtWidgets.QRadioButton(self.layoutWidget_2)
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(12)
        self.hsiBtn_3.setFont(font)
        self.hsiBtn_3.setObjectName("hsiBtn_3")
        self.btns_2.addButton(self.hsiBtn_3)
        self.verticalLayout_4.addWidget(self.hsiBtn_3)
        self.xyzBtn_3 = QtWidgets.QRadioButton(self.layoutWidget_2)
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(12)
        self.xyzBtn_3.setFont(font)
        self.xyzBtn_3.setObjectName("xyzBtn_3")
        self.btns_2.addButton(self.xyzBtn_3)
        self.verticalLayout_4.addWidget(self.xyzBtn_3)
        self.labBtn_3 = QtWidgets.QRadioButton(self.layoutWidget_2)
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(12)
        self.labBtn_3.setFont(font)
        self.labBtn_3.setObjectName("labBtn_3")
        self.btns_2.addButton(self.labBtn_3)
        self.verticalLayout_4.addWidget(self.labBtn_3)
        self.yuvBtn_3 = QtWidgets.QRadioButton(self.layoutWidget_2)
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(12)
        self.yuvBtn_3.setFont(font)
        self.yuvBtn_3.setObjectName("yuvBtn_3")
        self.btns_2.addButton(self.yuvBtn_3)
        self.verticalLayout_4.addWidget(self.yuvBtn_3)
        self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_7.setObjectName("horizontalLayout_7")
        self.label_8 = QtWidgets.QLabel(self.layoutWidget_2)
        self.label_8.setMaximumSize(QtCore.QSize(22, 22))
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(12)
        self.label_8.setFont(font)
        self.label_8.setAlignment(QtCore.Qt.AlignCenter)
        self.label_8.setObjectName("label_8")
        self.horizontalLayout_7.addWidget(self.label_8)
        self.k_level = QtWidgets.QSpinBox(self.layoutWidget_2)
        self.k_level.setMaximumSize(QtCore.QSize(89, 22))
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(12)
        self.k_level.setFont(font)
        self.k_level.setMinimum(2)
        self.k_level.setMaximum(5)
        self.k_level.setProperty("value", 2)
        self.k_level.setObjectName("k_level")
        self.horizontalLayout_7.addWidget(self.k_level)
        self.verticalLayout_4.addLayout(self.horizontalLayout_7)
        self.apply_3 = QtWidgets.QPushButton(self.layoutWidget_2)
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(12)
        self.apply_3.setFont(font)
        self.apply_3.setObjectName("apply_3")
        self.verticalLayout_4.addWidget(self.apply_3)
        self.horizontalLayout_2.addWidget(self.widget_3)
        self.kplane1 = MplCanvas(self.centralwidget)
        self.kplane1.setMaximumSize(QtCore.QSize(196, 250))
        self.kplane1.setObjectName("kplane1")
        self.horizontalLayout_2.addWidget(self.kplane1)
        self.kplane2 = MplCanvas(self.centralwidget)
        self.kplane2.setMaximumSize(QtCore.QSize(196, 250))
        self.kplane2.setObjectName("kplane2")
        self.horizontalLayout_2.addWidget(self.kplane2)
        self.kplane3 = MplCanvas(self.centralwidget)
        self.kplane3.setMaximumSize(QtCore.QSize(196, 250))
        self.kplane3.setObjectName("kplane3")
        self.horizontalLayout_2.addWidget(self.kplane3)
        self.mixed_kplane = MplCanvas(self.centralwidget)
        self.mixed_kplane.setMaximumSize(QtCore.QSize(196, 250))
        self.mixed_kplane.setObjectName("mixed_kplane")
        self.horizontalLayout_2.addWidget(self.mixed_kplane)
        self.verticalLayout.addLayout(self.horizontalLayout_2)
        self.verticalLayout_2.addLayout(self.verticalLayout)
        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
Beispiel #6
0
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(885, 760)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.raw = MplCanvas(self.centralwidget)
        self.raw.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.raw.setObjectName("raw")
        self.horizontalLayout_3.addWidget(self.raw)
        self.processed = MplCanvas(self.centralwidget)
        self.processed.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.processed.setObjectName("processed")
        self.horizontalLayout_3.addWidget(self.processed)
        self.verticalLayout.addLayout(self.horizontalLayout_3)
        self.widget = QtWidgets.QWidget(self.centralwidget)
        self.widget.setMaximumSize(QtCore.QSize(16777215, 320))
        self.widget.setObjectName("widget")
        self.tableWidget = QtWidgets.QTableWidget(self.widget)
        self.tableWidget.setGeometry(QtCore.QRect(50, 0, 270, 270))
        self.tableWidget.setMaximumSize(QtCore.QSize(270, 270))
        self.tableWidget.setObjectName("tableWidget")
        self.tableWidget.setColumnCount(0)
        self.tableWidget.setRowCount(0)
        self.label = QtWidgets.QLabel(self.widget)
        self.label.setGeometry(QtCore.QRect(80, 280, 111, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.label.setFont(font)
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName("label")
        self.spinBox = QtWidgets.QSpinBox(self.widget)
        self.spinBox.setGeometry(QtCore.QRect(210, 280, 81, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.spinBox.setFont(font)
        self.spinBox.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.spinBox.setAlignment(QtCore.Qt.AlignCenter)
        self.spinBox.setMinimum(3)
        self.spinBox.setMaximum(11)
        self.spinBox.setSingleStep(2)
        self.spinBox.setObjectName("spinBox")
        self.medianBtn = QtWidgets.QRadioButton(self.widget)
        self.medianBtn.setGeometry(QtCore.QRect(350, 50, 86, 20))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.medianBtn.setFont(font)
        self.medianBtn.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.medianBtn.setObjectName("medianBtn")
        self.buttonGroup = QtWidgets.QButtonGroup(MainWindow)
        self.buttonGroup.setObjectName("buttonGroup")
        self.buttonGroup.addButton(self.medianBtn)
        self.maxBtn = QtWidgets.QRadioButton(self.widget)
        self.maxBtn.setGeometry(QtCore.QRect(350, 90, 86, 20))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.maxBtn.setFont(font)
        self.maxBtn.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.maxBtn.setObjectName("maxBtn")
        self.buttonGroup.addButton(self.maxBtn)
        self.minBtn = QtWidgets.QRadioButton(self.widget)
        self.minBtn.setGeometry(QtCore.QRect(350, 130, 86, 20))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.minBtn.setFont(font)
        self.minBtn.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.minBtn.setObjectName("minBtn")
        self.buttonGroup.addButton(self.minBtn)
        self.gaBtn = QtWidgets.QRadioButton(self.widget)
        self.gaBtn.setGeometry(QtCore.QRect(350, 170, 111, 20))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.gaBtn.setFont(font)
        self.gaBtn.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.gaBtn.setObjectName("gaBtn")
        self.buttonGroup.addButton(self.gaBtn)
        self.soBtn = QtWidgets.QRadioButton(self.widget)
        self.soBtn.setGeometry(QtCore.QRect(350, 210, 111, 20))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.soBtn.setFont(font)
        self.soBtn.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.soBtn.setObjectName("soBtn")
        self.buttonGroup.addButton(self.soBtn)
        self.startBtn = QtWidgets.QPushButton(self.widget)
        self.startBtn.setGeometry(QtCore.QRect(620, 70, 151, 51))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(20)
        font.setBold(False)
        font.setWeight(50)
        self.startBtn.setFont(font)
        self.startBtn.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.startBtn.setObjectName("startBtn")
        self.resetBtn = QtWidgets.QPushButton(self.widget)
        self.resetBtn.setGeometry(QtCore.QRect(620, 10, 151, 51))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(20)
        font.setBold(False)
        font.setWeight(50)
        self.resetBtn.setFont(font)
        self.resetBtn.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.resetBtn.setObjectName("resetBtn")
        self.randomBtn = QtWidgets.QPushButton(self.widget)
        self.randomBtn.setGeometry(QtCore.QRect(340, 280, 121, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        font.setBold(False)
        font.setWeight(50)
        self.randomBtn.setFont(font)
        self.randomBtn.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.randomBtn.setObjectName("randomBtn")
        self.customBtn = QtWidgets.QRadioButton(self.widget)
        self.customBtn.setGeometry(QtCore.QRect(350, 10, 111, 20))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.customBtn.setFont(font)
        self.customBtn.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.customBtn.setChecked(True)
        self.customBtn.setObjectName("customBtn")
        self.buttonGroup.addButton(self.customBtn)
        self.medianBox = QtWidgets.QSpinBox(self.widget)
        self.medianBox.setGeometry(QtCore.QRect(470, 50, 61, 21))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(14)
        self.medianBox.setFont(font)
        self.medianBox.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.medianBox.setAlignment(QtCore.Qt.AlignCenter)
        self.medianBox.setMinimum(3)
        self.medianBox.setMaximum(11)
        self.medianBox.setSingleStep(2)
        self.medianBox.setObjectName("medianBox")
        self.maxBox = QtWidgets.QSpinBox(self.widget)
        self.maxBox.setGeometry(QtCore.QRect(470, 90, 61, 21))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(14)
        self.maxBox.setFont(font)
        self.maxBox.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.maxBox.setAlignment(QtCore.Qt.AlignCenter)
        self.maxBox.setMinimum(3)
        self.maxBox.setMaximum(11)
        self.maxBox.setSingleStep(2)
        self.maxBox.setObjectName("maxBox")
        self.minBox = QtWidgets.QSpinBox(self.widget)
        self.minBox.setGeometry(QtCore.QRect(470, 130, 61, 21))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(14)
        self.minBox.setFont(font)
        self.minBox.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.minBox.setAlignment(QtCore.Qt.AlignCenter)
        self.minBox.setMinimum(3)
        self.minBox.setMaximum(11)
        self.minBox.setSingleStep(2)
        self.minBox.setObjectName("minBox")
        self.gaBox = QtWidgets.QSpinBox(self.widget)
        self.gaBox.setGeometry(QtCore.QRect(470, 170, 61, 21))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(14)
        self.gaBox.setFont(font)
        self.gaBox.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.gaBox.setAlignment(QtCore.Qt.AlignCenter)
        self.gaBox.setMinimum(3)
        self.gaBox.setMaximum(11)
        self.gaBox.setSingleStep(2)
        self.gaBox.setObjectName("gaBox")
        self.logBtn = QtWidgets.QRadioButton(self.widget)
        self.logBtn.setGeometry(QtCore.QRect(350, 250, 111, 20))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.logBtn.setFont(font)
        self.logBtn.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.logBtn.setObjectName("logBtn")
        self.buttonGroup.addButton(self.logBtn)
        self.LoGBox = QtWidgets.QSpinBox(self.widget)
        self.LoGBox.setGeometry(QtCore.QRect(470, 250, 61, 21))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(14)
        self.LoGBox.setFont(font)
        self.LoGBox.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.LoGBox.setAlignment(QtCore.Qt.AlignCenter)
        self.LoGBox.setMinimum(1)
        self.LoGBox.setMaximum(5)
        self.LoGBox.setSingleStep(1)
        self.LoGBox.setObjectName("LoGBox")
        self.label_3 = QtWidgets.QLabel(self.widget)
        self.label_3.setGeometry(QtCore.QRect(550, 250, 51, 21))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(14)
        self.label_3.setFont(font)
        self.label_3.setObjectName("label_3")
        self.label_4 = QtWidgets.QLabel(self.widget)
        self.label_4.setGeometry(QtCore.QRect(550, 50, 51, 21))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(14)
        self.label_4.setFont(font)
        self.label_4.setObjectName("label_4")
        self.label_5 = QtWidgets.QLabel(self.widget)
        self.label_5.setGeometry(QtCore.QRect(550, 90, 51, 21))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(14)
        self.label_5.setFont(font)
        self.label_5.setObjectName("label_5")
        self.label_6 = QtWidgets.QLabel(self.widget)
        self.label_6.setGeometry(QtCore.QRect(550, 130, 51, 21))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(14)
        self.label_6.setFont(font)
        self.label_6.setObjectName("label_6")
        self.label_7 = QtWidgets.QLabel(self.widget)
        self.label_7.setGeometry(QtCore.QRect(550, 170, 51, 21))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(14)
        self.label_7.setFont(font)
        self.label_7.setObjectName("label_7")
        self.label_8 = QtWidgets.QLabel(self.widget)
        self.label_8.setGeometry(QtCore.QRect(680, 170, 51, 21))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(14)
        self.label_8.setFont(font)
        self.label_8.setObjectName("label_8")
        self.gauBox = QtWidgets.QSpinBox(self.widget)
        self.gauBox.setGeometry(QtCore.QRect(600, 170, 61, 21))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(14)
        self.gauBox.setFont(font)
        self.gauBox.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.gauBox.setAlignment(QtCore.Qt.AlignCenter)
        self.gauBox.setMinimum(1)
        self.gauBox.setMaximum(5)
        self.gauBox.setSingleStep(1)
        self.gauBox.setObjectName("gauBox")
        self.verticalLayout.addWidget(self.widget)
        self.horizontalLayout.addLayout(self.verticalLayout)
        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
    def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(812, 597)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.mplwidget = MplCanvas(self.centralwidget)
        self.mplwidget.setGeometry(QtCore.QRect(0, 0, 812, 551))
        self.mplwidget.setObjectName(_fromUtf8("mplwidget"))
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 812, 23))
        self.menubar.setObjectName(_fromUtf8("menubar"))
        self.menu_file = QtGui.QMenu(self.menubar)
        self.menu_file.setObjectName(_fromUtf8("menu_file"))
        self.menu_proc = QtGui.QMenu(self.menubar)
        self.menu_proc.setObjectName(_fromUtf8("menu_proc"))
        self.menu_recog = QtGui.QMenu(self.menubar)
        self.menu_recog.setObjectName(_fromUtf8("menu_recog"))
        self.menu_help = QtGui.QMenu(self.menubar)
        self.menu_help.setObjectName(_fromUtf8("menu_help"))
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        MainWindow.setStatusBar(self.statusbar)
        self.action_open = QtGui.QAction(MainWindow)
        self.action_open.setObjectName(_fromUtf8("action_open"))
        self.action_saveas = QtGui.QAction(MainWindow)
        self.action_saveas.setObjectName(_fromUtf8("action_saveas"))
        self.action_reload = QtGui.QAction(MainWindow)
        self.action_reload.setObjectName(_fromUtf8("action_reload"))
        self.action_quit = QtGui.QAction(MainWindow)
        self.action_quit.setObjectName(_fromUtf8("action_quit"))
        self.action_set = QtGui.QAction(MainWindow)
        self.action_set.setObjectName(_fromUtf8("action_set"))
        self.action_proc = QtGui.QAction(MainWindow)
        self.action_proc.setObjectName(_fromUtf8("action_proc"))
        self.action_train = QtGui.QAction(MainWindow)
        self.action_train.setObjectName(_fromUtf8("action_train"))
        self.action_rec = QtGui.QAction(MainWindow)
        self.action_rec.setObjectName(_fromUtf8("action_rec"))
        self.action_about = QtGui.QAction(MainWindow)
        self.action_about.setObjectName(_fromUtf8("action_about"))
        self.menu_file.addAction(self.action_open)
        self.menu_file.addAction(self.action_saveas)
        self.menu_file.addSeparator()
        self.menu_file.addAction(self.action_reload)
        self.menu_file.addSeparator()
        self.menu_file.addAction(self.action_quit)
        self.menu_proc.addAction(self.action_set)
        self.menu_proc.addSeparator()
        self.menu_proc.addAction(self.action_proc)
        self.menu_recog.addAction(self.action_train)
        self.menu_recog.addSeparator()
        self.menu_recog.addAction(self.action_rec)
        self.menu_help.addAction(self.action_about)
        self.menubar.addAction(self.menu_file.menuAction())
        self.menubar.addAction(self.menu_proc.menuAction())
        self.menubar.addAction(self.menu_recog.menuAction())
        self.menubar.addAction(self.menu_help.menuAction())

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
class Ui_MainWindow(QtGui.QMainWindow):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(812, 597)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.mplwidget = MplCanvas(self.centralwidget)
        self.mplwidget.setGeometry(QtCore.QRect(0, 0, 812, 551))
        self.mplwidget.setObjectName(_fromUtf8("mplwidget"))
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 812, 23))
        self.menubar.setObjectName(_fromUtf8("menubar"))
        self.menu_file = QtGui.QMenu(self.menubar)
        self.menu_file.setObjectName(_fromUtf8("menu_file"))
        self.menu_proc = QtGui.QMenu(self.menubar)
        self.menu_proc.setObjectName(_fromUtf8("menu_proc"))
        self.menu_recog = QtGui.QMenu(self.menubar)
        self.menu_recog.setObjectName(_fromUtf8("menu_recog"))
        self.menu_help = QtGui.QMenu(self.menubar)
        self.menu_help.setObjectName(_fromUtf8("menu_help"))
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        MainWindow.setStatusBar(self.statusbar)
        self.action_open = QtGui.QAction(MainWindow)
        self.action_open.setObjectName(_fromUtf8("action_open"))
        self.action_saveas = QtGui.QAction(MainWindow)
        self.action_saveas.setObjectName(_fromUtf8("action_saveas"))
        self.action_reload = QtGui.QAction(MainWindow)
        self.action_reload.setObjectName(_fromUtf8("action_reload"))
        self.action_quit = QtGui.QAction(MainWindow)
        self.action_quit.setObjectName(_fromUtf8("action_quit"))
        self.action_set = QtGui.QAction(MainWindow)
        self.action_set.setObjectName(_fromUtf8("action_set"))
        self.action_proc = QtGui.QAction(MainWindow)
        self.action_proc.setObjectName(_fromUtf8("action_proc"))
        self.action_train = QtGui.QAction(MainWindow)
        self.action_train.setObjectName(_fromUtf8("action_train"))
        self.action_rec = QtGui.QAction(MainWindow)
        self.action_rec.setObjectName(_fromUtf8("action_rec"))
        self.action_about = QtGui.QAction(MainWindow)
        self.action_about.setObjectName(_fromUtf8("action_about"))
        self.menu_file.addAction(self.action_open)
        self.menu_file.addAction(self.action_saveas)
        self.menu_file.addSeparator()
        self.menu_file.addAction(self.action_reload)
        self.menu_file.addSeparator()
        self.menu_file.addAction(self.action_quit)
        self.menu_proc.addAction(self.action_set)
        self.menu_proc.addSeparator()
        self.menu_proc.addAction(self.action_proc)
        self.menu_recog.addAction(self.action_train)
        self.menu_recog.addSeparator()
        self.menu_recog.addAction(self.action_rec)
        self.menu_help.addAction(self.action_about)
        self.menubar.addAction(self.menu_file.menuAction())
        self.menubar.addAction(self.menu_proc.menuAction())
        self.menubar.addAction(self.menu_recog.menuAction())
        self.menubar.addAction(self.menu_help.menuAction())

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

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(_translate("MainWindow", "Python数字字符识别程序", None))
        self.menu_file.setTitle(_translate("MainWindow", "文件", None))
        self.menu_proc.setTitle(_translate("MainWindow", "图像预处理", None))
        self.menu_recog.setTitle(_translate("MainWindow", "神经网络识别", None))
        self.menu_help.setTitle(_translate("MainWindow", "帮助", None))
        self.action_open.setText(_translate("MainWindow", "打开", None))
        self.action_saveas.setText(_translate("MainWindow", "另存为", None))
        self.action_reload.setText(_translate("MainWindow", "重新加载", None))
        self.action_quit.setText(_translate("MainWindow", "退出", None))
        self.action_set.setText(_translate("MainWindow", "输入归一化宽度和高度", None))
        self.action_proc.setText(_translate("MainWindow", "一次性预处理", None))
        self.action_train.setText(_translate("MainWindow", "训练网络", None))
        self.action_rec.setText(_translate("MainWindow", "识别", None))
        self.action_about.setText(_translate("MainWindow", "关于", None))
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1080, 900)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.label_2 = QtWidgets.QLabel(self.centralwidget)
        self.label_2.setMaximumSize(QtCore.QSize(16777215, 30))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.label_2.setFont(font)
        self.label_2.setAlignment(QtCore.Qt.AlignCenter)
        self.label_2.setObjectName("label_2")
        self.horizontalLayout_2.addWidget(self.label_2)
        self.label = QtWidgets.QLabel(self.centralwidget)
        self.label.setMaximumSize(QtCore.QSize(16777215, 30))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.label.setFont(font)
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName("label")
        self.horizontalLayout_2.addWidget(self.label)
        self.label_3 = QtWidgets.QLabel(self.centralwidget)
        self.label_3.setMaximumSize(QtCore.QSize(16777215, 30))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.label_3.setFont(font)
        self.label_3.setAlignment(QtCore.Qt.AlignCenter)
        self.label_3.setObjectName("label_3")
        self.horizontalLayout_2.addWidget(self.label_3)
        self.label_4 = QtWidgets.QLabel(self.centralwidget)
        self.label_4.setMaximumSize(QtCore.QSize(16777215, 30))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.label_4.setFont(font)
        self.label_4.setAlignment(QtCore.Qt.AlignCenter)
        self.label_4.setObjectName("label_4")
        self.horizontalLayout_2.addWidget(self.label_4)
        self.verticalLayout.addLayout(self.horizontalLayout_2)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.raw = MplCanvas(self.centralwidget)
        self.raw.setMaximumSize(QtCore.QSize(16777215, 335))
        self.raw.setObjectName("raw")
        self.horizontalLayout.addWidget(self.raw)
        self.spectrum = MplCanvas(self.centralwidget)
        self.spectrum.setMaximumSize(QtCore.QSize(16777215, 335))
        self.spectrum.setObjectName("spectrum")
        self.horizontalLayout.addWidget(self.spectrum)
        self.angle = MplCanvas(self.centralwidget)
        self.angle.setMaximumSize(QtCore.QSize(16777215, 335))
        self.angle.setObjectName("angle")
        self.horizontalLayout.addWidget(self.angle)
        self.ifft = MplCanvas(self.centralwidget)
        self.ifft.setMaximumSize(QtCore.QSize(16777215, 335))
        self.ifft.setObjectName("ifft")
        self.horizontalLayout.addWidget(self.ifft)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.widget = QtWidgets.QWidget(self.centralwidget)
        self.widget.setMaximumSize(QtCore.QSize(261, 16777215))
        self.widget.setObjectName("widget")
        self.ihp = QtWidgets.QRadioButton(self.widget)
        self.ihp.setGeometry(QtCore.QRect(10, 0, 121, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.ihp.setFont(font)
        self.ihp.setObjectName("ihp")
        self.filterButton = QtWidgets.QButtonGroup(MainWindow)
        self.filterButton.setObjectName("filterButton")
        self.filterButton.addButton(self.ihp)
        self.bhp = QtWidgets.QRadioButton(self.widget)
        self.bhp.setGeometry(QtCore.QRect(10, 30, 151, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.bhp.setFont(font)
        self.bhp.setObjectName("bhp")
        self.filterButton.addButton(self.bhp)
        self.ghp = QtWidgets.QRadioButton(self.widget)
        self.ghp.setGeometry(QtCore.QRect(10, 60, 151, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.ghp.setFont(font)
        self.ghp.setObjectName("ghp")
        self.filterButton.addButton(self.ghp)
        self.ilp = QtWidgets.QRadioButton(self.widget)
        self.ilp.setGeometry(QtCore.QRect(10, 90, 121, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.ilp.setFont(font)
        self.ilp.setObjectName("ilp")
        self.filterButton.addButton(self.ilp)
        self.blp = QtWidgets.QRadioButton(self.widget)
        self.blp.setGeometry(QtCore.QRect(10, 120, 151, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.blp.setFont(font)
        self.blp.setObjectName("blp")
        self.filterButton.addButton(self.blp)
        self.glp = QtWidgets.QRadioButton(self.widget)
        self.glp.setGeometry(QtCore.QRect(10, 150, 151, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.glp.setFont(font)
        self.glp.setObjectName("glp")
        self.filterButton.addButton(self.glp)
        self.h**o = QtWidgets.QRadioButton(self.widget)
        self.h**o.setGeometry(QtCore.QRect(10, 180, 111, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.h**o.setFont(font)
        self.h**o.setObjectName("h**o")
        self.filterButton.addButton(self.h**o)
        self.mob = QtWidgets.QRadioButton(self.widget)
        self.mob.setGeometry(QtCore.QRect(10, 210, 111, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.mob.setFont(font)
        self.mob.setObjectName("mob")
        self.filterButton.addButton(self.mob)
        self.mobwn = QtWidgets.QRadioButton(self.widget)
        self.mobwn.setGeometry(QtCore.QRect(10, 240, 181, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.mobwn.setFont(font)
        self.mobwn.setObjectName("mobwn")
        self.filterButton.addButton(self.mobwn)
        self.apply_1 = QtWidgets.QPushButton(self.widget)
        self.apply_1.setGeometry(QtCore.QRect(160, 180, 91, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.apply_1.setFont(font)
        self.apply_1.setObjectName("apply_1")
        self.reset_1 = QtWidgets.QPushButton(self.widget)
        self.reset_1.setGeometry(QtCore.QRect(160, 210, 91, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.reset_1.setFont(font)
        self.reset_1.setObjectName("reset_1")
        self.cutoff_box = QtWidgets.QSpinBox(self.widget)
        self.cutoff_box.setGeometry(QtCore.QRect(170, 30, 81, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.cutoff_box.setFont(font)
        self.cutoff_box.setMinimum(30)
        self.cutoff_box.setMaximum(510)
        self.cutoff_box.setSingleStep(20)
        self.cutoff_box.setObjectName("cutoff_box")
        self.label_5 = QtWidgets.QLabel(self.widget)
        self.label_5.setGeometry(QtCore.QRect(170, 0, 81, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.label_5.setFont(font)
        self.label_5.setAlignment(QtCore.Qt.AlignCenter)
        self.label_5.setObjectName("label_5")
        self.label_6 = QtWidgets.QLabel(self.widget)
        self.label_6.setGeometry(QtCore.QRect(170, 60, 81, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.label_6.setFont(font)
        self.label_6.setAlignment(QtCore.Qt.AlignCenter)
        self.label_6.setObjectName("label_6")
        self.order_box = QtWidgets.QSpinBox(self.widget)
        self.order_box.setGeometry(QtCore.QRect(170, 90, 81, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.order_box.setFont(font)
        self.order_box.setMinimum(1)
        self.order_box.setMaximum(10)
        self.order_box.setSingleStep(1)
        self.order_box.setObjectName("order_box")
        self.rH_box = QtWidgets.QSpinBox(self.widget)
        self.rH_box.setGeometry(QtCore.QRect(200, 120, 51, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.rH_box.setFont(font)
        self.rH_box.setMinimum(6)
        self.rH_box.setMaximum(10)
        self.rH_box.setSingleStep(1)
        self.rH_box.setObjectName("rH_box")
        self.rL_box = QtWidgets.QSpinBox(self.widget)
        self.rL_box.setGeometry(QtCore.QRect(200, 150, 51, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.rL_box.setFont(font)
        self.rL_box.setMinimum(1)
        self.rL_box.setMaximum(5)
        self.rL_box.setSingleStep(1)
        self.rL_box.setObjectName("rL_box")
        self.label_7 = QtWidgets.QLabel(self.widget)
        self.label_7.setGeometry(QtCore.QRect(180, 120, 21, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.label_7.setFont(font)
        self.label_7.setAlignment(QtCore.Qt.AlignCenter)
        self.label_7.setObjectName("label_7")
        self.label_8 = QtWidgets.QLabel(self.widget)
        self.label_8.setGeometry(QtCore.QRect(180, 150, 21, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.label_8.setFont(font)
        self.label_8.setAlignment(QtCore.Qt.AlignCenter)
        self.label_8.setObjectName("label_8")
        self.horizontalLayout_3.addWidget(self.widget)
        self.filter = MplCanvas(self.centralwidget)
        self.filter.setMaximumSize(QtCore.QSize(260, 269))
        self.filter.setObjectName("filter")
        self.horizontalLayout_3.addWidget(self.filter)
        self.widget_3 = QtWidgets.QWidget(self.centralwidget)
        self.widget_3.setObjectName("widget_3")
        self.inverse = QtWidgets.QRadioButton(self.widget_3)
        self.inverse.setGeometry(QtCore.QRect(10, 0, 121, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.inverse.setFont(font)
        self.inverse.setObjectName("inverse")
        self.denoiseButton = QtWidgets.QButtonGroup(MainWindow)
        self.denoiseButton.setObjectName("denoiseButton")
        self.denoiseButton.addButton(self.inverse)
        self.wiener = QtWidgets.QRadioButton(self.widget_3)
        self.wiener.setGeometry(QtCore.QRect(10, 30, 121, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.wiener.setFont(font)
        self.wiener.setObjectName("wiener")
        self.denoiseButton.addButton(self.wiener)
        self.apply_2 = QtWidgets.QPushButton(self.widget_3)
        self.apply_2.setGeometry(QtCore.QRect(10, 60, 91, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.apply_2.setFont(font)
        self.apply_2.setObjectName("apply_2")
        self.reset_2 = QtWidgets.QPushButton(self.widget_3)
        self.reset_2.setGeometry(QtCore.QRect(110, 60, 91, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.reset_2.setFont(font)
        self.reset_2.setObjectName("reset_2")
        self.horizontalLayout_3.addWidget(self.widget_3)
        self.denoise = MplCanvas(self.centralwidget)
        self.denoise.setMaximumSize(QtCore.QSize(260, 269))
        self.denoise.setObjectName("denoise")
        self.horizontalLayout_3.addWidget(self.denoise)
        self.verticalLayout.addLayout(self.horizontalLayout_3)
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1080, 22))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
Beispiel #10
0
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(921, 656)
        MainWindow.setMinimumSize(QtCore.QSize(0, 0))
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.horizontalLayout_5 = QtGui.QHBoxLayout(self.centralwidget)
        self.horizontalLayout_5.setObjectName("horizontalLayout_5")
        self.verticalLayout_3 = QtGui.QVBoxLayout()
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.groupBox = QtGui.QGroupBox(self.centralwidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.MinimumExpanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth())
        self.groupBox.setSizePolicy(sizePolicy)
        self.groupBox.setMinimumSize(QtCore.QSize(261, 202))
        self.groupBox.setMaximumSize(QtCore.QSize(261, 301))
        self.groupBox.setObjectName("groupBox")
        self.verticalLayout = QtGui.QVBoxLayout(self.groupBox)
        self.verticalLayout.setObjectName("verticalLayout")
        self.formLayout = QtGui.QFormLayout()
        self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
        self.formLayout.setObjectName("formLayout")
        self.label_7 = QtGui.QLabel(self.groupBox)
        self.label_7.setObjectName("label_7")
        self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.label_7)
        self.downsample_fac = QtGui.QLineEdit(self.groupBox)
        self.downsample_fac.setObjectName("downsample_fac")
        self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.downsample_fac)
        self.fft_size = QtGui.QLineEdit(self.groupBox)
        self.fft_size.setMinimumSize(QtCore.QSize(0, 0))
        self.fft_size.setObjectName("fft_size")
        self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.fft_size)
        self.label_3 = QtGui.QLabel(self.groupBox)
        self.label_3.setObjectName("label_3")
        self.formLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.label_3)
        self.overlap_fac = QtGui.QLineEdit(self.groupBox)
        self.overlap_fac.setObjectName("overlap_fac")
        self.formLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.overlap_fac)
        self.label_2 = QtGui.QLabel(self.groupBox)
        self.label_2.setObjectName("label_2")
        self.formLayout.setWidget(5, QtGui.QFormLayout.LabelRole, self.label_2)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.clip_min = QtGui.QLineEdit(self.groupBox)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.clip_min.sizePolicy().hasHeightForWidth())
        self.clip_min.setSizePolicy(sizePolicy)
        self.clip_min.setBaseSize(QtCore.QSize(0, 0))
        self.clip_min.setObjectName("clip_min")
        self.horizontalLayout.addWidget(self.clip_min)
        self.clip_max = QtGui.QLineEdit(self.groupBox)
        self.clip_max.setObjectName("clip_max")
        self.horizontalLayout.addWidget(self.clip_max)
        self.formLayout.setLayout(5, QtGui.QFormLayout.FieldRole, self.horizontalLayout)
        self.label_5 = QtGui.QLabel(self.groupBox)
        self.label_5.setObjectName("label_5")
        self.formLayout.setWidget(6, QtGui.QFormLayout.LabelRole, self.label_5)
        self.horizontalLayout_3 = QtGui.QHBoxLayout()
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.y_num_ticks = QtGui.QLineEdit(self.groupBox)
        self.y_num_ticks.setObjectName("y_num_ticks")
        self.horizontalLayout_3.addWidget(self.y_num_ticks)
        self.y_resolution = QtGui.QLineEdit(self.groupBox)
        self.y_resolution.setObjectName("y_resolution")
        self.horizontalLayout_3.addWidget(self.y_resolution)
        self.formLayout.setLayout(6, QtGui.QFormLayout.FieldRole, self.horizontalLayout_3)
        self.label_4 = QtGui.QLabel(self.groupBox)
        self.label_4.setObjectName("label_4")
        self.formLayout.setWidget(7, QtGui.QFormLayout.LabelRole, self.label_4)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.x_num_ticks = QtGui.QLineEdit(self.groupBox)
        self.x_num_ticks.setObjectName("x_num_ticks")
        self.horizontalLayout_2.addWidget(self.x_num_ticks)
        self.x_resolution = QtGui.QLineEdit(self.groupBox)
        self.x_resolution.setObjectName("x_resolution")
        self.horizontalLayout_2.addWidget(self.x_resolution)
        self.formLayout.setLayout(7, QtGui.QFormLayout.FieldRole, self.horizontalLayout_2)
        self.label_8 = QtGui.QLabel(self.groupBox)
        self.label_8.setObjectName("label_8")
        self.formLayout.setWidget(8, QtGui.QFormLayout.LabelRole, self.label_8)
        self.x_tick_rotation = QtGui.QLineEdit(self.groupBox)
        self.x_tick_rotation.setObjectName("x_tick_rotation")
        self.formLayout.setWidget(8, QtGui.QFormLayout.FieldRole, self.x_tick_rotation)
        self.x_grid = QtGui.QCheckBox(self.groupBox)
        self.x_grid.setObjectName("x_grid")
        self.formLayout.setWidget(9, QtGui.QFormLayout.LabelRole, self.x_grid)
        self.y_grid = QtGui.QCheckBox(self.groupBox)
        self.y_grid.setObjectName("y_grid")
        self.formLayout.setWidget(10, QtGui.QFormLayout.LabelRole, self.y_grid)
        self.label = QtGui.QLabel(self.groupBox)
        self.label.setObjectName("label")
        self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.label)
        self.label_12 = QtGui.QLabel(self.groupBox)
        self.label_12.setObjectName("label_12")
        self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.label_12)
        self.win_size = QtGui.QLineEdit(self.groupBox)
        self.win_size.setObjectName("win_size")
        self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.win_size)
        self.verticalLayout.addLayout(self.formLayout)
        self.render = QtGui.QPushButton(self.groupBox)
        self.render.setObjectName("render")
        self.verticalLayout.addWidget(self.render)
        self.verticalLayout_3.addWidget(self.groupBox)
        self.groupBox_3 = QtGui.QGroupBox(self.centralwidget)
        self.groupBox_3.setMinimumSize(QtCore.QSize(261, 87))
        self.groupBox_3.setMaximumSize(QtCore.QSize(261, 101))
        self.groupBox_3.setObjectName("groupBox_3")
        self.verticalLayout_2 = QtGui.QVBoxLayout(self.groupBox_3)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.formLayout_2 = QtGui.QFormLayout()
        self.formLayout_2.setObjectName("formLayout_2")
        self.label_10 = QtGui.QLabel(self.groupBox_3)
        self.label_10.setObjectName("label_10")
        self.formLayout_2.setWidget(3, QtGui.QFormLayout.LabelRole, self.label_10)
        self.freq_res = QtGui.QLineEdit(self.groupBox_3)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.freq_res.sizePolicy().hasHeightForWidth())
        self.freq_res.setSizePolicy(sizePolicy)
        self.freq_res.setReadOnly(True)
        self.freq_res.setObjectName("freq_res")
        self.formLayout_2.setWidget(3, QtGui.QFormLayout.FieldRole, self.freq_res)
        self.label_9 = QtGui.QLabel(self.groupBox_3)
        self.label_9.setObjectName("label_9")
        self.formLayout_2.setWidget(1, QtGui.QFormLayout.LabelRole, self.label_9)
        self.sampling_freq = QtGui.QLineEdit(self.groupBox_3)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.sampling_freq.sizePolicy().hasHeightForWidth())
        self.sampling_freq.setSizePolicy(sizePolicy)
        self.sampling_freq.setReadOnly(True)
        self.sampling_freq.setObjectName("sampling_freq")
        self.formLayout_2.setWidget(1, QtGui.QFormLayout.FieldRole, self.sampling_freq)
        self.label_11 = QtGui.QLabel(self.groupBox_3)
        self.label_11.setObjectName("label_11")
        self.formLayout_2.setWidget(2, QtGui.QFormLayout.LabelRole, self.label_11)
        self.data_length = QtGui.QLineEdit(self.groupBox_3)
        self.data_length.setObjectName("data_length")
        self.formLayout_2.setWidget(2, QtGui.QFormLayout.FieldRole, self.data_length)
        self.verticalLayout_2.addLayout(self.formLayout_2)
        self.verticalLayout_3.addWidget(self.groupBox_3)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.verticalLayout_3.addItem(spacerItem)
        self.horizontalLayout_5.addLayout(self.verticalLayout_3)
        self.groupBox_2 = QtGui.QGroupBox(self.centralwidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.groupBox_2.sizePolicy().hasHeightForWidth())
        self.groupBox_2.setSizePolicy(sizePolicy)
        self.groupBox_2.setObjectName("groupBox_2")
        self.horizontalLayout_4 = QtGui.QHBoxLayout(self.groupBox_2)
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.mpl = MplCanvas(self.groupBox_2)
        self.mpl.setObjectName("mpl")
        self.horizontalLayout_7 = QtGui.QHBoxLayout(self.mpl)
        self.horizontalLayout_7.setObjectName("horizontalLayout_7")
        self.horizontalLayout_4.addWidget(self.mpl)
        self.horizontalLayout_5.addWidget(self.groupBox_2)
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 921, 21))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
        MainWindow.setTabOrder(self.downsample_fac, self.fft_size)
        MainWindow.setTabOrder(self.fft_size, self.overlap_fac)
        MainWindow.setTabOrder(self.overlap_fac, self.clip_min)
        MainWindow.setTabOrder(self.clip_min, self.clip_max)
        MainWindow.setTabOrder(self.clip_max, self.y_num_ticks)
        MainWindow.setTabOrder(self.y_num_ticks, self.y_resolution)
        MainWindow.setTabOrder(self.y_resolution, self.x_num_ticks)
        MainWindow.setTabOrder(self.x_num_ticks, self.x_resolution)
        MainWindow.setTabOrder(self.x_resolution, self.x_tick_rotation)
        MainWindow.setTabOrder(self.x_tick_rotation, self.x_grid)
        MainWindow.setTabOrder(self.x_grid, self.y_grid)
        MainWindow.setTabOrder(self.y_grid, self.render)
Beispiel #11
0
class mWindow(QtWidgets.QMainWindow):
    def __init__(self):
        super().__init__()
        self.mui = Ui_mWin()
        self.mui.setupUi(self)
        self.setFixedSize(730, 450)
        self.setWindowIcon(QIcon('app.png'))

        self.plot_canvas = MplCanvas()
        self.navTBar = NavTBar(self.plot_canvas, self)
        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(self.navTBar)
        layout.addWidget(self.plot_canvas)
        self.mui.wgPlot.setLayout(layout)

        self.mui.btnSolve.clicked.connect(self.solve)

    def solve(self):
        expr = self.mui.txtExpr.text()
        start = self.mui.dsbStart.value()
        stop = self.mui.dsbStop.value()
        precision = self.mui.sbPrecision.value()

        solver = EquationSolver(expr, start, stop, precision)

        bs, bssteps = solver.bisection()
        if bs:
            res = str(round(bs, solver.precision))
            st = str(bssteps)
        else:
            res = 'no solutions'
            st = 'N/a'
        self.mui.lblBi.setText(res)
        self.mui.lblBiSteps.setText(st)

        nr, nrsteps = solver.newton_raphson()
        if bs:
            res = str(round(nr, solver.precision))
            st = str(nrsteps)
        else:
            res = 'no solutions'
            st = 'N/a'
        self.mui.lblNr.setText(res)
        self.mui.lblNrSteps.setText(st)

        se, sesteps = solver.secant()
        if se:
            res = str(round(se, solver.precision))
            st = str(sesteps)
        else:
            res = 'no solutions'
            st = 'N/a'
        self.mui.lblSe.setText(res)
        self.mui.lblSeSteps.setText(st)

        ax = self.plot_canvas.axes
        ax.clear()
        solver.plot_graph(ax)
        ax.legend(loc='best')
        ax.set_title('SOLUTION IN RANGE [{}, {}]'.format(start, stop))
        ax.grid()
        self.plot_canvas.draw()
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(975, 684)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
        self.verticalLayout.setObjectName("verticalLayout")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.tabWidget.sizePolicy().hasHeightForWidth())
        self.tabWidget.setSizePolicy(sizePolicy)
        self.tabWidget.setMinimumSize(QtCore.QSize(0, 313))
        self.tabWidget.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.tabWidget.setObjectName("tabWidget")
        self.tab = MplCanvas()
        self.tab.setObjectName("tab")
        self.label_4 = QtWidgets.QLabel(self.tab)
        self.label_4.setGeometry(QtCore.QRect(0, 110, 461, 81))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(20)
        self.label_4.setFont(font)
        self.label_4.setAlignment(QtCore.Qt.AlignCenter)
        self.label_4.setObjectName("label_4")
        self.tabWidget.addTab(self.tab, "")
        self.tab_2 = MplCanvas()
        self.tab_2.setObjectName("tab_2")
        self.label_5 = QtWidgets.QLabel(self.tab_2)
        self.label_5.setGeometry(QtCore.QRect(0, 110, 461, 81))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(20)
        self.label_5.setFont(font)
        self.label_5.setAlignment(QtCore.Qt.AlignCenter)
        self.label_5.setObjectName("label_5")
        self.tabWidget.addTab(self.tab_2, "")
        self.tab_3 = MplCanvas()
        self.tab_3.setObjectName("tab_3")
        self.label_6 = QtWidgets.QLabel(self.tab_3)
        self.label_6.setGeometry(QtCore.QRect(0, 110, 461, 81))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(20)
        self.label_6.setFont(font)
        self.label_6.setAlignment(QtCore.Qt.AlignCenter)
        self.label_6.setObjectName("label_6")
        self.tabWidget.addTab(self.tab_3, "")
        self.horizontalLayout.addWidget(self.tabWidget)
        self.widget_precessed = MplCanvas(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.widget_precessed.sizePolicy().hasHeightForWidth())
        self.widget_precessed.setSizePolicy(sizePolicy)
        self.widget_precessed.setMinimumSize(QtCore.QSize(0, 313))
        self.widget_precessed.setCursor(
            QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.widget_precessed.setStyleSheet(
            "background-color: rgb(255, 255, 255);")
        self.widget_precessed.setObjectName("widget_precessed")
        self.horizontalLayout.addWidget(self.widget_precessed)
        self.verticalLayout_2.addLayout(self.horizontalLayout)
        self.line_3 = QtWidgets.QFrame(self.centralwidget)
        self.line_3.setFrameShape(QtWidgets.QFrame.HLine)
        self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line_3.setObjectName("line_3")
        self.verticalLayout_2.addWidget(self.line_3)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.widget_3 = QtWidgets.QWidget(self.centralwidget)
        self.widget_3.setObjectName("widget_3")
        self.pushButton_1 = QtWidgets.QPushButton(self.widget_3)
        self.pushButton_1.setGeometry(QtCore.QRect(60, 50, 191, 41))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.pushButton_1.setFont(font)
        self.pushButton_1.setCursor(QtGui.QCursor(
            QtCore.Qt.PointingHandCursor))
        self.pushButton_1.setObjectName("pushButton_1")
        self.line = QtWidgets.QFrame(self.widget_3)
        self.line.setGeometry(QtCore.QRect(310, 0, 20, 331))
        self.line.setFrameShape(QtWidgets.QFrame.VLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line.setObjectName("line")
        self.line_2 = QtWidgets.QFrame(self.widget_3)
        self.line_2.setGeometry(QtCore.QRect(630, 0, 20, 331))
        self.line_2.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line_2.setObjectName("line_2")
        self.label = QtWidgets.QLabel(self.widget_3)
        self.label.setGeometry(QtCore.QRect(0, 10, 311, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(20)
        self.label.setFont(font)
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName("label")
        self.label_3 = QtWidgets.QLabel(self.widget_3)
        self.label_3.setGeometry(QtCore.QRect(320, 10, 311, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(20)
        self.label_3.setFont(font)
        self.label_3.setAlignment(QtCore.Qt.AlignCenter)
        self.label_3.setObjectName("label_3")
        self.label_7 = QtWidgets.QLabel(self.widget_3)
        self.label_7.setGeometry(QtCore.QRect(640, 10, 311, 31))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(20)
        self.label_7.setFont(font)
        self.label_7.setAlignment(QtCore.Qt.AlignCenter)
        self.label_7.setObjectName("label_7")
        self.pushButton_2 = QtWidgets.QPushButton(self.widget_3)
        self.pushButton_2.setGeometry(QtCore.QRect(60, 110, 191, 41))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.pushButton_2.setFont(font)
        self.pushButton_2.setCursor(QtGui.QCursor(
            QtCore.Qt.PointingHandCursor))
        self.pushButton_2.setObjectName("pushButton_2")
        self.pushButton_3 = QtWidgets.QPushButton(self.widget_3)
        self.pushButton_3.setGeometry(QtCore.QRect(60, 170, 191, 41))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.pushButton_3.setFont(font)
        self.pushButton_3.setCursor(QtGui.QCursor(
            QtCore.Qt.PointingHandCursor))
        self.pushButton_3.setObjectName("pushButton_3")
        self.pushButton_4 = QtWidgets.QPushButton(self.widget_3)
        self.pushButton_4.setGeometry(QtCore.QRect(60, 230, 191, 41))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.pushButton_4.setFont(font)
        self.pushButton_4.setCursor(QtGui.QCursor(
            QtCore.Qt.PointingHandCursor))
        self.pushButton_4.setObjectName("pushButton_4")
        self.pushButton_5 = QtWidgets.QPushButton(self.widget_3)
        self.pushButton_5.setGeometry(QtCore.QRect(380, 50, 191, 41))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.pushButton_5.setFont(font)
        self.pushButton_5.setCursor(QtGui.QCursor(
            QtCore.Qt.PointingHandCursor))
        self.pushButton_5.setObjectName("pushButton_5")
        self.pushButton_6 = QtWidgets.QPushButton(self.widget_3)
        self.pushButton_6.setGeometry(QtCore.QRect(700, 50, 191, 41))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.pushButton_6.setFont(font)
        self.pushButton_6.setCursor(QtGui.QCursor(
            QtCore.Qt.PointingHandCursor))
        self.pushButton_6.setObjectName("pushButton_6")
        self.spinBox_db = QtWidgets.QSpinBox(self.widget_3)
        self.spinBox_db.setGeometry(QtCore.QRect(390, 100, 171, 41))
        font = QtGui.QFont()
        font.setPointSize(16)
        self.spinBox_db.setFont(font)
        self.spinBox_db.setAlignment(QtCore.Qt.AlignCenter)
        self.spinBox_db.setMinimum(1)
        self.spinBox_db.setMaximum(5)
        self.spinBox_db.setProperty("value", 1)
        self.spinBox_db.setObjectName("spinBox_db")
        self.horizontalLayout_2.addWidget(self.widget_3)
        self.verticalLayout_2.addLayout(self.horizontalLayout_2)
        self.verticalLayout.addLayout(self.verticalLayout_2)
        MainWindow.setCentralWidget(self.centralwidget)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        self.tabWidget.setCurrentIndex(0)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
Beispiel #13
0
class MainWindow(QMainWindow):
    def __init__(self):
        super(MainWindow, self).__init__()
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.mainToolBar.close()
        self.ui.menuBar.close()

        self.setWindowTitle(k_Title_App)
        # self.setWindowFlags(Qt.WindowMinimizeButtonHint | Qt.WindowCloseButtonHint)
        self.setWindowFlags(Qt.FramelessWindowHint)
        # self.setFixedSize(1280,800)
        self.showFullScreen()

        self.mng = CameraManager()
        self.mng.loadInfo('./IP_Camera.json')

        self.setupGUI_Video()
        self.setupGUI_Iots()
        self.setupNotification()

        self.map_view = MapWidget(self)
        self.ui.pushBtn_Video.clicked.connect(self.openCamera)
        self.ui.pushBtn_Map.clicked.connect(self.map_view.show)

    def setupGUI_Video(self):
        self.img_dumb = np.zeros((540, 960, 3), dtype="uint8")
        self.img_dumb.fill(128)
        self.img_preview = np.zeros((540, 960, 3), dtype="uint8")
        self.ui.videoPreview.setPixmap(
            QPixmap.fromImage(
                QImage(self.img_dumb, PRV_w * 2, PRV_h * 2,
                       QImage.Format_RGB888)))
        self.timer_videos = QTimer(self)
        self.timer_videos.timeout.connect(self.updateVideos)
        self.timer_videos.setInterval(30)

        # self.ui.box_cam.currentIndexChanged.connect(self.camera_Changed)
        # self.ui.box_cam.activated.connect(self.camera_Saved)
        # self.camera_Changed()

        self.timer_proc = QTimer(self)
        self.timer_proc.timeout.connect(self.img_processing)
        self.timer_proc.setInterval(1000)
        self.timer_proc.start()

        self.ui.check_proc.setEnabled(False)
        self.warning_time = datetime.now()
        self.warning_level = 0

        # self.ui.check_proc.clicked.connect(self.processStatusChanged)
        self.ui.cB_Bell.clicked.connect(self.notifcationStatusChanged)
        self.ui.cB_SMS.clicked.connect(self.notifcationStatusChanged)
        # self.mng.cameraInfo.locations.

    def setupGUI_Iots(self):
        self.mqttc = mqtt.Client()
        self.mqttc.on_message = self.on_iot_message
        self.mqttc.on_publish = self.on_iot_publish
        self.mqttc.connect("127.0.0.1", 1883, 60)
        self.mqttc.subscribe("demo/test", qos=0)
        self.mqttc.loop_start()

        self.iot_canvas = MplCanvas(self.ui.iot_widget,
                                    width=8.0,
                                    height=1.6,
                                    dpi=100)
        self.ui.temp_label.setStyleSheet("color: red")
        self.ui.humid_label.setStyleSheet("color: blue")

        self.timer_alarm = QTimer(self)
        self.timer_alarm.timeout.connect(self.alarming_message)
        self.timer_alarm.setInterval(3000)
        self.timer_alarm.start()

    def setupNotification(self):
        # Draw The Table
        fname = 'Notification.json'
        with open(fname) as json_file:
            data = json.load(json_file)
            self.user_list = data['users']
        self.ui.tableWidget.setRowCount(len(self.user_list))
        for id in range(len(self.user_list)):
            uItem = self.user_list[id]
            self.ui.tableWidget.setItem(id, 0, QTableWidgetItem(uItem['name']))
            self.ui.tableWidget.setItem(id, 1, QTableWidgetItem(uItem['time']))
            self.ui.tableWidget.setItem(id, 2, QTableWidgetItem(uItem['tel']))

        pass

    @Slot()
    def openCamera(self):
        if (self.ui.pushBtn_Video.text() == 'Open Streams'):
            self.mng.openStreams()
            self.timer_videos.start()
            self.ui.check_proc.setEnabled(True)
            self.ui.pushBtn_Video.setText('CLOSE')
        else:
            self.timer_videos.stop()
            self.ui.check_proc.setChecked(False)
            self.ui.check_proc.setEnabled(False)

            self.mng.callStoping()
            self.ui.pushBtn_Video.setText('Open Streams')
            self.ui.videoPreview.setPixmap(
                QPixmap.fromImage(
                    QImage(self.img_dumb, PRV_w * 2, PRV_h * 2,
                           QImage.Format_RGB888)))

    @Slot()
    def img_processing(self):
        if (self.ui.check_proc.isChecked()):
            if (self.mng.SSDModel.isReady == False):
                self.mng.SSDModel.preparingModel()
            self.mng.callSSD()
            rs, ids = self.mng.checkAlarming()

            triggerTime = datetime.now()
            delta_Time = (triggerTime - self.warning_time).seconds

            if rs:
                self.ui.cB_Bell.setEnabled(True)
                self.warning_time = datetime.now(
                )  # reset time stamp detect smoke objects
                if delta_Time < 10.0:
                    self.warning_level += 1  # Continue state
                else:
                    self.warning_level = 1  # ReStart state
                print('Current warning level ' + str(self.warning_level))

                if self.warning_level > MAX_WARNING:
                    _user = self.user_list[0]  #SELECT HOANGQC
                    mess = json.dumps({"tel": _user["tel"], "cam": ids})
                    infot = self.mqttc.publish("FireAlarm/SMS", mess, qos=2)
                    infot.wait_for_publish()
                    print(ids)

            else:
                if delta_Time > 15.0:
                    self.warning_level = 0  # Reset Warning state
                    # print('Reset warning state ... ... ...')

            self.mng.drawResult = True
        else:
            self.mng.drawResult = False

    @Slot()
    def processStatusChanged(self):
        print("..." + str(self.ui.check_proc.checkState()))
        pass

    @Slot()
    def notifcationStatusChanged(self):
        print("...")
        pass

    @Slot()
    def updateVideos(self):
        # self.mng.callSSD()
        self.img_preview[0:PRV_h, 0:PRV_w] = self.mng.camera_preview[0]
        if (self.mng.camera_number > 1):
            self.img_preview[0:PRV_h,
                             PRV_w:(PRV_w * 2)] = self.mng.camera_preview[1]
        if (self.mng.camera_number > 2):
            self.img_preview[PRV_h:PRV_h * 2,
                             0:PRV_w] = self.mng.camera_preview[2]
        if (self.mng.camera_number > 3):
            self.img_preview[PRV_h:PRV_h * 2,
                             PRV_w:PRV_w * 2] = self.mng.camera_preview[3]

        self.ui.videoPreview.setPixmap(
            QPixmap.fromImage(
                QImage(self.img_preview, PRV_w * 2, PRV_h * 2,
                       QImage.Format_RGB888).rgbSwapped()))

    def on_iot_message(self, mqttc, obj, msg):
        print('Update IoTs ...')
        payload = json.loads(
            msg.payload)  # you can use json.loads to convert string to json
        self.ui.temp_label.setText("T: " + str(payload['t']) + " ℃")
        self.ui.humid_label.setText("H: " + str(payload['h']) + " %")
        self.ui.co_label.setText("CO: " + str(payload['MQ7']) + " ppm")
        # print(payload['t'], payload['h'], payload['MQ7'])  # then you can check the value
        self.iot_canvas.updateData(json.loads(msg.payload))

    def on_iot_publish(self, mqttc, obj, mid):
        # print("pub: " + str(mid) + " - mess = " + str(obj))
        pass

    def alarming_message(self):
        mess = 'OFF'
        if self.ui.cB_Bell.isChecked(): mess = 'ON'
        infot = self.mqttc.publish("FireAlarm/BELL", mess, qos=2)
        infot.wait_for_publish()
        pass

    def closeEvent(self, event: PyQt5.QtGui.QCloseEvent):
        print('App is closing ...')
        self.mng.callStoping()
Beispiel #14
0
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1120, 861)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
        self.verticalLayout.setObjectName("verticalLayout")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.label_2 = QtWidgets.QLabel(self.centralwidget)
        self.label_2.setMaximumSize(QtCore.QSize(200, 30))
        font = QtGui.QFont()
        font.setFamily("Bahnschrift")
        font.setPointSize(16)
        self.label_2.setFont(font)
        self.label_2.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft
                                  | QtCore.Qt.AlignVCenter)
        self.label_2.setObjectName("label_2")
        self.horizontalLayout_3.addWidget(self.label_2)
        self.label = QtWidgets.QLabel(self.centralwidget)
        self.label.setMaximumSize(QtCore.QSize(250, 30))
        font = QtGui.QFont()
        font.setFamily("Bahnschrift")
        font.setPointSize(16)
        self.label.setFont(font)
        self.label.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing
                                | QtCore.Qt.AlignVCenter)
        self.label.setObjectName("label")
        self.horizontalLayout_3.addWidget(self.label)
        self.verticalLayout_2.addLayout(self.horizontalLayout_3)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.raw_widget = MplCanvas(self.centralwidget)
        self.raw_widget.setMaximumSize(QtCore.QSize(550, 16777215))
        self.raw_widget.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
        self.raw_widget.setObjectName("raw_widget")
        self.horizontalLayout.addWidget(self.raw_widget)
        self.processed_widget = MplCanvas(self.centralwidget)
        self.processed_widget.setMaximumSize(QtCore.QSize(550, 16777215))
        self.processed_widget.setObjectName("processed_widget")
        self.horizontalLayout.addWidget(self.processed_widget)
        self.verticalLayout_2.addLayout(self.horizontalLayout)
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.label_4 = QtWidgets.QLabel(self.centralwidget)
        self.label_4.setMaximumSize(QtCore.QSize(200, 30))
        font = QtGui.QFont()
        font.setFamily("Bahnschrift")
        font.setPointSize(16)
        self.label_4.setFont(font)
        self.label_4.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft
                                  | QtCore.Qt.AlignVCenter)
        self.label_4.setObjectName("label_4")
        self.horizontalLayout_4.addWidget(self.label_4)
        self.label_3 = QtWidgets.QLabel(self.centralwidget)
        self.label_3.setMaximumSize(QtCore.QSize(200, 30))
        font = QtGui.QFont()
        font.setFamily("Bahnschrift")
        font.setPointSize(16)
        self.label_3.setFont(font)
        self.label_3.setAlignment(QtCore.Qt.AlignRight
                                  | QtCore.Qt.AlignTrailing
                                  | QtCore.Qt.AlignVCenter)
        self.label_3.setObjectName("label_3")
        self.horizontalLayout_4.addWidget(self.label_3)
        self.verticalLayout_2.addLayout(self.horizontalLayout_4)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.histogram_widget = MplCanvas(self.centralwidget)
        self.histogram_widget.setMaximumSize(QtCore.QSize(550, 16777215))
        self.histogram_widget.setObjectName("histogram_widget")
        self.horizontalLayout_2.addWidget(self.histogram_widget)
        self.widget_4 = QtWidgets.QWidget(self.centralwidget)
        self.widget_4.setMaximumSize(QtCore.QSize(560, 16777215))
        self.widget_4.setObjectName("widget_4")
        self.addValue = QtWidgets.QDoubleSpinBox(self.widget_4)
        self.addValue.setGeometry(QtCore.QRect(90, 10, 111, 41))
        font = QtGui.QFont()
        font.setFamily("Bahnschrift")
        font.setPointSize(16)
        self.addValue.setFont(font)
        self.addValue.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
        self.addValue.setMinimum(-31.0)
        self.addValue.setMaximum(31.0)
        self.addValue.setSingleStep(1.0)
        self.addValue.setObjectName("addValue")
        self.avgBtn = QtWidgets.QPushButton(self.widget_4)
        self.avgBtn.setGeometry(QtCore.QRect(90, 110, 231, 41))
        font = QtGui.QFont()
        font.setFamily("Bahnschrift")
        font.setPointSize(16)
        self.avgBtn.setFont(font)
        self.avgBtn.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.avgBtn.setObjectName("avgBtn")
        self.shiftBtn = QtWidgets.QPushButton(self.widget_4)
        self.shiftBtn.setGeometry(QtCore.QRect(90, 160, 231, 41))
        font = QtGui.QFont()
        font.setFamily("Bahnschrift")
        font.setPointSize(16)
        self.shiftBtn.setFont(font)
        self.shiftBtn.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.shiftBtn.setObjectName("shiftBtn")
        self.mulValue = QtWidgets.QDoubleSpinBox(self.widget_4)
        self.mulValue.setGeometry(QtCore.QRect(90, 60, 111, 41))
        font = QtGui.QFont()
        font.setFamily("Bahnschrift")
        font.setPointSize(16)
        self.mulValue.setFont(font)
        self.mulValue.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
        self.mulValue.setMaximum(10.0)
        self.mulValue.setSingleStep(0.5)
        self.mulValue.setProperty("value", 1.0)
        self.mulValue.setObjectName("mulValue")
        self.label_5 = QtWidgets.QLabel(self.widget_4)
        self.label_5.setGeometry(QtCore.QRect(210, 10, 111, 41))
        font = QtGui.QFont()
        font.setFamily("Bahnschrift")
        font.setPointSize(16)
        self.label_5.setFont(font)
        self.label_5.setAlignment(QtCore.Qt.AlignCenter)
        self.label_5.setObjectName("label_5")
        self.label_6 = QtWidgets.QLabel(self.widget_4)
        self.label_6.setGeometry(QtCore.QRect(210, 60, 111, 41))
        font = QtGui.QFont()
        font.setFamily("Bahnschrift")
        font.setPointSize(16)
        self.label_6.setFont(font)
        self.label_6.setAlignment(QtCore.Qt.AlignCenter)
        self.label_6.setObjectName("label_6")
        self.horizontalLayoutWidget_5 = QtWidgets.QWidget(self.widget_4)
        self.horizontalLayoutWidget_5.setGeometry(
            QtCore.QRect(330, 50, 171, 131))
        self.horizontalLayoutWidget_5.setObjectName("horizontalLayoutWidget_5")
        self.horizontalLayout_7 = QtWidgets.QHBoxLayout(
            self.horizontalLayoutWidget_5)
        self.horizontalLayout_7.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_7.setObjectName("horizontalLayout_7")
        self.raw2_widget = MplCanvas(self.horizontalLayoutWidget_5)
        self.raw2_widget.setMaximumSize(QtCore.QSize(300, 300))
        self.raw2_widget.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.raw2_widget.setObjectName("raw2_widget")
        self.horizontalLayout_7.addWidget(self.raw2_widget)
        self.label_7 = QtWidgets.QLabel(self.widget_4)
        self.label_7.setGeometry(QtCore.QRect(340, 10, 151, 41))
        self.label_7.setMaximumSize(QtCore.QSize(200, 41))
        font = QtGui.QFont()
        font.setFamily("Bahnschrift")
        font.setPointSize(16)
        self.label_7.setFont(font)
        self.label_7.setAlignment(QtCore.Qt.AlignCenter)
        self.label_7.setObjectName("label_7")
        self.horizontalLayout_2.addWidget(self.widget_4)
        self.verticalLayout_2.addLayout(self.horizontalLayout_2)
        self.verticalLayout.addLayout(self.verticalLayout_2)
        MainWindow.setCentralWidget(self.centralwidget)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)
        self.toolBar = QtWidgets.QToolBar(MainWindow)
        self.toolBar.setObjectName("toolBar")
        MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)
        self.actionreadImage = QtWidgets.QAction(MainWindow)
        icon = QtGui.QIcon()
        icon.addPixmap(
            QtGui.QPixmap(
                ".\\C1HW01-2020/500_F_219110502_6EtOxEEa9KQCbholMIqObqKCgArSGfvC.jpg"
            ), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionreadImage.setIcon(icon)
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        font.setPointSize(16)
        self.actionreadImage.setFont(font)
        self.actionreadImage.setVisible(True)
        self.actionreadImage.setObjectName("actionreadImage")
        self.toolBar.addAction(self.actionreadImage)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1111, 820)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.widget = QtWidgets.QWidget(self.centralwidget)
        self.widget.setMaximumSize(QtCore.QSize(16777215, 50))
        self.widget.setObjectName("widget")
        self.label = QtWidgets.QLabel(self.widget)
        self.label.setGeometry(QtCore.QRect(290, 0, 158, 41))
        font = QtGui.QFont()
        font.setFamily("Bahnschrift Light")
        font.setPointSize(16)
        self.label.setFont(font)
        self.label.setObjectName("label")
        self.label_2 = QtWidgets.QLabel(self.widget)
        self.label_2.setGeometry(QtCore.QRect(610, 0, 205, 41))
        font = QtGui.QFont()
        font.setFamily("Bahnschrift Light")
        font.setPointSize(16)
        self.label_2.setFont(font)
        self.label_2.setObjectName("label_2")
        self.label_7 = QtWidgets.QLabel(self.widget)
        self.label_7.setGeometry(QtCore.QRect(880, 0, 205, 41))
        font = QtGui.QFont()
        font.setFamily("Bahnschrift Light")
        font.setPointSize(14)
        self.label_7.setFont(font)
        self.label_7.setAlignment(QtCore.Qt.AlignCenter)
        self.label_7.setObjectName("label_7")
        self.horizontalLayout.addWidget(self.widget)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.raw = MplCanvas(self.centralwidget)
        self.raw.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.raw.setObjectName("raw")
        self.horizontalLayout_2.addWidget(self.raw)
        self.gray1 = MplCanvas(self.centralwidget)
        self.gray1.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.gray1.setObjectName("gray1")
        self.horizontalLayout_2.addWidget(self.gray1)
        self.gray1_hist = MplCanvas(self.centralwidget)
        self.gray1_hist.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.gray1_hist.setObjectName("gray1_hist")
        self.horizontalLayout_2.addWidget(self.gray1_hist)
        self.gray2 = MplCanvas(self.centralwidget)
        self.gray2.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.gray2.setObjectName("gray2")
        self.horizontalLayout_2.addWidget(self.gray2)
        self.gray2_hist = MplCanvas(self.centralwidget)
        self.gray2_hist.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.gray2_hist.setObjectName("gray2_hist")
        self.horizontalLayout_2.addWidget(self.gray2_hist)
        self.subtract_hist = MplCanvas(self.centralwidget)
        self.subtract_hist.setCursor(
            QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.subtract_hist.setObjectName("subtract_hist")
        self.horizontalLayout_2.addWidget(self.subtract_hist)
        self.verticalLayout.addLayout(self.horizontalLayout_2)
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.resize = MplCanvas(self.centralwidget)
        self.resize.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.resize.setObjectName("resize")
        self.horizontalLayout_4.addWidget(self.resize)
        self.resize_gray = MplCanvas(self.centralwidget)
        self.resize_gray.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.resize_gray.setObjectName("resize_gray")
        self.horizontalLayout_4.addWidget(self.resize_gray)
        self.resize_hist = MplCanvas(self.centralwidget)
        self.resize_hist.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.resize_hist.setObjectName("resize_hist")
        self.horizontalLayout_4.addWidget(self.resize_hist)
        self.bright_contrast = MplCanvas(self.centralwidget)
        self.bright_contrast.setCursor(
            QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.bright_contrast.setObjectName("bright_contrast")
        self.horizontalLayout_4.addWidget(self.bright_contrast)
        self.binary = MplCanvas(self.centralwidget)
        self.binary.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.binary.setObjectName("binary")
        self.horizontalLayout_4.addWidget(self.binary)
        self.verticalLayout.addLayout(self.horizontalLayout_4)
        self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_5.setObjectName("horizontalLayout_5")
        self.widget_2 = QtWidgets.QWidget(self.centralwidget)
        self.widget_2.setObjectName("widget_2")
        self.resize_slider = QtWidgets.QSlider(self.widget_2)
        self.resize_slider.setGeometry(QtCore.QRect(230, 41, 171, 31))
        self.resize_slider.setOrientation(QtCore.Qt.Horizontal)
        self.resize_slider.setObjectName("resize_slider")
        self.label_3 = QtWidgets.QLabel(self.widget_2)
        self.label_3.setGeometry(QtCore.QRect(280, 10, 71, 31))
        font = QtGui.QFont()
        font.setFamily("Bahnschrift Light")
        font.setPointSize(16)
        self.label_3.setFont(font)
        self.label_3.setAlignment(QtCore.Qt.AlignCenter)
        self.label_3.setObjectName("label_3")
        self.label_4 = QtWidgets.QLabel(self.widget_2)
        self.label_4.setGeometry(QtCore.QRect(700, 10, 111, 31))
        font = QtGui.QFont()
        font.setFamily("Bahnschrift Light")
        font.setPointSize(16)
        self.label_4.setFont(font)
        self.label_4.setAlignment(QtCore.Qt.AlignCenter)
        self.label_4.setObjectName("label_4")
        self.bright_slider = QtWidgets.QSlider(self.widget_2)
        self.bright_slider.setGeometry(QtCore.QRect(670, 50, 171, 31))
        self.bright_slider.setOrientation(QtCore.Qt.Horizontal)
        self.bright_slider.setObjectName("bright_slider")
        self.label_5 = QtWidgets.QLabel(self.widget_2)
        self.label_5.setGeometry(QtCore.QRect(700, 110, 111, 31))
        font = QtGui.QFont()
        font.setFamily("Bahnschrift Light")
        font.setPointSize(16)
        self.label_5.setFont(font)
        self.label_5.setAlignment(QtCore.Qt.AlignCenter)
        self.label_5.setObjectName("label_5")
        self.contrast_slider = QtWidgets.QSlider(self.widget_2)
        self.contrast_slider.setGeometry(QtCore.QRect(670, 150, 171, 31))
        self.contrast_slider.setOrientation(QtCore.Qt.Horizontal)
        self.contrast_slider.setObjectName("contrast_slider")
        self.label_6 = QtWidgets.QLabel(self.widget_2)
        self.label_6.setGeometry(QtCore.QRect(930, 10, 111, 31))
        font = QtGui.QFont()
        font.setFamily("Bahnschrift Light")
        font.setPointSize(16)
        self.label_6.setFont(font)
        self.label_6.setAlignment(QtCore.Qt.AlignCenter)
        self.label_6.setObjectName("label_6")
        self.binary_slider = QtWidgets.QSlider(self.widget_2)
        self.binary_slider.setGeometry(QtCore.QRect(900, 50, 171, 31))
        self.binary_slider.setOrientation(QtCore.Qt.Horizontal)
        self.binary_slider.setObjectName("binary_slider")
        self.equal_btn = QtWidgets.QPushButton(self.widget_2)
        self.equal_btn.setGeometry(QtCore.QRect(910, 120, 161, 51))
        font = QtGui.QFont()
        font.setFamily("Bahnschrift Light")
        font.setPointSize(16)
        self.equal_btn.setFont(font)
        self.equal_btn.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.equal_btn.setObjectName("equal_btn")
        self.horizontalLayout_5.addWidget(self.widget_2)
        self.verticalLayout.addLayout(self.horizontalLayout_5)
        MainWindow.setCentralWidget(self.centralwidget)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
Beispiel #16
0
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(921, 656)
        MainWindow.setMinimumSize(QtCore.QSize(0, 0))
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.horizontalLayout_5 = QtGui.QHBoxLayout(self.centralwidget)
        self.horizontalLayout_5.setObjectName("horizontalLayout_5")
        self.verticalLayout_3 = QtGui.QVBoxLayout()
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.groupBox = QtGui.QGroupBox(self.centralwidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,
                                       QtGui.QSizePolicy.MinimumExpanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.groupBox.sizePolicy().hasHeightForWidth())
        self.groupBox.setSizePolicy(sizePolicy)
        self.groupBox.setMinimumSize(QtCore.QSize(261, 202))
        self.groupBox.setMaximumSize(QtCore.QSize(261, 301))
        self.groupBox.setObjectName("groupBox")
        self.verticalLayout = QtGui.QVBoxLayout(self.groupBox)
        self.verticalLayout.setObjectName("verticalLayout")
        self.formLayout = QtGui.QFormLayout()
        self.formLayout.setFieldGrowthPolicy(
            QtGui.QFormLayout.AllNonFixedFieldsGrow)
        self.formLayout.setObjectName("formLayout")
        self.label_7 = QtGui.QLabel(self.groupBox)
        self.label_7.setObjectName("label_7")
        self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.label_7)
        self.downsample_fac = QtGui.QLineEdit(self.groupBox)
        self.downsample_fac.setObjectName("downsample_fac")
        self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole,
                                  self.downsample_fac)
        self.fft_size = QtGui.QLineEdit(self.groupBox)
        self.fft_size.setMinimumSize(QtCore.QSize(0, 0))
        self.fft_size.setObjectName("fft_size")
        self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole,
                                  self.fft_size)
        self.label_3 = QtGui.QLabel(self.groupBox)
        self.label_3.setObjectName("label_3")
        self.formLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.label_3)
        self.overlap_fac = QtGui.QLineEdit(self.groupBox)
        self.overlap_fac.setObjectName("overlap_fac")
        self.formLayout.setWidget(4, QtGui.QFormLayout.FieldRole,
                                  self.overlap_fac)
        self.label_2 = QtGui.QLabel(self.groupBox)
        self.label_2.setObjectName("label_2")
        self.formLayout.setWidget(5, QtGui.QFormLayout.LabelRole, self.label_2)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.clip_min = QtGui.QLineEdit(self.groupBox)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.clip_min.sizePolicy().hasHeightForWidth())
        self.clip_min.setSizePolicy(sizePolicy)
        self.clip_min.setBaseSize(QtCore.QSize(0, 0))
        self.clip_min.setObjectName("clip_min")
        self.horizontalLayout.addWidget(self.clip_min)
        self.clip_max = QtGui.QLineEdit(self.groupBox)
        self.clip_max.setObjectName("clip_max")
        self.horizontalLayout.addWidget(self.clip_max)
        self.formLayout.setLayout(5, QtGui.QFormLayout.FieldRole,
                                  self.horizontalLayout)
        self.label_5 = QtGui.QLabel(self.groupBox)
        self.label_5.setObjectName("label_5")
        self.formLayout.setWidget(6, QtGui.QFormLayout.LabelRole, self.label_5)
        self.horizontalLayout_3 = QtGui.QHBoxLayout()
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.y_num_ticks = QtGui.QLineEdit(self.groupBox)
        self.y_num_ticks.setObjectName("y_num_ticks")
        self.horizontalLayout_3.addWidget(self.y_num_ticks)
        self.y_resolution = QtGui.QLineEdit(self.groupBox)
        self.y_resolution.setObjectName("y_resolution")
        self.horizontalLayout_3.addWidget(self.y_resolution)
        self.formLayout.setLayout(6, QtGui.QFormLayout.FieldRole,
                                  self.horizontalLayout_3)
        self.label_4 = QtGui.QLabel(self.groupBox)
        self.label_4.setObjectName("label_4")
        self.formLayout.setWidget(7, QtGui.QFormLayout.LabelRole, self.label_4)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.x_num_ticks = QtGui.QLineEdit(self.groupBox)
        self.x_num_ticks.setObjectName("x_num_ticks")
        self.horizontalLayout_2.addWidget(self.x_num_ticks)
        self.x_resolution = QtGui.QLineEdit(self.groupBox)
        self.x_resolution.setObjectName("x_resolution")
        self.horizontalLayout_2.addWidget(self.x_resolution)
        self.formLayout.setLayout(7, QtGui.QFormLayout.FieldRole,
                                  self.horizontalLayout_2)
        self.label_8 = QtGui.QLabel(self.groupBox)
        self.label_8.setObjectName("label_8")
        self.formLayout.setWidget(8, QtGui.QFormLayout.LabelRole, self.label_8)
        self.x_tick_rotation = QtGui.QLineEdit(self.groupBox)
        self.x_tick_rotation.setObjectName("x_tick_rotation")
        self.formLayout.setWidget(8, QtGui.QFormLayout.FieldRole,
                                  self.x_tick_rotation)
        self.x_grid = QtGui.QCheckBox(self.groupBox)
        self.x_grid.setObjectName("x_grid")
        self.formLayout.setWidget(9, QtGui.QFormLayout.LabelRole, self.x_grid)
        self.y_grid = QtGui.QCheckBox(self.groupBox)
        self.y_grid.setObjectName("y_grid")
        self.formLayout.setWidget(10, QtGui.QFormLayout.LabelRole, self.y_grid)
        self.label = QtGui.QLabel(self.groupBox)
        self.label.setObjectName("label")
        self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.label)
        self.label_12 = QtGui.QLabel(self.groupBox)
        self.label_12.setObjectName("label_12")
        self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole,
                                  self.label_12)
        self.win_size = QtGui.QLineEdit(self.groupBox)
        self.win_size.setObjectName("win_size")
        self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole,
                                  self.win_size)
        self.verticalLayout.addLayout(self.formLayout)
        self.render = QtGui.QPushButton(self.groupBox)
        self.render.setObjectName("render")
        self.verticalLayout.addWidget(self.render)
        self.verticalLayout_3.addWidget(self.groupBox)
        self.groupBox_3 = QtGui.QGroupBox(self.centralwidget)
        self.groupBox_3.setMinimumSize(QtCore.QSize(261, 87))
        self.groupBox_3.setMaximumSize(QtCore.QSize(261, 101))
        self.groupBox_3.setObjectName("groupBox_3")
        self.verticalLayout_2 = QtGui.QVBoxLayout(self.groupBox_3)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.formLayout_2 = QtGui.QFormLayout()
        self.formLayout_2.setObjectName("formLayout_2")
        self.label_10 = QtGui.QLabel(self.groupBox_3)
        self.label_10.setObjectName("label_10")
        self.formLayout_2.setWidget(3, QtGui.QFormLayout.LabelRole,
                                    self.label_10)
        self.freq_res = QtGui.QLineEdit(self.groupBox_3)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.freq_res.sizePolicy().hasHeightForWidth())
        self.freq_res.setSizePolicy(sizePolicy)
        self.freq_res.setReadOnly(True)
        self.freq_res.setObjectName("freq_res")
        self.formLayout_2.setWidget(3, QtGui.QFormLayout.FieldRole,
                                    self.freq_res)
        self.label_9 = QtGui.QLabel(self.groupBox_3)
        self.label_9.setObjectName("label_9")
        self.formLayout_2.setWidget(1, QtGui.QFormLayout.LabelRole,
                                    self.label_9)
        self.sampling_freq = QtGui.QLineEdit(self.groupBox_3)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.sampling_freq.sizePolicy().hasHeightForWidth())
        self.sampling_freq.setSizePolicy(sizePolicy)
        self.sampling_freq.setReadOnly(True)
        self.sampling_freq.setObjectName("sampling_freq")
        self.formLayout_2.setWidget(1, QtGui.QFormLayout.FieldRole,
                                    self.sampling_freq)
        self.label_11 = QtGui.QLabel(self.groupBox_3)
        self.label_11.setObjectName("label_11")
        self.formLayout_2.setWidget(2, QtGui.QFormLayout.LabelRole,
                                    self.label_11)
        self.data_length = QtGui.QLineEdit(self.groupBox_3)
        self.data_length.setObjectName("data_length")
        self.formLayout_2.setWidget(2, QtGui.QFormLayout.FieldRole,
                                    self.data_length)
        self.verticalLayout_2.addLayout(self.formLayout_2)
        self.verticalLayout_3.addWidget(self.groupBox_3)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
                                       QtGui.QSizePolicy.Expanding)
        self.verticalLayout_3.addItem(spacerItem)
        self.horizontalLayout_5.addLayout(self.verticalLayout_3)
        self.groupBox_2 = QtGui.QGroupBox(self.centralwidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.groupBox_2.sizePolicy().hasHeightForWidth())
        self.groupBox_2.setSizePolicy(sizePolicy)
        self.groupBox_2.setObjectName("groupBox_2")
        self.horizontalLayout_4 = QtGui.QHBoxLayout(self.groupBox_2)
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.mpl = MplCanvas(self.groupBox_2)
        self.mpl.setObjectName("mpl")
        self.horizontalLayout_7 = QtGui.QHBoxLayout(self.mpl)
        self.horizontalLayout_7.setObjectName("horizontalLayout_7")
        self.horizontalLayout_4.addWidget(self.mpl)
        self.horizontalLayout_5.addWidget(self.groupBox_2)
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 921, 21))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
        MainWindow.setTabOrder(self.downsample_fac, self.fft_size)
        MainWindow.setTabOrder(self.fft_size, self.overlap_fac)
        MainWindow.setTabOrder(self.overlap_fac, self.clip_min)
        MainWindow.setTabOrder(self.clip_min, self.clip_max)
        MainWindow.setTabOrder(self.clip_max, self.y_num_ticks)
        MainWindow.setTabOrder(self.y_num_ticks, self.y_resolution)
        MainWindow.setTabOrder(self.y_resolution, self.x_num_ticks)
        MainWindow.setTabOrder(self.x_num_ticks, self.x_resolution)
        MainWindow.setTabOrder(self.x_resolution, self.x_tick_rotation)
        MainWindow.setTabOrder(self.x_tick_rotation, self.x_grid)
        MainWindow.setTabOrder(self.x_grid, self.y_grid)
        MainWindow.setTabOrder(self.y_grid, self.render)