Load radar data asynchronously

This commit is contained in:
Dan Paulat 2021-11-11 23:47:27 -06:00
parent 803a25e884
commit 3625515b8a
6 changed files with 71 additions and 13 deletions

View file

@ -77,11 +77,6 @@ MapWidget::MapWidget(const QMapboxGLSettings& settings) :
setFocusPolicy(Qt::StrongFocus);
p->radarProductManager_->Initialize();
QString ar2vFile = qgetenv("AR2V_FILE");
if (!ar2vFile.isEmpty())
{
p->radarProductManager_->LoadLevel2Data(ar2vFile.toUtf8().constData());
}
SelectRadarProduct(common::Level2Product::Reflectivity);
}
@ -110,6 +105,19 @@ void MapWidget::SelectRadarProduct(common::Level2Product product)
p->radarProductView_->LoadColorTable(colorTable);
}
connect(
p->radarProductView_.get(),
&view::RadarProductView::ColorTableUpdated,
this,
[&]() { update(); },
Qt::QueuedConnection);
connect(
p->radarProductView_.get(),
&view::RadarProductView::SweepComputed,
this,
[&]() { update(); },
Qt::QueuedConnection);
if (p->map_ != nullptr)
{
AddLayers();