From 075d65a535fb6180b32bc356c02f3d98120edd05 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Thu, 9 May 2024 00:22:45 -0500 Subject: [PATCH] Add "All" location type for audio alerts --- scwx-qt/source/scwx/qt/manager/alert_manager.cpp | 3 +-- scwx-qt/source/scwx/qt/types/location_types.cpp | 1 + scwx-qt/source/scwx/qt/types/location_types.hpp | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scwx-qt/source/scwx/qt/manager/alert_manager.cpp b/scwx-qt/source/scwx/qt/manager/alert_manager.cpp index dfaa8707..aa96dedd 100644 --- a/scwx-qt/source/scwx/qt/manager/alert_manager.cpp +++ b/scwx-qt/source/scwx/qt/manager/alert_manager.cpp @@ -132,12 +132,11 @@ void AlertManager::Impl::HandleAlert(const types::TextEventKey& key, continue; } - bool activeAtLocation = false; + bool activeAtLocation = (locationMethod == types::LocationMethod::All); if (locationMethod == types::LocationMethod::Fixed || locationMethod == types::LocationMethod::Track) { - // Determine if the alert is active at the current coordinte auto alertCoordinates = segment->codedLocation_->coordinates(); diff --git a/scwx-qt/source/scwx/qt/types/location_types.cpp b/scwx-qt/source/scwx/qt/types/location_types.cpp index 4732eb2e..63ec414c 100644 --- a/scwx-qt/source/scwx/qt/types/location_types.cpp +++ b/scwx-qt/source/scwx/qt/types/location_types.cpp @@ -16,6 +16,7 @@ static const std::unordered_map locationMethodName_ {{LocationMethod::Fixed, "Fixed"}, {LocationMethod::Track, "Track"}, {LocationMethod::County, "County"}, + {LocationMethod::All, "All"}, {LocationMethod::Unknown, "?"}}; SCWX_GET_ENUM(LocationMethod, GetLocationMethod, locationMethodName_) diff --git a/scwx-qt/source/scwx/qt/types/location_types.hpp b/scwx-qt/source/scwx/qt/types/location_types.hpp index c9d9784e..3c9407de 100644 --- a/scwx-qt/source/scwx/qt/types/location_types.hpp +++ b/scwx-qt/source/scwx/qt/types/location_types.hpp @@ -16,10 +16,11 @@ enum class LocationMethod Fixed, Track, County, + All, Unknown }; typedef scwx::util:: - Iterator + Iterator LocationMethodIterator; LocationMethod GetLocationMethod(const std::string& name);