mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-19 15:54:00 +08:00
add tool to watch all three beautiful cameras (#22528)
This commit is contained in:
2
selfdrive/ui/.gitignore
vendored
2
selfdrive/ui/.gitignore
vendored
@@ -1,8 +1,8 @@
|
||||
moc_*
|
||||
*.moc
|
||||
|
||||
watch3
|
||||
installer/installers/*
|
||||
|
||||
replay/replay
|
||||
replay/tests/test_replay
|
||||
qt/text
|
||||
|
||||
@@ -114,5 +114,7 @@ if arch in ['x86_64', 'Darwin'] and os.path.exists(Dir("#tools/").get_abspath())
|
||||
replay_libs = [replay_lib, 'avutil', 'avcodec', 'avformat', 'swscale', 'bz2', 'curl'] + qt_libs
|
||||
qt_env.Program("replay/replay", ["replay/main.cc"], LIBS=replay_libs)
|
||||
|
||||
qt_env.Program("watch3", ["watch3.cc"], LIBS=qt_libs)
|
||||
|
||||
if GetOption('test'):
|
||||
qt_env.Program('replay/tests/test_replay', ['replay/tests/test_runner.cc', 'replay/tests/test_replay.cc'], LIBS=[replay_libs])
|
||||
|
||||
28
selfdrive/ui/watch3.cc
Normal file
28
selfdrive/ui/watch3.cc
Normal file
@@ -0,0 +1,28 @@
|
||||
#include <QApplication>
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "selfdrive/ui/qt/qt_window.h"
|
||||
#include "selfdrive/ui/qt/util.h"
|
||||
#include "selfdrive/ui/qt/widgets/cameraview.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
QSurfaceFormat fmt;
|
||||
fmt.setRenderableType(QSurfaceFormat::OpenGLES);
|
||||
QSurfaceFormat::setDefaultFormat(fmt);
|
||||
|
||||
QApplication a(argc, argv);
|
||||
QWidget w;
|
||||
setMainWindow(&w);
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout(&w);
|
||||
layout->setMargin(0);
|
||||
layout->setSpacing(0);
|
||||
layout->addWidget(new CameraViewWidget(VISION_STREAM_RGB_BACK, false));
|
||||
|
||||
QHBoxLayout *hlayout = new QHBoxLayout(&w);
|
||||
layout->addLayout(hlayout);
|
||||
hlayout->addWidget(new CameraViewWidget(VISION_STREAM_RGB_FRONT, false));
|
||||
hlayout->addWidget(new CameraViewWidget(VISION_STREAM_RGB_WIDE, false));
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
Reference in New Issue
Block a user