mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 04:00:04 +00:00 
			
		
		
		
	Boost.Log -> spdlog - wsr88d/rda
This commit is contained in:
		
							parent
							
								
									44bcc7dd4c
								
							
						
					
					
						commit
						dda71133e0
					
				
					 10 changed files with 105 additions and 128 deletions
				
			
		|  | @ -1,9 +1,8 @@ | |||
| #include <scwx/wsr88d/rda/clutter_filter_bypass_map.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
| #include <vector> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace wsr88d | ||||
|  | @ -12,7 +11,8 @@ namespace rda | |||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = | ||||
|    "[scwx::wsr88d::rda::clutter_filter_bypass_map] "; | ||||
|    "scwx::wsr88d::rda::clutter_filter_bypass_map"; | ||||
| static const auto logger_ = util::Logger::Create(logPrefix_); | ||||
| 
 | ||||
| class ClutterFilterBypassMapImpl | ||||
| { | ||||
|  | @ -61,8 +61,7 @@ ClutterFilterBypassMap::range_bin(uint16_t e, uint16_t r, uint16_t b) const | |||
| 
 | ||||
| bool ClutterFilterBypassMap::Parse(std::istream& is) | ||||
| { | ||||
|    BOOST_LOG_TRIVIAL(trace) | ||||
|       << logPrefix_ << "Parsing Clutter Filter Bypass Map (Message Type 13)"; | ||||
|    logger_->trace("Parsing Clutter Filter Bypass Map (Message Type 13)"); | ||||
| 
 | ||||
|    bool     messageValid         = true; | ||||
|    size_t   bytesRead            = 0; | ||||
|  | @ -79,21 +78,18 @@ bool ClutterFilterBypassMap::Parse(std::istream& is) | |||
| 
 | ||||
|    if (p->mapGenerationDate_ < 1) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ << "Invalid date: " << p->mapGenerationDate_; | ||||
|       logger_->warn("Invalid date: {}", p->mapGenerationDate_); | ||||
|       messageValid = false; | ||||
|    } | ||||
|    if (p->mapGenerationTime_ > 1440) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ << "Invalid time: " << p->mapGenerationTime_; | ||||
|       logger_->warn("Invalid time: {}", p->mapGenerationTime_); | ||||
|       messageValid = false; | ||||
|    } | ||||
|    if (numElevationSegments < 1 || numElevationSegments > 5) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ | ||||
|          << "Invalid number of elevation segments: " << numElevationSegments; | ||||
|       logger_->warn("Invalid number of elevation segments: {}", | ||||
|                     numElevationSegments); | ||||
|       messageValid = false; | ||||
|    } | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,9 +1,8 @@ | |||
| #include <scwx/wsr88d/rda/clutter_filter_map.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
| #include <vector> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace wsr88d | ||||
|  | @ -11,8 +10,8 @@ namespace wsr88d | |||
| namespace rda | ||||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = | ||||
|    "[scwx::wsr88d::rda::clutter_filter_map] "; | ||||
| static const std::string logPrefix_ = "scwx::wsr88d::rda::clutter_filter_map"; | ||||
| static const auto        logger_    = util::Logger::Create(logPrefix_); | ||||
| 
 | ||||
| struct RangeZone | ||||
| { | ||||
|  | @ -75,8 +74,7 @@ uint16_t ClutterFilterMap::end_range(uint16_t e, uint16_t a, uint16_t z) const | |||
| 
 | ||||
| bool ClutterFilterMap::Parse(std::istream& is) | ||||
| { | ||||
|    BOOST_LOG_TRIVIAL(trace) | ||||
|       << logPrefix_ << "Parsing Clutter Filter Map (Message Type 15)"; | ||||
|    logger_->trace("Parsing Clutter Filter Map (Message Type 15)"); | ||||
| 
 | ||||
|    bool     messageValid         = true; | ||||
|    size_t   bytesRead            = 0; | ||||
|  | @ -93,21 +91,18 @@ bool ClutterFilterMap::Parse(std::istream& is) | |||
| 
 | ||||
|    if (p->mapGenerationDate_ < 1) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ << "Invalid date: " << p->mapGenerationDate_; | ||||
|       logger_->warn("Invalid date: {}", p->mapGenerationDate_); | ||||
|       messageValid = false; | ||||
|    } | ||||
|    if (p->mapGenerationTime_ > 1440) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ << "Invalid time: " << p->mapGenerationTime_; | ||||
|       logger_->warn("Invalid time: {}", p->mapGenerationTime_); | ||||
|       messageValid = false; | ||||
|    } | ||||
|    if (numElevationSegments < 1 || numElevationSegments > 5) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ | ||||
|          << "Invalid number of elevation segments: " << numElevationSegments; | ||||
|       logger_->warn("Invalid number of elevation segments: {}", | ||||
|                     numElevationSegments); | ||||
|       messageValid = false; | ||||
|    } | ||||
| 
 | ||||
|  | @ -132,9 +127,7 @@ bool ClutterFilterMap::Parse(std::istream& is) | |||
| 
 | ||||
|          if (numRangeZones < 1 || numRangeZones > 20) | ||||
|          { | ||||
|             BOOST_LOG_TRIVIAL(warning) | ||||
|                << logPrefix_ | ||||
|                << "Invalid number of range zones: " << numRangeZones; | ||||
|             logger_->warn("Invalid number of range zones: {}", numRangeZones); | ||||
|             messageValid = false; | ||||
|          } | ||||
| 
 | ||||
|  | @ -158,14 +151,12 @@ bool ClutterFilterMap::Parse(std::istream& is) | |||
| 
 | ||||
|             if (zone.opCode > 2) | ||||
|             { | ||||
|                BOOST_LOG_TRIVIAL(warning) | ||||
|                   << logPrefix_ << "Invalid op code: " << zone.opCode; | ||||
|                logger_->warn("Invalid op code: {}", zone.opCode); | ||||
|                messageValid = false; | ||||
|             } | ||||
|             if (zone.endRange > 511) | ||||
|             { | ||||
|                BOOST_LOG_TRIVIAL(warning) | ||||
|                   << logPrefix_ << "Invalid end range: " << zone.endRange; | ||||
|                logger_->warn("Invalid end range: {}", zone.endRange); | ||||
|                messageValid = false; | ||||
|             } | ||||
|          } | ||||
|  |  | |||
|  | @ -1,6 +1,5 @@ | |||
| #include <scwx/wsr88d/rda/digital_radar_data.hpp> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
|  | @ -9,8 +8,8 @@ namespace wsr88d | |||
| namespace rda | ||||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = | ||||
|    "[scwx::wsr88d::rda::digital_radar_data] "; | ||||
| static const std::string logPrefix_ = "scwx::wsr88d::rda::digital_radar_data"; | ||||
| static const auto        logger_    = util::Logger::Create(logPrefix_); | ||||
| 
 | ||||
| static const std::unordered_map<std::string, DataBlockType> strToDataBlock_ { | ||||
|    {"VOL", DataBlockType::Volume}, | ||||
|  | @ -145,9 +144,15 @@ const void* MomentDataBlock::data_moments() const | |||
| 
 | ||||
|    switch (p->dataWordSize_) | ||||
|    { | ||||
|    case 8: dataMoments = p->momentGates8_.data(); break; | ||||
|    case 16: dataMoments = p->momentGates16_.data(); break; | ||||
|    default: dataMoments = nullptr; break; | ||||
|    case 8: | ||||
|       dataMoments = p->momentGates8_.data(); | ||||
|       break; | ||||
|    case 16: | ||||
|       dataMoments = p->momentGates16_.data(); | ||||
|       break; | ||||
|    default: | ||||
|       dataMoments = nullptr; | ||||
|       break; | ||||
|    } | ||||
| 
 | ||||
|    return dataMoments; | ||||
|  | @ -210,16 +215,14 @@ bool MomentDataBlock::Parse(std::istream& is) | |||
|       } | ||||
|       else | ||||
|       { | ||||
|          BOOST_LOG_TRIVIAL(warning) | ||||
|             << logPrefix_ << "Invalid data word size: " << p->dataWordSize_; | ||||
|          logger_->warn("Invalid data word size: {}", p->dataWordSize_); | ||||
|          dataBlockValid = false; | ||||
|       } | ||||
|    } | ||||
|    else | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ << "Invalid number of data moment gates: " | ||||
|          << p->numberOfDataMomentGates_; | ||||
|       logger_->warn("Invalid number of data moment gates: {}", | ||||
|                     p->numberOfDataMomentGates_); | ||||
|       dataBlockValid = false; | ||||
|    } | ||||
| 
 | ||||
|  | @ -657,8 +660,7 @@ DigitalRadarData::moment_data_block(DataBlockType type) const | |||
| 
 | ||||
| bool DigitalRadarData::Parse(std::istream& is) | ||||
| { | ||||
|    BOOST_LOG_TRIVIAL(trace) | ||||
|       << logPrefix_ << "Parsing Digital Radar Data (Message Type 31)"; | ||||
|    logger_->trace("Parsing Digital Radar Data (Message Type 31)"); | ||||
| 
 | ||||
|    bool   messageValid = true; | ||||
|    size_t bytesRead    = 0; | ||||
|  | @ -694,26 +696,22 @@ bool DigitalRadarData::Parse(std::istream& is) | |||
| 
 | ||||
|    if (p->azimuthNumber_ < 1 || p->azimuthNumber_ > 720) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ << "Invalid azimuth number: " << p->azimuthNumber_; | ||||
|       logger_->warn("Invalid azimuth number: {}", p->azimuthNumber_); | ||||
|       messageValid = false; | ||||
|    } | ||||
|    if (p->elevationNumber_ < 1 || p->elevationNumber_ > 32) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ << "Invalid elevation number: " << p->elevationNumber_; | ||||
|       logger_->warn("Invalid elevation number: ", p->elevationNumber_); | ||||
|       messageValid = false; | ||||
|    } | ||||
|    if (p->dataBlockCount_ < 4 || p->dataBlockCount_ > 10) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ | ||||
|          << "Invalid number of data blocks: " << p->dataBlockCount_; | ||||
|       logger_->warn("Invalid number of data blocks: {}", p->dataBlockCount_); | ||||
|       messageValid = false; | ||||
|    } | ||||
|    if (p->compressionIndicator_ != 0) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) << logPrefix_ << "Compression not supported"; | ||||
|       logger_->warn("Compression not supported"); | ||||
|       messageValid = false; | ||||
|    } | ||||
| 
 | ||||
|  | @ -772,8 +770,7 @@ bool DigitalRadarData::Parse(std::istream& is) | |||
|             std::move(MomentDataBlock::Create(dataBlockType, dataName, is)); | ||||
|          break; | ||||
|       default: | ||||
|          BOOST_LOG_TRIVIAL(warning) | ||||
|             << logPrefix_ << "Unknown data name: " << dataName; | ||||
|          logger_->warn("Unknown data name: {}", dataName); | ||||
|          break; | ||||
|       } | ||||
|    } | ||||
|  |  | |||
|  | @ -1,7 +1,5 @@ | |||
| #include <scwx/wsr88d/rda/level2_message.hpp> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace wsr88d | ||||
|  | @ -9,7 +7,7 @@ namespace wsr88d | |||
| namespace rda | ||||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = "[scwx::wsr88d::rda::level2_message] "; | ||||
| static const std::string logPrefix_ = "scwx::wsr88d::rda::level2_message"; | ||||
| 
 | ||||
| class Level2MessageImpl | ||||
| { | ||||
|  |  | |||
|  | @ -1,5 +1,6 @@ | |||
| #include <scwx/wsr88d/rda/level2_message_factory.hpp> | ||||
| 
 | ||||
| #include <scwx/util/logger.hpp> | ||||
| #include <scwx/util/vectorbuf.hpp> | ||||
| #include <scwx/wsr88d/rda/clutter_filter_bypass_map.hpp> | ||||
| #include <scwx/wsr88d/rda/clutter_filter_map.hpp> | ||||
|  | @ -12,8 +13,6 @@ | |||
| #include <unordered_map> | ||||
| #include <vector> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace wsr88d | ||||
|  | @ -22,7 +21,8 @@ namespace rda | |||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = | ||||
|    "[scwx::wsr88d::rda::level2_message_factory] "; | ||||
|    "scwx::wsr88d::rda::level2_message_factory"; | ||||
| static const auto logger_ = util::Logger::Create(logPrefix_); | ||||
| 
 | ||||
| typedef std::function<std::shared_ptr<Level2Message>(Level2MessageHeader&&, | ||||
|                                                      std::istream&)> | ||||
|  | @ -51,9 +51,8 @@ Level2MessageInfo Level2MessageFactory::Create(std::istream& is) | |||
| 
 | ||||
|    if (info.headerValid && create_.find(header.message_type()) == create_.end()) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ << "Unknown message type: " | ||||
|          << static_cast<unsigned>(header.message_type()); | ||||
|       logger_->warn("Unknown message type: {}", | ||||
|                     static_cast<unsigned>(header.message_type())); | ||||
|       info.messageValid = false; | ||||
|    } | ||||
| 
 | ||||
|  | @ -68,16 +67,15 @@ Level2MessageInfo Level2MessageFactory::Create(std::istream& is) | |||
| 
 | ||||
|       if (totalSegments == 1) | ||||
|       { | ||||
|          BOOST_LOG_TRIVIAL(trace) << logPrefix_ << "Found Message " | ||||
|                                   << static_cast<unsigned>(messageType); | ||||
|          logger_->trace("Found Message {}", static_cast<unsigned>(messageType)); | ||||
|          messageStream = &is; | ||||
|       } | ||||
|       else | ||||
|       { | ||||
|          BOOST_LOG_TRIVIAL(trace) | ||||
|             << logPrefix_ << "Found Message " | ||||
|             << static_cast<unsigned>(messageType) << " Segment " << segment | ||||
|             << "/" << totalSegments; | ||||
|          logger_->trace("Found Message {} Segment {}/{}", | ||||
|                         static_cast<unsigned>(messageType), | ||||
|                         segment, | ||||
|                         totalSegments); | ||||
| 
 | ||||
|          if (segment == 1) | ||||
|          { | ||||
|  | @ -89,8 +87,7 @@ Level2MessageInfo Level2MessageFactory::Create(std::istream& is) | |||
| 
 | ||||
|          if (messageData_.capacity() < bufferedSize_ + dataSize) | ||||
|          { | ||||
|             BOOST_LOG_TRIVIAL(debug) | ||||
|                << logPrefix_ << "Bad size estimate, increasing size"; | ||||
|             logger_->debug("Bad size estimate, increasing size"); | ||||
| 
 | ||||
|             // Estimate remaining size
 | ||||
|             uint16_t remainingSegments = | ||||
|  | @ -105,8 +102,7 @@ Level2MessageInfo Level2MessageFactory::Create(std::istream& is) | |||
| 
 | ||||
|          if (is.eof()) | ||||
|          { | ||||
|             BOOST_LOG_TRIVIAL(warning) | ||||
|                << logPrefix_ << "End of file reached trying to buffer message"; | ||||
|             logger_->warn("End of file reached trying to buffer message"); | ||||
|             info.messageValid = false; | ||||
|             messageData_.shrink_to_fit(); | ||||
|             bufferedSize_ = 0; | ||||
|  |  | |||
|  | @ -1,10 +1,9 @@ | |||
| #include <scwx/wsr88d/rda/level2_message_header.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
| #include <istream> | ||||
| #include <string> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| 
 | ||||
| #ifdef WIN32 | ||||
| #   include <WinSock2.h> | ||||
| #else | ||||
|  | @ -19,7 +18,8 @@ namespace rda | |||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = | ||||
|    "[scwx::wsr88d::rda::level2_message_header] "; | ||||
|    "scwx::wsr88d::rda::level2_message_header"; | ||||
| static const auto logger_ = util::Logger::Create(logPrefix_); | ||||
| 
 | ||||
| class Level2MessageHeaderImpl | ||||
| { | ||||
|  | @ -123,44 +123,40 @@ bool Level2MessageHeader::Parse(std::istream& is) | |||
| 
 | ||||
|    if (is.eof()) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "Reached end of file"; | ||||
|       logger_->debug("Reached end of file"); | ||||
|       headerValid = false; | ||||
|    } | ||||
|    else | ||||
|    { | ||||
|       if (p->messageSize_ < 9) | ||||
|       { | ||||
|          BOOST_LOG_TRIVIAL(warning) | ||||
|             << logPrefix_ << "Invalid message size: " << p->messageSize_; | ||||
|          logger_->warn("Invalid message size: {}", p->messageSize_); | ||||
|          headerValid = false; | ||||
|       } | ||||
|       if (p->julianDate_ < 1) | ||||
|       { | ||||
|          BOOST_LOG_TRIVIAL(warning) | ||||
|             << logPrefix_ << "Invalid date: " << p->julianDate_; | ||||
|          logger_->warn("Invalid date: {}", p->julianDate_); | ||||
|          headerValid = false; | ||||
|       } | ||||
|       if (p->millisecondsOfDay_ > 86'399'999u) | ||||
|       { | ||||
|          BOOST_LOG_TRIVIAL(warning) | ||||
|             << logPrefix_ << "Invalid milliseconds: " << p->millisecondsOfDay_; | ||||
|          logger_->warn("Invalid milliseconds: {}", p->millisecondsOfDay_); | ||||
|          headerValid = false; | ||||
|       } | ||||
|       if (p->messageSize_ < 65534 && | ||||
|           p->messageSegmentNumber_ > p->numberOfMessageSegments_) | ||||
|       { | ||||
|          BOOST_LOG_TRIVIAL(warning) | ||||
|             << logPrefix_ << "Invalid segment = " << p->messageSegmentNumber_ | ||||
|             << "/" << p->numberOfMessageSegments_; | ||||
|          logger_->warn("Invalid segment = {}/{}", | ||||
|                        p->messageSegmentNumber_, | ||||
|                        p->numberOfMessageSegments_); | ||||
|          headerValid = false; | ||||
|       } | ||||
|    } | ||||
| 
 | ||||
|    if (headerValid) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(trace) | ||||
|          << logPrefix_ | ||||
|          << "Message type: " << static_cast<unsigned>(p->messageType_); | ||||
|       logger_->trace("Message type: {}", | ||||
|                      static_cast<unsigned>(p->messageType_)); | ||||
|    } | ||||
| 
 | ||||
|    return headerValid; | ||||
|  |  | |||
|  | @ -1,9 +1,8 @@ | |||
| #include <scwx/wsr88d/rda/performance_maintenance_data.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
| #include <array> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace wsr88d | ||||
|  | @ -12,7 +11,8 @@ namespace rda | |||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = | ||||
|    "[scwx::wsr88d::rda::performance_maintenance_data] "; | ||||
|    "scwx::wsr88d::rda::performance_maintenance_data"; | ||||
| static const auto logger_ = util::Logger::Create(logPrefix_); | ||||
| 
 | ||||
| class PerformanceMaintenanceDataImpl | ||||
| { | ||||
|  | @ -1823,8 +1823,7 @@ uint16_t PerformanceMaintenanceData::version() const | |||
| 
 | ||||
| bool PerformanceMaintenanceData::Parse(std::istream& is) | ||||
| { | ||||
|    BOOST_LOG_TRIVIAL(trace) | ||||
|       << logPrefix_ << "Parsing Performance/Maintenance Data (Message Type 3)"; | ||||
|    logger_->trace("Parsing Performance/Maintenance Data (Message Type 3)"); | ||||
| 
 | ||||
|    bool   messageValid = true; | ||||
|    size_t bytesRead    = 0; | ||||
|  |  | |||
|  | @ -1,6 +1,5 @@ | |||
| #include <scwx/wsr88d/rda/rda_adaptation_data.hpp> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
|  | @ -9,8 +8,8 @@ namespace wsr88d | |||
| namespace rda | ||||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = | ||||
|    "[scwx::wsr88d::rda::rda_adaptation_data] "; | ||||
| static const std::string logPrefix_ = "scwx::wsr88d::rda::rda_adaptation_data"; | ||||
| static const auto        logger_    = util::Logger::Create(logPrefix_); | ||||
| 
 | ||||
| struct AntManualSetup | ||||
| { | ||||
|  | @ -1267,8 +1266,7 @@ float RdaAdaptationData::txb_alarm_thresh() const | |||
| 
 | ||||
| bool RdaAdaptationData::Parse(std::istream& is) | ||||
| { | ||||
|    BOOST_LOG_TRIVIAL(trace) | ||||
|       << logPrefix_ << "Parsing RDA Adaptation Data (Message Type 18)"; | ||||
|    logger_->trace("Parsing RDA Adaptation Data (Message Type 18)"); | ||||
| 
 | ||||
|    bool   messageValid = true; | ||||
|    size_t bytesRead    = 0; | ||||
|  |  | |||
|  | @ -1,6 +1,5 @@ | |||
| #include <scwx/wsr88d/rda/rda_status_data.hpp> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
|  | @ -9,7 +8,8 @@ namespace wsr88d | |||
| namespace rda | ||||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = "[scwx::wsr88d::rda::rda_status_data] "; | ||||
| static const std::string logPrefix_ = "scwx::wsr88d::rda::rda_status_data"; | ||||
| static const auto        logger_    = util::Logger::Create(logPrefix_); | ||||
| 
 | ||||
| class RdaStatusDataImpl | ||||
| { | ||||
|  | @ -233,8 +233,7 @@ uint16_t RdaStatusData::status_version() const | |||
| 
 | ||||
| bool RdaStatusData::Parse(std::istream& is) | ||||
| { | ||||
|    BOOST_LOG_TRIVIAL(trace) | ||||
|       << logPrefix_ << "Parsing RDA Status Data (Message Type 2)"; | ||||
|    logger_->trace("Parsing RDA Status Data (Message Type 2)"); | ||||
| 
 | ||||
|    bool   messageValid = true; | ||||
|    size_t bytesRead    = 0; | ||||
|  |  | |||
|  | @ -1,6 +1,5 @@ | |||
| #include <scwx/wsr88d/rda/volume_coverage_pattern_data.hpp> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
|  | @ -10,7 +9,8 @@ namespace rda | |||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = | ||||
|    "[scwx::wsr88d::rda::volume_coverage_pattern_data] "; | ||||
|    "scwx::wsr88d::rda::volume_coverage_pattern_data"; | ||||
| static const auto logger_ = util::Logger::Create(logPrefix_); | ||||
| 
 | ||||
| struct Sector; | ||||
| 
 | ||||
|  | @ -137,8 +137,12 @@ float VolumeCoveragePatternData::doppler_velocity_resolution() const | |||
| 
 | ||||
|    switch (p->dopplerVelocityResolution_) | ||||
|    { | ||||
|    case 2: resolution = 0.5f; break; | ||||
|    case 4: resolution = 1.0f; break; | ||||
|    case 2: | ||||
|       resolution = 0.5f; | ||||
|       break; | ||||
|    case 4: | ||||
|       resolution = 1.0f; | ||||
|       break; | ||||
|    } | ||||
| 
 | ||||
|    return resolution; | ||||
|  | @ -233,12 +237,18 @@ WaveformType VolumeCoveragePatternData::waveform_type(uint16_t e) const | |||
| { | ||||
|    switch (p->elevationCuts_[e].waveformType_) | ||||
|    { | ||||
|    case 1: return WaveformType::ContiguousSurveillance; | ||||
|    case 2: return WaveformType::ContiguousDopplerWithAmbiguityResolution; | ||||
|    case 3: return WaveformType::ContiguousDopplerWithoutAmbiguityResolution; | ||||
|    case 4: return WaveformType::Batch; | ||||
|    case 5: return WaveformType::StaggeredPulsePair; | ||||
|    default: return WaveformType::Unknown; | ||||
|    case 1: | ||||
|       return WaveformType::ContiguousSurveillance; | ||||
|    case 2: | ||||
|       return WaveformType::ContiguousDopplerWithAmbiguityResolution; | ||||
|    case 3: | ||||
|       return WaveformType::ContiguousDopplerWithoutAmbiguityResolution; | ||||
|    case 4: | ||||
|       return WaveformType::Batch; | ||||
|    case 5: | ||||
|       return WaveformType::StaggeredPulsePair; | ||||
|    default: | ||||
|       return WaveformType::Unknown; | ||||
|    } | ||||
| } | ||||
| 
 | ||||
|  | @ -380,8 +390,7 @@ VolumeCoveragePatternData::doppler_prf_pulse_count_radial(uint16_t e, | |||
| 
 | ||||
| bool VolumeCoveragePatternData::Parse(std::istream& is) | ||||
| { | ||||
|    BOOST_LOG_TRIVIAL(trace) | ||||
|       << logPrefix_ << "Parsing Volume Coverage Pattern Data (Message Type 5)"; | ||||
|    logger_->trace("Parsing Volume Coverage Pattern Data (Message Type 5)"); | ||||
| 
 | ||||
|    bool   messageValid = true; | ||||
|    size_t bytesRead    = 0; | ||||
|  | @ -412,15 +421,13 @@ bool VolumeCoveragePatternData::Parse(std::istream& is) | |||
| 
 | ||||
|    if (messageSize < 34 || messageSize > 747) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ << "Invalid message size: " << messageSize; | ||||
|       logger_->warn("Invalid message size: {}", messageSize); | ||||
|       messageValid = false; | ||||
|    } | ||||
|    if (numberOfElevationCuts < 1 || numberOfElevationCuts > 32) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ | ||||
|          << "Invalid number of elevation cuts: " << numberOfElevationCuts; | ||||
|       logger_->warn("Invalid number of elevation cuts: {}", | ||||
|                     numberOfElevationCuts); | ||||
|       messageValid = false; | ||||
|    } | ||||
| 
 | ||||
|  | @ -483,9 +490,9 @@ bool VolumeCoveragePatternData::Parse(std::istream& is) | |||
| 
 | ||||
|    if (messageValid && bytesRead != messageSize * 2) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ << "Bytes read (" << bytesRead | ||||
|          << ") not equal to message size (" << messageSize * 2 << ")"; | ||||
|       logger_->warn("Bytes read ({}) not equal to message size ({})", | ||||
|                     bytesRead, | ||||
|                     messageSize * 2); | ||||
|    } | ||||
| 
 | ||||
|    if (!ValidateMessage(is, bytesRead)) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat