From 79733f5a63c6956249dc47f3c5372d0dd65136b0 Mon Sep 17 00:00:00 2001 From: Rick Lan Date: Sat, 6 Jul 2024 18:33:02 +0800 Subject: [PATCH] ui for tetoo --- selfdrive/ui/qt/onroad/annotated_camera.cc | 8 ++++++++ selfdrive/ui/qt/onroad/annotated_camera.h | 3 ++- selfdrive/ui/ui.cc | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/qt/onroad/annotated_camera.cc b/selfdrive/ui/qt/onroad/annotated_camera.cc index 9d484c2db..f0ad48c46 100644 --- a/selfdrive/ui/qt/onroad/annotated_camera.cc +++ b/selfdrive/ui/qt/onroad/annotated_camera.cc @@ -47,6 +47,7 @@ AnnotatedCameraWidget::AnnotatedCameraWidget(VisionStreamType type, QWidget* par rainbow_path = new RainbowPath; flight_panel = new FlightPanel; chevron_ext = new ChevronExt; + tt_indicator = new TeTooIndicator; #endif } @@ -94,6 +95,7 @@ void AnnotatedCameraWidget::updateState(const UIState &s) { rainbow_path->update_states(s); flight_panel->update_states(s, is_metric); chevron_ext->update_states(s, is_metric); + tt_indicator->update_states(s, is_metric); #endif } @@ -145,6 +147,11 @@ void AnnotatedCameraWidget::drawHud(QPainter &p) { p.setFont(InterFont(66)); drawText(p, rect().center().x(), 290, speedUnit, 200); + #ifdef DP + tt_indicator->paint_speed_camera(p, rect()); + tt_indicator->paint_maxspeed(p, set_speed_rect.topRight()); + #endif + p.restore(); } @@ -395,6 +402,7 @@ void AnnotatedCameraWidget::paintGL() { update_model(s, model); #ifdef DP + tt_indicator->paint_road_name(painter, rect().left(), rect().bottom(), rect().width()); flight_panel->paint(painter, width(), height()); #endif diff --git a/selfdrive/ui/qt/onroad/annotated_camera.h b/selfdrive/ui/qt/onroad/annotated_camera.h index 18d0c13ba..921848caf 100644 --- a/selfdrive/ui/qt/onroad/annotated_camera.h +++ b/selfdrive/ui/qt/onroad/annotated_camera.h @@ -44,7 +44,8 @@ private: PersonalityButton *personality_btn; KnightScanner *knight_scanner; RainbowPath *rainbow_path; - ChevronExt * chevron_ext; + ChevronExt *chevron_ext; + TeTooIndicator *tt_indicator; #endif protected: diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index 70281fb56..8673ab9fa 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -252,6 +252,8 @@ UIState::UIState(QObject *parent) : QObject(parent) { "carControl", "controlsStateExt", // de2e "longitudinalPlanExt", + // TeToo + "teToo", }); Params params;