Do not display an elevation number when there is non

This commit is contained in:
AdenKoperczak 2025-04-13 10:59:41 -04:00
parent 484c08c455
commit 24f5f0a3e3
No known key found for this signature in database
GPG key ID: 9843017036F62EE7
12 changed files with 166 additions and 145 deletions

View file

@ -67,7 +67,7 @@ public:
float latitude_;
float longitude_;
float elevation_;
std::optional<float> elevation_ {};
float range_;
std::uint16_t vcp_;
@ -92,7 +92,7 @@ boost::asio::thread_pool& Level3RadialView::thread_pool()
return p->threadPool_;
}
float Level3RadialView::elevation() const
std::optional<float> Level3RadialView::elevation() const
{
return p->elevation_;
}
@ -312,7 +312,10 @@ void Level3RadialView::ComputeSweep()
p->latitude_ = descriptionBlock->latitude_of_radar();
p->longitude_ = descriptionBlock->longitude_of_radar();
p->range_ = descriptionBlock->range();
p->elevation_ = static_cast<float>(descriptionBlock->elevation().value());
p->elevation_ =
descriptionBlock->has_elevation() ?
static_cast<float>(descriptionBlock->elevation().value()) :
std::optional<float> {};
p->sweepTime_ =
scwx::util::TimePoint(descriptionBlock->volume_scan_date(),
descriptionBlock->volume_scan_start_time() * 1000);