Compare commits

...

2 Commits

Author SHA1 Message Date
firestar5683 28ec3ccb80 squeak squeak 2026-08-23 10:41:13 -05:00
firestar5683 5f65219aed name 2026-08-21 20:26:21 -05:00
16 changed files with 213 additions and 34 deletions
Binary file not shown.
+1
View File
@@ -66,6 +66,7 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
{"HondaLateralPidKiScale", {PERSISTENT, FLOAT, "1.0", "1.0", 3}},
{"HondaLateralPidKpScale", {PERSISTENT, FLOAT, "1.0", "1.0", 3}},
{"HondaWindFactorParams", {PERSISTENT, FLOAT}},
{"HomeScreenName", {PERSISTENT, STRING, "StarPilot", "StarPilot", 3}},
{"InstallDate", {PERSISTENT, TIME}},
{"IsDriverViewEnabled", {CLEAR_ON_MANAGER_START, BOOL}},
{"IsEngaged", {PERSISTENT, BOOL}},
Binary file not shown.
+96 -14
View File
@@ -1,17 +1,99 @@
info face="como-heavy" size=-200 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=0 aa=1 padding=0,0,0,0 spacing=0,0 outline=0
common lineHeight=200 base=200 scaleW=1024 scaleH=512 pages=1 packed=0 alphaChnl=0 redChnl=4 greenChnl=4 blueChnl=4
common lineHeight=200 base=200 scaleW=2048 scaleH=2048 pages=1 packed=0 alphaChnl=0 redChnl=4 greenChnl=4 blueChnl=4
page id=0 file="como-heavy.png"
chars count=13
chars count=95
char id=32 x=6 y=6 width=39 height=200 xoffset=0 yoffset=0 xadvance=39 page=0 chnl=15
char id=63 x=57 y=6 width=81 height=115 xoffset=0 yoffset=47 xadvance=83 page=0 chnl=15
char id=80 x=150 y=6 width=100 height=113 xoffset=8 yoffset=49 xadvance=110 page=0 chnl=15
char id=83 x=262 y=6 width=101 height=116 xoffset=4 yoffset=47 xadvance=108 page=0 chnl=15
char id=97 x=375 y=6 width=88 height=85 xoffset=5 yoffset=78 xadvance=100 page=0 chnl=15
char id=105 x=475 y=6 width=31 height=121 xoffset=6 yoffset=41 xadvance=43 page=0 chnl=15
char id=108 x=518 y=6 width=29 height=119 xoffset=7 yoffset=43 xadvance=43 page=0 chnl=15
char id=111 x=559 y=6 width=88 height=85 xoffset=5 yoffset=78 xadvance=98 page=0 chnl=15
char id=112 x=659 y=6 width=88 height=115 xoffset=7 yoffset=78 xadvance=100 page=0 chnl=15
char id=114 x=759 y=6 width=63 height=83 xoffset=7 yoffset=79 xadvance=69 page=0 chnl=15
char id=115 x=834 y=6 width=77 height=85 xoffset=4 yoffset=78 xadvance=84 page=0 chnl=15
char id=116 x=923 y=6 width=63 height=111 xoffset=6 yoffset=52 xadvance=70 page=0 chnl=15
char id=122 x=6 y=218 width=79 height=81 xoffset=3 yoffset=80 xadvance=85 page=0 chnl=15
char id=33 x=57 y=6 width=32 height=114 xoffset=8 yoffset=48 xadvance=48 page=0 chnl=15
char id=34 x=101 y=6 width=68 height=64 xoffset=6 yoffset=48 xadvance=80 page=0 chnl=15
char id=35 x=181 y=6 width=101 height=111 xoffset=3 yoffset=51 xadvance=107 page=0 chnl=15
char id=36 x=294 y=6 width=90 height=136 xoffset=8 yoffset=40 xadvance=107 page=0 chnl=15
char id=37 x=396 y=6 width=115 height=113 xoffset=3 yoffset=50 xadvance=121 page=0 chnl=15
char id=38 x=523 y=6 width=109 height=116 xoffset=3 yoffset=47 xadvance=113 page=0 chnl=15
char id=39 x=644 y=6 width=30 height=64 xoffset=6 yoffset=48 xadvance=42 page=0 chnl=15
char id=40 x=686 y=6 width=53 height=131 xoffset=8 yoffset=48 xadvance=67 page=0 chnl=15
char id=41 x=751 y=6 width=53 height=131 xoffset=6 yoffset=48 xadvance=67 page=0 chnl=15
char id=42 x=816 y=6 width=82 height=79 xoffset=4 yoffset=43 xadvance=90 page=0 chnl=15
char id=43 x=910 y=6 width=97 height=98 xoffset=5 yoffset=63 xadvance=107 page=0 chnl=15
char id=44 x=1019 y=6 width=42 height=60 xoffset=-3 yoffset=129 xadvance=48 page=0 chnl=15
char id=45 x=1073 y=6 width=61 height=29 xoffset=5 yoffset=102 xadvance=71 page=0 chnl=15
char id=46 x=1146 y=6 width=33 height=33 xoffset=8 yoffset=129 xadvance=48 page=0 chnl=15
char id=47 x=1191 y=6 width=57 height=114 xoffset=1 yoffset=48 xadvance=59 page=0 chnl=15
char id=48 x=1260 y=6 width=95 height=113 xoffset=6 yoffset=50 xadvance=107 page=0 chnl=15
char id=49 x=1367 y=6 width=63 height=110 xoffset=20 yoffset=52 xadvance=107 page=0 chnl=15
char id=50 x=1442 y=6 width=87 height=111 xoffset=11 yoffset=50 xadvance=107 page=0 chnl=15
char id=51 x=1541 y=6 width=87 height=113 xoffset=11 yoffset=50 xadvance=107 page=0 chnl=15
char id=52 x=1640 y=6 width=99 height=111 xoffset=5 yoffset=51 xadvance=107 page=0 chnl=15
char id=53 x=1751 y=6 width=88 height=111 xoffset=10 yoffset=52 xadvance=107 page=0 chnl=15
char id=54 x=1851 y=6 width=91 height=113 xoffset=8 yoffset=50 xadvance=107 page=0 chnl=15
char id=55 x=6 y=218 width=92 height=110 xoffset=9 yoffset=52 xadvance=107 page=0 chnl=15
char id=56 x=110 y=218 width=94 height=113 xoffset=7 yoffset=50 xadvance=107 page=0 chnl=15
char id=57 x=216 y=218 width=90 height=113 xoffset=9 yoffset=50 xadvance=107 page=0 chnl=15
char id=58 x=318 y=218 width=33 height=83 xoffset=8 yoffset=79 xadvance=48 page=0 chnl=15
char id=59 x=363 y=218 width=44 height=110 xoffset=-3 yoffset=79 xadvance=48 page=0 chnl=15
char id=60 x=419 y=218 width=95 height=90 xoffset=6 yoffset=67 xadvance=107 page=0 chnl=15
char id=61 x=526 y=218 width=95 height=66 xoffset=6 yoffset=79 xadvance=107 page=0 chnl=15
char id=62 x=633 y=218 width=94 height=90 xoffset=7 yoffset=67 xadvance=107 page=0 chnl=15
char id=63 x=739 y=218 width=81 height=115 xoffset=0 yoffset=47 xadvance=83 page=0 chnl=15
char id=64 x=832 y=218 width=115 height=117 xoffset=5 yoffset=55 xadvance=124 page=0 chnl=15
char id=65 x=959 y=218 width=107 height=115 xoffset=7 yoffset=47 xadvance=120 page=0 chnl=15
char id=66 x=1078 y=218 width=103 height=112 xoffset=8 yoffset=49 xadvance=114 page=0 chnl=15
char id=67 x=1193 y=218 width=110 height=116 xoffset=5 yoffset=47 xadvance=116 page=0 chnl=15
char id=68 x=1315 y=218 width=108 height=112 xoffset=8 yoffset=49 xadvance=121 page=0 chnl=15
char id=69 x=1435 y=218 width=99 height=112 xoffset=8 yoffset=49 xadvance=109 page=0 chnl=15
char id=70 x=1546 y=218 width=97 height=113 xoffset=8 yoffset=49 xadvance=105 page=0 chnl=15
char id=71 x=1655 y=218 width=114 height=116 xoffset=5 yoffset=47 xadvance=123 page=0 chnl=15
char id=72 x=1781 y=218 width=108 height=114 xoffset=8 yoffset=48 xadvance=124 page=0 chnl=15
char id=73 x=1901 y=218 width=32 height=114 xoffset=8 yoffset=48 xadvance=48 page=0 chnl=15
char id=74 x=6 y=430 width=95 height=115 xoffset=1 yoffset=48 xadvance=102 page=0 chnl=15
char id=75 x=113 y=430 width=101 height=114 xoffset=8 yoffset=48 xadvance=112 page=0 chnl=15
char id=76 x=226 y=430 width=96 height=113 xoffset=8 yoffset=48 xadvance=103 page=0 chnl=15
char id=77 x=334 y=430 width=129 height=114 xoffset=8 yoffset=48 xadvance=145 page=0 chnl=15
char id=78 x=475 y=430 width=107 height=114 xoffset=8 yoffset=48 xadvance=123 page=0 chnl=15
char id=79 x=594 y=430 width=119 height=116 xoffset=5 yoffset=47 xadvance=128 page=0 chnl=15
char id=80 x=725 y=430 width=100 height=113 xoffset=8 yoffset=49 xadvance=110 page=0 chnl=15
char id=81 x=837 y=430 width=119 height=129 xoffset=5 yoffset=47 xadvance=128 page=0 chnl=15
char id=82 x=968 y=430 width=100 height=113 xoffset=8 yoffset=49 xadvance=112 page=0 chnl=15
char id=83 x=1080 y=430 width=101 height=116 xoffset=4 yoffset=47 xadvance=108 page=0 chnl=15
char id=84 x=1193 y=430 width=111 height=113 xoffset=0 yoffset=49 xadvance=110 page=0 chnl=15
char id=85 x=1316 y=430 width=101 height=116 xoffset=7 yoffset=48 xadvance=114 page=0 chnl=15
char id=86 x=1429 y=430 width=115 height=114 xoffset=0 yoffset=48 xadvance=115 page=0 chnl=15
char id=87 x=1556 y=430 width=162 height=114 xoffset=1 yoffset=48 xadvance=164 page=0 chnl=15
char id=88 x=1730 y=430 width=106 height=114 xoffset=3 yoffset=48 xadvance=112 page=0 chnl=15
char id=89 x=1848 y=430 width=111 height=114 xoffset=0 yoffset=48 xadvance=110 page=0 chnl=15
char id=90 x=6 y=642 width=102 height=112 xoffset=3 yoffset=49 xadvance=108 page=0 chnl=15
char id=91 x=120 y=642 width=51 height=129 xoffset=10 yoffset=49 xadvance=67 page=0 chnl=15
char id=92 x=183 y=642 width=57 height=114 xoffset=1 yoffset=48 xadvance=59 page=0 chnl=15
char id=93 x=252 y=642 width=52 height=129 xoffset=6 yoffset=49 xadvance=67 page=0 chnl=15
char id=94 x=316 y=642 width=97 height=75 xoffset=5 yoffset=48 xadvance=107 page=0 chnl=15
char id=95 x=425 y=642 width=84 height=14 xoffset=0 yoffset=168 xadvance=83 page=0 chnl=15
char id=96 x=521 y=642 width=40 height=36 xoffset=16 yoffset=36 xadvance=83 page=0 chnl=15
char id=97 x=573 y=642 width=88 height=85 xoffset=5 yoffset=78 xadvance=100 page=0 chnl=15
char id=98 x=673 y=642 width=88 height=120 xoffset=7 yoffset=43 xadvance=100 page=0 chnl=15
char id=99 x=773 y=642 width=80 height=85 xoffset=5 yoffset=78 xadvance=87 page=0 chnl=15
char id=100 x=865 y=642 width=88 height=120 xoffset=5 yoffset=43 xadvance=100 page=0 chnl=15
char id=101 x=965 y=642 width=85 height=85 xoffset=5 yoffset=78 xadvance=93 page=0 chnl=15
char id=102 x=1062 y=642 width=64 height=120 xoffset=7 yoffset=42 xadvance=69 page=0 chnl=15
char id=103 x=1138 y=642 width=88 height=116 xoffset=5 yoffset=78 xadvance=100 page=0 chnl=15
char id=104 x=1238 y=642 width=83 height=119 xoffset=7 yoffset=43 xadvance=96 page=0 chnl=15
char id=105 x=1333 y=642 width=31 height=121 xoffset=6 yoffset=41 xadvance=43 page=0 chnl=15
char id=106 x=1376 y=642 width=46 height=152 xoffset=-9 yoffset=41 xadvance=43 page=0 chnl=15
char id=107 x=1434 y=642 width=79 height=119 xoffset=7 yoffset=43 xadvance=88 page=0 chnl=15
char id=108 x=1525 y=642 width=29 height=119 xoffset=7 yoffset=43 xadvance=43 page=0 chnl=15
char id=109 x=1566 y=642 width=126 height=84 xoffset=7 yoffset=78 xadvance=138 page=0 chnl=15
char id=110 x=1704 y=642 width=83 height=84 xoffset=7 yoffset=78 xadvance=96 page=0 chnl=15
char id=111 x=1799 y=642 width=88 height=85 xoffset=5 yoffset=78 xadvance=98 page=0 chnl=15
char id=112 x=1899 y=642 width=88 height=115 xoffset=7 yoffset=78 xadvance=100 page=0 chnl=15
char id=113 x=6 y=854 width=88 height=115 xoffset=5 yoffset=78 xadvance=100 page=0 chnl=15
char id=114 x=106 y=854 width=63 height=83 xoffset=7 yoffset=79 xadvance=69 page=0 chnl=15
char id=115 x=181 y=854 width=77 height=85 xoffset=4 yoffset=78 xadvance=84 page=0 chnl=15
char id=116 x=270 y=854 width=63 height=111 xoffset=6 yoffset=52 xadvance=70 page=0 chnl=15
char id=117 x=345 y=854 width=83 height=84 xoffset=6 yoffset=79 xadvance=96 page=0 chnl=15
char id=118 x=440 y=854 width=86 height=83 xoffset=0 yoffset=79 xadvance=86 page=0 chnl=15
char id=119 x=538 y=854 width=129 height=83 xoffset=0 yoffset=79 xadvance=128 page=0 chnl=15
char id=120 x=679 y=854 width=81 height=83 xoffset=3 yoffset=79 xadvance=87 page=0 chnl=15
char id=121 x=772 y=854 width=83 height=115 xoffset=6 yoffset=79 xadvance=96 page=0 chnl=15
char id=122 x=867 y=854 width=79 height=81 xoffset=3 yoffset=80 xadvance=85 page=0 chnl=15
char id=123 x=958 y=854 width=62 height=129 xoffset=2 yoffset=49 xadvance=70 page=0 chnl=15
char id=124 x=1032 y=854 width=22 height=150 xoffset=16 yoffset=43 xadvance=53 page=0 chnl=15
char id=125 x=1066 y=854 width=62 height=129 xoffset=6 yoffset=49 xadvance=70 page=0 chnl=15
char id=126 x=1140 y=854 width=97 height=38 xoffset=5 yoffset=92 xadvance=107 page=0 chnl=15
Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 192 KiB

+1 -1
View File
@@ -12,7 +12,7 @@ LANGUAGES_FILE = TRANSLATIONS_DIR / "languages.json"
GLYPH_PADDING = 6
EXTRA_CHARS = "–‑✓×°§•X⚙✕◀▶✔⌫⇧␣○●↳çêüñ–‑✓×°§•€£¥²⚠ⓘ"
UNIFONT_LANGUAGES = {"ar", "th", "zh-CHT", "zh-CHS", "ko", "ja"}
BRAND_FONT_CHARS = " StarPilotstarpilot?z"
BRAND_FONT_CHARS = "".join(chr(codepoint) for codepoint in range(32, 127))
def _languages():
@@ -29,11 +29,14 @@ class FakeDetector:
self.slow_lead_detected = False
self.stop_light_detected = False
self.stop_light_model_detected = False
self.toggle_objects = []
def curve_detection(self, *_args, **_kwargs):
def curve_detection(self, _v_ego, toggles):
self.toggle_objects.append(toggles)
return None
def slow_lead(self, *_args, **_kwargs):
def slow_lead(self, toggles, _v_ego):
self.toggle_objects.append(toggles)
return None
def stop_sign_and_light(self, *_args, **_kwargs):
@@ -114,6 +117,23 @@ def test_ccm_stays_experimental_when_no_chill_condition_matches(monkeypatch):
assert ccm.status_value == CCStatus["OFF"]
def test_ccm_reuses_detector_toggles(monkeypatch):
_planner, detector, ccm = make_ccm()
sm = make_sm()
toggles = make_toggles()
monkeypatch.setattr("openpilot.starpilot.controls.lib.conditional_chill_mode.time.monotonic", lambda: 1.0)
ccm.update(20 * CV.MPH_TO_MS, 21 * CV.MPH_TO_MS, sm, toggles)
first_curve_toggles, first_slow_lead_toggles = detector.toggle_objects
detector.toggle_objects.clear()
ccm.update(20 * CV.MPH_TO_MS, 21 * CV.MPH_TO_MS, sm, toggles)
second_curve_toggles, second_slow_lead_toggles = detector.toggle_objects
assert first_curve_toggles is first_slow_lead_toggles
assert second_curve_toggles is second_slow_lead_toggles
assert first_curve_toggles is second_curve_toggles
def test_ccm_enters_chill_for_open_road_speed_recovery(monkeypatch):
planner, _detector, ccm = make_ccm()
sm = make_sm()
+7 -6
View File
@@ -8,7 +8,7 @@ from openpilot.selfdrive.ui.widgets.exp_mode_button import ExperimentalModeButto
from openpilot.selfdrive.ui.widgets.drive_stats import DriveStatsDashboard
from openpilot.selfdrive.ui.widgets.home_info_card import HomeInfoCard
from openpilot.selfdrive.ui.widgets.setup import SetupWidget
from openpilot.selfdrive.ui.lib.starpilot_version import starpilot_display_description
from openpilot.selfdrive.ui.lib.starpilot_version import home_screen_name, starpilot_display_description
from openpilot.system.ui.lib.text_measure import measure_text_cached
from openpilot.system.ui.lib.application import gui_app, FontWeight, MousePos
from openpilot.system.ui.lib.multilang import tr, trn
@@ -181,9 +181,10 @@ class HomeLayout(Widget):
version_rect = rl.Rectangle(self.header_rect.x + self.header_rect.width - version_text_width, self.header_rect.y,
version_text_width, self.header_rect.height)
brand_text = "StarPilot"
detail_text = self._version_text.removeprefix(brand_text)
brand_font = gui_app.font(FontWeight.BRAND)
brand_text = home_screen_name(self.params)
detail_text = self._version_text[len(brand_text):] if self._version_text.startswith(brand_text) else self._version_text
brand_font_weight = FontWeight.BRAND if brand_text.isascii() else FontWeight.MEDIUM
brand_font = gui_app.font(brand_font_weight)
version_font_size = 48
def _measure_header(font_size: int) -> tuple[rl.Vector2, rl.Vector2]:
@@ -200,7 +201,7 @@ class HomeLayout(Widget):
rendered_width = min(total_width, version_rect.width)
text_x = version_rect.x + version_rect.width - rendered_width
brand_rect = rl.Rectangle(text_x, version_rect.y, min(brand_size.x, rendered_width), version_rect.height)
gui_label(brand_rect, brand_text, version_font_size + 2, rl.WHITE, font_weight=FontWeight.BRAND, elide_right=False)
gui_label(brand_rect, brand_text, version_font_size + 2, rl.WHITE, font_weight=brand_font_weight, elide_right=False)
detail_width = max(0.0, rendered_width - brand_rect.width)
if detail_text and detail_width > 0:
@@ -260,7 +261,7 @@ class HomeLayout(Widget):
self._prev_alerts_present = alerts_present
def _get_version_text(self) -> str:
brand = "StarPilot"
brand = home_screen_name(self.params)
description = starpilot_display_description(self.params.get("UpdaterCurrentDescription"))
version_text = f"{brand} {description}" if description else brand
+25
View File
@@ -1,4 +1,29 @@
STARPILOT_DISPLAY_VERSION = "6.7.6"
DEFAULT_HOME_SCREEN_NAME = "StarPilot"
HOME_SCREEN_NAME_MAX_LENGTH = 12
def normalize_home_screen_name(value: str | bytes | None) -> str:
if isinstance(value, bytes):
value = value.decode("utf-8", errors="ignore")
name = str(value or "").strip()[:HOME_SCREEN_NAME_MAX_LENGTH]
return name or DEFAULT_HOME_SCREEN_NAME
def home_screen_name(params) -> str:
try:
value = params.get("HomeScreenName", encoding="utf-8")
except TypeError:
value = params.get("HomeScreenName")
if not value:
try:
value = params.get_default_value("HomeScreenName")
except (AttributeError, KeyError):
value = DEFAULT_HOME_SCREEN_NAME
return normalize_home_screen_name(value)
def starpilot_display_description(description: str | None) -> str:
@@ -0,0 +1,11 @@
from openpilot.selfdrive.ui.lib.starpilot_version import (
DEFAULT_HOME_SCREEN_NAME,
HOME_SCREEN_NAME_MAX_LENGTH,
normalize_home_screen_name,
)
def test_home_screen_name_defaults_and_truncates():
assert normalize_home_screen_name("") == DEFAULT_HOME_SCREEN_NAME
assert normalize_home_screen_name(" Custom Name ") == "Custom Name"
assert len(normalize_home_screen_name("abcdefghijklmnop")) == HOME_SCREEN_NAME_MAX_LENGTH
+6 -2
View File
@@ -12,7 +12,7 @@ from openpilot.system.ui.widgets.icon_widget import IconWidget
from openpilot.system.ui.widgets.label import UnifiedLabel
from openpilot.system.ui.lib.application import ASSETS_DIR, gui_app, FontWeight, MousePos
from openpilot.selfdrive.ui.lib.mode_banner import ModeBannerVariant, get_mode_banner_variant, mode_atom_color
from openpilot.selfdrive.ui.lib.starpilot_version import STARPILOT_DISPLAY_VERSION
from openpilot.selfdrive.ui.lib.starpilot_version import DEFAULT_HOME_SCREEN_NAME, STARPILOT_DISPLAY_VERSION, home_screen_name
from openpilot.selfdrive.ui.ui_state import ui_state
HEAD_BUTTON_FONT_SIZE = 40
@@ -158,6 +158,7 @@ class MiciHomeLayout(Widget):
self._version_text = None
self._experimental_mode = False
self._current_model_name = "default"
self._home_screen_name = DEFAULT_HOME_SCREEN_NAME
self._mode_status_atom = ModeStatusAtom()
self._egpu_icon = IconWidget("icons_mici/egpu.png", (50, 37))
@@ -173,7 +174,7 @@ class MiciHomeLayout(Widget):
self._mic_icon,
], spacing=18)
self._openpilot_label = UnifiedLabel("StarPilot", font_size=96, font_weight=FontWeight.BRAND, max_width=480, wrap_text=False)
self._openpilot_label = UnifiedLabel(self._home_screen_name, font_size=96, font_weight=FontWeight.BRAND, max_width=480, wrap_text=False)
self._version_label = UnifiedLabel("", font_size=36, font_weight=FontWeight.ROMAN, max_width=480, wrap_text=False)
self._large_version_label = UnifiedLabel("", font_size=64, text_color=rl.GRAY, font_weight=FontWeight.ROMAN, max_width=480, wrap_text=False)
self._date_label = UnifiedLabel("", font_size=36, text_color=rl.GRAY, font_weight=FontWeight.ROMAN, max_width=480, wrap_text=False)
@@ -188,6 +189,9 @@ class MiciHomeLayout(Widget):
def _update_params(self):
self._experimental_mode = ui_state.params.get_bool("ExperimentalMode")
self._mode_status_atom.refresh()
self._home_screen_name = home_screen_name(ui_state.params)
self._openpilot_label.set_text(self._home_screen_name)
self._openpilot_label.set_font_weight(FontWeight.BRAND if self._home_screen_name.isascii() else FontWeight.MEDIUM)
def _clean_model_name(value: str) -> str:
return re.sub(r"[🗺️👀📡]", "", value).replace("(Default)", "").strip()
@@ -2060,6 +2060,16 @@
"is_parent_toggle": true,
"settings_tier": "simple"
},
{
"key": "HomeScreenName",
"label": "Custom Home Screen Name",
"description": "Replace the StarPilot wordmark on the home screen. Leave it blank to use StarPilot. Maximum 12 characters.",
"data_type": "string",
"ui_type": "text",
"placeholder": "StarPilot",
"max_length": 12,
"settings_tier": "advanced"
},
{
"key": "HideSpeed",
"label": "Hide Current Speed",
@@ -10,6 +10,21 @@ from openpilot.starpilot.common.experimental_state import (
)
class DetectorToggles:
"""Fixed detector configuration used by Conditional Chill."""
__slots__ = ()
conditional_curves = True
conditional_curves_lead = True
conditional_lead = True
conditional_slower_lead = True
conditional_stopped_lead = True
DETECTOR_TOGGLES = DetectorToggles()
class ConditionalChillMode:
CCM_STOP_MODEL_TIME = 7.0
CHILL_SPEED_ENTRY_CONFIRM_TIME = 0.35
@@ -132,15 +147,8 @@ class ConditionalChillMode:
self._launch_forced_exit = False
def _refresh_detector(self, v_ego, sm):
detector_toggles = type("DetectorToggles", (), {
"conditional_curves": True,
"conditional_curves_lead": True,
"conditional_lead": True,
"conditional_slower_lead": True,
"conditional_stopped_lead": True,
})()
self.detector.curve_detection(v_ego, detector_toggles)
self.detector.slow_lead(detector_toggles, v_ego)
self.detector.curve_detection(v_ego, DETECTOR_TOGGLES)
self.detector.slow_lead(DETECTOR_TOGGLES, v_ego)
self.detector.stop_sign_and_light(v_ego, sm, self.CCM_STOP_MODEL_TIME)
def _has_hard_veto(self, v_ego, sm, allow_launch=False):
@@ -1617,6 +1617,7 @@ function renderSettingRow(p) {
id="ds-${p.key}"
value="${() => toSelectValue(state.values[p.key])}"
placeholder="${p.placeholder || ""}"
maxlength="${p.max_length || ""}"
disabled="${() => isLocked()}"
@change="${() => updateParam(p.key, "text")}" />
`
@@ -128,6 +128,7 @@ def test_requested_simple_and_advanced_settings_tiers():
param for param in params
if not param["key"].startswith("PIPPreview")
and param["key"] != "DisableWideRoad"
and param["key"] != "HomeScreenName"
]
assert {param["settings_tier"] for param in params} == {"simple"}
@@ -173,6 +174,8 @@ def test_requested_simple_and_advanced_settings_tiers():
assert developer["DeveloperUI"]["settings_tier"] == "advanced"
assert developer["RedneckCruise"]["settings_tier"] == "advanced"
assert sections["Visual (Display & UI)"]["DisableWideRoad"]["settings_tier"] == "advanced"
assert sections["Visual (Display & UI)"]["HomeScreenName"]["settings_tier"] == "advanced"
assert sections["Visual (Display & UI)"]["HomeScreenName"]["max_length"] == 12
def test_hidden_feature_defaults_remain_enabled():
+13
View File
@@ -46,6 +46,7 @@ from openpilot.system.hardware import HARDWARE, PC
from openpilot.system.hardware.hw import Paths
from openpilot.system.loggerd.deleter import PRESERVE_ATTR_NAME, PRESERVE_ATTR_VALUE, PRESERVE_COUNT
from openpilot.system.version import get_build_metadata
from openpilot.selfdrive.ui.lib.starpilot_version import DEFAULT_HOME_SCREEN_NAME, HOME_SCREEN_NAME_MAX_LENGTH
from openpilot.tools.longitudinal_maneuvers.capabilities import get_longitudinal_maneuver_support
from panda import Panda
@@ -4991,6 +4992,16 @@ def setup(app):
val = data["value"]
selected_label_input = str(data.get("label") or "").strip()
if key == "HomeScreenName":
if not params.get_bool("GalaxyDeveloperMode"):
return jsonify({"error": "Custom Home Screen Name is available only with Galaxy Developer Mode enabled."}), 403
val = str(val or "").strip()
if len(val) > HOME_SCREEN_NAME_MAX_LENGTH:
return jsonify({"error": f"Custom Home Screen Name must be {HOME_SCREEN_NAME_MAX_LENGTH} characters or fewer."}), 400
data["value"] = val or DEFAULT_HOME_SCREEN_NAME
val = data["value"]
# Python json parses true/false as boolean
if isinstance(val, bool):
str_val = "1" if val else "0"
@@ -5336,6 +5347,8 @@ def setup(app):
if key == "RivianAngleControl":
response["message"] = "Rivian steering mode updated. The safe channel handoff is in progress."
updated = {}
if key == "HomeScreenName":
updated[key] = str_val
if key in PANDA_FIRMWARE_TOGGLE_KEYS:
threading.Thread(target=_flash_panda_then_reboot, daemon=True).start()
response["message"] = f"Parameter '{key}' updated successfully. Panda flashing started; device will reboot when finished."