Fix stale storm tracking information logic to use selected time

This commit is contained in:
Dan Paulat 2024-02-21 23:02:24 -06:00
parent 925f91995a
commit 6eb9caf819

View file

@ -137,7 +137,8 @@ void OverlayProductView::Impl::LoadProduct(
if (autoUpdate)
{
connect(request.get(),
connect(
request.get(),
&request::NexradFileRequest::RequestComplete,
self_,
[=, this](std::shared_ptr<request::NexradFileRequest> request)
@ -155,14 +156,14 @@ void OverlayProductView::Impl::LoadProduct(
if (level3File != nullptr)
{
const auto& header = level3File->message()->header();
productTime =
util::TimePoint(header.date_of_message(),
header.time_of_message() * 1000);
productTime = util::TimePoint(
header.date_of_message(), header.time_of_message() * 1000);
}
// If the record is from the last 30 minutes
if (productTime + 30min >= time ||
productTime + 30min >= std::chrono::system_clock::now())
if (productTime + 30min >= std::chrono::system_clock::now() ||
(selectedTime_ != std::chrono::system_clock::time_point {} &&
productTime + 30min >= selectedTime_))
{
// Store loaded record
std::unique_lock lock {recordMutex_};