mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-02 03:52:11 +08:00
alerts: make soft disables an orange alert (#22925)
old-commit-hash: 833399e9418db26df70169d37c2dff90051d89c7
This commit is contained in:
@@ -404,7 +404,7 @@ class Controls:
|
||||
elif self.CP.pcmCruise and CS.cruiseState.enabled:
|
||||
self.v_cruise_kph = CS.cruiseState.speed * CV.MS_TO_KPH
|
||||
|
||||
# decrease the soft disable timer at every step, as it's reset on
|
||||
# decrement the soft disable timer at every step, as it's reset on
|
||||
# entrance in SOFT_DISABLING state
|
||||
self.soft_disable_timer = max(0, self.soft_disable_timer - 1)
|
||||
|
||||
@@ -426,7 +426,7 @@ class Controls:
|
||||
if self.state == State.enabled:
|
||||
if self.events.any(ET.SOFT_DISABLE):
|
||||
self.state = State.softDisabling
|
||||
self.soft_disable_timer = 300 # 3s
|
||||
self.soft_disable_timer = int(3 / DT_CTRL)
|
||||
self.current_alert_types.append(ET.SOFT_DISABLE)
|
||||
|
||||
# SOFT DISABLING
|
||||
|
||||
@@ -149,7 +149,7 @@ class NoEntryAlert(Alert):
|
||||
class SoftDisableAlert(Alert):
|
||||
def __init__(self, alert_text_2):
|
||||
super().__init__("TAKE CONTROL IMMEDIATELY", alert_text_2,
|
||||
AlertStatus.critical, AlertSize.full,
|
||||
AlertStatus.userPrompt, AlertSize.full,
|
||||
Priority.MID, VisualAlert.steerRequired,
|
||||
AudibleAlert.chimeWarningRepeatInfinite, 2.),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user