fix engage/disengage sounds

old-commit-hash: 51b7dc0e385945faf0341c52b14555e75e804d04
This commit is contained in:
Adeeb Shihadeh
2020-06-23 10:46:33 -07:00
parent fea7183248
commit ab66589a46
4 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ class Events:
alert = alert(*callback_args)
if DT_CTRL * (self.events_prev[e] + 1) >= alert.creation_delay:
alert.alert_type = EVENT_NAME[e]
alert.alert_type = f"{EVENT_NAME[e]}/{et}"
ret.append(alert)
return ret
+1 -1
View File
@@ -1 +1 @@
a8b50cfc06473f66896b3f74a562263d3cccec36
12861083f7fdcfd2876d7f8102f1853a3248e2a7
+2 -1
View File
@@ -308,7 +308,7 @@ void handle_message(UIState *s, SubMaster &sm) {
if (!scene.frontview){ s->controls_seen = true; }
auto alert_sound = scene.controls_state.getAlertSound();
if (scene.alert_text2.compare(scene.controls_state.getAlertText2()) != 0) {
if (scene.alert_type.compare(scene.controls_state.getAlertType()) != 0) {
if (alert_sound == AudibleAlert::NONE) {
s->sound.stop();
} else {
@@ -318,6 +318,7 @@ void handle_message(UIState *s, SubMaster &sm) {
scene.alert_text1 = scene.controls_state.getAlertText1();
scene.alert_text2 = scene.controls_state.getAlertText2();
scene.alert_size = scene.controls_state.getAlertSize();
scene.alert_type = scene.controls_state.getAlertType();
auto alertStatus = scene.controls_state.getAlertStatus();
if (alertStatus == cereal::ControlsState::AlertStatus::USER_PROMPT) {
update_status(s, STATUS_WARNING);
+1
View File
@@ -118,6 +118,7 @@ typedef struct UIScene {
std::string alert_text1;
std::string alert_text2;
std::string alert_type;
cereal::ControlsState::AlertSize alert_size;
// Used to show gps planner status