mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 15:00:04 +00:00
switch level2 incoming elevation to optional
This commit is contained in:
parent
f481d57ed1
commit
e10ebdeb5e
9 changed files with 41 additions and 32 deletions
|
|
@ -699,12 +699,12 @@ AwsLevel2ChunksDataProvider::AwsLevel2ChunksDataProvider(
|
|||
AwsLevel2ChunksDataProvider& AwsLevel2ChunksDataProvider::operator=(
|
||||
AwsLevel2ChunksDataProvider&&) noexcept = default;
|
||||
|
||||
float AwsLevel2ChunksDataProvider::GetCurrentElevation()
|
||||
std::optional<float> AwsLevel2ChunksDataProvider::GetCurrentElevation()
|
||||
{
|
||||
if (!p->currentScan_.valid_ || p->currentScan_.nexradFile_ == nullptr)
|
||||
{
|
||||
// Does not have any scan elevation. -90 is beyond what is possible
|
||||
return INVALID_ELEVATION;
|
||||
return {};
|
||||
}
|
||||
|
||||
auto vcpData = p->currentScan_.nexradFile_->vcp_data();
|
||||
|
|
@ -712,7 +712,7 @@ float AwsLevel2ChunksDataProvider::GetCurrentElevation()
|
|||
if (radarData.size() == 0)
|
||||
{
|
||||
// Does not have any scan elevation. -90 is beyond what is possible
|
||||
return INVALID_ELEVATION;
|
||||
return {};
|
||||
}
|
||||
|
||||
const auto& lastElevation = radarData.crbegin();
|
||||
|
|
@ -729,7 +729,7 @@ float AwsLevel2ChunksDataProvider::GetCurrentElevation()
|
|||
return digitalRadarData0->elevation_angle().value();
|
||||
}
|
||||
|
||||
return INVALID_ELEVATION;
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace scwx::provider
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue