mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-30 02:52:04 +08:00
faster driverview start (#20507)
old-commit-hash: 32c4cf00c2d6bac059516cc44494808cf5a408ca
This commit is contained in:
@@ -396,6 +396,11 @@ void ui_draw(UIState *s) {
|
||||
if (draw_alerts && s->scene.alert_size != cereal::ControlsState::AlertSize::NONE) {
|
||||
ui_draw_vision_alert(s);
|
||||
}
|
||||
|
||||
if (s->scene.driver_view && !s->vipc_client->connected) {
|
||||
nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE);
|
||||
ui_draw_text(s, s->viz_rect.centerX(), s->viz_rect.centerY(), "Please wait for camera to start", 40 * 2.5, COLOR_WHITE, "sans-bold");
|
||||
}
|
||||
nvgEndFrame(s->vg);
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ void HomeWindow::mousePressEvent(QMouseEvent* e) {
|
||||
UIState* ui_state = &glWindow->ui_state;
|
||||
if (GLWindow::ui_state.scene.driver_view) {
|
||||
Params().write_db_value("IsDriverViewEnabled", "0", 1);
|
||||
GLWindow::ui_state.scene.driver_view = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "common/params.h"
|
||||
#include "common/util.h"
|
||||
#include "selfdrive/hardware/hw.h"
|
||||
|
||||
#include "home.hpp"
|
||||
|
||||
QWidget * toggles_panel() {
|
||||
QVBoxLayout *toggles_list = new QVBoxLayout();
|
||||
@@ -86,7 +86,10 @@ DevicePanel::DevicePanel(QWidget* parent) : QWidget(parent) {
|
||||
|
||||
offroad_btns.append(new ButtonControl("Driver Camera", "PREVIEW",
|
||||
"Preview the driver facing camera to help optimize device mounting position for best driver monitoring experience. (vehicle must be off)",
|
||||
[=]() { Params().write_db_value("IsDriverViewEnabled", "1", 1); }));
|
||||
[=]() {
|
||||
Params().write_db_value("IsDriverViewEnabled", "1", 1);
|
||||
GLWindow::ui_state.scene.driver_view = true; }
|
||||
));
|
||||
|
||||
offroad_btns.append(new ButtonControl("Reset Calibration", "RESET",
|
||||
"openpilot requires the device to be mounted within 4° left or right and within 5° up or down. openpilot is continuously calibrating, resetting is rarely required.", [=]() {
|
||||
|
||||
@@ -205,11 +205,6 @@ static void update_sockets(UIState *s) {
|
||||
}
|
||||
if (sm.updated("driverMonitoringState")) {
|
||||
scene.dmonitoring_state = sm["driverMonitoringState"].getDriverMonitoringState();
|
||||
if(!scene.driver_view && !scene.ignition) {
|
||||
read_param(&scene.driver_view, "IsDriverViewEnabled");
|
||||
}
|
||||
} else if ((sm.frame - sm.rcv_frame("driverMonitoringState")) > UI_FREQ/2) {
|
||||
scene.driver_view = false;
|
||||
}
|
||||
if (sm.updated("sensorEvents")) {
|
||||
for (auto sensor : sm["sensorEvents"].getSensorEvents()) {
|
||||
|
||||
Reference in New Issue
Block a user