From f59adbeaaa4ac8634cba663fa39679f4af0c9325 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 16 Feb 2022 23:47:02 -0800 Subject: [PATCH] keep the new alert consistent for process replay --- selfdrive/controls/lib/events.py | 7 ++++++- selfdrive/test/process_replay/ref_commit | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index 235d9e10b6..0b6537d1e7 100644 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -1,3 +1,4 @@ +import os from enum import IntEnum from typing import Dict, Union, Callable, List, Optional @@ -14,6 +15,7 @@ VisualAlert = car.CarControl.HUDControl.VisualAlert AudibleAlert = car.CarControl.HUDControl.AudibleAlert EventName = car.CarEvent.EventName +REPLAY = "REPLAY" in os.environ # Alert priorities class Priority(IntEnum): @@ -215,7 +217,10 @@ def user_soft_disable_alert(alert_text_2: str) -> AlertCallbackType: return func def startup_master_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert: - return StartupAlert("WARNING: This branch is not tested", get_short_branch(""), alert_status=AlertStatus.userPrompt) + branch = get_short_branch("") + if REPLAY: + branch = "replay" + return StartupAlert("WARNING: This branch is not tested", branch, alert_status=AlertStatus.userPrompt) def below_engage_speed_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert: return NoEntryAlert(f"Speed Below {get_display_speed(CP.minEnableSpeed, metric)}") diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index 5492740301..57c51c1f1a 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -ec35d9040244398405758f4419839ca19fb98d3d \ No newline at end of file +ff965c772bd1bc85dec717d090cee4466033ce73 \ No newline at end of file