Select the latest product level 3 product available when switching products

This commit is contained in:
Dan Paulat 2022-09-23 22:46:44 -05:00
parent 0f3d1708c0
commit bf6b3e3601
2 changed files with 12 additions and 2 deletions

View file

@ -747,7 +747,16 @@ RadarProductManagerImpl::GetLevel3ProductRecord(
if (it != level3ProductRecordsMap_.cend()) if (it != level3ProductRecordsMap_.cend())
{ {
record = util::GetBoundedElementValue(it->second, time); if (time == std::chrono::system_clock::time_point {})
{
// If a default-initialized time point is given, return the latest
// record
record = it->second.rbegin()->second;
}
else
{
record = util::GetBoundedElementValue(it->second, time);
}
} }
return record; return record;

View file

@ -326,7 +326,8 @@ void MapWidget::SelectRadarProduct(common::RadarProductGroup group,
if (radarProductView != nullptr) if (radarProductView != nullptr)
{ {
radarProductView->SelectTime(p->selectedTime_); // Always select the latest product available
radarProductView->SelectTime({});
if (radarProductViewCreated) if (radarProductViewCreated)
{ {