Files
StarPilot/tools/cabana/mainwin.cc
T
Dean Lee f93f4e9f9b canbana: complete basic functions (#25965)
* add chart header

* get all signal val from logs

* loop in selected range

* clear list before append

* automatically zoom on yaxis

* cleanup

* sync charts

* fix event_begin_sec

* set the color of rubber

* add TODO

* sync slider with charts

* keep video aspect ratio

* sync plot buttons

* reduce flickers

* cleanup

* refactor detail view

* clear counters

* more

use qcamera
old-commit-hash: a6ba073231761e06ac6f070a01b434243d9d0693
2022-10-05 21:17:22 -07:00

38 lines
1.2 KiB
C++

#include "tools/cabana/mainwin.h"
#include <QHBoxLayout>
#include <QVBoxLayout>
MainWindow::MainWindow() : QWidget() {
QVBoxLayout *main_layout = new QVBoxLayout(this);
QHBoxLayout *h_layout = new QHBoxLayout();
main_layout->addLayout(h_layout);
messages_widget = new MessagesWidget(this);
h_layout->addWidget(messages_widget);
detail_widget = new DetailWidget(this);
detail_widget->setFixedWidth(600);
h_layout->addWidget(detail_widget);
// right widget
QWidget *right_container = new QWidget(this);
right_container->setFixedWidth(640);
QVBoxLayout *r_layout = new QVBoxLayout(right_container);
video_widget = new VideoWidget(this);
r_layout->addWidget(video_widget);
charts_widget = new ChartsWidget(this);
QScrollArea *scroll = new QScrollArea(this);
scroll->setWidget(charts_widget);
scroll->setWidgetResizable(true);
scroll->setFrameShape(QFrame::NoFrame);
scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
scroll->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
r_layout->addWidget(scroll);
h_layout->addWidget(right_container);
QObject::connect(messages_widget, &MessagesWidget::msgChanged, detail_widget, &DetailWidget::setMsg);
}