From a41f4b802eee6867c6e8e53eadf44e6bd14468dd Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Fri, 26 May 2023 01:25:16 -0500 Subject: [PATCH] Split volume time and selected time - Volume time to be used for radar product view - Selected time to be used for animated alerts --- scwx-qt/source/scwx/qt/main/main_window.cpp | 2 +- .../scwx/qt/manager/timeline_manager.cpp | 18 +++++++++++++----- .../scwx/qt/manager/timeline_manager.hpp | 4 +++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/scwx-qt/source/scwx/qt/main/main_window.cpp b/scwx-qt/source/scwx/qt/main/main_window.cpp index 2a637600..31d0d537 100644 --- a/scwx-qt/source/scwx/qt/main/main_window.cpp +++ b/scwx-qt/source/scwx/qt/main/main_window.cpp @@ -697,7 +697,7 @@ void MainWindowImpl::ConnectAnimationSignals() &manager::TimelineManager::AnimationStepEnd); connect(timelineManager_.get(), - &manager::TimelineManager::TimeUpdated, + &manager::TimelineManager::VolumeTimeUpdated, [this](std::chrono::system_clock::time_point dateTime) { for (auto map : maps_) diff --git a/scwx-qt/source/scwx/qt/manager/timeline_manager.cpp b/scwx-qt/source/scwx/qt/manager/timeline_manager.cpp index 47856aac..b4fee799 100644 --- a/scwx-qt/source/scwx/qt/manager/timeline_manager.cpp +++ b/scwx-qt/source/scwx/qt/manager/timeline_manager.cpp @@ -159,7 +159,8 @@ void TimelineManager::Impl::SelectTime( logger_->debug("Time updated: Live"); - emit self_->TimeUpdated(selectedTime); + emit self_->VolumeTimeUpdated(selectedTime); + emit self_->SelectedTimeUpdated(selectedTime); return; } @@ -182,7 +183,6 @@ void TimelineManager::Impl::SelectTime( if (elementPtr != nullptr) { - selectedTime_ = selectedTime; // If the adjusted time changed, or if a new radar site has been // selected @@ -192,17 +192,25 @@ void TimelineManager::Impl::SelectTime( // If the time was found, select it adjustedTime_ = *elementPtr; - logger_->debug("Time updated: {}", adjustedTime_); + logger_->debug("Volume time updated: {}", + scwx::util::TimeString(adjustedTime_)); - emit self_->TimeUpdated(adjustedTime_); + emit self_->VolumeTimeUpdated(adjustedTime_); } } else { // No volume time was found - logger_->info("No volume scan found for {}", selectedTime); + logger_->info("No volume scan found for {}", + scwx::util::TimeString(selectedTime)); } + logger_->trace("Selected time updated: {}", + scwx::util::TimeString(selectedTime)); + + selectedTime_ = selectedTime; + emit self_->SelectedTimeUpdated(selectedTime); + previousRadarSite_ = radarSite_; }); } diff --git a/scwx-qt/source/scwx/qt/manager/timeline_manager.hpp b/scwx-qt/source/scwx/qt/manager/timeline_manager.hpp index 84ca7ad5..3d6e0cc9 100644 --- a/scwx-qt/source/scwx/qt/manager/timeline_manager.hpp +++ b/scwx-qt/source/scwx/qt/manager/timeline_manager.hpp @@ -41,7 +41,9 @@ public slots: void AnimationStepEnd(); signals: - void TimeUpdated(std::chrono::system_clock::time_point dateTime); + void SelectedTimeUpdated(std::chrono::system_clock::time_point dateTime); + void VolumeTimeUpdated(std::chrono::system_clock::time_point dateTime); + void ViewTypeUpdated(types::MapTime viewType); private: