From 1479525c4a72864084117af546e8ecc20a5e820b Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Fri, 26 May 2023 17:12:12 -0500 Subject: [PATCH] Timeline step begin and end --- .../scwx/qt/manager/timeline_manager.cpp | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/scwx-qt/source/scwx/qt/manager/timeline_manager.cpp b/scwx-qt/source/scwx/qt/manager/timeline_manager.cpp index dc215ac7..2ebd038e 100644 --- a/scwx-qt/source/scwx/qt/manager/timeline_manager.cpp +++ b/scwx-qt/source/scwx/qt/manager/timeline_manager.cpp @@ -131,6 +131,18 @@ void TimelineManager::SetLoopSpeed(double loopSpeed) void TimelineManager::AnimationStepBegin() { logger_->debug("AnimationStepBegin"); + + if (p->viewType_ == types::MapTime::Live || + p->pinnedTime_ == std::chrono::system_clock::time_point {}) + { + // If the selected view type is live, select the current products + p->SelectTime(std::chrono::system_clock::now() - p->loopTime_); + } + else + { + // If the selected view type is archive, select using the pinned time + p->SelectTime(p->pinnedTime_ - p->loopTime_); + } } void TimelineManager::AnimationStepBack() @@ -160,6 +172,17 @@ void TimelineManager::AnimationStepNext() void TimelineManager::AnimationStepEnd() { logger_->debug("AnimationStepEnd"); + + if (p->viewType_ == types::MapTime::Live) + { + // If the selected view type is live, select the current products + p->SelectTime(); + } + else + { + // If the selected view type is archive, select using the pinned time + p->SelectTime(p->pinnedTime_); + } } void TimelineManager::Impl::SelectTime(