From ecbed0f4f8fcf356044bdcbef123edf9a6ec75b4 Mon Sep 17 00:00:00 2001 From: firestarsdog <229254897+firestarsdog@users.noreply.github.com> Date: Sat, 30 May 2026 21:31:43 -0400 Subject: [PATCH] BigUI WIP: Remove dock lol --- selfdrive/ui/onroad/starpilot/aethergauge.py | 12 ++--- .../onroad/starpilot/starpilot_onroad_view.py | 52 +------------------ 2 files changed, 4 insertions(+), 60 deletions(-) diff --git a/selfdrive/ui/onroad/starpilot/aethergauge.py b/selfdrive/ui/onroad/starpilot/aethergauge.py index a54c6d22c..9c45a0751 100644 --- a/selfdrive/ui/onroad/starpilot/aethergauge.py +++ b/selfdrive/ui/onroad/starpilot/aethergauge.py @@ -1,6 +1,5 @@ from dataclasses import dataclass from enum import Enum -from typing import Optional import math import pyray as rl from openpilot.common.constants import CV @@ -313,18 +312,13 @@ class AetherGauge: return get_data() return None - def render(self, rect: rl.Rectangle, font_bold: rl.Font, font_medium: rl.Font, current_speed: float, - dock_rect: Optional[rl.Rectangle] = None): + def render(self, rect: rl.Rectangle, font_bold: rl.Font, font_medium: rl.Font, current_speed: float): data = self.get_active_data() if not data: return - if dock_rect: - cx = dock_rect.x + dock_rect.width / 2 - cy_speed = dock_rect.y + dock_rect.height * 0.75 - else: - cx = rect.x + rect.width / 2 - cy_speed = rect.y + 180 * SCALE + cx = rect.x + rect.width / 2 + cy_speed = rect.y + 180 * SCALE speed_text = str(round(current_speed)) speed_text_size = measure_text_cached(font_bold, speed_text, int(176 * SCALE)) diff --git a/selfdrive/ui/onroad/starpilot/starpilot_onroad_view.py b/selfdrive/ui/onroad/starpilot/starpilot_onroad_view.py index c30f042e7..d0f60046c 100644 --- a/selfdrive/ui/onroad/starpilot/starpilot_onroad_view.py +++ b/selfdrive/ui/onroad/starpilot/starpilot_onroad_view.py @@ -1,4 +1,3 @@ -import math import pyray as rl import time from msgq.visionipc import VisionStreamType @@ -60,57 +59,10 @@ class StarPilotOnroadView(AugmentedRoadView): self._personality_button.render() self._render_standstill_timer() self._render_developer_metrics() + self._aethergauge.render(self._content_rect, self._font_bold, self._font_medium, current_speed=self._hud_renderer.speed) self._render_bottom_row_widgets() self._render_pedals() - def _render_bottom_dock_gradient(self, rect, border_width, border_color): - has_road_name = (self._params.get_bool("RoadNameUI") - and ui_state.sm.valid.get("mapdOut", False) - and getattr(ui_state.sm["mapdOut"], "roadName", "")) - has_gauge = self._aethergauge.get_active_data() is not None - - if not has_road_name and not has_gauge: - return - - dock_w = 850 - dock_h = 150 - dock_x = rect.x + (rect.width - dock_w) / 2 - dock_y = rect.y + rect.height - dock_h - - cx = dock_x + dock_w / 2 - bottom = dock_y + dock_h - a = dock_w / 2 - border_t = border_width / dock_h - - for i in range(dock_h): - t = i / dock_h - y = bottom - i - half_w = a * math.sqrt(max(0.0, 1.0 - t * t)) - if t < 0.05: - half_w += border_width * (1.0 - t / 0.05) - if t <= border_t: - alpha = 255 - else: - t_fade = (t - border_t) / (1.0 - border_t) - alpha = int(255 * (1.0 - t_fade)) - rl.draw_rectangle(int(cx - half_w), int(y), int(half_w * 2), 1, - rl.Color(border_color.r, border_color.g, border_color.b, alpha)) - - if has_road_name: - road_name = getattr(ui_state.sm["mapdOut"], "roadName", "") - text_size = measure_text_cached(self._font_bold, road_name, 28) - rx = dock_x + (dock_w - text_size.x) / 2 - ry = dock_y + dock_h * 0.2 - pos = rl.Vector2(rx, ry) - for dx, dy in ((-1, -1), (1, -1), (-1, 1), (1, 1)): - rl.draw_text_ex(self._font_bold, road_name, rl.Vector2(pos.x + dx, pos.y + dy), 28, 0, rl.BLACK) - rl.draw_text_ex(self._font_bold, road_name, pos, 28, 0, rl.WHITE) - - if has_gauge: - gauge_rect = rl.Rectangle(dock_x + dock_w * 0.1, dock_y + dock_h * 0.35, dock_w * 0.8, dock_h * 0.65) - self._aethergauge.render(self._content_rect, self._font_bold, self._font_medium, - current_speed=self._hud_renderer.speed, dock_rect=gauge_rect) - def _render_path_features(self, rect: rl.Rectangle): """Render path-related features (adjacent paths, blind spot, path edges).""" mr = self.model_renderer @@ -233,8 +185,6 @@ class StarPilotOnroadView(AugmentedRoadView): def _draw_border(self, rect: rl.Rectangle): border_width = self._get_border_width() - border_color = get_screen_edge_color(ui_state) - self._render_bottom_dock_gradient(rect, border_width, border_color) rl.draw_rectangle_rounded_lines_ex(rect, 0.12, 10, border_width, rl.BLACK) border_rect = rl.Rectangle(rect.x + border_width, rect.y + border_width, rect.width - 2 * border_width, rect.height - 2 * border_width)