Add sequence number, volume scan and elevation to product description hover

This commit is contained in:
Dan Paulat 2023-11-19 21:45:43 -06:00
parent c190813946
commit d5222eac63
3 changed files with 36 additions and 2 deletions

View file

@ -5,6 +5,8 @@
#include <cstdint>
#include <memory>
#include <units/angle.h>
namespace scwx
{
namespace wsr88d
@ -20,7 +22,7 @@ public:
explicit ProductDescriptionBlock();
~ProductDescriptionBlock();
ProductDescriptionBlock(const ProductDescriptionBlock&) = delete;
ProductDescriptionBlock(const ProductDescriptionBlock&) = delete;
ProductDescriptionBlock& operator=(const ProductDescriptionBlock&) = delete;
ProductDescriptionBlock(ProductDescriptionBlock&&) noexcept;
@ -62,6 +64,8 @@ public:
float log_offset() const;
float log_scale() const;
units::angle::degrees<double> elevation() const;
bool IsCompressionEnabled() const;
size_t data_size() const override;

View file

@ -139,7 +139,7 @@ ProductDescriptionBlock::ProductDescriptionBlock() :
ProductDescriptionBlock::~ProductDescriptionBlock() = default;
ProductDescriptionBlock::ProductDescriptionBlock(
ProductDescriptionBlock&&) noexcept = default;
ProductDescriptionBlock&&) noexcept = default;
ProductDescriptionBlock& ProductDescriptionBlock::operator=(
ProductDescriptionBlock&&) noexcept = default;
@ -590,6 +590,18 @@ float ProductDescriptionBlock::log_scale() const
return logScale;
}
units::angle::degrees<double> ProductDescriptionBlock::elevation() const
{
double elevation = 0.0;
if (p->elevationNumber_ > 0)
{
elevation = p->parameters_[2] * 0.1;
}
return units::angle::degrees<double> {elevation};
}
bool ProductDescriptionBlock::IsCompressionEnabled() const
{
bool isCompressed = false;