mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 04:20:05 +00:00 
			
		
		
		
	Refactoring generic message components to awips namespace
This commit is contained in:
		
							parent
							
								
									a76103650e
								
							
						
					
					
						commit
						7a9582a689
					
				
					 14 changed files with 64 additions and 65 deletions
				
			
		|  | @ -14,7 +14,7 @@ | |||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace wsr88d | ||||
| namespace awips | ||||
| { | ||||
| 
 | ||||
| class MessageImpl; | ||||
|  | @ -120,5 +120,5 @@ private: | |||
|    std::unique_ptr<MessageImpl> p; | ||||
| }; | ||||
| 
 | ||||
| } // namespace wsr88d
 | ||||
| } // namespace awips
 | ||||
| } // namespace scwx
 | ||||
|  | @ -5,9 +5,7 @@ | |||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace wsr88d | ||||
| { | ||||
| namespace rpg | ||||
| namespace awips | ||||
| { | ||||
| 
 | ||||
| class WmoHeaderImpl; | ||||
|  | @ -51,6 +49,5 @@ private: | |||
|    std::unique_ptr<WmoHeaderImpl> p; | ||||
| }; | ||||
| 
 | ||||
| } // namespace rpg
 | ||||
| } // namespace wsr88d
 | ||||
| } // namespace awips
 | ||||
| } // namespace scwx
 | ||||
|  | @ -1,7 +1,7 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <scwx/awips/message.hpp> | ||||
| #include <scwx/wsr88d/rda/level2_message_header.hpp> | ||||
| #include <scwx/wsr88d/message.hpp> | ||||
| 
 | ||||
| #ifdef WIN32 | ||||
| #   include <WinSock2.h> | ||||
|  | @ -18,7 +18,7 @@ namespace rda | |||
| 
 | ||||
| class Level2MessageImpl; | ||||
| 
 | ||||
| class Level2Message : public Message | ||||
| class Level2Message : public awips::Message | ||||
| { | ||||
| protected: | ||||
|    explicit Level2Message(); | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <scwx/wsr88d/message.hpp> | ||||
| #include <scwx/awips/message.hpp> | ||||
| 
 | ||||
| #include <cstdint> | ||||
| #include <memory> | ||||
|  | @ -14,7 +14,7 @@ namespace rpg | |||
| 
 | ||||
| class GraphicAlphanumericBlockImpl; | ||||
| 
 | ||||
| class GraphicAlphanumericBlock : public Message | ||||
| class GraphicAlphanumericBlock : public awips::Message | ||||
| { | ||||
| public: | ||||
|    explicit GraphicAlphanumericBlock(); | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <scwx/awips/message.hpp> | ||||
| #include <scwx/wsr88d/rpg/level3_message_header.hpp> | ||||
| #include <scwx/wsr88d/message.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
|  | @ -12,7 +12,7 @@ namespace rpg | |||
| 
 | ||||
| class Level3MessageImpl; | ||||
| 
 | ||||
| class Level3Message : public Message | ||||
| class Level3Message : public awips::Message | ||||
| { | ||||
| protected: | ||||
|    explicit Level3Message(); | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <scwx/wsr88d/message.hpp> | ||||
| #include <scwx/awips/message.hpp> | ||||
| 
 | ||||
| #include <cstdint> | ||||
| #include <memory> | ||||
|  | @ -12,7 +12,7 @@ namespace wsr88d | |||
| namespace rpg | ||||
| { | ||||
| 
 | ||||
| class Packet : public Message | ||||
| class Packet : public awips::Message | ||||
| { | ||||
| protected: | ||||
|    explicit Packet(); | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <scwx/wsr88d/message.hpp> | ||||
| #include <scwx/awips/message.hpp> | ||||
| 
 | ||||
| #include <cstdint> | ||||
| #include <memory> | ||||
|  | @ -14,7 +14,7 @@ namespace rpg | |||
| 
 | ||||
| class ProductDescriptionBlockImpl; | ||||
| 
 | ||||
| class ProductDescriptionBlock : public Message | ||||
| class ProductDescriptionBlock : public awips::Message | ||||
| { | ||||
| public: | ||||
|    explicit ProductDescriptionBlock(); | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <scwx/wsr88d/message.hpp> | ||||
| #include <scwx/awips/message.hpp> | ||||
| #include <scwx/wsr88d/rpg/packet.hpp> | ||||
| 
 | ||||
| #include <cstdint> | ||||
|  | @ -15,7 +15,7 @@ namespace rpg | |||
| 
 | ||||
| class ProductSymbologyBlockImpl; | ||||
| 
 | ||||
| class ProductSymbologyBlock : public Message | ||||
| class ProductSymbologyBlock : public awips::Message | ||||
| { | ||||
| public: | ||||
|    explicit ProductSymbologyBlock(); | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <scwx/wsr88d/message.hpp> | ||||
| #include <scwx/awips/message.hpp> | ||||
| 
 | ||||
| #include <cstdint> | ||||
| #include <memory> | ||||
|  | @ -14,7 +14,7 @@ namespace rpg | |||
| 
 | ||||
| class TabularAlphanumericBlockImpl; | ||||
| 
 | ||||
| class TabularAlphanumericBlock : public Message | ||||
| class TabularAlphanumericBlock : public awips::Message | ||||
| { | ||||
| public: | ||||
|    explicit TabularAlphanumericBlock(); | ||||
|  |  | |||
|  | @ -1,13 +1,13 @@ | |||
| #include <scwx/wsr88d/message.hpp> | ||||
| #include <scwx/awips/message.hpp> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| 
 | ||||
| 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
 | ||||
|  | @ -1,4 +1,4 @@ | |||
| #include <scwx/wsr88d/rpg/wmo_header.hpp> | ||||
| #include <scwx/awips/wmo_header.hpp> | ||||
| #include <scwx/util/streams.hpp> | ||||
| 
 | ||||
| #include <istream> | ||||
|  | @ -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
 | ||||
|  | @ -1,7 +1,7 @@ | |||
| #include <scwx/wsr88d/level3_file.hpp> | ||||
| #include <scwx/awips/wmo_header.hpp> | ||||
| #include <scwx/wsr88d/rpg/ccb_header.hpp> | ||||
| #include <scwx/wsr88d/rpg/level3_message_factory.hpp> | ||||
| #include <scwx/wsr88d/rpg/wmo_header.hpp> | ||||
| 
 | ||||
| #include <fstream> | ||||
| 
 | ||||
|  | @ -27,9 +27,9 @@ public: | |||
|    bool DecompressFile(std::istream& is, std::stringstream& ss); | ||||
|    bool LoadFileData(std::istream& is); | ||||
| 
 | ||||
|    std::shared_ptr<rpg::WmoHeader>     wmoHeader_; | ||||
|    std::shared_ptr<awips::WmoHeader>   wmoHeader_; | ||||
|    std::shared_ptr<rpg::CcbHeader>     ccbHeader_; | ||||
|    std::shared_ptr<rpg::WmoHeader>     innerHeader_; | ||||
|    std::shared_ptr<awips::WmoHeader>   innerHeader_; | ||||
|    std::shared_ptr<rpg::Level3Message> message_; | ||||
| }; | ||||
| 
 | ||||
|  | @ -69,7 +69,7 @@ bool Level3File::LoadData(std::istream& is) | |||
| { | ||||
|    BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "Loading Data"; | ||||
| 
 | ||||
|    p->wmoHeader_ = std::make_shared<rpg::WmoHeader>(); | ||||
|    p->wmoHeader_ = std::make_shared<awips::WmoHeader>(); | ||||
| 
 | ||||
|    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<rpg::WmoHeader>(); | ||||
|       innerHeader_ = std::make_shared<awips::WmoHeader>(); | ||||
|       dataValid    = innerHeader_->Parse(ss); | ||||
|    } | ||||
| 
 | ||||
|  |  | |||
|  | @ -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<char*>(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<char*>(&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; | ||||
| } | ||||
|  | @ -477,14 +477,15 @@ bool RadialDataBlock::Parse(std::istream& is) | |||
| 
 | ||||
|    p->lrtup_            = ntohs(p->lrtup_); | ||||
|    p->unambigiousRange_ = ntohs(p->unambigiousRange_); | ||||
|    p->noiseLevelHorizontal_ = Message::SwapFloat(p->noiseLevelHorizontal_); | ||||
|    p->noiseLevelVertical_   = Message::SwapFloat(p->noiseLevelVertical_); | ||||
|    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; | ||||
| } | ||||
|  |  | |||
|  | @ -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}) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat