Zik is my boss

This commit is contained in:
firestar5683
2026-06-07 20:37:47 -05:00
parent aba65bf755
commit c88bebbc3e
5 changed files with 16 additions and 1 deletions
+2 -1
View File
@@ -395,7 +395,8 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
{"MapSpeedLimit", {CLEAR_ON_MANAGER_START, FLOAT, "0.0", "0.0"}},
{"NavDesiresAllowed", {PERSISTENT, BOOL, "1", "0", 2}},
{"NavLongitudinalAllowed", {PERSISTENT, BOOL, "1", "0", 2}},
{"NavDestination", {PERSISTENT | CLEAR_ON_MANAGER_START | CLEAR_ON_OFFROAD_TRANSITION, STRING, "", ""}},
{"ClearNavOnOffroad", {PERSISTENT, BOOL, "1", "1", 2}},
{"NavDestination", {PERSISTENT | CLEAR_ON_MANAGER_START, STRING, "", ""}},
{"NavInstructionCollapsed", {CLEAR_ON_MANAGER_START | CLEAR_ON_OFFROAD_TRANSITION, BOOL, "0", "0"}},
{"NavInstructionState", {CLEAR_ON_MANAGER_START | CLEAR_ON_OFFROAD_TRANSITION, JSON, "{}", "{}"}},
{"NextMapSpeedLimit", {CLEAR_ON_MANAGER_START, JSON, "{}", "{}"}},
@@ -369,6 +369,10 @@ class StarPilotAppearanceLayout(_SettingsPage):
subtitle=tr_noop("Show navigation info on the driving screen."),
get_state=lambda: self._params.get_bool("NavigationUI"),
set_state=lambda s: self._params.put_bool("NavigationUI", s)),
SettingRow("ClearNavOnOffroad", "toggle", tr_noop("Clear Route When Offroad"),
subtitle=tr_noop("Clear the active navigation destination when the device goes offroad."),
get_state=lambda: self._params.get_bool("ClearNavOnOffroad"),
set_state=lambda s: self._params.put_bool("ClearNavOnOffroad", s)),
SettingRow("RoadNameUI", "toggle", tr_noop("Road Name"),
subtitle="",
get_state=lambda: self._params.get_bool("RoadNameUI"),
@@ -1960,6 +1960,13 @@
"ui_type": "toggle",
"is_parent_toggle": true
},
{
"key": "ClearNavOnOffroad",
"label": "Clear Route When Offroad",
"description": "Clear the active navigation destination when the device goes offroad.",
"data_type": "bool",
"ui_type": "toggle"
},
{
"key": "RoadNameUI",
"label": "Road Name",
@@ -61,6 +61,7 @@ StarPilotVisualsPanel::StarPilotVisualsPanel(StarPilotSettingsWindow *parent, bo
{"RoadEdgesWidth", tr("Road Edges Width"), tr("<b>Set the road-edge thickness.</b><br><br>Default matches half of the MUTCD lane-line width standard of 4 inches."), ""},
{"NavigationUI", tr("Navigation Widgets"), tr("<b>Speed limits, and other navigation widgets.</b>"), "../../starpilot/assets/toggle_icons/icon_map.png"},
{"ClearNavOnOffroad", tr("Clear Route When Offroad"), tr("<b>Clear the active navigation destination</b> when the device goes offroad."), ""},
{"RoadNameUI", tr("Road Name"), tr("<b>Display the road name at the bottom of the driving screen</b> using data from \"OpenStreetMap (OSM)\"."), ""},
{"ShowSpeedLimits", tr("Show Speed Limits"), tr("<b>Show speed limits</b> in the top-left corner of the driving screen. Uses data from the car's dashboard (if supported) and \"OpenStreetMap (OSM)\"."), ""},
{"SLCMapboxFiller", tr("Show Speed Limits from Mapbox"), tr("<b>Use Mapbox speed-limit data when no other source is available.</b>"), ""},
+2
View File
@@ -775,6 +775,8 @@ def manager_thread() -> None:
# StarPilot variables
params_memory.clear_all(ParamKeyFlag.CLEAR_ON_OFFROAD_TRANSITION)
if params.get_bool("ClearNavOnOffroad"):
params.remove("NavDestination")
ignition = any(ps.ignitionLine or ps.ignitionCan for ps in sm['pandaStates'] if ps.pandaType != log.PandaState.PandaType.unknown)
if ignition and not ignition_prev: