Пример #1
0
class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(901, 1016)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.diffView = PlotWidget(self.centralwidget)
        self.diffView.setGeometry(QtCore.QRect(50, 640, 800, 200))
        self.diffView.setObjectName(_fromUtf8("diffView"))
        self.dtmView = GLViewWidget(self.centralwidget)
        self.dtmView.setGeometry(QtCore.QRect(50, 30, 800, 600))
        self.dtmView.setObjectName(_fromUtf8("dtmView"))
        self.frameNumber = QtGui.QLCDNumber(self.centralwidget)
        self.frameNumber.setGeometry(QtCore.QRect(720, 940, 111, 51))
        self.frameNumber.setObjectName(_fromUtf8("frameNumber"))
        self.horizontalSlider = QtGui.QSlider(self.centralwidget)
        self.horizontalSlider.setGeometry(QtCore.QRect(50, 860, 791, 29))
        self.horizontalSlider.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider.setObjectName(_fromUtf8("horizontalSlider"))
        self.checkBox = QtGui.QCheckBox(self.centralwidget)
        self.checkBox.setGeometry(QtCore.QRect(60, 930, 181, 37))
        self.checkBox.setObjectName(_fromUtf8("checkBox"))
        self.label = QtGui.QLabel(self.centralwidget)
        self.label.setGeometry(QtCore.QRect(700, 900, 151, 32))
        self.label.setObjectName(_fromUtf8("label"))
        self.diffBox = QtGui.QCheckBox(self.centralwidget)
        self.diffBox.setGeometry(QtCore.QRect(200, 940, 99, 22))
        self.diffBox.setObjectName(_fromUtf8("diffBox"))
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 901, 25))
        self.menubar.setObjectName(_fromUtf8("menubar"))
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        MainWindow.setStatusBar(self.statusbar)

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

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None))
        self.checkBox.setText(_translate("MainWindow", "Play Movie", None))
        self.label.setText(_translate("MainWindow", "Frame No.", None))
        self.diffBox.setText(_translate("MainWindow", "Show Diffs", None))
Пример #2
0
class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1184, 827)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.widget = GLViewWidget(self.centralwidget)
        self.widget.setGeometry(QtCore.QRect(0, 0, 921, 781))
        self.widget.setObjectName("widget")
        self.label = QtWidgets.QLabel(self.centralwidget)
        self.label.setGeometry(QtCore.QRect(950, 20, 47, 13))
        self.label.setObjectName("label")
        self.translateX = QtWidgets.QLineEdit(self.centralwidget)
        self.translateX.setGeometry(QtCore.QRect(950, 50, 113, 20))
        self.translateX.setObjectName("translateX")
        self.translateY = QtWidgets.QLineEdit(self.centralwidget)
        self.translateY.setGeometry(QtCore.QRect(950, 80, 113, 20))
        self.translateY.setObjectName("translateY")
        self.translateZ = QtWidgets.QLineEdit(self.centralwidget)
        self.translateZ.setGeometry(QtCore.QRect(950, 110, 113, 20))
        self.translateZ.setObjectName("translateZ")
        self.label_2 = QtWidgets.QLabel(self.centralwidget)
        self.label_2.setGeometry(QtCore.QRect(930, 50, 16, 16))
        self.label_2.setObjectName("label_2")
        self.label_3 = QtWidgets.QLabel(self.centralwidget)
        self.label_3.setGeometry(QtCore.QRect(930, 80, 16, 16))
        self.label_3.setObjectName("label_3")
        self.label_4 = QtWidgets.QLabel(self.centralwidget)
        self.label_4.setGeometry(QtCore.QRect(930, 110, 16, 16))
        self.label_4.setObjectName("label_4")
        self.label_5 = QtWidgets.QLabel(self.centralwidget)
        self.label_5.setGeometry(QtCore.QRect(950, 150, 47, 13))
        self.label_5.setObjectName("label_5")
        self.rotateZ = QtWidgets.QLineEdit(self.centralwidget)
        self.rotateZ.setGeometry(QtCore.QRect(950, 240, 113, 20))
        self.rotateZ.setObjectName("rotateZ")
        self.label_6 = QtWidgets.QLabel(self.centralwidget)
        self.label_6.setGeometry(QtCore.QRect(930, 210, 16, 16))
        self.label_6.setObjectName("label_6")
        self.label_7 = QtWidgets.QLabel(self.centralwidget)
        self.label_7.setGeometry(QtCore.QRect(930, 240, 16, 16))
        self.label_7.setObjectName("label_7")
        self.rotateX = QtWidgets.QLineEdit(self.centralwidget)
        self.rotateX.setGeometry(QtCore.QRect(950, 180, 113, 20))
        self.rotateX.setObjectName("rotateX")
        self.label_8 = QtWidgets.QLabel(self.centralwidget)
        self.label_8.setGeometry(QtCore.QRect(930, 180, 16, 16))
        self.label_8.setObjectName("label_8")
        self.rotateY = QtWidgets.QLineEdit(self.centralwidget)
        self.rotateY.setGeometry(QtCore.QRect(950, 210, 113, 20))
        self.rotateY.setObjectName("rotateY")
        self.label_9 = QtWidgets.QLabel(self.centralwidget)
        self.label_9.setGeometry(QtCore.QRect(930, 310, 16, 16))
        self.label_9.setObjectName("label_9")
        self.scaleZ = QtWidgets.QLineEdit(self.centralwidget)
        self.scaleZ.setGeometry(QtCore.QRect(950, 370, 113, 20))
        self.scaleZ.setObjectName("scaleZ")
        self.scaleX = QtWidgets.QLineEdit(self.centralwidget)
        self.scaleX.setGeometry(QtCore.QRect(950, 310, 113, 20))
        self.scaleX.setObjectName("scaleX")
        self.scaleY = QtWidgets.QLineEdit(self.centralwidget)
        self.scaleY.setGeometry(QtCore.QRect(950, 340, 113, 20))
        self.scaleY.setObjectName("scaleY")
        self.label_10 = QtWidgets.QLabel(self.centralwidget)
        self.label_10.setGeometry(QtCore.QRect(950, 280, 47, 13))
        self.label_10.setObjectName("label_10")
        self.label_11 = QtWidgets.QLabel(self.centralwidget)
        self.label_11.setGeometry(QtCore.QRect(930, 370, 16, 16))
        self.label_11.setObjectName("label_11")
        self.label_12 = QtWidgets.QLabel(self.centralwidget)
        self.label_12.setGeometry(QtCore.QRect(930, 340, 16, 16))
        self.label_12.setObjectName("label_12")
        self.label_13 = QtWidgets.QLabel(self.centralwidget)
        self.label_13.setGeometry(QtCore.QRect(1070, 180, 47, 13))
        self.label_13.setObjectName("label_13")
        self.label_14 = QtWidgets.QLabel(self.centralwidget)
        self.label_14.setGeometry(QtCore.QRect(1070, 210, 47, 13))
        self.label_14.setObjectName("label_14")
        self.label_15 = QtWidgets.QLabel(self.centralwidget)
        self.label_15.setGeometry(QtCore.QRect(1070, 240, 47, 13))
        self.label_15.setObjectName("label_15")
        self.pushButton = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton.setGeometry(QtCore.QRect(970, 440, 181, 23))
        self.pushButton.setObjectName("pushButton")
        self.label_16 = QtWidgets.QLabel(self.centralwidget)
        self.label_16.setGeometry(QtCore.QRect(950, 640, 201, 141))
        self.label_16.setObjectName("label_16")
        self.scaleAll = QtWidgets.QLineEdit(self.centralwidget)
        self.scaleAll.setGeometry(QtCore.QRect(970, 400, 113, 20))
        self.scaleAll.setObjectName("scaleAll")
        self.label_17 = QtWidgets.QLabel(self.centralwidget)
        self.label_17.setGeometry(QtCore.QRect(930, 400, 41, 16))
        self.label_17.setObjectName("label_17")
        self.resetButton = QtWidgets.QPushButton(self.centralwidget)
        self.resetButton.setGeometry(QtCore.QRect(970, 470, 181, 23))
        self.resetButton.setObjectName("resetButton")
        self.projectionButton = QtWidgets.QPushButton(self.centralwidget)
        self.projectionButton.setGeometry(QtCore.QRect(970, 500, 181, 23))
        self.projectionButton.setObjectName("projectionButton")
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1184, 21))
        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)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.label.setText(_translate("MainWindow", "Translate"))
        self.label_2.setText(_translate("MainWindow", "x"))
        self.label_3.setText(_translate("MainWindow", "y"))
        self.label_4.setText(_translate("MainWindow", "z"))
        self.label_5.setText(_translate("MainWindow", "Rotate"))
        self.label_6.setText(_translate("MainWindow", "y"))
        self.label_7.setText(_translate("MainWindow", "z"))
        self.label_8.setText(_translate("MainWindow", "x"))
        self.label_9.setText(_translate("MainWindow", "x"))
        self.label_10.setText(_translate("MainWindow", "Scale"))
        self.label_11.setText(_translate("MainWindow", "z"))
        self.label_12.setText(_translate("MainWindow", "y"))
        self.label_13.setText(_translate("MainWindow", "degrees"))
        self.label_14.setText(_translate("MainWindow", "degrees"))
        self.label_15.setText(_translate("MainWindow", "degrees"))
        self.pushButton.setText(
            _translate("MainWindow", "Perform transformations"))
        self.label_16.setText(
            _translate(
                "MainWindow",
                "<html><head/><body><p>Legend:</p><p>X Axis - blue line</p><p>Y Axis - yellow line</p><p>Z Axis - green line</p><p>Grid cell size: 10</p></body></html>"
            ))
        self.label_17.setText(_translate("MainWindow", "all axis"))
        self.resetButton.setText(_translate("MainWindow", "Reset"))
        self.projectionButton.setText(
            _translate("MainWindow", "Toggle projections"))
Пример #3
0
class Ui_FreeIMUCal(object):
    def setupUi(self, FreeIMUCal):
        FreeIMUCal.setObjectName(_fromUtf8("FreeIMUCal"))
        FreeIMUCal.resize(800, 680)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,
                                       QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            FreeIMUCal.sizePolicy().hasHeightForWidth())
        FreeIMUCal.setSizePolicy(sizePolicy)
        FreeIMUCal.setMinimumSize(QtCore.QSize(800, 600))
        FreeIMUCal.setMaximumSize(QtCore.QSize(800, 680))
        FreeIMUCal.setDocumentMode(False)
        self.centralwidget = QtGui.QWidget(FreeIMUCal)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Maximum,
                                       QtGui.QSizePolicy.Maximum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.centralwidget.sizePolicy().hasHeightForWidth())
        self.centralwidget.setSizePolicy(sizePolicy)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.line = QtGui.QFrame(self.centralwidget)
        self.line.setGeometry(QtCore.QRect(10, 20, 791, 16))
        self.line.setFrameShape(QtGui.QFrame.HLine)
        self.line.setFrameShadow(QtGui.QFrame.Sunken)
        self.line.setObjectName(_fromUtf8("line"))
        self.gridLayoutWidget = QtGui.QWidget(self.centralwidget)
        self.gridLayoutWidget.setGeometry(QtCore.QRect(0, 0, 801, 25))
        self.gridLayoutWidget.setObjectName(_fromUtf8("gridLayoutWidget"))
        self.gridLayout = QtGui.QGridLayout(self.gridLayoutWidget)
        self.gridLayout.setSizeConstraint(QtGui.QLayout.SetDefaultConstraint)
        self.gridLayout.setMargin(0)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.line_2 = QtGui.QFrame(self.gridLayoutWidget)
        self.line_2.setFrameShape(QtGui.QFrame.VLine)
        self.line_2.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_2.setObjectName(_fromUtf8("line_2"))
        self.gridLayout.addWidget(self.line_2, 0, 4, 1, 1)
        self.samplingToggleButton = QtGui.QPushButton(self.gridLayoutWidget)
        self.samplingToggleButton.setEnabled(False)
        self.samplingToggleButton.setAutoDefault(False)
        self.samplingToggleButton.setDefault(False)
        self.samplingToggleButton.setFlat(False)
        self.samplingToggleButton.setObjectName(
            _fromUtf8("samplingToggleButton"))
        self.gridLayout.addWidget(self.samplingToggleButton, 0, 7, 1, 1)
        self.serialPortEdit = QtGui.QLineEdit(self.gridLayoutWidget)
        self.serialPortEdit.setObjectName(_fromUtf8("serialPortEdit"))
        self.gridLayout.addWidget(self.serialPortEdit, 0, 1, 1, 1)
        self.calibrateButton = QtGui.QPushButton(self.gridLayoutWidget)
        self.calibrateButton.setEnabled(False)
        self.calibrateButton.setObjectName(_fromUtf8("calibrateButton"))
        self.gridLayout.addWidget(self.calibrateButton, 0, 9, 1, 1)
        self.label = QtGui.QLabel(self.gridLayoutWidget)
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
        self.calAlgorithmComboBox = QtGui.QComboBox(self.gridLayoutWidget)
        self.calAlgorithmComboBox.setEnabled(False)
        self.calAlgorithmComboBox.setObjectName(
            _fromUtf8("calAlgorithmComboBox"))
        self.calAlgorithmComboBox.addItem(_fromUtf8(""))
        self.gridLayout.addWidget(self.calAlgorithmComboBox, 0, 8, 1, 1)
        self.connectButton = QtGui.QPushButton(self.gridLayoutWidget)
        self.connectButton.setObjectName(_fromUtf8("connectButton"))
        self.gridLayout.addWidget(self.connectButton, 0, 3, 1, 1)
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem, 0, 6, 1, 1)
        self.serialProtocol = QtGui.QComboBox(self.gridLayoutWidget)
        self.serialProtocol.setEnabled(True)
        self.serialProtocol.setObjectName(_fromUtf8("serialProtocol"))
        self.serialProtocol.addItem(_fromUtf8(""))
        self.gridLayout.addWidget(self.serialProtocol, 0, 2, 1, 1)
        self.tabWidget = QtGui.QTabWidget(self.centralwidget)
        self.tabWidget.setGeometry(QtCore.QRect(0, 30, 801, 631))
        self.tabWidget.setObjectName(_fromUtf8("tabWidget"))
        self.uncalibratedTab = QtGui.QWidget()
        self.uncalibratedTab.setObjectName(_fromUtf8("uncalibratedTab"))
        self.gridLayoutWidget_4 = QtGui.QWidget(self.uncalibratedTab)
        self.gridLayoutWidget_4.setGeometry(QtCore.QRect(0, 10, 791, 588))
        self.gridLayoutWidget_4.setObjectName(_fromUtf8("gridLayoutWidget_4"))
        self.gridLayout_4 = QtGui.QGridLayout(self.gridLayoutWidget_4)
        self.gridLayout_4.setSizeConstraint(QtGui.QLayout.SetMaximumSize)
        self.gridLayout_4.setMargin(0)
        self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4"))
        self.gridLayout_5 = QtGui.QGridLayout()
        self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5"))
        self.label_2 = QtGui.QLabel(self.gridLayoutWidget_4)
        self.label_2.setAlignment(QtCore.Qt.AlignCenter)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.gridLayout_5.addWidget(self.label_2, 0, 1, 1, 1)
        self.accYZ = PlotWidget(self.gridLayoutWidget_4)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(
            self.accYZ.sizePolicy().hasHeightForWidth())
        self.accYZ.setSizePolicy(sizePolicy)
        self.accYZ.setObjectName(_fromUtf8("accYZ"))
        self.gridLayout_5.addWidget(self.accYZ, 1, 0, 1, 1)
        self.accZX = PlotWidget(self.gridLayoutWidget_4)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(
            self.accZX.sizePolicy().hasHeightForWidth())
        self.accZX.setSizePolicy(sizePolicy)
        self.accZX.setObjectName(_fromUtf8("accZX"))
        self.gridLayout_5.addWidget(self.accZX, 1, 1, 1, 1)
        self.accXY = PlotWidget(self.gridLayoutWidget_4)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(
            self.accXY.sizePolicy().hasHeightForWidth())
        self.accXY.setSizePolicy(sizePolicy)
        self.accXY.setObjectName(_fromUtf8("accXY"))
        self.gridLayout_5.addWidget(self.accXY, 0, 0, 1, 1)
        self.gridLayout_4.addLayout(self.gridLayout_5, 1, 0, 1, 1)
        self.gridLayout_3 = QtGui.QGridLayout()
        self.gridLayout_3.setSizeConstraint(QtGui.QLayout.SetFixedSize)
        self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3"))
        self.magnXY = PlotWidget(self.gridLayoutWidget_4)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(
            self.magnXY.sizePolicy().hasHeightForWidth())
        self.magnXY.setSizePolicy(sizePolicy)
        self.magnXY.setObjectName(_fromUtf8("magnXY"))
        self.gridLayout_3.addWidget(self.magnXY, 0, 0, 1, 1)
        self.magnYZ = PlotWidget(self.gridLayoutWidget_4)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(
            self.magnYZ.sizePolicy().hasHeightForWidth())
        self.magnYZ.setSizePolicy(sizePolicy)
        self.magnYZ.setObjectName(_fromUtf8("magnYZ"))
        self.gridLayout_3.addWidget(self.magnYZ, 1, 0, 1, 1)
        self.magnZX = PlotWidget(self.gridLayoutWidget_4)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(
            self.magnZX.sizePolicy().hasHeightForWidth())
        self.magnZX.setSizePolicy(sizePolicy)
        self.magnZX.setObjectName(_fromUtf8("magnZX"))
        self.gridLayout_3.addWidget(self.magnZX, 1, 1, 1, 1)
        self.label_3 = QtGui.QLabel(self.gridLayoutWidget_4)
        self.label_3.setAlignment(QtCore.Qt.AlignCenter)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.gridLayout_3.addWidget(self.label_3, 0, 1, 1, 1)
        self.gridLayout_4.addLayout(self.gridLayout_3, 1, 2, 1, 1)
        self.magn3D = GLViewWidget(self.gridLayoutWidget_4)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.magn3D.sizePolicy().hasHeightForWidth())
        self.magn3D.setSizePolicy(sizePolicy)
        self.magn3D.setObjectName(_fromUtf8("magn3D"))
        self.gridLayout_4.addWidget(self.magn3D, 0, 2, 1, 1)
        self.acc3D = GLViewWidget(self.gridLayoutWidget_4)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.acc3D.sizePolicy().hasHeightForWidth())
        self.acc3D.setSizePolicy(sizePolicy)
        self.acc3D.setObjectName(_fromUtf8("acc3D"))
        self.gridLayout_4.addWidget(self.acc3D, 0, 0, 1, 1)
        self.line_3 = QtGui.QFrame(self.gridLayoutWidget_4)
        self.line_3.setLineWidth(1)
        self.line_3.setFrameShape(QtGui.QFrame.VLine)
        self.line_3.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_3.setObjectName(_fromUtf8("line_3"))
        self.gridLayout_4.addWidget(self.line_3, 1, 1, 1, 1)
        self.tabWidget.addTab(self.uncalibratedTab, _fromUtf8(""))
        self.calibratedTab = QtGui.QWidget()
        self.calibratedTab.setObjectName(_fromUtf8("calibratedTab"))
        self.horizontalLayoutWidget = QtGui.QWidget(self.calibratedTab)
        self.horizontalLayoutWidget.setGeometry(QtCore.QRect(0, 380, 791, 181))
        self.horizontalLayoutWidget.setObjectName(
            _fromUtf8("horizontalLayoutWidget"))
        self.horizontalLayout = QtGui.QHBoxLayout(self.horizontalLayoutWidget)
        self.horizontalLayout.setMargin(0)
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.groupBox = QtGui.QGroupBox(self.horizontalLayoutWidget)
        self.groupBox.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft
                                   | QtCore.Qt.AlignVCenter)
        self.groupBox.setFlat(False)
        self.groupBox.setCheckable(False)
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.layoutWidget = QtGui.QWidget(self.groupBox)
        self.layoutWidget.setGeometry(QtCore.QRect(10, 20, 381, 154))
        self.layoutWidget.setObjectName(_fromUtf8("layoutWidget"))
        self.formLayout_3 = QtGui.QFormLayout(self.layoutWidget)
        self.formLayout_3.setSizeConstraint(QtGui.QLayout.SetNoConstraint)
        self.formLayout_3.setFieldGrowthPolicy(
            QtGui.QFormLayout.ExpandingFieldsGrow)
        self.formLayout_3.setLabelAlignment(QtCore.Qt.AlignLeading
                                            | QtCore.Qt.AlignLeft
                                            | QtCore.Qt.AlignVCenter)
        self.formLayout_3.setMargin(0)
        self.formLayout_3.setObjectName(_fromUtf8("formLayout_3"))
        self.label_14 = QtGui.QLabel(self.layoutWidget)
        self.label_14.setObjectName(_fromUtf8("label_14"))
        self.formLayout_3.setWidget(0, QtGui.QFormLayout.LabelRole,
                                    self.label_14)
        self.calRes_acc_OSx = QtGui.QLineEdit(self.layoutWidget)
        self.calRes_acc_OSx.setObjectName(_fromUtf8("calRes_acc_OSx"))
        self.formLayout_3.setWidget(0, QtGui.QFormLayout.FieldRole,
                                    self.calRes_acc_OSx)
        self.label_15 = QtGui.QLabel(self.layoutWidget)
        self.label_15.setObjectName(_fromUtf8("label_15"))
        self.formLayout_3.setWidget(1, QtGui.QFormLayout.LabelRole,
                                    self.label_15)
        self.calRes_acc_OSy = QtGui.QLineEdit(self.layoutWidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.calRes_acc_OSy.sizePolicy().hasHeightForWidth())
        self.calRes_acc_OSy.setSizePolicy(sizePolicy)
        self.calRes_acc_OSy.setObjectName(_fromUtf8("calRes_acc_OSy"))
        self.formLayout_3.setWidget(1, QtGui.QFormLayout.FieldRole,
                                    self.calRes_acc_OSy)
        self.label_16 = QtGui.QLabel(self.layoutWidget)
        self.label_16.setObjectName(_fromUtf8("label_16"))
        self.formLayout_3.setWidget(2, QtGui.QFormLayout.LabelRole,
                                    self.label_16)
        self.calRes_acc_OSz = QtGui.QLineEdit(self.layoutWidget)
        self.calRes_acc_OSz.setObjectName(_fromUtf8("calRes_acc_OSz"))
        self.formLayout_3.setWidget(2, QtGui.QFormLayout.FieldRole,
                                    self.calRes_acc_OSz)
        self.label_17 = QtGui.QLabel(self.layoutWidget)
        self.label_17.setObjectName(_fromUtf8("label_17"))
        self.formLayout_3.setWidget(3, QtGui.QFormLayout.LabelRole,
                                    self.label_17)
        self.calRes_acc_SCx = QtGui.QLineEdit(self.layoutWidget)
        self.calRes_acc_SCx.setObjectName(_fromUtf8("calRes_acc_SCx"))
        self.formLayout_3.setWidget(3, QtGui.QFormLayout.FieldRole,
                                    self.calRes_acc_SCx)
        self.label_18 = QtGui.QLabel(self.layoutWidget)
        self.label_18.setObjectName(_fromUtf8("label_18"))
        self.formLayout_3.setWidget(4, QtGui.QFormLayout.LabelRole,
                                    self.label_18)
        self.calRes_acc_SCy = QtGui.QLineEdit(self.layoutWidget)
        self.calRes_acc_SCy.setObjectName(_fromUtf8("calRes_acc_SCy"))
        self.formLayout_3.setWidget(4, QtGui.QFormLayout.FieldRole,
                                    self.calRes_acc_SCy)
        self.label_19 = QtGui.QLabel(self.layoutWidget)
        self.label_19.setObjectName(_fromUtf8("label_19"))
        self.formLayout_3.setWidget(5, QtGui.QFormLayout.LabelRole,
                                    self.label_19)
        self.calRes_acc_SCz = QtGui.QLineEdit(self.layoutWidget)
        self.calRes_acc_SCz.setObjectName(_fromUtf8("calRes_acc_SCz"))
        self.formLayout_3.setWidget(5, QtGui.QFormLayout.FieldRole,
                                    self.calRes_acc_SCz)
        self.horizontalLayout.addWidget(self.groupBox)
        self.groupBox_2 = QtGui.QGroupBox(self.horizontalLayoutWidget)
        self.groupBox_2.setObjectName(_fromUtf8("groupBox_2"))
        self.layoutWidget_2 = QtGui.QWidget(self.groupBox_2)
        self.layoutWidget_2.setGeometry(QtCore.QRect(10, 20, 381, 154))
        self.layoutWidget_2.setObjectName(_fromUtf8("layoutWidget_2"))
        self.formLayout_5 = QtGui.QFormLayout(self.layoutWidget_2)
        self.formLayout_5.setSizeConstraint(QtGui.QLayout.SetNoConstraint)
        self.formLayout_5.setFieldGrowthPolicy(
            QtGui.QFormLayout.ExpandingFieldsGrow)
        self.formLayout_5.setLabelAlignment(QtCore.Qt.AlignLeading
                                            | QtCore.Qt.AlignLeft
                                            | QtCore.Qt.AlignVCenter)
        self.formLayout_5.setMargin(0)
        self.formLayout_5.setObjectName(_fromUtf8("formLayout_5"))
        self.label_27 = QtGui.QLabel(self.layoutWidget_2)
        self.label_27.setObjectName(_fromUtf8("label_27"))
        self.formLayout_5.setWidget(0, QtGui.QFormLayout.LabelRole,
                                    self.label_27)
        self.calRes_magn_OSx = QtGui.QLineEdit(self.layoutWidget_2)
        self.calRes_magn_OSx.setObjectName(_fromUtf8("calRes_magn_OSx"))
        self.formLayout_5.setWidget(0, QtGui.QFormLayout.FieldRole,
                                    self.calRes_magn_OSx)
        self.label_28 = QtGui.QLabel(self.layoutWidget_2)
        self.label_28.setObjectName(_fromUtf8("label_28"))
        self.formLayout_5.setWidget(1, QtGui.QFormLayout.LabelRole,
                                    self.label_28)
        self.calRes_magn_OSy = QtGui.QLineEdit(self.layoutWidget_2)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.calRes_magn_OSy.sizePolicy().hasHeightForWidth())
        self.calRes_magn_OSy.setSizePolicy(sizePolicy)
        self.calRes_magn_OSy.setObjectName(_fromUtf8("calRes_magn_OSy"))
        self.formLayout_5.setWidget(1, QtGui.QFormLayout.FieldRole,
                                    self.calRes_magn_OSy)
        self.label_29 = QtGui.QLabel(self.layoutWidget_2)
        self.label_29.setObjectName(_fromUtf8("label_29"))
        self.formLayout_5.setWidget(2, QtGui.QFormLayout.LabelRole,
                                    self.label_29)
        self.calRes_magn_OSz = QtGui.QLineEdit(self.layoutWidget_2)
        self.calRes_magn_OSz.setObjectName(_fromUtf8("calRes_magn_OSz"))
        self.formLayout_5.setWidget(2, QtGui.QFormLayout.FieldRole,
                                    self.calRes_magn_OSz)
        self.label_30 = QtGui.QLabel(self.layoutWidget_2)
        self.label_30.setObjectName(_fromUtf8("label_30"))
        self.formLayout_5.setWidget(3, QtGui.QFormLayout.LabelRole,
                                    self.label_30)
        self.calRes_magn_SCx = QtGui.QLineEdit(self.layoutWidget_2)
        self.calRes_magn_SCx.setObjectName(_fromUtf8("calRes_magn_SCx"))
        self.formLayout_5.setWidget(3, QtGui.QFormLayout.FieldRole,
                                    self.calRes_magn_SCx)
        self.label_31 = QtGui.QLabel(self.layoutWidget_2)
        self.label_31.setObjectName(_fromUtf8("label_31"))
        self.formLayout_5.setWidget(4, QtGui.QFormLayout.LabelRole,
                                    self.label_31)
        self.calRes_magn_SCy = QtGui.QLineEdit(self.layoutWidget_2)
        self.calRes_magn_SCy.setObjectName(_fromUtf8("calRes_magn_SCy"))
        self.formLayout_5.setWidget(4, QtGui.QFormLayout.FieldRole,
                                    self.calRes_magn_SCy)
        self.label_32 = QtGui.QLabel(self.layoutWidget_2)
        self.label_32.setObjectName(_fromUtf8("label_32"))
        self.formLayout_5.setWidget(5, QtGui.QFormLayout.LabelRole,
                                    self.label_32)
        self.calRes_magn_SCz = QtGui.QLineEdit(self.layoutWidget_2)
        self.calRes_magn_SCz.setObjectName(_fromUtf8("calRes_magn_SCz"))
        self.formLayout_5.setWidget(5, QtGui.QFormLayout.FieldRole,
                                    self.calRes_magn_SCz)
        self.horizontalLayout.addWidget(self.groupBox_2)
        self.horizontalLayoutWidget_2 = QtGui.QWidget(self.calibratedTab)
        self.horizontalLayoutWidget_2.setGeometry(
            QtCore.QRect(488, 560, 301, 31))
        self.horizontalLayoutWidget_2.setObjectName(
            _fromUtf8("horizontalLayoutWidget_2"))
        self.horizontalLayout_2 = QtGui.QHBoxLayout(
            self.horizontalLayoutWidget_2)
        self.horizontalLayout_2.setMargin(0)
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.saveCalibrationEEPROMButton = QtGui.QPushButton(
            self.horizontalLayoutWidget_2)
        self.saveCalibrationEEPROMButton.setEnabled(False)
        self.saveCalibrationEEPROMButton.setObjectName(
            _fromUtf8("saveCalibrationEEPROMButton"))
        self.horizontalLayout_2.addWidget(self.saveCalibrationEEPROMButton)
        self.saveCalibrationHeaderButton = QtGui.QPushButton(
            self.horizontalLayoutWidget_2)
        self.saveCalibrationHeaderButton.setEnabled(False)
        self.saveCalibrationHeaderButton.setObjectName(
            _fromUtf8("saveCalibrationHeaderButton"))
        self.horizontalLayout_2.addWidget(self.saveCalibrationHeaderButton)
        self.horizontalLayoutWidget_3 = QtGui.QWidget(self.calibratedTab)
        self.horizontalLayoutWidget_3.setGeometry(QtCore.QRect(0, 0, 791, 381))
        self.horizontalLayoutWidget_3.setObjectName(
            _fromUtf8("horizontalLayoutWidget_3"))
        self.horizontalLayout_3 = QtGui.QHBoxLayout(
            self.horizontalLayoutWidget_3)
        self.horizontalLayout_3.setMargin(0)
        self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
        self.tabWidget_2 = QtGui.QTabWidget(self.horizontalLayoutWidget_3)
        self.tabWidget_2.setTabPosition(QtGui.QTabWidget.South)
        self.tabWidget_2.setTabShape(QtGui.QTabWidget.Rounded)
        self.tabWidget_2.setUsesScrollButtons(True)
        self.tabWidget_2.setDocumentMode(False)
        self.tabWidget_2.setTabsClosable(False)
        self.tabWidget_2.setMovable(False)
        self.tabWidget_2.setObjectName(_fromUtf8("tabWidget_2"))
        self.tab = QtGui.QWidget()
        self.tab.setObjectName(_fromUtf8("tab"))
        self.accXY_cal = PlotWidget(self.tab)
        self.accXY_cal.setGeometry(QtCore.QRect(0, 0, 781, 351))
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(
            self.accXY_cal.sizePolicy().hasHeightForWidth())
        self.accXY_cal.setSizePolicy(sizePolicy)
        self.accXY_cal.setObjectName(_fromUtf8("accXY_cal"))
        self.tabWidget_2.addTab(self.tab, _fromUtf8(""))
        self.tab_4 = QtGui.QWidget()
        self.tab_4.setObjectName(_fromUtf8("tab_4"))
        self.accYZ_cal = PlotWidget(self.tab_4)
        self.accYZ_cal.setGeometry(QtCore.QRect(0, 0, 781, 351))
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(
            self.accYZ_cal.sizePolicy().hasHeightForWidth())
        self.accYZ_cal.setSizePolicy(sizePolicy)
        self.accYZ_cal.setObjectName(_fromUtf8("accYZ_cal"))
        self.tabWidget_2.addTab(self.tab_4, _fromUtf8(""))
        self.tab_3 = QtGui.QWidget()
        self.tab_3.setObjectName(_fromUtf8("tab_3"))
        self.accZX_cal = PlotWidget(self.tab_3)
        self.accZX_cal.setGeometry(QtCore.QRect(0, 0, 781, 351))
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(
            self.accZX_cal.sizePolicy().hasHeightForWidth())
        self.accZX_cal.setSizePolicy(sizePolicy)
        self.accZX_cal.setObjectName(_fromUtf8("accZX_cal"))
        self.tabWidget_2.addTab(self.tab_3, _fromUtf8(""))
        self.tab_7 = QtGui.QWidget()
        self.tab_7.setObjectName(_fromUtf8("tab_7"))
        self.acc3D_cal = GLViewWidget(self.tab_7)
        self.acc3D_cal.setGeometry(QtCore.QRect(0, 0, 389, 351))
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.acc3D_cal.sizePolicy().hasHeightForWidth())
        self.acc3D_cal.setSizePolicy(sizePolicy)
        self.acc3D_cal.setObjectName(_fromUtf8("acc3D_cal"))
        self.tabWidget_2.addTab(self.tab_7, _fromUtf8(""))
        self.horizontalLayout_3.addWidget(self.tabWidget_2)
        self.tabWidget_3 = QtGui.QTabWidget(self.horizontalLayoutWidget_3)
        self.tabWidget_3.setTabPosition(QtGui.QTabWidget.South)
        self.tabWidget_3.setTabShape(QtGui.QTabWidget.Rounded)
        self.tabWidget_3.setUsesScrollButtons(True)
        self.tabWidget_3.setDocumentMode(False)
        self.tabWidget_3.setTabsClosable(False)
        self.tabWidget_3.setMovable(False)
        self.tabWidget_3.setObjectName(_fromUtf8("tabWidget_3"))
        self.tab_2 = QtGui.QWidget()
        self.tab_2.setObjectName(_fromUtf8("tab_2"))
        self.magnXY_cal = PlotWidget(self.tab_2)
        self.magnXY_cal.setGeometry(QtCore.QRect(0, 0, 781, 351))
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(
            self.magnXY_cal.sizePolicy().hasHeightForWidth())
        self.magnXY_cal.setSizePolicy(sizePolicy)
        self.magnXY_cal.setObjectName(_fromUtf8("magnXY_cal"))
        self.tabWidget_3.addTab(self.tab_2, _fromUtf8(""))
        self.tab_5 = QtGui.QWidget()
        self.tab_5.setObjectName(_fromUtf8("tab_5"))
        self.magnYZ_cal = PlotWidget(self.tab_5)
        self.magnYZ_cal.setGeometry(QtCore.QRect(0, 0, 781, 351))
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(
            self.magnYZ_cal.sizePolicy().hasHeightForWidth())
        self.magnYZ_cal.setSizePolicy(sizePolicy)
        self.magnYZ_cal.setObjectName(_fromUtf8("magnYZ_cal"))
        self.tabWidget_3.addTab(self.tab_5, _fromUtf8(""))
        self.tab_6 = QtGui.QWidget()
        self.tab_6.setObjectName(_fromUtf8("tab_6"))
        self.magnZX_cal = PlotWidget(self.tab_6)
        self.magnZX_cal.setGeometry(QtCore.QRect(0, 0, 781, 351))
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(
            self.magnZX_cal.sizePolicy().hasHeightForWidth())
        self.magnZX_cal.setSizePolicy(sizePolicy)
        self.magnZX_cal.setObjectName(_fromUtf8("magnZX_cal"))
        self.tabWidget_3.addTab(self.tab_6, _fromUtf8(""))
        self.tab_8 = QtGui.QWidget()
        self.tab_8.setObjectName(_fromUtf8("tab_8"))
        self.magn3D_cal = GLViewWidget(self.tab_8)
        self.magn3D_cal.setGeometry(QtCore.QRect(0, 0, 389, 351))
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.magn3D_cal.sizePolicy().hasHeightForWidth())
        self.magn3D_cal.setSizePolicy(sizePolicy)
        self.magn3D_cal.setObjectName(_fromUtf8("magn3D_cal"))
        self.tabWidget_3.addTab(self.tab_8, _fromUtf8(""))
        self.horizontalLayout_3.addWidget(self.tabWidget_3)
        self.horizontalLayoutWidget_4 = QtGui.QWidget(self.calibratedTab)
        self.horizontalLayoutWidget_4.setGeometry(QtCore.QRect(
            0, 560, 161, 31))
        self.horizontalLayoutWidget_4.setObjectName(
            _fromUtf8("horizontalLayoutWidget_4"))
        self.horizontalLayout_4 = QtGui.QHBoxLayout(
            self.horizontalLayoutWidget_4)
        self.horizontalLayout_4.setMargin(0)
        self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4"))
        self.clearCalibrationEEPROMButton = QtGui.QPushButton(
            self.horizontalLayoutWidget_4)
        self.clearCalibrationEEPROMButton.setEnabled(False)
        self.clearCalibrationEEPROMButton.setObjectName(
            _fromUtf8("clearCalibrationEEPROMButton"))
        self.horizontalLayout_4.addWidget(self.clearCalibrationEEPROMButton)
        self.tabWidget.addTab(self.calibratedTab, _fromUtf8(""))
        self.tab_9 = QtGui.QWidget()
        self.tab_9.setObjectName(_fromUtf8("tab_9"))
        self.label_4 = QtGui.QLabel(self.tab_9)
        self.label_4.setGeometry(QtCore.QRect(290, 270, 261, 16))
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.tabWidget.addTab(self.tab_9, _fromUtf8(""))
        FreeIMUCal.setCentralWidget(self.centralwidget)
        self.statusbar = QtGui.QStatusBar(FreeIMUCal)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        FreeIMUCal.setStatusBar(self.statusbar)

        self.retranslateUi(FreeIMUCal)
        self.tabWidget.setCurrentIndex(0)
        self.tabWidget_2.setCurrentIndex(0)
        self.tabWidget_3.setCurrentIndex(0)
        QtCore.QMetaObject.connectSlotsByName(FreeIMUCal)

    def retranslateUi(self, FreeIMUCal):
        FreeIMUCal.setWindowTitle(
            _translate("FreeIMUCal", "FreeIMU Calibration Application", None))
        self.samplingToggleButton.setToolTip(
            _translate(
                "FreeIMUCal",
                "Toggle Start/Stop sampling of sensor data from the IMU",
                None))
        self.samplingToggleButton.setText(
            _translate("FreeIMUCal", "Start Sampling", None))
        self.calibrateButton.setToolTip(
            _translate("FreeIMUCal",
                       "Run calibration algorithm over the data collected",
                       None))
        self.calibrateButton.setText(
            _translate("FreeIMUCal", "Calibrate", None))
        self.label.setText(_translate("FreeIMUCal", "Serial Port:", None))
        self.calAlgorithmComboBox.setToolTip(
            _translate(
                "FreeIMUCal",
                "<html><head/><body><p>Calibration Algorithm used.</p></body></html>",
                None))
        self.calAlgorithmComboBox.setItemText(
            0, _translate("FreeIMUCal", "Ellipsoid to Sphere", None))
        self.connectButton.setToolTip(
            _translate("FreeIMUCal", "Connect or Disconnect from the Arduino",
                       None))
        self.connectButton.setText(_translate("FreeIMUCal", "Connect", None))
        self.serialProtocol.setToolTip(
            _translate("FreeIMUCal", "Serial Protocol to Communicate with IMU",
                       None))
        self.serialProtocol.setItemText(
            0, _translate("FreeIMUCal", "FreeIMU_serial", None))
        self.label_2.setText(_translate("FreeIMUCal", "Accelerometer", None))
        self.label_3.setText(_translate("FreeIMUCal", "Magnetometer", None))
        self.tabWidget.setTabText(
            self.tabWidget.indexOf(self.uncalibratedTab),
            _translate("FreeIMUCal", "Uncalibrated", None))
        self.groupBox.setTitle(_translate("FreeIMUCal", "Accelerometer", None))
        self.label_14.setText(_translate("FreeIMUCal", "Offset X", None))
        self.label_15.setText(_translate("FreeIMUCal", "Offset Y", None))
        self.label_16.setText(_translate("FreeIMUCal", "Offset Z", None))
        self.label_17.setText(_translate("FreeIMUCal", "Scale X", None))
        self.label_18.setText(_translate("FreeIMUCal", "Scale Y", None))
        self.label_19.setText(_translate("FreeIMUCal", "Scale Z", None))
        self.groupBox_2.setTitle(_translate("FreeIMUCal", "Magnetometer",
                                            None))
        self.label_27.setText(_translate("FreeIMUCal", "Offset X", None))
        self.label_28.setText(_translate("FreeIMUCal", "Offset Y", None))
        self.label_29.setText(_translate("FreeIMUCal", "Offset Z", None))
        self.label_30.setText(_translate("FreeIMUCal", "Scale X", None))
        self.label_31.setText(_translate("FreeIMUCal", "Scale Y", None))
        self.label_32.setText(_translate("FreeIMUCal", "Scale Z", None))
        self.saveCalibrationEEPROMButton.setToolTip(
            _translate(
                "FreeIMUCal",
                "Store the calibration parameters to the microcontroller EEPROM",
                None))
        self.saveCalibrationEEPROMButton.setText(
            _translate("FreeIMUCal", "Save to EEPROM", None))
        self.saveCalibrationHeaderButton.setToolTip(
            _translate(
                "FreeIMUCal",
                "Store the calibration parameters in an header .h file. When such header is active the EEPROM calibration storage code is disabled thus saving program and data memory.",
                None))
        self.saveCalibrationHeaderButton.setText(
            _translate("FreeIMUCal", "Save to calibration.h", None))
        self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab),
                                    _translate("FreeIMUCal", "Acc XY", None))
        self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_4),
                                    _translate("FreeIMUCal", "Acc YZ", None))
        self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_3),
                                    _translate("FreeIMUCal", "Acc ZX", None))
        self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_7),
                                    _translate("FreeIMUCal", "Acc 3D", None))
        self.tabWidget_3.setTabText(self.tabWidget_3.indexOf(self.tab_2),
                                    _translate("FreeIMUCal", "Magn XY", None))
        self.tabWidget_3.setTabText(self.tabWidget_3.indexOf(self.tab_5),
                                    _translate("FreeIMUCal", "Magn YZ", None))
        self.tabWidget_3.setTabText(self.tabWidget_3.indexOf(self.tab_6),
                                    _translate("FreeIMUCal", "Magn ZX", None))
        self.tabWidget_3.setTabText(self.tabWidget_3.indexOf(self.tab_8),
                                    _translate("FreeIMUCal", "Magn 3D", None))
        self.clearCalibrationEEPROMButton.setToolTip(
            _translate(
                "FreeIMUCal",
                "<html><head/><body><p>Clear any calibration parameter from the microcontroller EEPROM</p></body></html>",
                None))
        self.clearCalibrationEEPROMButton.setText(
            _translate("FreeIMUCal", "Clear EEPROM", None))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.calibratedTab),
                                  _translate("FreeIMUCal", "Calibrated", None))
        self.label_4.setText(
            _translate("FreeIMUCal", "To Be Implemented", None))
        self.tabWidget.setTabText(
            self.tabWidget.indexOf(self.tab_9),
            _translate("FreeIMUCal", "Orientation Sensing Test", None))
class PoseEstimation(object):
    @staticmethod
    def getframe(option):
        image = None
        ret_val = 0
        camera = 0
        if option == "camera":
            cam = cv.VideoCapture(camera)
            ret_val, image = cam.read()
        elif option == "kinect":
            image, ret_val = freenect.sync_get_video()
            image = cv.cvtColor(image, cv.COLOR_RGB2BGR)
        elif option.__contains__("/"):
            image = cv.imread(option)
        elif option == "camera_image":
            print("after waiting")
            time.sleep(5)
            print("before waiting")
            cam = cv.VideoCapture(camera)
            ret_val, image = cam.read()
        return image, ret_val

    # creating window inilatizing graph objects
    def __init__(self, args, option='camera'):
        self.args = args
        self.fpsTime = 0
        self.option = option
        self.app = QtGui.QApplication(sys.argv)
        self.window = GLViewWidget()
        self.window.setGeometry(0, 150, 1920, 1080)
        self.window.setCameraPosition(distance=50, elevation=8)
        self.window.setWindowTitle("3D Pose Estimation")
        self.window.show()
        gx = GLGridItem()
        gy = GLGridItem()
        gz = GLGridItem()
        gx.rotate(90, 0, 1, 0)
        gy.rotate(90, 1, 0, 0)
        gx.translate(-10, 0, 0)
        gy.translate(0, -10, 0)
        gz.translate(0, 0, -10)
        self.window.addItem(gx)
        self.window.addItem(gy)
        self.window.addItem(gz)
        self.lines = {}
        keypoints = []
        self.connection = [[0, 1], [1, 2], [2, 3], [0, 4], [4, 5], [5, 6],
                           [0, 7], [7, 8], [8, 9], [9, 10], [8, 11], [11, 12],
                           [12, 13], [8, 14], [14, 15], [15, 16]]
        self.w, self.h = model_wh(self.args.resize)

        if self.w > 0 and self.h > 0:
            self.e = TfPoseEstimator(get_graph_path(self.args.model),
                                     target_size=(self.w, self.h),
                                     trt_bool=str2bool(self.args.tensorrt))
        else:
            self.e = TfPoseEstimator(get_graph_path(self.args.model),
                                     target_size=(432, 368),
                                     trt_bool=str2bool(self.args.tensorrt))

        print(self.args.option)
        image, ret_val = PoseEstimation.getframe(self.args.option)

        self.poseLifting = Prob3dPose(
            'lifting/prob_model/prob_model_params.mat')
        try:

            keypoints = self.mesh(image)
        except AssertionError:
            print("body not in image")
            keypoints = np.zeros((17, 3))
        except Exception:
            print("General exception")
            keypoints = np.zeros((17, 3))

        # self.lines = {}
        # self.connection = [
        #     [13, 16]
        # ]
        # p = []
        # p.append(keypoints[13])
        # p.append(keypoints[16])
        # p = np.array(p)
        finally:
            self.points = GLScatterPlotItem(
                pos=np.array(np.array(keypoints)),
                color=glColor((12, 255, 0)),
                size=15,
            )
            self.window.addItem(self.points)
            for n, pts in enumerate(self.connection):
                self.lines[n] = GLLinePlotItem(pos=np.array(
                    [keypoints[p] for p in pts]),
                                               color=glColor((0, 0, 255)),
                                               width=3,
                                               antialias=True)
                self.window.addItem(self.lines[n])

    def mesh(self, image):
        # image_h, image_w = image.shape[:2]

        width = 640
        height = 480
        pose_2d_mpiis = []
        visibilities = []

        humans = self.e.inference(image,
                                  resize_to_default=(self.w > 0
                                                     and self.h > 0),
                                  upsample_size=self.args.resize_out_ratio)
        image = TfPoseEstimator.draw_humans(image, humans, imgcopy=False)
        cv.putText(image, "FPS: %f" % (1.0 / (time.time() - self.fpsTime)),
                   (10, 10), cv.FONT_HERSHEY_SIMPLEX, 0.5, (0, 255, 0), 2)
        cv.imshow('tf-pose-estimation result', image)
        self.fpsTime = time.time()

        # image = TfPoseEstimator.draw_humans(image, humans, imgcopy=False)
        # cv2.putText(image,
        #             "FPS: %f" % (1.0 / (time.time() - terrain.fps_time)),
        #             (10, 10), cv2.FONT_HERSHEY_SIMPLEX, 0.5,
        #             (0, 255, 0), 2)
        # cv2.imshow('tf-pose-estimation result', image)
        # terrain.fps_time = time.time()
        # cv2.waitKey(1)

        for human in humans:
            pose_2d_mpii, visibility = common.MPIIPart.from_coco(human)
            pose_2d_mpiis.append([(int(y * height + 0.5), int(x * width + 0.5))
                                  for x, y in pose_2d_mpii])
            visibilities.append(visibility)

        pose_2d_mpiis = np.array(pose_2d_mpiis)
        visibilities = np.array(visibilities)
        transformed_pose2d, weights = self.poseLifting.transform_joints(
            pose_2d_mpiis, visibilities)
        pose_3d = self.poseLifting.compute_3d(transformed_pose2d, weights)

        keypoints = pose_3d[0].transpose()
        keypoints = keypoints / 100
        print(" \n")

        print(keypoints)
        return keypoints

    """
    return 3d keypoints

    """

    def update(self):
        """ tf.constant([123]) + tf.constant([321])
                update the mesh and shift the noise each time
                """
        # ret_val, image = terrain.get_video()
        # ret_val, image = self.cam.read()
        if cv.waitKey(1) & 0xFF == 27:
            cv.destroyAllWindows()
            sys.exit()

        keypoints = []
        image, ret_val = PoseEstimation.getframe(self.args.option)
        try:
            keypoints = self.mesh(image)
        except AssertionError:
            print("body not in image")
            keypoints = np.zeros((17, 3))
        except Exception:
            print("General exception")
            keypoints = np.zeros((17, 3))
        finally:
            self.points.setData(pos=np.array(keypoints))
            for n, pts in enumerate(self.connection):
                self.lines[n].setData(pos=np.array([keypoints[p]
                                                    for p in pts]))

    """
        update graph all graph objects
    """

    def start(self):
        if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
            QtGui.QApplication.instance().exec_()

    def animation(self, frametime=10):
        """u
        calls the update method to run in a loop
        """
        if not (self.option.__contains__("/")
                or self.option == "camera_image"):
            timer = QtCore.QTimer()
            timer.timeout.connect(self.update)
            timer.start(frametime)
        self.start()