mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-11-01 05:50:05 +00:00
Enable/disable auto update of radar data based on timeline selection
This commit is contained in:
parent
80f04be510
commit
4963add9cc
8 changed files with 129 additions and 39 deletions
|
|
@ -366,6 +366,7 @@ void TimelineManager::Impl::SelectTime(
|
|||
|
||||
logger_->debug("Time updated: Live");
|
||||
|
||||
emit self_->LiveStateUpdated(true);
|
||||
emit self_->VolumeTimeUpdated(selectedTime);
|
||||
emit self_->SelectedTimeUpdated(selectedTime);
|
||||
|
||||
|
|
@ -391,6 +392,9 @@ void TimelineManager::Impl::SelectTime(
|
|||
auto elementPtr =
|
||||
util::GetBoundedElementPointer(volumeTimes, selectedTime);
|
||||
|
||||
// The timeline is no longer live
|
||||
emit self_->LiveStateUpdated(false);
|
||||
|
||||
if (elementPtr != nullptr)
|
||||
{
|
||||
|
||||
|
|
@ -469,6 +473,13 @@ void TimelineManager::Impl::Step(Direction direction)
|
|||
adjustedTime_);
|
||||
}
|
||||
|
||||
if (it == volumeTimes.cend())
|
||||
{
|
||||
// Should not get here, but protect against an error
|
||||
logger_->error("No suitable volume time found");
|
||||
return;
|
||||
}
|
||||
|
||||
if (direction == Direction::Back)
|
||||
{
|
||||
// Only if we aren't at the beginning of the volume times set
|
||||
|
|
@ -481,6 +492,7 @@ void TimelineManager::Impl::Step(Direction direction)
|
|||
logger_->debug("Volume time updated: {}",
|
||||
scwx::util::TimeString(adjustedTime_));
|
||||
|
||||
emit self_->LiveStateUpdated(false);
|
||||
emit self_->VolumeTimeUpdated(adjustedTime_);
|
||||
emit self_->SelectedTimeUpdated(adjustedTime_);
|
||||
}
|
||||
|
|
@ -497,6 +509,7 @@ void TimelineManager::Impl::Step(Direction direction)
|
|||
logger_->debug("Volume time updated: {}",
|
||||
scwx::util::TimeString(adjustedTime_));
|
||||
|
||||
emit self_->LiveStateUpdated(false);
|
||||
emit self_->VolumeTimeUpdated(adjustedTime_);
|
||||
emit self_->SelectedTimeUpdated(adjustedTime_);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ signals:
|
|||
void VolumeTimeUpdated(std::chrono::system_clock::time_point dateTime);
|
||||
|
||||
void AnimationStateUpdated(types::AnimationState state);
|
||||
void LiveStateUpdated(bool isLive);
|
||||
void ViewTypeUpdated(types::MapTime viewType);
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue