mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-11-01 18:00:06 +00:00
Support selecting level 2 files for display
This commit is contained in:
parent
1655a7c571
commit
95de37cab4
8 changed files with 125 additions and 78 deletions
|
|
@ -47,6 +47,7 @@ public:
|
|||
product_ {product},
|
||||
radarProductManager_ {radarProductManager},
|
||||
selectedElevation_ {elevation},
|
||||
selectedTime_ {},
|
||||
elevationScan_ {nullptr},
|
||||
momentDataBlock0_ {nullptr},
|
||||
latitude_ {},
|
||||
|
|
@ -80,7 +81,8 @@ public:
|
|||
wsr88d::rda::DataBlockType dataBlockType_;
|
||||
std::shared_ptr<manager::RadarProductManager> radarProductManager_;
|
||||
|
||||
float selectedElevation_;
|
||||
float selectedElevation_;
|
||||
std::chrono::system_clock::time_point selectedTime_;
|
||||
|
||||
std::shared_ptr<wsr88d::rda::ElevationScan> elevationScan_;
|
||||
std::shared_ptr<wsr88d::rda::MomentDataBlock> momentDataBlock0_;
|
||||
|
|
@ -116,10 +118,6 @@ Level2ProductView::Level2ProductView(
|
|||
p(std::make_unique<Level2ProductViewImpl>(
|
||||
product, elevation, radarProductManager))
|
||||
{
|
||||
connect(radarProductManager.get(),
|
||||
&manager::RadarProductManager::Level2DataLoaded,
|
||||
this,
|
||||
&Level2ProductView::ComputeSweep);
|
||||
}
|
||||
Level2ProductView::~Level2ProductView() = default;
|
||||
|
||||
|
|
@ -248,6 +246,15 @@ void Level2ProductView::LoadColorTable(
|
|||
void Level2ProductView::SelectElevation(float elevation)
|
||||
{
|
||||
p->selectedElevation_ = elevation;
|
||||
}
|
||||
|
||||
void Level2ProductView::SelectTime(std::chrono::system_clock::time_point time)
|
||||
{
|
||||
p->selectedTime_ = time;
|
||||
}
|
||||
|
||||
void Level2ProductView::Update()
|
||||
{
|
||||
util::async([=]() { ComputeSweep(); });
|
||||
}
|
||||
|
||||
|
|
@ -348,8 +355,8 @@ void Level2ProductView::ComputeSweep()
|
|||
|
||||
std::shared_ptr<wsr88d::rda::ElevationScan> radarData;
|
||||
std::tie(radarData, p->elevationCut_, p->elevationCuts_) =
|
||||
p->radarProductManager_->GetLevel2Data(p->dataBlockType_,
|
||||
p->selectedElevation_);
|
||||
p->radarProductManager_->GetLevel2Data(
|
||||
p->dataBlockType_, p->selectedElevation_, p->selectedTime_);
|
||||
if (radarData == nullptr || radarData == p->elevationScan_)
|
||||
{
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ public:
|
|||
|
||||
void LoadColorTable(std::shared_ptr<common::ColorTable> colorTable) override;
|
||||
void SelectElevation(float elevation) override;
|
||||
void SelectTime(std::chrono::system_clock::time_point time) override;
|
||||
void Update() override;
|
||||
|
||||
common::RadarProductGroup GetRadarProductGroup() const override;
|
||||
std::string GetRadarProductName() const override;
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ public:
|
|||
virtual void
|
||||
LoadColorTable(std::shared_ptr<common::ColorTable> colorTable) = 0;
|
||||
virtual void SelectElevation(float elevation);
|
||||
virtual void SelectTime(std::chrono::system_clock::time_point time) = 0;
|
||||
virtual void Update() = 0;
|
||||
|
||||
virtual common::RadarProductGroup GetRadarProductGroup() const = 0;
|
||||
virtual std::string GetRadarProductName() const = 0;
|
||||
|
|
|
|||
|
|
@ -19,14 +19,14 @@ typedef std::function<std::shared_ptr<RadarProductView>(
|
|||
CreateRadarProductFunction;
|
||||
|
||||
std::shared_ptr<RadarProductView> RadarProductViewFactory::Create(
|
||||
const std::string& productGroup,
|
||||
common::RadarProductGroup productGroup,
|
||||
const std::string& productName,
|
||||
float elevation,
|
||||
std::shared_ptr<manager::RadarProductManager> radarProductManager)
|
||||
{
|
||||
std::shared_ptr<RadarProductView> view = nullptr;
|
||||
|
||||
if (productGroup == "L2")
|
||||
if (productGroup == common::RadarProductGroup::Level2)
|
||||
{
|
||||
common::Level2Product product = common::GetLevel2Product(productName);
|
||||
|
||||
|
|
@ -43,7 +43,8 @@ std::shared_ptr<RadarProductView> RadarProductViewFactory::Create(
|
|||
else
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(warning)
|
||||
<< logPrefix_ << "Unknown radar product group: " << productGroup;
|
||||
<< logPrefix_ << "Unknown radar product group: "
|
||||
<< common::GetRadarProductGroupName(productGroup);
|
||||
}
|
||||
|
||||
return view;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ private:
|
|||
|
||||
public:
|
||||
static std::shared_ptr<RadarProductView>
|
||||
Create(const std::string& productGroup,
|
||||
Create(common::RadarProductGroup productGroup,
|
||||
const std::string& productName,
|
||||
float elevation,
|
||||
std::shared_ptr<manager::RadarProductManager> radarProductManager);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue