mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-24 07:22:04 +08:00
Qt-UI add driver monitoring view in offroad (#20148)
* should work, need to test onroad * reduce diff * Update home.cc Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
@@ -160,7 +160,11 @@ void HomeWindow::setVisibility(bool offroad) {
|
||||
|
||||
void HomeWindow::mousePressEvent(QMouseEvent* e) {
|
||||
UIState* ui_state = &glWindow->ui_state;
|
||||
|
||||
if (GLWindow::ui_state.started && GLWindow::ui_state.scene.frontview) {
|
||||
Params().write_db_value("IsDriverViewEnabled", "0", 1);
|
||||
return;
|
||||
}
|
||||
|
||||
glWindow->wake();
|
||||
|
||||
// Settings button click
|
||||
|
||||
@@ -28,6 +28,7 @@ QFrame* horizontal_line(QWidget* parent = 0){
|
||||
line->setFixedHeight(2);
|
||||
return line;
|
||||
}
|
||||
|
||||
QWidget* labelWidget(QString labelName, QString labelContent){
|
||||
QHBoxLayout* labelLayout = new QHBoxLayout;
|
||||
labelLayout->addWidget(new QLabel(labelName), 0, Qt::AlignLeft);
|
||||
@@ -150,6 +151,14 @@ QWidget * device_panel() {
|
||||
for (auto &l : labels) {
|
||||
device_layout->addWidget(labelWidget(QString::fromStdString(l.first), QString::fromStdString(l.second)), 0, Qt::AlignTop);
|
||||
}
|
||||
|
||||
QPushButton* dcam_view = new QPushButton("Driver camera view");
|
||||
device_layout->addWidget(dcam_view, 0, Qt::AlignBottom);
|
||||
device_layout->addWidget(horizontal_line(), Qt::AlignBottom);
|
||||
QObject::connect(dcam_view, &QPushButton::released, [=]() {
|
||||
Params().write_db_value("IsDriverViewEnabled", "1", 1);
|
||||
});
|
||||
|
||||
|
||||
// TODO: show current calibration values
|
||||
QPushButton *clear_cal_btn = new QPushButton("Reset Calibration");
|
||||
|
||||
Reference in New Issue
Block a user