mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 08:10:05 +00:00
Resolve TODOs in level_2_chunks
This commit is contained in:
parent
3d7da7d971
commit
4906800a22
2 changed files with 10 additions and 13 deletions
|
|
@ -405,7 +405,6 @@ AwsLevel2ChunksDataProvider::Impl::ListObjects()
|
||||||
if (possibleLastNumbers.empty())
|
if (possibleLastNumbers.empty())
|
||||||
{
|
{
|
||||||
logger_->warn("Could not find last scan");
|
logger_->warn("Could not find last scan");
|
||||||
// TODO make sure this makes sence
|
|
||||||
return {false, 0, 0};
|
return {false, 0, 0};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -705,7 +704,6 @@ std::pair<size_t, size_t> AwsLevel2ChunksDataProvider::Refresh()
|
||||||
if (p->lastScan_.nexradFile_ != nullptr)
|
if (p->lastScan_.nexradFile_ != nullptr)
|
||||||
{
|
{
|
||||||
p->lastScan_.hasAllFiles_ = true;
|
p->lastScan_.hasAllFiles_ = true;
|
||||||
// TODO maybe set lastModified for timing
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Fall back to chunks if files did not load
|
// Fall back to chunks if files did not load
|
||||||
|
|
|
||||||
|
|
@ -528,7 +528,6 @@ bool Ar2vFile::IndexFile()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO not good
|
|
||||||
// NOLINTNEXTLINE
|
// NOLINTNEXTLINE
|
||||||
bool IsRadarDataIncomplete(
|
bool IsRadarDataIncomplete(
|
||||||
const std::shared_ptr<const rda::ElevationScan>& radarData)
|
const std::shared_ptr<const rda::ElevationScan>& radarData)
|
||||||
|
|
@ -583,10 +582,10 @@ Ar2vFile::Ar2vFile(const std::shared_ptr<Ar2vFile>& current,
|
||||||
std::shared_ptr<rda::ElevationScan> secondMostRecent = nullptr;
|
std::shared_ptr<rda::ElevationScan> secondMostRecent = nullptr;
|
||||||
|
|
||||||
// check if this volume scan has an earlier elevation scan
|
// check if this volume scan has an earlier elevation scan
|
||||||
auto maybe = elevation.second.rbegin(); // TODO name
|
auto possibleSecondMostRecent = elevation.second.rbegin();
|
||||||
++maybe;
|
++possibleSecondMostRecent;
|
||||||
|
|
||||||
if (maybe == elevation.second.rend())
|
if (possibleSecondMostRecent == elevation.second.rend())
|
||||||
{
|
{
|
||||||
if (last == nullptr)
|
if (last == nullptr)
|
||||||
{
|
{
|
||||||
|
|
@ -613,7 +612,7 @@ Ar2vFile::Ar2vFile(const std::shared_ptr<Ar2vFile>& current,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
secondMostRecent = maybe->second;
|
secondMostRecent = possibleSecondMostRecent->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make the new scan
|
// Make the new scan
|
||||||
|
|
@ -707,15 +706,15 @@ Ar2vFile::Ar2vFile(const std::shared_ptr<Ar2vFile>& current,
|
||||||
// Start below any reasonable elevation
|
// Start below any reasonable elevation
|
||||||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)
|
// NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)
|
||||||
float highestCurrentElevation = -90;
|
float highestCurrentElevation = -90;
|
||||||
const auto& maybe1 = p->index_.find(type.first);
|
const auto& elevationScans = p->index_.find(type.first);
|
||||||
if (maybe1 != p->index_.cend())
|
if (elevationScans != p->index_.cend())
|
||||||
{
|
{
|
||||||
const auto& maybe2 = maybe1->second.crbegin();
|
const auto& highestElevation = elevationScans->second.crbegin();
|
||||||
if (maybe2 != maybe1->second.crend())
|
if (highestElevation != elevationScans->second.crend())
|
||||||
{
|
{
|
||||||
// Add a slight offset to ensure good floating point compare.
|
// Add a slight offset to ensure good floating point compare.
|
||||||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)
|
// NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)
|
||||||
highestCurrentElevation = maybe2->first + 0.01f;
|
highestCurrentElevation = highestElevation->first + 0.01f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue