Skip to content

Commit f59adbe

Browse files
committed
keep the new alert consistent for process replay
1 parent ff965c7 commit f59adbe

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

selfdrive/controls/lib/events.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from enum import IntEnum
23
from typing import Dict, Union, Callable, List, Optional
34

@@ -14,6 +15,7 @@
1415
AudibleAlert = car.CarControl.HUDControl.AudibleAlert
1516
EventName = car.CarEvent.EventName
1617

18+
REPLAY = "REPLAY" in os.environ
1719

1820
# Alert priorities
1921
class Priority(IntEnum):
@@ -215,7 +217,10 @@ def func(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, soft_disable_
215217
return func
216218

217219
def startup_master_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert:
218-
return StartupAlert("WARNING: This branch is not tested", get_short_branch(""), alert_status=AlertStatus.userPrompt)
220+
branch = get_short_branch("")
221+
if REPLAY:
222+
branch = "replay"
223+
return StartupAlert("WARNING: This branch is not tested", branch, alert_status=AlertStatus.userPrompt)
219224

220225
def below_engage_speed_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert:
221226
return NoEntryAlert(f"Speed Below {get_display_speed(CP.minEnableSpeed, metric)}")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ec35d9040244398405758f4419839ca19fb98d3d
1+
ff965c772bd1bc85dec717d090cee4466033ce73

0 commit comments

Comments
 (0)