This commit is contained in:
Your Name
2024-05-04 15:16:36 -05:00
parent 106e8d9064
commit b017bec24b
4 changed files with 30 additions and 31 deletions

View File

@@ -46,7 +46,6 @@ static void drawIconGif(QPainter &p, const QPoint &center, const QMovie &img, co
}
OnroadWindow::OnroadWindow(QWidget *parent) : QWidget(parent), scene(uiState()->scene) {
bg = QColor(255, 0x33, 0x49, 0xc8); // init to a default color
QVBoxLayout *main_layout = new QVBoxLayout(this);
main_layout->setMargin(UI_BORDER_SIZE);
QStackedLayout *stacked_layout = new QStackedLayout;
@@ -97,11 +96,6 @@ void OnroadWindow::updateState(const UIState &s) {
return;
}
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);
@@ -114,8 +108,12 @@ void OnroadWindow::updateState(const UIState &s) {
nvg->updateState(s);
QColor bgColor = bg_colors[s.status];
if (paramsMemory.getInt("no_lat_lane_change") == 1) {
bgColor = bg_colors[STATUS_DISENGAGED];
}
if (bg != bgColor) {
// repaint border
bg = bgColor;
update();
}
@@ -639,6 +637,16 @@ void AnnotatedCameraWidget::updateState(const UIState &s) {
main_layout->setAlignment(map_settings_btn, (rightHandDM ? Qt::AlignLeft : Qt::AlignRight) | Qt::AlignTop);
}
QColor bgColor = bg_colors[s.status];
if (paramsMemory.getInt("no_lat_lane_change") == 1) {
bgColor = bg_colors[STATUS_DISENGAGED];
}
if (bg != bgColor) {
bg = bgColor;
update();
}
updateFrogPilotWidgets();
}
@@ -899,17 +907,12 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) {
painter.setBrush(path_gradient);
painter.drawPolygon(scene.track_vertices);
// 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]) {
// Paint path edges ,Use current background color
if (bg != bg_colors[STATUS_DISENGAGED]) {
QLinearGradient edge_gradient;
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)));
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(bgr.red(), bg.green(), bg.blue(), static_cast<int>(255 * 0.5)));
QPainterPath path;
path.addPolygon(scene.track_vertices);

View File

@@ -193,6 +193,7 @@ private:
bool v_ego_cluster_seen = false;
int status = STATUS_DISENGAGED;
std::unique_ptr<PubMaster> pm;
QColor bg = bg_colors[STATUS_DISENGAGED];
int skip_frame_count = 0;
bool wide_cam_requested = false;