mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 17:40:05 +00:00
Add precipitation accumulation products
Closes #149 (cherry picked from commit 14afeb33db929e51fa094845bc0b79e266c0f80e)
This commit is contained in:
parent
f3b7dcddbd
commit
524de364f2
7 changed files with 83 additions and 41 deletions
|
|
@ -8,6 +8,7 @@
|
|||
#include <scwx/wsr88d/rpg/radial_data_packet.hpp>
|
||||
|
||||
#include <limits>
|
||||
#include <unordered_set>
|
||||
|
||||
#include <boost/range/irange.hpp>
|
||||
#include <boost/timer/timer.hpp>
|
||||
|
|
@ -398,6 +399,16 @@ std::optional<float> Level3ProductView::GetDataValue(std::uint16_t level) const
|
|||
return descriptionBlock->data_value(static_cast<std::uint8_t>(level));
|
||||
}
|
||||
|
||||
bool Level3ProductView::IgnoreUnits() const
|
||||
{
|
||||
// Don't display units on these products. The current method of displaying
|
||||
// units is not accurate for these.
|
||||
static const std::unordered_set<std::string> kIgnoreUnitsProducts_ {
|
||||
"DAA", "DTA", "DU3", "DU6"};
|
||||
|
||||
return (kIgnoreUnitsProducts_.contains(p->product_));
|
||||
}
|
||||
|
||||
} // namespace view
|
||||
} // namespace qt
|
||||
} // namespace scwx
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ public:
|
|||
std::optional<wsr88d::DataLevelCode>
|
||||
GetDataLevelCode(std::uint16_t level) const override;
|
||||
std::optional<float> GetDataValue(std::uint16_t level) const override;
|
||||
bool IgnoreUnits() const override;
|
||||
|
||||
void SelectProduct(const std::string& productName) override;
|
||||
|
||||
|
|
|
|||
|
|
@ -144,6 +144,11 @@ RadarProductView::GetCfpMomentData() const
|
|||
return std::tie(data, dataSize, componentSize);
|
||||
}
|
||||
|
||||
bool RadarProductView::IgnoreUnits() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<std::pair<std::string, std::string>>
|
||||
RadarProductView::GetDescriptionFields() const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ public:
|
|||
virtual std::optional<wsr88d::DataLevelCode>
|
||||
GetDataLevelCode(std::uint16_t level) const = 0;
|
||||
virtual std::optional<float> GetDataValue(std::uint16_t level) const = 0;
|
||||
virtual bool IgnoreUnits() const;
|
||||
|
||||
virtual std::vector<std::pair<std::string, std::string>>
|
||||
GetDescriptionFields() const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue