Visuals - Developer UI - Border Metrics - Turn Signal
Display turn signal metrics in onroad UI border.
This commit is contained in:
parent
31c9f33623
commit
2f993ee079
@ -250,6 +250,33 @@ void OnroadWindow::paintEvent(QPaintEvent *event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (scene.show_signal) {
|
||||||
|
static int signal_frames = 0;
|
||||||
|
QColor signal_border_color;
|
||||||
|
|
||||||
|
if (scene.turn_signal_left || scene.turn_signal_right) {
|
||||||
|
if (sm.frame % 20 == 0) {
|
||||||
|
signal_border_color = bg_colors[STATUS_CONDITIONAL_OVERRIDDEN];
|
||||||
|
signal_frames = 15;
|
||||||
|
} else if (signal_frames > 0) {
|
||||||
|
signal_border_color = bg_colors[STATUS_CONDITIONAL_OVERRIDDEN];
|
||||||
|
signal_frames--;
|
||||||
|
} else {
|
||||||
|
signal_border_color = bg;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (scene.turn_signal_left) {
|
||||||
|
QRect leftHalf(rect.x(), rect.y(), rect.width() / 2, rect.height());
|
||||||
|
p.fillRect(leftHalf, QColor(signal_border_color.red(), signal_border_color.green(), signal_border_color.blue(), 255));
|
||||||
|
} else if (scene.turn_signal_right) {
|
||||||
|
QRect rightHalf(rect.x() + rect.width() / 2, rect.y(), rect.width() / 2, rect.height());
|
||||||
|
p.fillRect(rightHalf, QColor(signal_border_color.red(), signal_border_color.green(), signal_border_color.blue(), 255));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
signal_frames = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (scene.show_blind_spot) {
|
if (scene.show_blind_spot) {
|
||||||
auto getBlindspotColor = [&](bool turn_signal, int &frames) {
|
auto getBlindspotColor = [&](bool turn_signal, int &frames) {
|
||||||
if (turn_signal) {
|
if (turn_signal) {
|
||||||
|
@ -327,6 +327,7 @@ void ui_update_frogpilot_params(UIState *s) {
|
|||||||
bool developer_ui = params.getBool("DeveloperUI");
|
bool developer_ui = params.getBool("DeveloperUI");
|
||||||
bool border_metrics = developer_ui && params.getBool("BorderMetrics");
|
bool border_metrics = developer_ui && params.getBool("BorderMetrics");
|
||||||
scene.show_blind_spot = border_metrics && params.getBool("BlindSpotMetrics");
|
scene.show_blind_spot = border_metrics && params.getBool("BlindSpotMetrics");
|
||||||
|
scene.show_signal = border_metrics && params.getBool("SignalMetrics");
|
||||||
scene.show_steering = border_metrics && params.getBool("ShowSteering");
|
scene.show_steering = border_metrics && params.getBool("ShowSteering");
|
||||||
|
|
||||||
scene.disable_smoothing_mtsc = params.getBool("MTSCEnabled") && params.getBool("DisableMTSCSmoothing");
|
scene.disable_smoothing_mtsc = params.getBool("MTSCEnabled") && params.getBool("DisableMTSCSmoothing");
|
||||||
|
@ -217,6 +217,7 @@ typedef struct UIScene {
|
|||||||
bool show_aol_status_bar;
|
bool show_aol_status_bar;
|
||||||
bool show_blind_spot;
|
bool show_blind_spot;
|
||||||
bool show_cem_status_bar;
|
bool show_cem_status_bar;
|
||||||
|
bool show_signal;
|
||||||
bool show_slc_offset;
|
bool show_slc_offset;
|
||||||
bool show_slc_offset_ui;
|
bool show_slc_offset_ui;
|
||||||
bool show_steering;
|
bool show_steering;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user