Add alert while in preEnabled state (#1791)

old-commit-hash: ce80684f7ec6a61d8e4f08471611a30562707154
This commit is contained in:
Adeeb Shihadeh
2020-06-28 20:29:42 -07:00
committed by GitHub
parent 77c699af5b
commit 17fc7e2bec
2 changed files with 10 additions and 2 deletions
+2
View File
@@ -316,6 +316,8 @@ class Controls:
elif self.state == State.preEnabled:
if not self.events.any(ET.PRE_ENABLE):
self.state = State.enabled
else:
self.current_alert_types.append(ET.PRE_ENABLE)
# DISABLED
elif self.state == State.disabled:
+8 -2
View File
@@ -204,8 +204,6 @@ def wrong_car_mode_alert(CP, sm, metric):
EVENTS = {
# ********** events with no alerts **********
EventName.gasPressed: {ET.PRE_ENABLE: None},
# ********** events only containing alerts displayed in all states **********
EventName.debugAlert: {
@@ -333,6 +331,14 @@ EVENTS = {
# ********** events only containing alerts that display while engaged **********
EventName.gasPressed: {
ET.PRE_ENABLE: Alert(
"openpilot will not brake while gas pressed",
"",
AlertStatus.normal, AlertSize.small,
Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .0, .0, .1),
},
EventName.vehicleModelInvalid: {
ET.WARNING: Alert(
"Vehicle Parameter Identification Failed",