diff --git a/wxdata/include/scwx/wsr88d/message.hpp b/wxdata/include/scwx/awips/message.hpp similarity index 98% rename from wxdata/include/scwx/wsr88d/message.hpp rename to wxdata/include/scwx/awips/message.hpp index 89409bb3..049f2f7f 100644 --- a/wxdata/include/scwx/wsr88d/message.hpp +++ b/wxdata/include/scwx/awips/message.hpp @@ -14,7 +14,7 @@ namespace scwx { -namespace wsr88d +namespace awips { class MessageImpl; @@ -120,5 +120,5 @@ private: std::unique_ptr p; }; -} // namespace wsr88d +} // namespace awips } // namespace scwx diff --git a/wxdata/include/scwx/wsr88d/rpg/wmo_header.hpp b/wxdata/include/scwx/awips/wmo_header.hpp similarity index 94% rename from wxdata/include/scwx/wsr88d/rpg/wmo_header.hpp rename to wxdata/include/scwx/awips/wmo_header.hpp index 97691a79..e7094fc4 100644 --- a/wxdata/include/scwx/wsr88d/rpg/wmo_header.hpp +++ b/wxdata/include/scwx/awips/wmo_header.hpp @@ -5,9 +5,7 @@ namespace scwx { -namespace wsr88d -{ -namespace rpg +namespace awips { class WmoHeaderImpl; @@ -51,6 +49,5 @@ private: std::unique_ptr p; }; -} // namespace rpg -} // namespace wsr88d +} // namespace awips } // namespace scwx diff --git a/wxdata/include/scwx/wsr88d/rda/level2_message.hpp b/wxdata/include/scwx/wsr88d/rda/level2_message.hpp index 87a8de47..69ec42a1 100644 --- a/wxdata/include/scwx/wsr88d/rda/level2_message.hpp +++ b/wxdata/include/scwx/wsr88d/rda/level2_message.hpp @@ -1,7 +1,7 @@ #pragma once +#include #include -#include #ifdef WIN32 # include @@ -18,7 +18,7 @@ namespace rda class Level2MessageImpl; -class Level2Message : public Message +class Level2Message : public awips::Message { protected: explicit Level2Message(); diff --git a/wxdata/include/scwx/wsr88d/rpg/graphic_alphanumeric_block.hpp b/wxdata/include/scwx/wsr88d/rpg/graphic_alphanumeric_block.hpp index 0e67e38b..b81f5354 100644 --- a/wxdata/include/scwx/wsr88d/rpg/graphic_alphanumeric_block.hpp +++ b/wxdata/include/scwx/wsr88d/rpg/graphic_alphanumeric_block.hpp @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include @@ -14,7 +14,7 @@ namespace rpg class GraphicAlphanumericBlockImpl; -class GraphicAlphanumericBlock : public Message +class GraphicAlphanumericBlock : public awips::Message { public: explicit GraphicAlphanumericBlock(); diff --git a/wxdata/include/scwx/wsr88d/rpg/level3_message.hpp b/wxdata/include/scwx/wsr88d/rpg/level3_message.hpp index ffa157ce..ff1384da 100644 --- a/wxdata/include/scwx/wsr88d/rpg/level3_message.hpp +++ b/wxdata/include/scwx/wsr88d/rpg/level3_message.hpp @@ -1,7 +1,7 @@ #pragma once +#include #include -#include namespace scwx { @@ -12,7 +12,7 @@ namespace rpg class Level3MessageImpl; -class Level3Message : public Message +class Level3Message : public awips::Message { protected: explicit Level3Message(); diff --git a/wxdata/include/scwx/wsr88d/rpg/packet.hpp b/wxdata/include/scwx/wsr88d/rpg/packet.hpp index f12c5d1a..6243998b 100644 --- a/wxdata/include/scwx/wsr88d/rpg/packet.hpp +++ b/wxdata/include/scwx/wsr88d/rpg/packet.hpp @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include @@ -12,7 +12,7 @@ namespace wsr88d namespace rpg { -class Packet : public Message +class Packet : public awips::Message { protected: explicit Packet(); diff --git a/wxdata/include/scwx/wsr88d/rpg/product_description_block.hpp b/wxdata/include/scwx/wsr88d/rpg/product_description_block.hpp index 42fae57c..c7815a0d 100644 --- a/wxdata/include/scwx/wsr88d/rpg/product_description_block.hpp +++ b/wxdata/include/scwx/wsr88d/rpg/product_description_block.hpp @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include @@ -14,7 +14,7 @@ namespace rpg class ProductDescriptionBlockImpl; -class ProductDescriptionBlock : public Message +class ProductDescriptionBlock : public awips::Message { public: explicit ProductDescriptionBlock(); diff --git a/wxdata/include/scwx/wsr88d/rpg/product_symbology_block.hpp b/wxdata/include/scwx/wsr88d/rpg/product_symbology_block.hpp index 93aa3629..c55fd4ba 100644 --- a/wxdata/include/scwx/wsr88d/rpg/product_symbology_block.hpp +++ b/wxdata/include/scwx/wsr88d/rpg/product_symbology_block.hpp @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include @@ -15,7 +15,7 @@ namespace rpg class ProductSymbologyBlockImpl; -class ProductSymbologyBlock : public Message +class ProductSymbologyBlock : public awips::Message { public: explicit ProductSymbologyBlock(); diff --git a/wxdata/include/scwx/wsr88d/rpg/tabular_alphanumeric_block.hpp b/wxdata/include/scwx/wsr88d/rpg/tabular_alphanumeric_block.hpp index ee2cf369..e6ac58a8 100644 --- a/wxdata/include/scwx/wsr88d/rpg/tabular_alphanumeric_block.hpp +++ b/wxdata/include/scwx/wsr88d/rpg/tabular_alphanumeric_block.hpp @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include @@ -14,7 +14,7 @@ namespace rpg class TabularAlphanumericBlockImpl; -class TabularAlphanumericBlock : public Message +class TabularAlphanumericBlock : public awips::Message { public: explicit TabularAlphanumericBlock(); diff --git a/wxdata/source/scwx/wsr88d/message.cpp b/wxdata/source/scwx/awips/message.cpp similarity index 91% rename from wxdata/source/scwx/wsr88d/message.cpp rename to wxdata/source/scwx/awips/message.cpp index 9d26ed8a..23005396 100644 --- a/wxdata/source/scwx/wsr88d/message.cpp +++ b/wxdata/source/scwx/awips/message.cpp @@ -1,13 +1,13 @@ -#include +#include #include namespace scwx { -namespace wsr88d +namespace awips { -static const std::string logPrefix_ = "[scwx::wsr88d::message] "; +static const std::string logPrefix_ = "[scwx::awips::message] "; class MessageImpl { @@ -63,5 +63,5 @@ bool Message::ValidateMessage(std::istream& is, size_t bytesRead) const return messageValid; } -} // namespace wsr88d +} // namespace awips } // namespace scwx diff --git a/wxdata/source/scwx/wsr88d/rpg/wmo_header.cpp b/wxdata/source/scwx/awips/wmo_header.cpp similarity index 96% rename from wxdata/source/scwx/wsr88d/rpg/wmo_header.cpp rename to wxdata/source/scwx/awips/wmo_header.cpp index d71285ea..f2dc92b9 100644 --- a/wxdata/source/scwx/wsr88d/rpg/wmo_header.cpp +++ b/wxdata/source/scwx/awips/wmo_header.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -15,12 +15,10 @@ namespace scwx { -namespace wsr88d -{ -namespace rpg +namespace awips { -static const std::string logPrefix_ = "[scwx::wsr88d::rpg::wmo_header] "; +static const std::string logPrefix_ = "[scwx::awips::wmo_header] "; class WmoHeaderImpl { @@ -249,6 +247,5 @@ bool WmoHeader::Parse(std::istream& is) return headerValid; } -} // namespace rpg -} // namespace wsr88d +} // namespace awips } // namespace scwx diff --git a/wxdata/source/scwx/wsr88d/level3_file.cpp b/wxdata/source/scwx/wsr88d/level3_file.cpp index c77f253f..43b04751 100644 --- a/wxdata/source/scwx/wsr88d/level3_file.cpp +++ b/wxdata/source/scwx/wsr88d/level3_file.cpp @@ -1,7 +1,7 @@ #include +#include #include #include -#include #include @@ -27,9 +27,9 @@ public: bool DecompressFile(std::istream& is, std::stringstream& ss); bool LoadFileData(std::istream& is); - std::shared_ptr wmoHeader_; + std::shared_ptr wmoHeader_; std::shared_ptr ccbHeader_; - std::shared_ptr innerHeader_; + std::shared_ptr innerHeader_; std::shared_ptr message_; }; @@ -69,7 +69,7 @@ bool Level3File::LoadData(std::istream& is) { BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "Loading Data"; - p->wmoHeader_ = std::make_shared(); + p->wmoHeader_ = std::make_shared(); bool dataValid = p->wmoHeader_->Parse(is); @@ -161,7 +161,7 @@ bool Level3FileImpl::DecompressFile(std::istream& is, std::stringstream& ss) if (dataValid) { - innerHeader_ = std::make_shared(); + innerHeader_ = std::make_shared(); dataValid = innerHeader_->Parse(ss); } diff --git a/wxdata/source/scwx/wsr88d/rda/digital_radar_data.cpp b/wxdata/source/scwx/wsr88d/rda/digital_radar_data.cpp index 424b1641..21697c7d 100644 --- a/wxdata/source/scwx/wsr88d/rda/digital_radar_data.cpp +++ b/wxdata/source/scwx/wsr88d/rda/digital_radar_data.cpp @@ -190,8 +190,8 @@ bool MomentDataBlock::Parse(std::istream& is) p->dataMomentRangeSampleInterval_ = ntohs(p->dataMomentRangeSampleInterval_); p->tover_ = ntohs(p->tover_); p->snrThreshold_ = ntohs(p->snrThreshold_); - p->scale_ = Message::SwapFloat(p->scale_); - p->offset_ = Message::SwapFloat(p->offset_); + p->scale_ = awips::Message::SwapFloat(p->scale_); + p->offset_ = awips::Message::SwapFloat(p->offset_); if (p->numberOfDataMomentGates_ >= 0 && p->numberOfDataMomentGates_ <= 1840) { @@ -206,7 +206,7 @@ bool MomentDataBlock::Parse(std::istream& is) p->momentGates16_.resize(p->numberOfDataMomentGates_); is.read(reinterpret_cast(p->momentGates16_.data()), p->numberOfDataMomentGates_ * 2); - Message::SwapVector(p->momentGates16_); + awips::Message::SwapVector(p->momentGates16_); } else { @@ -329,17 +329,17 @@ bool VolumeDataBlock::Parse(std::istream& is) is.read(reinterpret_cast(&p->processingStatus_), 2); // 42-43 p->lrtup_ = ntohs(p->lrtup_); - p->latitude_ = Message::SwapFloat(p->latitude_); - p->longitude_ = Message::SwapFloat(p->longitude_); + p->latitude_ = awips::Message::SwapFloat(p->latitude_); + p->longitude_ = awips::Message::SwapFloat(p->longitude_); p->siteHeight_ = ntohs(p->siteHeight_); p->feedhornHeight_ = ntohs(p->feedhornHeight_); - p->calibrationConstant_ = Message::SwapFloat(p->calibrationConstant_); - p->horizontaShvTxPower_ = Message::SwapFloat(p->horizontaShvTxPower_); - p->verticalShvTxPower_ = Message::SwapFloat(p->verticalShvTxPower_); + p->calibrationConstant_ = awips::Message::SwapFloat(p->calibrationConstant_); + p->horizontaShvTxPower_ = awips::Message::SwapFloat(p->horizontaShvTxPower_); + p->verticalShvTxPower_ = awips::Message::SwapFloat(p->verticalShvTxPower_); p->systemDifferentialReflectivity_ = - Message::SwapFloat(p->systemDifferentialReflectivity_); + awips::Message::SwapFloat(p->systemDifferentialReflectivity_); p->initialSystemDifferentialPhase_ = - Message::SwapFloat(p->initialSystemDifferentialPhase_); + awips::Message::SwapFloat(p->initialSystemDifferentialPhase_); p->volumeCoveragePatternNumber_ = ntohs(p->volumeCoveragePatternNumber_); p->processingStatus_ = ntohs(p->processingStatus_); @@ -397,7 +397,7 @@ bool ElevationDataBlock::Parse(std::istream& is) p->lrtup_ = ntohs(p->lrtup_); p->atmos_ = ntohs(p->atmos_); - p->calibrationConstant_ = Message::SwapFloat(p->calibrationConstant_); + p->calibrationConstant_ = awips::Message::SwapFloat(p->calibrationConstant_); return dataBlockValid; } @@ -475,16 +475,17 @@ bool RadialDataBlock::Parse(std::istream& is) is.read(reinterpret_cast(&p->calibrationConstantVertical_), 4); // 24-27 - p->lrtup_ = ntohs(p->lrtup_); - p->unambigiousRange_ = ntohs(p->unambigiousRange_); - p->noiseLevelHorizontal_ = Message::SwapFloat(p->noiseLevelHorizontal_); - p->noiseLevelVertical_ = Message::SwapFloat(p->noiseLevelVertical_); - p->nyquistVelocity_ = ntohs(p->nyquistVelocity_); - p->radialFlags_ = ntohs(p->radialFlags_); + p->lrtup_ = ntohs(p->lrtup_); + p->unambigiousRange_ = ntohs(p->unambigiousRange_); + p->noiseLevelHorizontal_ = + awips::Message::SwapFloat(p->noiseLevelHorizontal_); + p->noiseLevelVertical_ = awips::Message::SwapFloat(p->noiseLevelVertical_); + p->nyquistVelocity_ = ntohs(p->nyquistVelocity_); + p->radialFlags_ = ntohs(p->radialFlags_); p->calibrationConstantHorizontal_ = - Message::SwapFloat(p->calibrationConstantHorizontal_); + awips::Message::SwapFloat(p->calibrationConstantHorizontal_); p->calibrationConstantVertical_ = - Message::SwapFloat(p->calibrationConstantVertical_); + awips::Message::SwapFloat(p->calibrationConstantVertical_); return dataBlockValid; } diff --git a/wxdata/wxdata.cmake b/wxdata/wxdata.cmake index a4cc8748..849a6a49 100644 --- a/wxdata/wxdata.cmake +++ b/wxdata/wxdata.cmake @@ -2,6 +2,10 @@ project(scwx-data) find_package(Boost) +set(HDR_AWIPS include/scwx/awips/message.hpp + include/scwx/awips/wmo_header.hpp) +set(SRC_AWIPS source/scwx/awips/message.cpp + source/scwx/awips/wmo_header.cpp) set(HDR_COMMON include/scwx/common/characters.hpp include/scwx/common/color_table.hpp include/scwx/common/constants.hpp @@ -22,11 +26,9 @@ set(SRC_UTIL source/scwx/util/rangebuf.cpp source/scwx/util/time.cpp source/scwx/util/vectorbuf.cpp) set(HDR_WSR88D include/scwx/wsr88d/ar2v_file.hpp - include/scwx/wsr88d/level3_file.hpp - include/scwx/wsr88d/message.hpp) + include/scwx/wsr88d/level3_file.hpp) set(SRC_WSR88D source/scwx/wsr88d/ar2v_file.cpp - source/scwx/wsr88d/level3_file.cpp - source/scwx/wsr88d/message.cpp) + source/scwx/wsr88d/level3_file.cpp) set(HDR_WSR88D_RDA include/scwx/wsr88d/rda/clutter_filter_map.hpp include/scwx/wsr88d/rda/digital_radar_data.hpp include/scwx/wsr88d/rda/level2_message.hpp @@ -83,8 +85,7 @@ set(HDR_WSR88D_RPG include/scwx/wsr88d/rpg/ccb_header.hpp include/scwx/wsr88d/rpg/unlinked_contour_vector_packet.hpp include/scwx/wsr88d/rpg/unlinked_vector_packet.hpp include/scwx/wsr88d/rpg/vector_arrow_data_packet.hpp - include/scwx/wsr88d/rpg/wind_barb_data_packet.hpp - include/scwx/wsr88d/rpg/wmo_header.hpp) + include/scwx/wsr88d/rpg/wind_barb_data_packet.hpp) set(SRC_WSR88D_RPG source/scwx/wsr88d/rpg/ccb_header.cpp source/scwx/wsr88d/rpg/cell_trend_data_packet.cpp source/scwx/wsr88d/rpg/cell_trend_volume_scan_times.cpp @@ -122,10 +123,11 @@ set(SRC_WSR88D_RPG source/scwx/wsr88d/rpg/ccb_header.cpp source/scwx/wsr88d/rpg/unlinked_contour_vector_packet.cpp source/scwx/wsr88d/rpg/unlinked_vector_packet.cpp source/scwx/wsr88d/rpg/vector_arrow_data_packet.cpp - source/scwx/wsr88d/rpg/wind_barb_data_packet.cpp - source/scwx/wsr88d/rpg/wmo_header.cpp) + source/scwx/wsr88d/rpg/wind_barb_data_packet.cpp) -add_library(wxdata OBJECT ${HDR_COMMON} +add_library(wxdata OBJECT ${HDR_AWIPS} + ${SRC_AWIPS} + ${HDR_COMMON} ${SRC_COMMON} ${HDR_UTIL} ${SRC_UTIL} @@ -136,6 +138,8 @@ add_library(wxdata OBJECT ${HDR_COMMON} ${HDR_WSR88D_RPG} ${SRC_WSR88D_RPG}) +source_group("Header Files\\awips" FILES ${HDR_AWIPS}) +source_group("Source Files\\awips" FILES ${SRC_AWIPS}) source_group("Header Files\\common" FILES ${HDR_COMMON}) source_group("Source Files\\common" FILES ${SRC_COMMON}) source_group("Header Files\\util" FILES ${HDR_UTIL})