Move elevation conversion code into VCP and DRD code

This commit is contained in:
AdenKoperczak 2025-04-08 10:41:44 -04:00
parent 63585af26d
commit 6ca76b9eca
No known key found for this signature in database
GPG key ID: 9843017036F62EE7
3 changed files with 30 additions and 19 deletions

View file

@ -220,7 +220,20 @@ uint16_t VolumeCoveragePatternData::number_of_base_tilts() const
double VolumeCoveragePatternData::elevation_angle(uint16_t e) const
{
return p->elevationCuts_[e].elevationAngle_ * ANGLE_DATA_SCALE;
// NOLINTNEXTLINE This conversion is accurate
float elevationAngleConverted =
p->elevationCuts_[e].elevationAngle_ * ANGLE_DATA_SCALE;
// Any elevation above 90 degrees should be interpreted as a
// negative angle
// NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers)
if (elevationAngleConverted > 90)
{
elevationAngleConverted -= 360;
}
// NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
return elevationAngleConverted;
}
uint16_t VolumeCoveragePatternData::elevation_angle_raw(uint16_t e) const