diff --git a/scwx-qt/source/scwx/qt/model/alert_model.cpp b/scwx-qt/source/scwx/qt/model/alert_model.cpp index d4bb1111..fed7cc17 100644 --- a/scwx-qt/source/scwx/qt/model/alert_model.cpp +++ b/scwx-qt/source/scwx/qt/model/alert_model.cpp @@ -10,7 +10,6 @@ #include #include - #include #include @@ -37,9 +36,9 @@ public: explicit AlertModelImpl(); ~AlertModelImpl() = default; - bool GetObserved(const types::TextEventKey& key); - awips::ThreatCategory GetThreatCategory(const types::TextEventKey& key); - bool GetTornadoPossible(const types::TextEventKey& key); + bool GetObserved(const types::TextEventKey& key); + awips::ibw::ThreatCategory GetThreatCategory(const types::TextEventKey& key); + bool GetTornadoPossible(const types::TextEventKey& key); static std::string GetCounties(const types::TextEventKey& key); static std::string GetState(const types::TextEventKey& key); @@ -61,7 +60,7 @@ public: types::TextEventHash> observedMap_; std::unordered_map> threatCategoryMap_; std::unordered_map> - distanceMap_; - scwx::common::Coordinate previousPosition_; + distanceMap_; + scwx::common::Coordinate previousPosition_; }; AlertModel::AlertModel(QObject* parent) : @@ -158,7 +157,7 @@ QVariant AlertModel::data(const QModelIndex& index, int role) const case static_cast(Column::ThreatCategory): if (role == Qt::DisplayRole) { - return QString::fromStdString(awips::GetThreatCategoryName( + return QString::fromStdString(awips::ibw::GetThreatCategoryName( p->GetThreatCategory(textEventKey))); } else @@ -439,10 +438,10 @@ bool AlertModelImpl::GetObserved(const types::TextEventKey& key) return observed; } -awips::ThreatCategory +awips::ibw::ThreatCategory AlertModelImpl::GetThreatCategory(const types::TextEventKey& key) { - awips::ThreatCategory threatCategory = awips::ThreatCategory::Base; + awips::ibw::ThreatCategory threatCategory = awips::ibw::ThreatCategory::Base; auto it = threatCategoryMap_.find(key); if (it != threatCategoryMap_.cend()) diff --git a/scwx-qt/source/scwx/qt/ui/settings/alert_palette_settings_widget.cpp b/scwx-qt/source/scwx/qt/ui/settings/alert_palette_settings_widget.cpp index 2036769f..0eb49807 100644 --- a/scwx-qt/source/scwx/qt/ui/settings/alert_palette_settings_widget.cpp +++ b/scwx-qt/source/scwx/qt/ui/settings/alert_palette_settings_widget.cpp @@ -179,7 +179,7 @@ QWidget* AlertPaletteSettingsWidget::Impl::CreateStackedWidgetPage( page->setLayout(gridLayout); const auto& impactBasedWarningInfo = - awips::GetImpactBasedWarningInfo(phenomenon); + awips::ibw::GetImpactBasedWarningInfo(phenomenon); int row = 0; @@ -200,13 +200,13 @@ QWidget* AlertPaletteSettingsWidget::Impl::CreateStackedWidgetPage( for (auto& category : impactBasedWarningInfo.threatCategories_) { - if (category == awips::ThreatCategory::Base) + if (category == awips::ibw::ThreatCategory::Base) { continue; } AddPhenomenonLine( - awips::GetThreatCategoryName(category), gridLayout, row++); + awips::ibw::GetThreatCategoryName(category), gridLayout, row++); } AddPhenomenonLine("Inactive", gridLayout, row++); diff --git a/wxdata/include/scwx/awips/impact_based_warnings.hpp b/wxdata/include/scwx/awips/impact_based_warnings.hpp index d45ffb8f..3d956893 100644 --- a/wxdata/include/scwx/awips/impact_based_warnings.hpp +++ b/wxdata/include/scwx/awips/impact_based_warnings.hpp @@ -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 diff --git a/wxdata/include/scwx/awips/text_product_message.hpp b/wxdata/include/scwx/awips/text_product_message.hpp index dec4af09..b043494f 100644 --- a/wxdata/include/scwx/awips/text_product_message.hpp +++ b/wxdata/include/scwx/awips/text_product_message.hpp @@ -64,9 +64,9 @@ struct Segment std::optional codedLocation_ {}; std::optional 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; diff --git a/wxdata/source/scwx/awips/impact_based_warnings.cpp b/wxdata/source/scwx/awips/impact_based_warnings.cpp index ca26fa7b..a5e63a76 100644 --- a/wxdata/source/scwx/awips/impact_based_warnings.cpp +++ b/wxdata/source/scwx/awips/impact_based_warnings.cpp @@ -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 impactBasedWarningInfo_ { @@ -62,5 +64,6 @@ const std::string& GetThreatCategoryName(ThreatCategory threatCategory) return threatCategoryName_.at(threatCategory); } +} // namespace ibw } // namespace awips } // namespace scwx diff --git a/wxdata/source/scwx/awips/text_product_message.cpp b/wxdata/source/scwx/awips/text_product_message.cpp index 541a1a1a..54ce7e25 100644 --- a/wxdata/source/scwx/awips/text_product_message.cpp +++ b/wxdata/source/scwx/awips/text_product_message.cpp @@ -378,7 +378,7 @@ void ParseCodedInformation(std::shared_ptr 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, 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: