fix engage/disengage sounds

old-commit-hash: 51b7dc0e38
commatwo_master
Adeeb Shihadeh 5 years ago
parent fea7183248
commit ab66589a46
  1. 2
      selfdrive/controls/lib/events.py
  2. 2
      selfdrive/test/process_replay/ref_commit
  3. 3
      selfdrive/ui/ui.cc
  4. 1
      selfdrive/ui/ui.hpp

@ -75,7 +75,7 @@ class Events:
alert = alert(*callback_args) alert = alert(*callback_args)
if DT_CTRL * (self.events_prev[e] + 1) >= alert.creation_delay: 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) ret.append(alert)
return ret return ret

@ -1 +1 @@
a8b50cfc06473f66896b3f74a562263d3cccec36 12861083f7fdcfd2876d7f8102f1853a3248e2a7

@ -308,7 +308,7 @@ void handle_message(UIState *s, SubMaster &sm) {
if (!scene.frontview){ s->controls_seen = true; } if (!scene.frontview){ s->controls_seen = true; }
auto alert_sound = scene.controls_state.getAlertSound(); 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) { if (alert_sound == AudibleAlert::NONE) {
s->sound.stop(); s->sound.stop();
} else { } else {
@ -318,6 +318,7 @@ void handle_message(UIState *s, SubMaster &sm) {
scene.alert_text1 = scene.controls_state.getAlertText1(); scene.alert_text1 = scene.controls_state.getAlertText1();
scene.alert_text2 = scene.controls_state.getAlertText2(); scene.alert_text2 = scene.controls_state.getAlertText2();
scene.alert_size = scene.controls_state.getAlertSize(); scene.alert_size = scene.controls_state.getAlertSize();
scene.alert_type = scene.controls_state.getAlertType();
auto alertStatus = scene.controls_state.getAlertStatus(); auto alertStatus = scene.controls_state.getAlertStatus();
if (alertStatus == cereal::ControlsState::AlertStatus::USER_PROMPT) { if (alertStatus == cereal::ControlsState::AlertStatus::USER_PROMPT) {
update_status(s, STATUS_WARNING); update_status(s, STATUS_WARNING);

@ -118,6 +118,7 @@ typedef struct UIScene {
std::string alert_text1; std::string alert_text1;
std::string alert_text2; std::string alert_text2;
std::string alert_type;
cereal::ControlsState::AlertSize alert_size; cereal::ControlsState::AlertSize alert_size;
// Used to show gps planner status // Used to show gps planner status

Loading…
Cancel
Save