add tool to watch all three beautiful cameras (#22528)

pull/22529/head
Adeeb Shihadeh 4 years ago committed by GitHub
parent 2f2b9116d4
commit ff771d9fcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      selfdrive/ui/.gitignore
  2. 2
      selfdrive/ui/SConscript
  3. 28
      selfdrive/ui/watch3.cc

@ -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])

@ -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();
}
Loading…
Cancel
Save