Ensure proper level 2 data gets selected after file is reloaded

This commit is contained in:
Dan Paulat 2024-10-25 22:35:00 -05:00
parent f1e35532b9
commit d209ce97ea

View file

@ -182,12 +182,9 @@ void Level2ProductView::ConnectRadarProductManager()
[this](std::shared_ptr<types::RadarProductRecord> record) [this](std::shared_ptr<types::RadarProductRecord> record)
{ {
if (record->radar_product_group() == if (record->radar_product_group() ==
common::RadarProductGroup::Level2 && common::RadarProductGroup::Level2)
std::chrono::floor<std::chrono::seconds>(record->time()) ==
selected_time())
{ {
// If the data associated with the currently selected time is // If level 2 data associated was reloaded, update the view
// reloaded, update the view
Update(); Update();
} }
}); });
@ -517,17 +514,10 @@ void Level2ProductView::ComputeSweep()
std::shared_ptr<wsr88d::rda::ElevationScan> radarData; std::shared_ptr<wsr88d::rda::ElevationScan> radarData;
std::chrono::system_clock::time_point requestedTime {selected_time()}; std::chrono::system_clock::time_point requestedTime {selected_time()};
std::chrono::system_clock::time_point foundTime; std::tie(radarData, p->elevationCut_, p->elevationCuts_, std::ignore) =
std::tie(radarData, p->elevationCut_, p->elevationCuts_, foundTime) =
radarProductManager->GetLevel2Data( radarProductManager->GetLevel2Data(
p->dataBlockType_, p->selectedElevation_, requestedTime); p->dataBlockType_, p->selectedElevation_, requestedTime);
// If a different time was found than what was requested, update it
if (requestedTime != foundTime)
{
SelectTime(foundTime);
}
if (radarData == nullptr) if (radarData == nullptr)
{ {
Q_EMIT SweepNotComputed(types::NoUpdateReason::NotLoaded); Q_EMIT SweepNotComputed(types::NoUpdateReason::NotLoaded);