Visuals - Developer UI - Border Metrics - Blind Spot

Display blind spot metrics in onroad UI border.
This commit is contained in:
FrogAi 2024-06-20 06:44:12 -07:00
parent 322eab5173
commit cb430e489f
4 changed files with 38 additions and 0 deletions

View File

@ -84,6 +84,14 @@ void OnroadWindow::updateState(const UIState &s) {
// FrogPilot variables
const UIScene &scene = s.scene;
blindSpotLeft = scene.blind_spot_left;
blindSpotRight = scene.blind_spot_right;
showBlindspot = scene.show_blind_spot && (blindSpotLeft || blindSpotRight);
if (showBlindspot) {
shouldUpdate = true;
}
if (shouldUpdate) {
update();
}
@ -203,4 +211,25 @@ void OnroadWindow::paintEvent(QPaintEvent *event) {
QRect rect = this->rect();
QColor bgColor(bg.red(), bg.green(), bg.blue(), 255);
p.fillRect(rect, bgColor);
if (showBlindspot) {
QColor blindspotColorLeft = bgColor;
QColor blindspotColorRight = bgColor;
if (blindSpotLeft) {
blindspotColorLeft = bg_colors[STATUS_TRAFFIC_MODE_ACTIVE];
}
if (blindSpotRight) {
blindspotColorRight = bg_colors[STATUS_TRAFFIC_MODE_ACTIVE];
}
int xLeft = rect.x();
int xRight = rect.x() + rect.width() / 2;
QRect blindspotRectLeft(xLeft, rect.y(), rect.width() / 2, rect.height());
QRect blindspotRectRight(xRight, rect.y(), rect.width() / 2, rect.height());
p.fillRect(blindspotRectLeft, blindspotColorLeft);
p.fillRect(blindspotRectRight, blindspotColorRight);
}
}

View File

@ -25,6 +25,10 @@ private:
QHBoxLayout* split;
// FrogPilot variables
bool blindSpotLeft;
bool blindSpotRight;
bool showBlindspot;
QPoint timeoutPoint = QPoint(420, 69);
QTimer clickTimer;

View File

@ -338,6 +338,10 @@ void ui_update_frogpilot_params(UIState *s, Params &params) {
scene.holiday_themes = custom_theme && params.getBool("HolidayThemes");
scene.random_events = custom_theme && params.getBool("RandomEvents");
bool developer_ui = params.getBool("DeveloperUI");
bool border_metrics = developer_ui && params.getBool("BorderMetrics");
scene.show_blind_spot = border_metrics && params.getBool("BlindSpotMetrics");
scene.disable_smoothing_mtsc = params.getBool("MTSCEnabled") && params.getBool("DisableMTSCSmoothing");
scene.disable_smoothing_vtsc = params.getBool("VisionTurnControl") && params.getBool("DisableVTSCSmoothing");

View File

@ -155,6 +155,7 @@ typedef struct UIScene {
bool road_name_ui;
bool rotating_wheel;
bool show_aol_status_bar;
bool show_blind_spot;
bool show_cem_status_bar;
bool show_slc_offset;
bool show_slc_offset_ui;