This commit is contained in:
Your Name
2024-05-04 14:55:30 -05:00
parent 8174cf8c2e
commit a81a839092
55 changed files with 78 additions and 39 deletions

View File

@@ -98,6 +98,11 @@ void OnroadWindow::updateState(const UIState &s) {
}
QColor bgColor = bg_colors[s.status];
// Clearpilot
if (paramsMemory.getInt("no_lat_lane_change") == 1) {
bg = bg_colors[STATUS_DISENGAGED];
}
Alert alert = Alert::get(*(s.sm), s.scene.started_frame);
alerts->updateAlert(alert);
@@ -109,11 +114,6 @@ void OnroadWindow::updateState(const UIState &s) {
nvg->updateState(s);
// Clearpilot
if (paramsMemory.getInt("no_lat_lane_change") == 1) {
bg = bg_colors[STATUS_DISENGAGED];
}
if (bg != bgColor) {
// repaint border
bg = bgColor;
@@ -899,29 +899,25 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) {
painter.setBrush(path_gradient);
painter.drawPolygon(scene.track_vertices);
// Paint path edges
// don't paint if not engaged color
// if (bg != bg_colors[STATUS_DISENGAGED]) {
// Use current background color
// Paint path edges ,Use current background color
QColor bgColor = bg_colors[uiState().status];
// Clearpilot
if (paramsMemory.getInt("no_lat_lane_change") == 1) {
bgColor = bg_colors[STATUS_DISENGAGED];
}
if (bgColor != bg_colors[STATUS_DISENGAGED]) {
QLinearGradient edge_gradient;
// QColor test_color = QColor(201, 41, 204, 0xd1);
QColor test_color;
test_color = bg;
// edge_gradient.setColorAt(0.0, QColor(test_color.red(), test_color.green(), test_color.blue(), static_cast<int>(OTHER_LANE_ALPHA * 255)));
// edge_gradient.setColorAt(0.5, QColor(test_color.red(), test_color.green(), test_color.blue(), static_cast<int>(OTHER_LANE_ALPHA * 255 * 0.5)));
// edge_gradient.setColorAt(1.0, QColor(test_color.red(), test_color.green(), test_color.blue(), static_cast<int>(OTHER_LANE_ALPHA * 255 * 0.1)));
edge_gradient.setColorAt(0.0, QColor(bg.red(), bg.green(), bg.blue(), static_cast<int>(255)));
edge_gradient.setColorAt(0.5, QColor(bg.red(), bg.green(), bg.blue(), static_cast<int>(255 * 0.7) ));
edge_gradient.setColorAt(1.0, QColor(bg.red(), bg.green(), bg.blue(), static_cast<int>(255 * 0.5)));
edge_gradient.setColorAt(0.0, QColor(bgColor.red(), bgColor.green(), bgColor.blue(), static_cast<int>(255)));
edge_gradient.setColorAt(0.5, QColor(bgColor.red(), bgColor.green(), bgColor.blue(), static_cast<int>(255 * 0.7) ));
edge_gradient.setColorAt(1.0, QColor(bgColor.red(), bgColor.green(), bg.blue(), static_cast<int>(255 * 0.5)));
QPainterPath path;
path.addPolygon(scene.track_vertices);
path.addPolygon(scene.track_edge_vertices);
// painter.setBrush(path_gradient);
painter.setBrush(edge_gradient);
painter.drawPath(path);
// }
}
// Paint blindspot path
if (scene.blind_spot_path) {