From 584f5943b6fcaf7b0885fb0beeb55eaf35319f41 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Fri, 27 Sep 2024 07:48:48 -0500 Subject: [PATCH] Re-add inactive alert palette display --- scwx-qt/source/scwx/qt/map/alert_layer.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/scwx-qt/source/scwx/qt/map/alert_layer.cpp b/scwx-qt/source/scwx/qt/map/alert_layer.cpp index c0842758..69ebddb9 100644 --- a/scwx-qt/source/scwx/qt/map/alert_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/alert_layer.cpp @@ -160,7 +160,8 @@ public: const QPointF& mouseGlobalPos); void ScheduleRefresh(); - LineData& GetLineData(std::shared_ptr& segment); + LineData& GetLineData(std::shared_ptr& segment, + bool alertActive); void UpdateLineData(); void AddLine(std::shared_ptr& geoLines, @@ -211,6 +212,7 @@ public: threatCategoryLineData_; LineData observedLineData_ {}; LineData tornadoPossibleLineData_ {}; + LineData inactiveLineData_ {}; std::chrono::system_clock::time_point selectedTime_ {}; @@ -456,7 +458,7 @@ void AlertLayer::Impl::AddAlert( auto& startTime = segmentRecord->segmentBegin_; auto& endTime = segmentRecord->segmentEnd_; - auto& lineData = GetLineData(segment); + auto& lineData = GetLineData(segment, alertActive); auto& geoLines = geoLines_.at(alertActive); const auto& coordinates = segment->codedLocation_->coordinates(); @@ -706,11 +708,19 @@ void AlertLayer::Impl::UpdateLineData() tornadoPossibleLineData_ = CreateLineData(alertPalette.tornado_possible()); } + + inactiveLineData_ = CreateLineData(alertPalette.inactive()); } AlertLayer::Impl::LineData& -AlertLayer::Impl::GetLineData(std::shared_ptr& segment) +AlertLayer::Impl::GetLineData(std::shared_ptr& segment, + bool alertActive) { + if (!alertActive) + { + return inactiveLineData_; + } + for (auto& threatCategory : ibw_.threatCategories_) { if (segment->threatCategory_ == threatCategory)