|
|
|
@ -192,10 +192,11 @@ class NormalPermanentAlert(Alert): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class StartupAlert(Alert): |
|
|
|
|
def __init__(self, alert_text_1: str, alert_text_2: str = "Always keep hands on wheel and eyes on road", alert_status=AlertStatus.normal): |
|
|
|
|
def __init__(self, alert_text_1: str, alert_text_2: str = "Always keep hands on wheel and eyes on road", alert_status=AlertStatus.normal, |
|
|
|
|
audible_alert: car.CarControl.HUDControl.AudibleAlert = AudibleAlert.none): |
|
|
|
|
super().__init__(alert_text_1, alert_text_2, |
|
|
|
|
alert_status, AlertSize.mid, |
|
|
|
|
Priority.LOWER, VisualAlert.none, AudibleAlert.none, 5.), |
|
|
|
|
Priority.LOWER, VisualAlert.none, audible_alert, 5.), |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ********** helper functions ********** |
|
|
|
@ -229,7 +230,12 @@ def startup_master_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubM |
|
|
|
|
if "REPLAY" in os.environ: |
|
|
|
|
branch = "replay" |
|
|
|
|
|
|
|
|
|
return StartupAlert("WARNING: This branch is not tested", branch, alert_status=AlertStatus.userPrompt) |
|
|
|
|
# TODO: also need cb for other startup alerts |
|
|
|
|
audible_alert = AudibleAlert.none |
|
|
|
|
if CS.cruiseState.enabled: |
|
|
|
|
audible_alert = AudibleAlert.disengage |
|
|
|
|
|
|
|
|
|
return StartupAlert("WARNING: This branch is not tested", branch, alert_status=AlertStatus.userPrompt, audible_alert=audible_alert) |
|
|
|
|
|
|
|
|
|
def below_engage_speed_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, personality) -> Alert: |
|
|
|
|
return NoEntryAlert(f"Drive above {get_display_speed(CP.minEnableSpeed, metric)} to engage") |
|
|
|
|