UI: rename frontview to driver_view (#20228)
parent
f96e8f2f17
commit
8db3eea6c5
|
@ -64,7 +64,7 @@ static void handle_display_state(UIState *s, bool user_input) {
|
|||
static void handle_vision_touch(UIState *s, int touch_x, int touch_y) {
|
||||
if (s->started && (touch_x >= s->viz_rect.x - bdr_s)
|
||||
&& (s->active_app != cereal::UiLayoutState::App::SETTINGS)) {
|
||||
if (!s->scene.frontview) {
|
||||
if (!s->scene.driver_view) {
|
||||
s->sidebar_collapsed = !s->sidebar_collapsed;
|
||||
} else {
|
||||
Params().write_db_value("IsDriverViewEnabled", "0", 1);
|
||||
|
@ -172,7 +172,7 @@ int main(int argc, char* argv[]) {
|
|||
|
||||
ui_draw(s);
|
||||
double u2 = millis_since_boot();
|
||||
if (!s->scene.frontview && (u2-u1 > 66)) {
|
||||
if (!s->scene.driver_view && (u2-u1 > 66)) {
|
||||
// warn on sub 15fps
|
||||
LOGW("slow frame(%llu) time: %.2f", (s->sm)->frame, u2-u1);
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ static void ui_draw_line(UIState *s, const line_vertices_data &vd, NVGcolor *col
|
|||
|
||||
static void draw_frame(UIState *s) {
|
||||
mat4 *out_mat;
|
||||
if (s->scene.frontview) {
|
||||
if (s->scene.driver_view) {
|
||||
glBindVertexArray(s->frame_vao[1]);
|
||||
out_mat = &s->front_frame_mat;
|
||||
} else {
|
||||
|
@ -377,7 +377,7 @@ static void ui_draw_vision_frame(UIState *s) {
|
|||
|
||||
static void ui_draw_vision(UIState *s) {
|
||||
const UIScene *scene = &s->scene;
|
||||
if (!scene->frontview) {
|
||||
if (!scene->driver_view) {
|
||||
// Draw augmented elements
|
||||
if (scene->world_objects_visible) {
|
||||
ui_draw_world(s);
|
||||
|
|
|
@ -160,7 +160,7 @@ 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) {
|
||||
if (GLWindow::ui_state.started && GLWindow::ui_state.scene.driver_view) {
|
||||
Params().write_db_value("IsDriverViewEnabled", "0", 1);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -188,11 +188,11 @@ static void update_sockets(UIState *s) {
|
|||
}
|
||||
if (sm.updated("driverMonitoringState")) {
|
||||
scene.dmonitoring_state = sm["driverMonitoringState"].getDriverMonitoringState();
|
||||
if(!scene.frontview && !s->ignition) {
|
||||
read_param(&scene.frontview, "IsDriverViewEnabled");
|
||||
if(!scene.driver_view && !s->ignition) {
|
||||
read_param(&scene.driver_view, "IsDriverViewEnabled");
|
||||
}
|
||||
} else if ((sm.frame - sm.rcv_frame("driverMonitoringState")) > UI_FREQ/2) {
|
||||
scene.frontview = false;
|
||||
scene.driver_view = false;
|
||||
}
|
||||
if (sm.updated("sensorEvents")) {
|
||||
for (auto sensor : sm["sensorEvents"].getSensorEvents()) {
|
||||
|
@ -205,7 +205,7 @@ static void update_sockets(UIState *s) {
|
|||
}
|
||||
}
|
||||
}
|
||||
s->started = scene.deviceState.getStarted() || scene.frontview;
|
||||
s->started = scene.deviceState.getStarted() || scene.driver_view;
|
||||
}
|
||||
|
||||
static void update_alert(UIState *s) {
|
||||
|
@ -305,7 +305,7 @@ static void update_status(UIState *s) {
|
|||
s->active_app = cereal::UiLayoutState::App::NONE;
|
||||
s->sidebar_collapsed = true;
|
||||
s->scene.alert_size = cereal::ControlsState::AlertSize::NONE;
|
||||
s->vipc_client = s->scene.frontview ? s->vipc_client_front : s->vipc_client_rear;
|
||||
s->vipc_client = s->scene.driver_view ? s->vipc_client_front : s->vipc_client_rear;
|
||||
} else {
|
||||
s->status = STATUS_OFFROAD;
|
||||
s->active_app = cereal::UiLayoutState::App::HOME;
|
||||
|
|
|
@ -100,7 +100,7 @@ typedef struct UIScene {
|
|||
bool world_objects_visible;
|
||||
|
||||
bool is_rhd;
|
||||
bool frontview;
|
||||
bool driver_view;
|
||||
|
||||
std::string alert_text1;
|
||||
std::string alert_text2;
|
||||
|
|
Loading…
Reference in New Issue