mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-16 06:32:16 +08:00
more
This commit is contained in:
@@ -154,7 +154,7 @@ class ModelRenderer(Widget, ModelRendererSP):
|
||||
self._draw_path(sm)
|
||||
|
||||
if sm.valid['liveTracks'] and sm.recv_frame['liveTracks'] >= ui_state.started_frame:
|
||||
self.radar_tracks.draw_radar_tracks(sm['liveTracks'], self._map_to_screen, self._path_offset_z, track_size=3,
|
||||
self.radar_tracks.draw_radar_tracks(sm['liveTracks'], self._map_to_screen, self._path_offset_z, track_size=5,
|
||||
screen_offset=(self._rect.x, self._rect.y))
|
||||
|
||||
# if render_lead_indicator and radar_state:
|
||||
|
||||
@@ -7,10 +7,10 @@ See the LICENSE.md file in the root directory for more details.
|
||||
import math
|
||||
import pyray as rl
|
||||
|
||||
RELATIVE_SPEED_COLOR_RANGE = 15.0 # m/s; speeds beyond this use the full endpoint color
|
||||
APPROACHING_COLOR = (32, 128, 255)
|
||||
RELATIVE_SPEED_COLOR_RANGE = 10.0 # m/s; speeds beyond this use the full endpoint color
|
||||
APPROACHING_COLOR = (0, 128, 255)
|
||||
NEUTRAL_COLOR = (255, 255, 255)
|
||||
RECEDING_COLOR = (255, 48, 48)
|
||||
RECEDING_COLOR = (255, 32, 32)
|
||||
|
||||
|
||||
def radar_track_color(v_rel: float) -> rl.Color:
|
||||
|
||||
@@ -9,14 +9,14 @@ def color_tuple(color):
|
||||
|
||||
|
||||
def test_radar_track_relative_speed_colors():
|
||||
assert color_tuple(radar_track_color(-15.0)) == (32, 128, 255, 255)
|
||||
assert color_tuple(radar_track_color(-10.0)) == (0, 128, 255, 255)
|
||||
assert color_tuple(radar_track_color(0.0)) == (255, 255, 255, 255)
|
||||
assert color_tuple(radar_track_color(15.0)) == (255, 48, 48, 255)
|
||||
assert color_tuple(radar_track_color(10.0)) == (255, 32, 32, 255)
|
||||
|
||||
approaching = color_tuple(radar_track_color(-7.5))
|
||||
receding = color_tuple(radar_track_color(7.5))
|
||||
assert approaching == (144, 192, 255, 255)
|
||||
assert receding == (255, 152, 152, 255)
|
||||
approaching = color_tuple(radar_track_color(-5.0))
|
||||
receding = color_tuple(radar_track_color(5.0))
|
||||
assert approaching == (128, 192, 255, 255)
|
||||
assert receding == (255, 144, 144, 255)
|
||||
|
||||
|
||||
def test_format_radar_tracks_status_none():
|
||||
|
||||
Reference in New Issue
Block a user