mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 08:00:06 +00:00
Adding impact based warnings to ibw namespace
This commit is contained in:
parent
38a2831779
commit
7101cdf183
6 changed files with 29 additions and 23 deletions
|
|
@ -9,6 +9,8 @@ namespace scwx
|
|||
{
|
||||
namespace awips
|
||||
{
|
||||
namespace ibw
|
||||
{
|
||||
|
||||
enum class ThreatCategory : int
|
||||
{
|
||||
|
|
@ -32,5 +34,6 @@ const ImpactBasedWarningInfo& GetImpactBasedWarningInfo(Phenomenon phenomenon);
|
|||
ThreatCategory GetThreatCategory(const std::string& name);
|
||||
const std::string& GetThreatCategoryName(ThreatCategory threatCategory);
|
||||
|
||||
} // namespace ibw
|
||||
} // namespace awips
|
||||
} // namespace scwx
|
||||
|
|
|
|||
|
|
@ -64,9 +64,9 @@ struct Segment
|
|||
std::optional<CodedLocation> codedLocation_ {};
|
||||
std::optional<CodedTimeMotionLocation> codedMotion_ {};
|
||||
|
||||
bool observed_ {false};
|
||||
ThreatCategory threatCategory_ {ThreatCategory::Base};
|
||||
bool tornadoPossible_ {false};
|
||||
bool observed_ {false};
|
||||
ibw::ThreatCategory threatCategory_ {ibw::ThreatCategory::Base};
|
||||
bool tornadoPossible_ {false};
|
||||
|
||||
Segment() = default;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,8 +10,10 @@ namespace scwx
|
|||
{
|
||||
namespace awips
|
||||
{
|
||||
namespace ibw
|
||||
{
|
||||
|
||||
static const std::string logPrefix_ = "scwx::awips::impact_based_warnings";
|
||||
static const std::string logPrefix_ = "scwx::awips::ibw::impact_based_warnings";
|
||||
|
||||
static const boost::unordered_flat_map<Phenomenon, ImpactBasedWarningInfo>
|
||||
impactBasedWarningInfo_ {
|
||||
|
|
@ -62,5 +64,6 @@ const std::string& GetThreatCategoryName(ThreatCategory threatCategory)
|
|||
return threatCategoryName_.at(threatCategory);
|
||||
}
|
||||
|
||||
} // namespace ibw
|
||||
} // namespace awips
|
||||
} // namespace scwx
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ void ParseCodedInformation(std::shared_ptr<Segment> segment,
|
|||
segment->tornadoPossible_ = true;
|
||||
}
|
||||
|
||||
else if (segment->threatCategory_ == ThreatCategory::Base &&
|
||||
else if (segment->threatCategory_ == ibw::ThreatCategory::Base &&
|
||||
(threatTagIt = std::find_if(kThreatCategoryTags.cbegin(),
|
||||
kThreatCategoryTags.cend(),
|
||||
[&it](const std::string& tag) {
|
||||
|
|
@ -389,18 +389,19 @@ void ParseCodedInformation(std::shared_ptr<Segment> segment,
|
|||
const std::string threatCategoryName =
|
||||
it->substr(threatTagIt->length());
|
||||
|
||||
ThreatCategory threatCategory = GetThreatCategory(threatCategoryName);
|
||||
ibw::ThreatCategory threatCategory =
|
||||
ibw::GetThreatCategory(threatCategoryName);
|
||||
|
||||
switch (threatCategory)
|
||||
{
|
||||
case ThreatCategory::Significant:
|
||||
case ibw::ThreatCategory::Significant:
|
||||
// "Significant" is no longer an official tag, and has largely been
|
||||
// replaced with "Considerable".
|
||||
threatCategory = ThreatCategory::Considerable;
|
||||
threatCategory = ibw::ThreatCategory::Considerable;
|
||||
break;
|
||||
|
||||
case ThreatCategory::Unknown:
|
||||
threatCategory = ThreatCategory::Base;
|
||||
case ibw::ThreatCategory::Unknown:
|
||||
threatCategory = ibw::ThreatCategory::Base;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue