mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 20:10:06 +00:00
Linting fixes
This commit is contained in:
parent
a65504a2cb
commit
57b773d009
4 changed files with 98 additions and 73 deletions
|
|
@ -10,7 +10,6 @@
|
||||||
#include <scwx/util/threads.hpp>
|
#include <scwx/util/threads.hpp>
|
||||||
#include <scwx/wsr88d/nexrad_file_factory.hpp>
|
#include <scwx/wsr88d/nexrad_file_factory.hpp>
|
||||||
|
|
||||||
#include <deque>
|
|
||||||
#include <execution>
|
#include <execution>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <shared_mutex>
|
#include <shared_mutex>
|
||||||
|
|
@ -64,6 +63,8 @@ static constexpr uint32_t NUM_COORIDNATES_1_DEGREE =
|
||||||
|
|
||||||
static const std::string kDefaultLevel3Product_ {"N0B"};
|
static const std::string kDefaultLevel3Product_ {"N0B"};
|
||||||
|
|
||||||
|
static constexpr std::size_t kTimerPlaces_ {6u};
|
||||||
|
|
||||||
static constexpr std::chrono::seconds kFastRetryInterval_ {15};
|
static constexpr std::chrono::seconds kFastRetryInterval_ {15};
|
||||||
static constexpr std::chrono::seconds kSlowRetryInterval_ {120};
|
static constexpr std::chrono::seconds kSlowRetryInterval_ {120};
|
||||||
|
|
||||||
|
|
@ -464,6 +465,8 @@ void RadarProductManager::Initialize()
|
||||||
const auto radialGates0_5Degree =
|
const auto radialGates0_5Degree =
|
||||||
boost::irange<uint32_t>(0, NUM_RADIAL_GATES_0_5_DEGREE);
|
boost::irange<uint32_t>(0, NUM_RADIAL_GATES_0_5_DEGREE);
|
||||||
|
|
||||||
|
// NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers): Values are given
|
||||||
|
// descriptions
|
||||||
p->CalculateCoordinates(
|
p->CalculateCoordinates(
|
||||||
radialGates0_5Degree,
|
radialGates0_5Degree,
|
||||||
units::angle::degrees<float> {0.5f}, // Radial angle
|
units::angle::degrees<float> {0.5f}, // Radial angle
|
||||||
|
|
@ -471,10 +474,11 @@ void RadarProductManager::Initialize()
|
||||||
// Far end of the first gate is the gate size distance from the radar site
|
// Far end of the first gate is the gate size distance from the radar site
|
||||||
1.0f,
|
1.0f,
|
||||||
coordinates0_5Degree);
|
coordinates0_5Degree);
|
||||||
|
// NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
|
||||||
|
|
||||||
timer.stop();
|
timer.stop();
|
||||||
logger_->debug("Coordinates (0.5 degree) calculated in {}",
|
logger_->debug("Coordinates (0.5 degree) calculated in {}",
|
||||||
timer.format(6, "%ws"));
|
timer.format(kTimerPlaces_, "%ws"));
|
||||||
|
|
||||||
// Calculate half degree smooth azimuth coordinates
|
// Calculate half degree smooth azimuth coordinates
|
||||||
timer.start();
|
timer.start();
|
||||||
|
|
@ -483,6 +487,8 @@ void RadarProductManager::Initialize()
|
||||||
|
|
||||||
coordinates0_5DegreeSmooth.resize(NUM_COORIDNATES_0_5_DEGREE);
|
coordinates0_5DegreeSmooth.resize(NUM_COORIDNATES_0_5_DEGREE);
|
||||||
|
|
||||||
|
// NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers): Values are given
|
||||||
|
// descriptions
|
||||||
p->CalculateCoordinates(radialGates0_5Degree,
|
p->CalculateCoordinates(radialGates0_5Degree,
|
||||||
units::angle::degrees<float> {0.5f}, // Radial angle
|
units::angle::degrees<float> {0.5f}, // Radial angle
|
||||||
units::angle::degrees<float> {0.25f}, // Angle offset
|
units::angle::degrees<float> {0.25f}, // Angle offset
|
||||||
|
|
@ -490,10 +496,11 @@ void RadarProductManager::Initialize()
|
||||||
// distance from the radar site
|
// distance from the radar site
|
||||||
0.5f,
|
0.5f,
|
||||||
coordinates0_5DegreeSmooth);
|
coordinates0_5DegreeSmooth);
|
||||||
|
// NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
|
||||||
|
|
||||||
timer.stop();
|
timer.stop();
|
||||||
logger_->debug("Coordinates (0.5 degree smooth) calculated in {}",
|
logger_->debug("Coordinates (0.5 degree smooth) calculated in {}",
|
||||||
timer.format(6, "%ws"));
|
timer.format(kTimerPlaces_, "%ws"));
|
||||||
|
|
||||||
// Calculate 1 degree azimuth coordinates
|
// Calculate 1 degree azimuth coordinates
|
||||||
timer.start();
|
timer.start();
|
||||||
|
|
@ -504,6 +511,8 @@ void RadarProductManager::Initialize()
|
||||||
const auto radialGates1Degree =
|
const auto radialGates1Degree =
|
||||||
boost::irange<uint32_t>(0, NUM_RADIAL_GATES_1_DEGREE);
|
boost::irange<uint32_t>(0, NUM_RADIAL_GATES_1_DEGREE);
|
||||||
|
|
||||||
|
// NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers): Values are given
|
||||||
|
// descriptions
|
||||||
p->CalculateCoordinates(
|
p->CalculateCoordinates(
|
||||||
radialGates1Degree,
|
radialGates1Degree,
|
||||||
units::angle::degrees<float> {1.0f}, // Radial angle
|
units::angle::degrees<float> {1.0f}, // Radial angle
|
||||||
|
|
@ -511,10 +520,11 @@ void RadarProductManager::Initialize()
|
||||||
// Far end of the first gate is the gate size distance from the radar site
|
// Far end of the first gate is the gate size distance from the radar site
|
||||||
1.0f,
|
1.0f,
|
||||||
coordinates1Degree);
|
coordinates1Degree);
|
||||||
|
// NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
|
||||||
|
|
||||||
timer.stop();
|
timer.stop();
|
||||||
logger_->debug("Coordinates (1 degree) calculated in {}",
|
logger_->debug("Coordinates (1 degree) calculated in {}",
|
||||||
timer.format(6, "%ws"));
|
timer.format(kTimerPlaces_, "%ws"));
|
||||||
|
|
||||||
// Calculate 1 degree smooth azimuth coordinates
|
// Calculate 1 degree smooth azimuth coordinates
|
||||||
timer.start();
|
timer.start();
|
||||||
|
|
@ -522,6 +532,8 @@ void RadarProductManager::Initialize()
|
||||||
|
|
||||||
coordinates1DegreeSmooth.resize(NUM_COORIDNATES_1_DEGREE);
|
coordinates1DegreeSmooth.resize(NUM_COORIDNATES_1_DEGREE);
|
||||||
|
|
||||||
|
// NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers): Values are given
|
||||||
|
// descriptions
|
||||||
p->CalculateCoordinates(radialGates1Degree,
|
p->CalculateCoordinates(radialGates1Degree,
|
||||||
units::angle::degrees<float> {1.0f}, // Radial angle
|
units::angle::degrees<float> {1.0f}, // Radial angle
|
||||||
units::angle::degrees<float> {0.5f}, // Angle offset
|
units::angle::degrees<float> {0.5f}, // Angle offset
|
||||||
|
|
@ -529,10 +541,11 @@ void RadarProductManager::Initialize()
|
||||||
// distance from the radar site
|
// distance from the radar site
|
||||||
0.5f,
|
0.5f,
|
||||||
coordinates1DegreeSmooth);
|
coordinates1DegreeSmooth);
|
||||||
|
// NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
|
||||||
|
|
||||||
timer.stop();
|
timer.stop();
|
||||||
logger_->debug("Coordinates (1 degree smooth) calculated in {}",
|
logger_->debug("Coordinates (1 degree smooth) calculated in {}",
|
||||||
timer.format(6, "%ws"));
|
timer.format(kTimerPlaces_, "%ws"));
|
||||||
|
|
||||||
p->initialized_ = true;
|
p->initialized_ = true;
|
||||||
}
|
}
|
||||||
|
|
@ -558,23 +571,25 @@ void RadarProductManagerImpl::CalculateCoordinates(
|
||||||
radialGates.end(),
|
radialGates.end(),
|
||||||
[&](uint32_t radialGate)
|
[&](uint32_t radialGate)
|
||||||
{
|
{
|
||||||
const uint16_t gate =
|
const auto gate = static_cast<std::uint16_t>(
|
||||||
static_cast<uint16_t>(radialGate % common::MAX_DATA_MOMENT_GATES);
|
radialGate % common::MAX_DATA_MOMENT_GATES);
|
||||||
const uint16_t radial =
|
const auto radial = static_cast<std::uint16_t>(
|
||||||
static_cast<uint16_t>(radialGate / common::MAX_DATA_MOMENT_GATES);
|
radialGate / common::MAX_DATA_MOMENT_GATES);
|
||||||
|
|
||||||
const float angle = radial * radialAngle.value() + angleOffset.value();
|
const float angle = static_cast<float>(radial) * radialAngle.value() +
|
||||||
const float range = (gate + gateRangeOffset) * gateSize;
|
angleOffset.value();
|
||||||
const size_t offset = radialGate * 2;
|
const float range =
|
||||||
|
(static_cast<float>(gate) + gateRangeOffset) * gateSize;
|
||||||
|
const std::size_t offset = static_cast<std::size_t>(radialGate) * 2;
|
||||||
|
|
||||||
double latitude;
|
double latitude = 0.0;
|
||||||
double longitude;
|
double longitude = 0.0;
|
||||||
|
|
||||||
geodesic.Direct(
|
geodesic.Direct(
|
||||||
radar.first, radar.second, angle, range, latitude, longitude);
|
radar.first, radar.second, angle, range, latitude, longitude);
|
||||||
|
|
||||||
outputCoordinates[offset] = latitude;
|
outputCoordinates[offset] = static_cast<float>(latitude);
|
||||||
outputCoordinates[offset + 1] = longitude;
|
outputCoordinates[offset + 1] = static_cast<float>(longitude);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,6 @@
|
||||||
#include <scwx/qt/view/radar_product_view.hpp>
|
#include <scwx/qt/view/radar_product_view.hpp>
|
||||||
#include <scwx/util/logger.hpp>
|
#include <scwx/util/logger.hpp>
|
||||||
|
|
||||||
#include <execution>
|
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
# pragma warning(push, 0)
|
# pragma warning(push, 0)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
#include <scwx/util/logger.hpp>
|
#include <scwx/util/logger.hpp>
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <execution>
|
|
||||||
|
|
||||||
#include <boost/json.hpp>
|
#include <boost/json.hpp>
|
||||||
|
|
||||||
|
|
@ -53,21 +52,21 @@ public:
|
||||||
{
|
{
|
||||||
for (std::size_t i = 0; i < kCount_; i++)
|
for (std::size_t i = 0; i < kCount_; i++)
|
||||||
{
|
{
|
||||||
map_[i].mapStyle_.SetDefault(kDefaultMapStyle_);
|
map_.at(i).mapStyle_.SetDefault(kDefaultMapStyle_);
|
||||||
map_[i].radarSite_.SetDefault(kDefaultRadarSite_);
|
map_.at(i).radarSite_.SetDefault(kDefaultRadarSite_);
|
||||||
map_[i].radarProductGroup_.SetDefault(
|
map_.at(i).radarProductGroup_.SetDefault(
|
||||||
kDefaultRadarProductGroupString_);
|
kDefaultRadarProductGroupString_);
|
||||||
map_[i].radarProduct_.SetDefault(kDefaultRadarProduct_[i]);
|
map_.at(i).radarProduct_.SetDefault(kDefaultRadarProduct_.at(i));
|
||||||
map_[i].smoothingEnabled_.SetDefault(kDefaultSmoothingEnabled_);
|
map_.at(i).smoothingEnabled_.SetDefault(kDefaultSmoothingEnabled_);
|
||||||
|
|
||||||
map_[i].radarSite_.SetValidator(
|
map_.at(i).radarSite_.SetValidator(
|
||||||
[](const std::string& value)
|
[](const std::string& value)
|
||||||
{
|
{
|
||||||
// Radar site must exist
|
// Radar site must exist
|
||||||
return config::RadarSite::Get(value) != nullptr;
|
return config::RadarSite::Get(value) != nullptr;
|
||||||
});
|
});
|
||||||
|
|
||||||
map_[i].radarProductGroup_.SetValidator(
|
map_.at(i).radarProductGroup_.SetValidator(
|
||||||
[](const std::string& value)
|
[](const std::string& value)
|
||||||
{
|
{
|
||||||
// Radar product group must be valid
|
// Radar product group must be valid
|
||||||
|
|
@ -76,12 +75,12 @@ public:
|
||||||
return radarProductGroup != common::RadarProductGroup::Unknown;
|
return radarProductGroup != common::RadarProductGroup::Unknown;
|
||||||
});
|
});
|
||||||
|
|
||||||
map_[i].radarProduct_.SetValidator(
|
map_.at(i).radarProduct_.SetValidator(
|
||||||
[this, i](const std::string& value)
|
[this, i](const std::string& value)
|
||||||
{
|
{
|
||||||
common::RadarProductGroup radarProductGroup =
|
common::RadarProductGroup radarProductGroup =
|
||||||
common::GetRadarProductGroup(
|
common::GetRadarProductGroup(
|
||||||
map_[i].radarProductGroup_.GetValue());
|
map_.at(i).radarProductGroup_.GetValue());
|
||||||
|
|
||||||
if (radarProductGroup == common::RadarProductGroup::Level2)
|
if (radarProductGroup == common::RadarProductGroup::Level2)
|
||||||
{
|
{
|
||||||
|
|
@ -97,11 +96,11 @@ public:
|
||||||
});
|
});
|
||||||
|
|
||||||
variables_.insert(variables_.cend(),
|
variables_.insert(variables_.cend(),
|
||||||
{&map_[i].mapStyle_,
|
{&map_.at(i).mapStyle_,
|
||||||
&map_[i].radarSite_,
|
&map_.at(i).radarSite_,
|
||||||
&map_[i].radarProductGroup_,
|
&map_.at(i).radarProductGroup_,
|
||||||
&map_[i].radarProduct_,
|
&map_.at(i).radarProduct_,
|
||||||
&map_[i].smoothingEnabled_});
|
&map_.at(i).smoothingEnabled_});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -109,11 +108,11 @@ public:
|
||||||
|
|
||||||
void SetDefaults(std::size_t i)
|
void SetDefaults(std::size_t i)
|
||||||
{
|
{
|
||||||
map_[i].mapStyle_.SetValueToDefault();
|
map_.at(i).mapStyle_.SetValueToDefault();
|
||||||
map_[i].radarSite_.SetValueToDefault();
|
map_.at(i).radarSite_.SetValueToDefault();
|
||||||
map_[i].radarProductGroup_.SetValueToDefault();
|
map_.at(i).radarProductGroup_.SetValueToDefault();
|
||||||
map_[i].radarProduct_.SetValueToDefault();
|
map_.at(i).radarProduct_.SetValueToDefault();
|
||||||
map_[i].smoothingEnabled_.SetValueToDefault();
|
map_.at(i).smoothingEnabled_.SetValueToDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
friend void tag_invoke(boost::json::value_from_tag,
|
friend void tag_invoke(boost::json::value_from_tag,
|
||||||
|
|
@ -160,28 +159,28 @@ std::size_t MapSettings::count() const
|
||||||
|
|
||||||
SettingsVariable<std::string>& MapSettings::map_style(std::size_t i) const
|
SettingsVariable<std::string>& MapSettings::map_style(std::size_t i) const
|
||||||
{
|
{
|
||||||
return p->map_[i].mapStyle_;
|
return p->map_.at(i).mapStyle_;
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsVariable<std::string>& MapSettings::radar_site(std::size_t i) const
|
SettingsVariable<std::string>& MapSettings::radar_site(std::size_t i) const
|
||||||
{
|
{
|
||||||
return p->map_[i].radarSite_;
|
return p->map_.at(i).radarSite_;
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsVariable<std::string>&
|
SettingsVariable<std::string>&
|
||||||
MapSettings::radar_product_group(std::size_t i) const
|
MapSettings::radar_product_group(std::size_t i) const
|
||||||
{
|
{
|
||||||
return p->map_[i].radarProductGroup_;
|
return p->map_.at(i).radarProductGroup_;
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsVariable<std::string>& MapSettings::radar_product(std::size_t i) const
|
SettingsVariable<std::string>& MapSettings::radar_product(std::size_t i) const
|
||||||
{
|
{
|
||||||
return p->map_[i].radarProduct_;
|
return p->map_.at(i).radarProduct_;
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsVariable<bool>& MapSettings::smoothing_enabled(std::size_t i) const
|
SettingsVariable<bool>& MapSettings::smoothing_enabled(std::size_t i) const
|
||||||
{
|
{
|
||||||
return p->map_[i].smoothingEnabled_;
|
return p->map_.at(i).smoothingEnabled_;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MapSettings::Shutdown()
|
bool MapSettings::Shutdown()
|
||||||
|
|
@ -191,7 +190,7 @@ bool MapSettings::Shutdown()
|
||||||
// Commit settings that are managed separate from the settings dialog
|
// Commit settings that are managed separate from the settings dialog
|
||||||
for (std::size_t i = 0; i < kCount_; ++i)
|
for (std::size_t i = 0; i < kCount_; ++i)
|
||||||
{
|
{
|
||||||
Impl::MapData& mapRecordSettings = p->map_[i];
|
Impl::MapData& mapRecordSettings = p->map_.at(i);
|
||||||
|
|
||||||
dataChanged |= mapRecordSettings.mapStyle_.Commit();
|
dataChanged |= mapRecordSettings.mapStyle_.Commit();
|
||||||
dataChanged |= mapRecordSettings.smoothingEnabled_.Commit();
|
dataChanged |= mapRecordSettings.smoothingEnabled_.Commit();
|
||||||
|
|
@ -215,7 +214,7 @@ bool MapSettings::ReadJson(const boost::json::object& json)
|
||||||
if (i < mapArray.size() && mapArray.at(i).is_object())
|
if (i < mapArray.size() && mapArray.at(i).is_object())
|
||||||
{
|
{
|
||||||
const boost::json::object& mapRecord = mapArray.at(i).as_object();
|
const boost::json::object& mapRecord = mapArray.at(i).as_object();
|
||||||
Impl::MapData& mapRecordSettings = p->map_[i];
|
Impl::MapData& mapRecordSettings = p->map_.at(i);
|
||||||
|
|
||||||
// Load JSON Elements
|
// Load JSON Elements
|
||||||
validated &= mapRecordSettings.mapStyle_.ReadValue(mapRecord);
|
validated &= mapRecordSettings.mapStyle_.ReadValue(mapRecord);
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,9 @@ static constexpr std::uint32_t kMaxRadialGates_ =
|
||||||
common::MAX_0_5_DEGREE_RADIALS * common::MAX_DATA_MOMENT_GATES;
|
common::MAX_0_5_DEGREE_RADIALS * common::MAX_DATA_MOMENT_GATES;
|
||||||
static constexpr std::uint32_t kMaxCoordinates_ = kMaxRadialGates_ * 2u;
|
static constexpr std::uint32_t kMaxCoordinates_ = kMaxRadialGates_ * 2u;
|
||||||
|
|
||||||
|
static constexpr std::size_t kVerticesPerGate_ = 6u;
|
||||||
|
static constexpr std::size_t kVerticesPerOriginGate_ = 3u;
|
||||||
|
|
||||||
static constexpr uint16_t RANGE_FOLDED = 1u;
|
static constexpr uint16_t RANGE_FOLDED = 1u;
|
||||||
static constexpr uint32_t VERTICES_PER_BIN = 6u;
|
static constexpr uint32_t VERTICES_PER_BIN = 6u;
|
||||||
static constexpr uint32_t VALUES_PER_VERTEX = 2u;
|
static constexpr uint32_t VALUES_PER_VERTEX = 2u;
|
||||||
|
|
@ -769,7 +772,11 @@ void Level2ProductView::ComputeSweep()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::size_t vertexCount = (gate > 0) ? 6 : 3;
|
std::size_t vertexCount =
|
||||||
|
(gate > 0) ? kVerticesPerGate_ : kVerticesPerOriginGate_;
|
||||||
|
|
||||||
|
// Allow pointer arithmetic here, as bounds have already been checked
|
||||||
|
// NOLINTBEGIN(cppcoreguidelines-pro-bounds-pointer-arithmetic)
|
||||||
|
|
||||||
// Store data moment value
|
// Store data moment value
|
||||||
if (dataMomentsArray8 != nullptr)
|
if (dataMomentsArray8 != nullptr)
|
||||||
|
|
@ -902,6 +909,8 @@ void Level2ProductView::ComputeSweep()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOLINTEND(cppcoreguidelines-pro-bounds-pointer-arithmetic)
|
||||||
|
|
||||||
// Store vertices
|
// Store vertices
|
||||||
if (gate > 0)
|
if (gate > 0)
|
||||||
{
|
{
|
||||||
|
|
@ -919,13 +928,15 @@ void Level2ProductView::ComputeSweep()
|
||||||
common::MAX_DATA_MOMENT_GATES +
|
common::MAX_DATA_MOMENT_GATES +
|
||||||
baseCoord) *
|
baseCoord) *
|
||||||
2;
|
2;
|
||||||
std::size_t offset2 = offset1 + gateSize * 2;
|
std::size_t offset2 =
|
||||||
|
offset1 + static_cast<std::size_t>(gateSize) * 2;
|
||||||
std::size_t offset3 =
|
std::size_t offset3 =
|
||||||
(((startRadial + radial + 1) % vertexRadials) *
|
(((startRadial + radial + 1) % vertexRadials) *
|
||||||
common::MAX_DATA_MOMENT_GATES +
|
common::MAX_DATA_MOMENT_GATES +
|
||||||
baseCoord) *
|
baseCoord) *
|
||||||
2;
|
2;
|
||||||
std::size_t offset4 = offset3 + gateSize * 2;
|
std::size_t offset4 =
|
||||||
|
offset3 + static_cast<std::size_t>(gateSize) * 2;
|
||||||
|
|
||||||
vertices[vIndex++] = coordinates[offset1];
|
vertices[vIndex++] = coordinates[offset1];
|
||||||
vertices[vIndex++] = coordinates[offset1 + 1];
|
vertices[vIndex++] = coordinates[offset1 + 1];
|
||||||
|
|
@ -945,7 +956,7 @@ void Level2ProductView::ComputeSweep()
|
||||||
vertices[vIndex++] = coordinates[offset4];
|
vertices[vIndex++] = coordinates[offset4];
|
||||||
vertices[vIndex++] = coordinates[offset4 + 1];
|
vertices[vIndex++] = coordinates[offset4 + 1];
|
||||||
|
|
||||||
vertexCount = 6;
|
vertexCount = kVerticesPerGate_;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -970,7 +981,7 @@ void Level2ProductView::ComputeSweep()
|
||||||
vertices[vIndex++] = coordinates[offset2];
|
vertices[vIndex++] = coordinates[offset2];
|
||||||
vertices[vIndex++] = coordinates[offset2 + 1];
|
vertices[vIndex++] = coordinates[offset2 + 1];
|
||||||
|
|
||||||
vertexCount = 3;
|
vertexCount = kVerticesPerOriginGate_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1010,7 +1021,7 @@ void Level2ProductView::Impl::ComputeEdgeValue()
|
||||||
{
|
{
|
||||||
case wsr88d::rda::DataBlockType::MomentVel:
|
case wsr88d::rda::DataBlockType::MomentVel:
|
||||||
case wsr88d::rda::DataBlockType::MomentZdr:
|
case wsr88d::rda::DataBlockType::MomentZdr:
|
||||||
edgeValue_ = offset;
|
edgeValue_ = static_cast<std::uint16_t>(offset);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wsr88d::rda::DataBlockType::MomentSw:
|
case wsr88d::rda::DataBlockType::MomentSw:
|
||||||
|
|
@ -1019,7 +1030,7 @@ void Level2ProductView::Impl::ComputeEdgeValue()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wsr88d::rda::DataBlockType::MomentRho:
|
case wsr88d::rda::DataBlockType::MomentRho:
|
||||||
edgeValue_ = 255;
|
edgeValue_ = std::numeric_limits<std::uint8_t>::max();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wsr88d::rda::DataBlockType::MomentRef:
|
case wsr88d::rda::DataBlockType::MomentRef:
|
||||||
|
|
@ -1194,30 +1205,32 @@ void Level2ProductView::Impl::ComputeCoordinates(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::for_each(std::execution::par_unseq,
|
std::for_each(
|
||||||
gates.begin(),
|
std::execution::par_unseq,
|
||||||
gates.end(),
|
gates.begin(),
|
||||||
[&](std::uint32_t gate)
|
gates.end(),
|
||||||
{
|
[&](std::uint32_t gate)
|
||||||
const std::uint32_t radialGate =
|
{
|
||||||
radial * common::MAX_DATA_MOMENT_GATES + gate;
|
const std::uint32_t radialGate =
|
||||||
const float range =
|
radial * common::MAX_DATA_MOMENT_GATES + gate;
|
||||||
(gate + gateRangeOffset) * gateSize;
|
const float range =
|
||||||
const std::size_t offset = radialGate * 2;
|
(static_cast<float>(gate) + gateRangeOffset) * gateSize;
|
||||||
|
const std::size_t offset =
|
||||||
|
static_cast<std::size_t>(radialGate) * 2;
|
||||||
|
|
||||||
double latitude;
|
double latitude = 0.0;
|
||||||
double longitude;
|
double longitude = 0.0;
|
||||||
|
|
||||||
geodesic.Direct(radarLatitude,
|
geodesic.Direct(radarLatitude,
|
||||||
radarLongitude,
|
radarLongitude,
|
||||||
angle.value(),
|
angle.value(),
|
||||||
range,
|
range,
|
||||||
latitude,
|
latitude,
|
||||||
longitude);
|
longitude);
|
||||||
|
|
||||||
coordinates_[offset] = latitude;
|
coordinates_[offset] = static_cast<float>(latitude);
|
||||||
coordinates_[offset + 1] = longitude;
|
coordinates_[offset + 1] = static_cast<float>(longitude);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
timer.stop();
|
timer.stop();
|
||||||
logger_->debug("Coordinates calculated in {}", timer.format(6, "%ws"));
|
logger_->debug("Coordinates calculated in {}", timer.format(6, "%ws"));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue