mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-03 04:22:09 +08:00
revert tici ui rotate
old-commit-hash: b3fad609d9886e55696529290acdc70263e59fff
This commit is contained in:
@@ -17,21 +17,11 @@ extern "C"{
|
||||
#include "sidebar.hpp"
|
||||
|
||||
// TODO: this is also hardcoded in common/transformations/camera.py
|
||||
// TODO: choose based on frame input size
|
||||
#ifdef QCOM2
|
||||
const mat3 intrinsic_matrix = (mat3){{
|
||||
2648.0, 0.0, 1928.0/2,
|
||||
0.0, 2648.0, 1208.0/2,
|
||||
0.0, 0.0, 1.0
|
||||
}};
|
||||
#else
|
||||
const mat3 intrinsic_matrix = (mat3){{
|
||||
910., 0., 582.,
|
||||
0., 910., 437.,
|
||||
0., 0., 1.
|
||||
}};
|
||||
#endif
|
||||
|
||||
|
||||
const uint8_t alert_colors[][4] = {
|
||||
[STATUS_OFFROAD] = {0x07, 0x23, 0x39, 0xf1},
|
||||
|
||||
@@ -23,20 +23,15 @@ MainWindow::MainWindow(QWidget *parent) : QWidget(parent) {
|
||||
|
||||
#ifdef QCOM2
|
||||
set_core_affinity(7);
|
||||
QLabel * label = new QLabel(this);
|
||||
main_layout->addWidget(label);
|
||||
#endif
|
||||
|
||||
GLWindow * glWindow = new GLWindow;
|
||||
glWindow->setLabel(label);
|
||||
glWindow->show();
|
||||
#else
|
||||
GLWindow * glWindow = new GLWindow(this);
|
||||
main_layout->addWidget(glWindow);
|
||||
#endif
|
||||
|
||||
SettingsWindow * settingsWindow = new SettingsWindow(this);
|
||||
main_layout->addWidget(settingsWindow);
|
||||
|
||||
|
||||
main_layout->setMargin(0);
|
||||
setLayout(main_layout);
|
||||
QObject::connect(glWindow, SIGNAL(openSettings()), this, SLOT(openSettings()));
|
||||
@@ -63,10 +58,6 @@ GLWindow::GLWindow(QWidget *parent) : QOpenGLWidget(parent) {
|
||||
timer = new QTimer(this);
|
||||
QObject::connect(timer, SIGNAL(timeout()), this, SLOT(timerUpdate()));
|
||||
|
||||
#ifdef QCOM2
|
||||
setFixedWidth(vwp_w);
|
||||
setFixedHeight(vwp_h);
|
||||
#endif
|
||||
}
|
||||
|
||||
GLWindow::~GLWindow() {
|
||||
@@ -74,10 +65,6 @@ GLWindow::~GLWindow() {
|
||||
doneCurrent();
|
||||
}
|
||||
|
||||
void GLWindow::setLabel(QLabel * l){
|
||||
label = l;
|
||||
}
|
||||
|
||||
void GLWindow::initializeGL() {
|
||||
initializeOpenGLFunctions();
|
||||
std::cout << "OpenGL version: " << glGetString(GL_VERSION) << std::endl;
|
||||
@@ -112,13 +99,6 @@ void GLWindow::timerUpdate(){
|
||||
#endif
|
||||
|
||||
update();
|
||||
|
||||
if (label != NULL){
|
||||
QImage img = grabFramebuffer();
|
||||
QTransform transform;
|
||||
transform.rotate(90);
|
||||
label->setPixmap(QPixmap::fromImage(img).transformed(transform));
|
||||
}
|
||||
}
|
||||
|
||||
void GLWindow::resizeGL(int w, int h) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTimer>
|
||||
#include <QLabel>
|
||||
#include <QGuiApplication>
|
||||
#include <QOpenGLWidget>
|
||||
#include <QOpenGLFunctions>
|
||||
@@ -40,7 +39,6 @@ class GLWindow : public QOpenGLWidget, protected QOpenGLFunctions
|
||||
public:
|
||||
using QOpenGLWidget::QOpenGLWidget;
|
||||
explicit GLWindow(QWidget *parent = 0);
|
||||
void setLabel(QLabel *l);
|
||||
~GLWindow();
|
||||
|
||||
protected:
|
||||
@@ -54,7 +52,7 @@ private:
|
||||
QTimer * timer;
|
||||
UIState * ui_state;
|
||||
QtSound sound;
|
||||
QLabel * label = NULL;
|
||||
|
||||
bool onroad = true;
|
||||
|
||||
public slots:
|
||||
|
||||
Reference in New Issue
Block a user