Initial moving of product listing to the background for level 3

This commit is contained in:
Dan Paulat 2025-08-30 16:27:55 -05:00
parent 68f66c0c2f
commit f4226b487d
14 changed files with 356 additions and 178 deletions

View file

@ -11,11 +11,7 @@
#include <boost/range/irange.hpp>
#include <boost/timer/timer.hpp>
namespace scwx
{
namespace qt
{
namespace view
namespace scwx::qt::view
{
static const std::string logPrefix_ = "scwx::qt::view::level2_product_view";
@ -552,7 +548,11 @@ void Level2ProductView::ComputeSweep()
std::shared_ptr<wsr88d::rda::ElevationScan> radarData;
std::chrono::system_clock::time_point requestedTime {selected_time()};
std::tie(radarData, p->elevationCut_, p->elevationCuts_, std::ignore) =
std::tie(radarData,
p->elevationCut_,
p->elevationCuts_,
std::ignore,
std::ignore) =
radarProductManager->GetLevel2Data(
p->dataBlockType_, p->selectedElevation_, requestedTime);
@ -1369,7 +1369,7 @@ Level2ProductView::GetBinLevel(const common::Coordinate& coordinate) const
auto nextRadial = radarData->find((i + 1) % numRadials);
if (nextRadial != radarData->cend())
{
nextAngle = nextRadial->second->azimuth_angle();
nextAngle = nextRadial->second->azimuth_angle();
// Level 2 angles are the center of the bins.
const units::degrees<float> deltaAngle =
@ -1564,6 +1564,4 @@ std::shared_ptr<Level2ProductView> Level2ProductView::Create(
return std::make_shared<Level2ProductView>(product, radarProductManager);
}
} // namespace view
} // namespace qt
} // namespace scwx
} // namespace scwx::qt::view

View file

@ -11,17 +11,12 @@
#include <scwx/wsr88d/rpg/radial_data_packet.hpp>
#include <limits>
#include <unordered_set>
#include <boost/range/irange.hpp>
#include <boost/timer/timer.hpp>
#include <fmt/format.h>
namespace scwx
{
namespace qt
{
namespace view
namespace scwx::qt::view
{
static const std::string logPrefix_ = "scwx::qt::view::level3_product_view";
@ -151,6 +146,22 @@ void Level3ProductView::ConnectRadarProductManager()
Update();
}
});
connect(radar_product_manager().get(),
&manager::RadarProductManager::ProductTimesPopulated,
this,
[this](common::RadarProductGroup group,
const std::string& product,
std::chrono::system_clock::time_point queryTime)
{
if (group == common::RadarProductGroup::Level3 &&
product == p->product_ && queryTime == selected_time())
{
// If the data associated with the currently selected time is
// reloaded, update the view
Update();
}
});
}
void Level3ProductView::DisconnectRadarProductManager()
@ -596,6 +607,4 @@ bool Level3ProductView::IgnoreUnits() const
return false;
}
} // namespace view
} // namespace qt
} // namespace scwx
} // namespace scwx::qt::view

View file

@ -10,11 +10,7 @@
#include <boost/range/irange.hpp>
#include <boost/timer/timer.hpp>
namespace scwx
{
namespace qt
{
namespace view
namespace scwx::qt::view
{
static const std::string logPrefix_ = "scwx::qt::view::level3_radial_view";
@ -31,15 +27,7 @@ static constexpr std::uint32_t VALUES_PER_VERTEX = 2u;
class Level3RadialView::Impl
{
public:
explicit Impl(Level3RadialView* self) :
self_ {self},
latitude_ {},
longitude_ {},
range_ {},
vcp_ {},
sweepTime_ {}
{
}
explicit Impl(Level3RadialView* self) : self_ {self} {}
~Impl() { threadPool_.join(); };
void ComputeCoordinates(
@ -65,13 +53,13 @@ public:
bool lastShowSmoothedRangeFolding_ {false};
bool lastSmoothingEnabled_ {false};
float latitude_;
float longitude_;
float latitude_ {};
float longitude_ {};
std::optional<float> elevation_ {};
float range_;
std::uint16_t vcp_;
float range_ {};
std::uint16_t vcp_ {};
std::chrono::system_clock::time_point sweepTime_;
std::chrono::system_clock::time_point sweepTime_ {};
};
Level3RadialView::Level3RadialView(
@ -148,7 +136,7 @@ void Level3RadialView::ComputeSweep()
std::shared_ptr<wsr88d::rpg::Level3Message> message;
std::chrono::system_clock::time_point requestedTime {selected_time()};
std::chrono::system_clock::time_point foundTime;
std::tie(message, foundTime) =
std::tie(message, foundTime, std::ignore) =
radarProductManager->GetLevel3Data(GetRadarProductName(), requestedTime);
// If a different time was found than what was requested, update it
@ -752,6 +740,4 @@ std::shared_ptr<Level3RadialView> Level3RadialView::Create(
return std::make_shared<Level3RadialView>(product, radarProductManager);
}
} // namespace view
} // namespace qt
} // namespace scwx
} // namespace scwx::qt::view

View file

@ -10,11 +10,7 @@
#include <boost/timer/timer.hpp>
#include <units/angle.h>
namespace scwx
{
namespace qt
{
namespace view
namespace scwx::qt::view
{
static const std::string logPrefix_ = "scwx::qt::view::level3_raster_view";
@ -125,7 +121,7 @@ void Level3RasterView::ComputeSweep()
std::shared_ptr<wsr88d::rpg::Level3Message> message;
std::chrono::system_clock::time_point requestedTime {selected_time()};
std::chrono::system_clock::time_point foundTime;
std::tie(message, foundTime) =
std::tie(message, foundTime, std::ignore) =
radarProductManager->GetLevel3Data(GetRadarProductName(), requestedTime);
// If a different time was found than what was requested, update it
@ -538,6 +534,4 @@ std::shared_ptr<Level3RasterView> Level3RasterView::Create(
return std::make_shared<Level3RasterView>(product, radarProductManager);
}
} // namespace view
} // namespace qt
} // namespace scwx
} // namespace scwx::qt::view

View file

@ -8,11 +8,7 @@
#include <boost/asio.hpp>
#include <boost/uuid/random_generator.hpp>
namespace scwx
{
namespace qt
{
namespace view
namespace scwx::qt::view
{
static const std::string logPrefix_ = "scwx::qt::view::overlay_product_view";
@ -128,6 +124,22 @@ void OverlayProductView::Impl::ConnectRadarProductManager()
}
},
Qt::QueuedConnection);
connect(radarProductManager_.get(),
&manager::RadarProductManager::ProductTimesPopulated,
self_,
[this](common::RadarProductGroup group,
const std::string& product,
std::chrono::system_clock::time_point queryTime)
{
if (group == common::RadarProductGroup::Level3 &&
product == kNst_ && queryTime == selectedTime_)
{
// If the data associated with the currently selected time is
// reloaded, update the view
Update(product);
}
});
}
void OverlayProductView::Impl::DisconnectRadarProductManager()
@ -286,7 +298,7 @@ void OverlayProductView::Impl::Update(const std::string& product)
std::shared_ptr<wsr88d::rpg::Level3Message> message;
std::chrono::system_clock::time_point requestedTime {selectedTime_};
std::chrono::system_clock::time_point foundTime;
std::tie(message, foundTime) =
std::tie(message, foundTime, std::ignore) =
radarProductManager_->GetLevel3Data(product, requestedTime);
// If a different time was found than what was requested, update it
@ -329,6 +341,4 @@ void OverlayProductView::SetAutoUpdate(bool enabled)
p->autoUpdateEnabled_ = enabled;
}
} // namespace view
} // namespace qt
} // namespace scwx
} // namespace scwx::qt::view