Merge pull request #344 from dpaulat/hotfix/live-level2-data-not-latest

Ensure live level 2 data displays correct scans
This commit is contained in:
Dan Paulat 2025-01-20 23:47:39 -06:00 committed by GitHub
commit 42314a64b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 23 additions and 8 deletions

View file

@ -1507,10 +1507,10 @@ RadarProductManager::GetLevel2Data(wsr88d::rda::DataBlockType dataBlockType,
if (recordRadarData != nullptr)
{
auto& radarData0 = (*recordRadarData)[0];
auto collectionTime =
auto& radarData0 = (*recordRadarData)[0];
auto collectionTime = std::chrono::floor<std::chrono::seconds>(
scwx::util::TimePoint(radarData0->modified_julian_date(),
radarData0->collection_time());
radarData0->collection_time()));
// Find the newest radar data, not newer than the selected time
if (radarData == nullptr ||

View file

@ -1801,7 +1801,16 @@ void MapWidgetImpl::RadarProductManagerConnect()
(group == common::RadarProductGroup::Level2 ||
context_->radar_product() == product))
{
widget_->SelectRadarProduct(record);
if (group == common::RadarProductGroup::Level2)
{
// Level 2 products may have multiple time points,
// ensure the latest is selected
widget_->SelectRadarProduct(group, product);
}
else
{
widget_->SelectRadarProduct(record);
}
}
});
}