mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 21:00:05 +00:00 
			
		
		
		
	Removing boost log from Boost.Log -> spdlog - settings, types, util, view
This commit is contained in:
		
							parent
							
								
									e6bddc79db
								
							
						
					
					
						commit
						c6281d799f
					
				
					 13 changed files with 109 additions and 127 deletions
				
			
		|  | @ -1,7 +1,5 @@ | |||
| #include <scwx/qt/request/nexrad_file_request.hpp> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
|  | @ -9,8 +7,7 @@ namespace qt | |||
| namespace request | ||||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = | ||||
|    "[scwx::qt::request::nexrad_file_request] "; | ||||
| static const std::string logPrefix_ = "scwx::qt::request::nexrad_file_request"; | ||||
| 
 | ||||
| class NexradFileRequestImpl | ||||
| { | ||||
|  |  | |||
|  | @ -1,7 +1,6 @@ | |||
| #include <scwx/qt/settings/general_settings.hpp> | ||||
| #include <scwx/qt/util/json.hpp> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
|  | @ -10,7 +9,8 @@ namespace qt | |||
| namespace settings | ||||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = "[scwx::qt::settings::general_settings] "; | ||||
| static const std::string logPrefix_ = "scwx::qt::settings::general_settings"; | ||||
| static const auto        logger_    = scwx::util::Logger::Create(logPrefix_); | ||||
| 
 | ||||
| static const std::string DEFAULT_DEFAULT_RADAR_SITE = "KLSX"; | ||||
| static const int64_t     DEFAULT_GRID_WIDTH         = 1; | ||||
|  | @ -115,13 +115,11 @@ GeneralSettings::Load(const boost::json::value* json, bool& jsonDirty) | |||
|    { | ||||
|       if (json == nullptr) | ||||
|       { | ||||
|          BOOST_LOG_TRIVIAL(warning) | ||||
|             << logPrefix_ << "Key is not present, resetting to defaults"; | ||||
|          logger_->warn("Key is not present, resetting to defaults"); | ||||
|       } | ||||
|       else if (!json->is_object()) | ||||
|       { | ||||
|          BOOST_LOG_TRIVIAL(warning) | ||||
|             << logPrefix_ << "Invalid json, resetting to defaults"; | ||||
|          logger_->warn("Invalid json, resetting to defaults"); | ||||
|       } | ||||
| 
 | ||||
|       generalSettings->p->SetDefaults(); | ||||
|  |  | |||
|  | @ -1,7 +1,6 @@ | |||
| #include <scwx/qt/settings/palette_settings.hpp> | ||||
| #include <scwx/qt/util/json.hpp> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
|  | @ -10,7 +9,8 @@ namespace qt | |||
| namespace settings | ||||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = "[scwx::qt::settings::palette_settings] "; | ||||
| static const std::string logPrefix_ = "scwx::qt::settings::palette_settings"; | ||||
| static const auto        logger_    = scwx::util::Logger::Create(logPrefix_); | ||||
| 
 | ||||
| static const std::vector<std::string> paletteNames_ = { | ||||
|    // Level 2 / Common Products
 | ||||
|  | @ -125,13 +125,11 @@ PaletteSettings::Load(const boost::json::value* json, bool& jsonDirty) | |||
|    { | ||||
|       if (json == nullptr) | ||||
|       { | ||||
|          BOOST_LOG_TRIVIAL(warning) | ||||
|             << logPrefix_ << "Key is not present, resetting to defaults"; | ||||
|          logger_->warn("Key is not present, resetting to defaults"); | ||||
|       } | ||||
|       else if (!json->is_object()) | ||||
|       { | ||||
|          BOOST_LOG_TRIVIAL(warning) | ||||
|             << logPrefix_ << "Invalid json, resetting to defaults"; | ||||
|          logger_->warn("Invalid json, resetting to defaults"); | ||||
|       } | ||||
| 
 | ||||
|       generalSettings->p->SetDefaults(); | ||||
|  |  | |||
|  | @ -3,8 +3,6 @@ | |||
| #include <scwx/common/sites.hpp> | ||||
| #include <scwx/util/time.hpp> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
|  | @ -12,8 +10,7 @@ namespace qt | |||
| namespace types | ||||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = | ||||
|    "[scwx::qt::types::radar_product_record] "; | ||||
| static const std::string logPrefix_ = "scwx::qt::types::radar_product_record"; | ||||
| 
 | ||||
| class RadarProductRecordImpl | ||||
| { | ||||
|  |  | |||
|  | @ -2,11 +2,11 @@ | |||
| #define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING | ||||
| 
 | ||||
| #include <scwx/qt/util/font.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
| #include <codecvt> | ||||
| #include <unordered_map> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| #include <boost/timer/timer.hpp> | ||||
| #include <QFile> | ||||
| #include <QFileInfo> | ||||
|  | @ -76,7 +76,8 @@ static const std::string CODEPOINTS = | |||
|    "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" | ||||
|    "`abcdefghijklmnopqrstuvwxyz{|}~"; | ||||
| 
 | ||||
| static const std::string logPrefix_ = "[scwx::qt::util::font] "; | ||||
| static const std::string logPrefix_ = "scwx::qt::util::font"; | ||||
| static const auto        logger_    = scwx::util::Logger::Create(logPrefix_); | ||||
| 
 | ||||
| static constexpr float BASE_POINT_SIZE = 72.0f; | ||||
| static constexpr float POINT_SCALE     = 1.0f / BASE_POINT_SIZE; | ||||
|  | @ -144,9 +145,8 @@ float Font::BufferText(std::shared_ptr<FontBuffer> buffer, | |||
|       auto it = p->glyphs_.find(c); | ||||
|       if (it == p->glyphs_.end()) | ||||
|       { | ||||
|          BOOST_LOG_TRIVIAL(info) | ||||
|             << logPrefix_ | ||||
|             << "Could not draw character: " << static_cast<uint32_t>(c); | ||||
|          logger_->info("Could not draw character: {}", | ||||
|                        static_cast<uint32_t>(c)); | ||||
|          continue; | ||||
|       } | ||||
| 
 | ||||
|  | @ -198,9 +198,7 @@ float Font::TextLength(const std::string& text, float pointSize) const | |||
|       auto it = p->glyphs_.find(c); | ||||
|       if (it == p->glyphs_.end()) | ||||
|       { | ||||
|          BOOST_LOG_TRIVIAL(info) | ||||
|             << logPrefix_ | ||||
|             << "Character not found: " << static_cast<uint32_t>(c); | ||||
|          logger_->info("Character not found: {}", static_cast<uint32_t>(c)); | ||||
|          continue; | ||||
|       } | ||||
| 
 | ||||
|  | @ -242,7 +240,7 @@ GLuint Font::GenerateTexture(gl::OpenGLFunctions& gl) | |||
| 
 | ||||
| std::shared_ptr<Font> Font::Create(const std::string& resource) | ||||
| { | ||||
|    BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "Loading font file: " << resource; | ||||
|    logger_->debug("Loading font file: {}", resource); | ||||
| 
 | ||||
|    std::shared_ptr<Font>   font = nullptr; | ||||
|    boost::timer::cpu_timer timer; | ||||
|  | @ -250,7 +248,7 @@ std::shared_ptr<Font> Font::Create(const std::string& resource) | |||
|    auto it = fontMap_.find(resource); | ||||
|    if (it != fontMap_.end()) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "Font already created"; | ||||
|       logger_->debug("Font already created"); | ||||
|       return it->second; | ||||
|    } | ||||
| 
 | ||||
|  | @ -258,7 +256,7 @@ std::shared_ptr<Font> Font::Create(const std::string& resource) | |||
|    fontFile.open(QIODevice::ReadOnly); | ||||
|    if (!fontFile.isOpen()) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(error) << logPrefix_ << "Could not read font file"; | ||||
|       logger_->error("Could not read font file"); | ||||
|       return font; | ||||
|    } | ||||
| 
 | ||||
|  | @ -298,8 +296,7 @@ std::shared_ptr<Font> Font::Create(const std::string& resource) | |||
|       } | ||||
|    } | ||||
| 
 | ||||
|    BOOST_LOG_TRIVIAL(debug) | ||||
|       << logPrefix_ << "Font loaded in " << timer.format(6, "%ws"); | ||||
|    logger_->debug("Font loaded in {}", timer.format(6, "%ws")); | ||||
| 
 | ||||
|    texture_font_delete(textureFont); | ||||
| 
 | ||||
|  | @ -337,9 +334,8 @@ void FontImpl::ParseNames(FT_Face face) | |||
|       } | ||||
|    } | ||||
| 
 | ||||
|    BOOST_LOG_TRIVIAL(debug) | ||||
|       << logPrefix_ << "Font family: " << fontData_.fontFamily_ << " (" | ||||
|       << fontData_.fontSubfamily_ << ")"; | ||||
|    logger_->debug( | ||||
|       "Font family: {} ({})", fontData_.fontFamily_, fontData_.fontSubfamily_); | ||||
| } | ||||
| 
 | ||||
| static void ParseSfntName(const FT_SfntName& sfntName, std::string& str) | ||||
|  |  | |||
|  | @ -1,9 +1,8 @@ | |||
| #include <scwx/qt/util/font_buffer.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
| #include <mutex> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
|  | @ -11,7 +10,8 @@ namespace qt | |||
| namespace util | ||||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = "[scwx::qt::util::font_buffer] "; | ||||
| static const std::string logPrefix_ = "scwx::qt::util::font_buffer"; | ||||
| static const auto        logger_    = scwx::util::Logger::Create(logPrefix_); | ||||
| 
 | ||||
| class FontBufferImpl | ||||
| { | ||||
|  | @ -140,8 +140,7 @@ void FontBuffer::Push(std::initializer_list<GLuint>  indices, | |||
| { | ||||
|    if (indices.size() % 3 != 0 || vertices.size() % 9 != 0) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ << "Invalid push arguments, ignoring"; | ||||
|       logger_->warn("Invalid push arguments, ignoring"); | ||||
|       return; | ||||
|    } | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,8 +1,8 @@ | |||
| #include <scwx/qt/util/json.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
| #include <fstream> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| #include <QFile> | ||||
| #include <QTextStream> | ||||
| 
 | ||||
|  | @ -15,7 +15,8 @@ namespace util | |||
| namespace json | ||||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = "[scwx::qt::util::json] "; | ||||
| static const std::string logPrefix_ = "scwx::qt::util::json"; | ||||
| static const auto        logger_    = scwx::util::Logger::Create(logPrefix_); | ||||
| 
 | ||||
| /* Adapted from:
 | ||||
|  * https://www.boost.org/doc/libs/1_77_0/libs/json/doc/html/json/examples.html#json.examples.pretty
 | ||||
|  | @ -50,16 +51,18 @@ bool FromJsonInt64(const boost::json::object& json, | |||
| 
 | ||||
|          if (minValue.has_value() && value < *minValue) | ||||
|          { | ||||
|             BOOST_LOG_TRIVIAL(warning) | ||||
|                << logPrefix_ << key << " less than minimum (" << value << " < " | ||||
|                << *minValue << "), setting to: " << *minValue; | ||||
|             logger_->warn("{} less than minimum ({} < {}), setting to: {2}", | ||||
|                           key, | ||||
|                           value, | ||||
|                           *minValue); | ||||
|             value = *minValue; | ||||
|          } | ||||
|          else if (maxValue.has_value() && value > *maxValue) | ||||
|          { | ||||
|             BOOST_LOG_TRIVIAL(warning) | ||||
|                << logPrefix_ << key << " greater than maximum (" << value | ||||
|                << " > " << *maxValue << "), setting to: " << *maxValue; | ||||
|             logger_->warn("{} greater than maximum ({} > {}), setting to: {2}", | ||||
|                           key, | ||||
|                           value, | ||||
|                           *maxValue); | ||||
|             value = *maxValue; | ||||
|          } | ||||
|          else | ||||
|  | @ -69,17 +72,17 @@ bool FromJsonInt64(const boost::json::object& json, | |||
|       } | ||||
|       else | ||||
|       { | ||||
|          BOOST_LOG_TRIVIAL(warning) | ||||
|             << logPrefix_ << key << " is not an int64 (" << jv->kind() | ||||
|             << "), setting to default:" << defaultValue; | ||||
|          logger_->warn("{} is not an int64 ({}), setting to default: {}", | ||||
|                        key, | ||||
|                        jv->kind(), | ||||
|                        defaultValue); | ||||
|          value = defaultValue; | ||||
|       } | ||||
|    } | ||||
|    else | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(debug) | ||||
|          << logPrefix_ << key | ||||
|          << " is not present, setting to default: " << defaultValue; | ||||
|       logger_->debug( | ||||
|          "{} is not present, setting to default: {}", key, defaultValue); | ||||
|       value = defaultValue; | ||||
|    } | ||||
| 
 | ||||
|  | @ -103,17 +106,15 @@ bool FromJsonString(const boost::json::object& json, | |||
|       } | ||||
|       else | ||||
|       { | ||||
|          BOOST_LOG_TRIVIAL(warning) | ||||
|             << logPrefix_ << key | ||||
|             << " is not a string, setting to default: " << defaultValue; | ||||
|          logger_->warn( | ||||
|             "{} is not a string, setting to default: {}", key, defaultValue); | ||||
|          value = defaultValue; | ||||
|       } | ||||
|    } | ||||
|    else | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(debug) | ||||
|          << logPrefix_ << key | ||||
|          << " is not present, setting to default: " << defaultValue; | ||||
|       logger_->debug( | ||||
|          "{} is not present, setting to default: {}", key, defaultValue); | ||||
|       value = defaultValue; | ||||
|    } | ||||
| 
 | ||||
|  | @ -156,9 +157,8 @@ static boost::json::value ReadJsonFile(QFile& file) | |||
|    } | ||||
|    else | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ << "Could not open file for reading: \"" | ||||
|          << file.fileName().toStdString() << "\""; | ||||
|       logger_->warn("Could not open file for reading: \"{}\"", | ||||
|                     file.fileName().toStdString()); | ||||
|    } | ||||
| 
 | ||||
|    return json; | ||||
|  | @ -176,7 +176,7 @@ static boost::json::value ReadJsonStream(std::istream& is) | |||
|       p.write(line, ec); | ||||
|       if (ec) | ||||
|       { | ||||
|          BOOST_LOG_TRIVIAL(warning) << logPrefix_ << ec.message(); | ||||
|          logger_->warn("{}", ec.message()); | ||||
|          return nullptr; | ||||
|       } | ||||
|    } | ||||
|  | @ -184,7 +184,7 @@ static boost::json::value ReadJsonStream(std::istream& is) | |||
|    p.finish(ec); | ||||
|    if (ec) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) << logPrefix_ << ec.message(); | ||||
|       logger_->warn("{}", ec.message()); | ||||
|       return nullptr; | ||||
|    } | ||||
| 
 | ||||
|  | @ -199,8 +199,7 @@ void WriteJsonFile(const std::string&        path, | |||
| 
 | ||||
|    if (!ofs.is_open()) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ << "Cannot write JSON file: \"" << path << "\""; | ||||
|       logger_->warn("Cannot write JSON file: \"{}\"", path); | ||||
|    } | ||||
|    else | ||||
|    { | ||||
|  | @ -277,11 +276,17 @@ static void PrettyPrintJson(std::ostream&             os, | |||
|       break; | ||||
|    } | ||||
| 
 | ||||
|    case boost::json::kind::uint64: os << jv.get_uint64(); break; | ||||
|    case boost::json::kind::uint64: | ||||
|       os << jv.get_uint64(); | ||||
|       break; | ||||
| 
 | ||||
|    case boost::json::kind::int64: os << jv.get_int64(); break; | ||||
|    case boost::json::kind::int64: | ||||
|       os << jv.get_int64(); | ||||
|       break; | ||||
| 
 | ||||
|    case boost::json::kind::double_: os << jv.get_double(); break; | ||||
|    case boost::json::kind::double_: | ||||
|       os << jv.get_double(); | ||||
|       break; | ||||
| 
 | ||||
|    case boost::json::kind::bool_: | ||||
|       if (jv.get_bool()) | ||||
|  | @ -290,7 +295,9 @@ static void PrettyPrintJson(std::ostream&             os, | |||
|          os << "false"; | ||||
|       break; | ||||
| 
 | ||||
|    case boost::json::kind::null: os << "null"; break; | ||||
|    case boost::json::kind::null: | ||||
|       os << "null"; | ||||
|       break; | ||||
|    } | ||||
| 
 | ||||
|    if (indent->empty()) | ||||
|  |  | |||
|  | @ -1,9 +1,9 @@ | |||
| #include <scwx/qt/view/level2_product_view.hpp> | ||||
| #include <scwx/common/constants.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| #include <scwx/util/threads.hpp> | ||||
| #include <scwx/util/time.hpp> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| #include <boost/range/irange.hpp> | ||||
| #include <boost/timer/timer.hpp> | ||||
| 
 | ||||
|  | @ -14,7 +14,8 @@ namespace qt | |||
| namespace view | ||||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = "[scwx::qt::view::level2_product_view] "; | ||||
| static const std::string logPrefix_ = "scwx::qt::view::level2_product_view"; | ||||
| static const auto        logger_    = scwx::util::Logger::Create(logPrefix_); | ||||
| 
 | ||||
| static constexpr uint16_t RANGE_FOLDED      = 1u; | ||||
| static constexpr uint32_t VERTICES_PER_BIN  = 6u; | ||||
|  | @ -73,8 +74,8 @@ public: | |||
|       } | ||||
|       else | ||||
|       { | ||||
|          BOOST_LOG_TRIVIAL(warning) << logPrefix_ << "Unknown product: \"" | ||||
|                                     << common::GetLevel2Name(product) << "\""; | ||||
|          logger_->warn("Unknown product: \"{}\"", | ||||
|                        common::GetLevel2Name(product)); | ||||
|          dataBlockType_ = wsr88d::rda::DataBlockType::Unknown; | ||||
|       } | ||||
|    } | ||||
|  | @ -347,7 +348,7 @@ void Level2ProductView::UpdateColorTable() | |||
| 
 | ||||
| void Level2ProductView::ComputeSweep() | ||||
| { | ||||
|    BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "ComputeSweep()"; | ||||
|    logger_->debug("ComputeSweep()"); | ||||
| 
 | ||||
|    boost::timer::cpu_timer timer; | ||||
| 
 | ||||
|  | @ -382,8 +383,8 @@ void Level2ProductView::ComputeSweep() | |||
| 
 | ||||
|    if (momentData0 == nullptr) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) << logPrefix_ << "No moment data for " | ||||
|                                  << common::GetLevel2Name(p->product_); | ||||
|       logger_->warn("No moment data for {}", | ||||
|                     common::GetLevel2Name(p->product_)); | ||||
|       return; | ||||
|    } | ||||
| 
 | ||||
|  | @ -462,8 +463,7 @@ void Level2ProductView::ComputeSweep() | |||
| 
 | ||||
|       if (momentData0->data_word_size() != momentData->data_word_size()) | ||||
|       { | ||||
|          BOOST_LOG_TRIVIAL(warning) | ||||
|             << logPrefix_ << "Radial " << radial << " has different word size"; | ||||
|          logger_->warn("Radial {} has different word size", radial); | ||||
|          continue; | ||||
|       } | ||||
| 
 | ||||
|  | @ -632,8 +632,7 @@ void Level2ProductView::ComputeSweep() | |||
|    } | ||||
| 
 | ||||
|    timer.stop(); | ||||
|    BOOST_LOG_TRIVIAL(debug) | ||||
|       << logPrefix_ << "Vertices calculated in " << timer.format(6, "%ws"); | ||||
|    logger_->debug("Vertices calculated in {}", timer.format(6, "%ws")); | ||||
| 
 | ||||
|    UpdateColorTable(); | ||||
| 
 | ||||
|  |  | |||
|  | @ -6,7 +6,6 @@ | |||
| #include <scwx/wsr88d/rpg/graphic_product_message.hpp> | ||||
| #include <scwx/wsr88d/rpg/radial_data_packet.hpp> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| #include <boost/range/irange.hpp> | ||||
| #include <boost/timer/timer.hpp> | ||||
| 
 | ||||
|  | @ -17,7 +16,7 @@ namespace qt | |||
| namespace view | ||||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = "[scwx::qt::view::level3_product_view] "; | ||||
| static const std::string logPrefix_ = "scwx::qt::view::level3_product_view"; | ||||
| 
 | ||||
| static constexpr uint16_t RANGE_FOLDED = 1u; | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,11 +1,11 @@ | |||
| #include <scwx/qt/view/level3_radial_view.hpp> | ||||
| #include <scwx/common/constants.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| #include <scwx/util/threads.hpp> | ||||
| #include <scwx/util/time.hpp> | ||||
| #include <scwx/wsr88d/rpg/digital_radial_data_array_packet.hpp> | ||||
| #include <scwx/wsr88d/rpg/radial_data_packet.hpp> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| #include <boost/range/irange.hpp> | ||||
| #include <boost/timer/timer.hpp> | ||||
| 
 | ||||
|  | @ -16,7 +16,8 @@ namespace qt | |||
| namespace view | ||||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = "[scwx::qt::view::level3_radial_view] "; | ||||
| static const std::string logPrefix_ = "scwx::qt::view::level3_radial_view"; | ||||
| static const auto        logger_    = scwx::util::Logger::Create(logPrefix_); | ||||
| 
 | ||||
| static constexpr uint16_t RANGE_FOLDED      = 1u; | ||||
| static constexpr uint32_t VERTICES_PER_BIN  = 6u; | ||||
|  | @ -105,7 +106,7 @@ void Level3RadialView::SelectTime(std::chrono::system_clock::time_point time) | |||
| 
 | ||||
| void Level3RadialView::ComputeSweep() | ||||
| { | ||||
|    BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "ComputeSweep()"; | ||||
|    logger_->debug("ComputeSweep()"); | ||||
| 
 | ||||
|    boost::timer::cpu_timer timer; | ||||
| 
 | ||||
|  | @ -120,8 +121,7 @@ void Level3RadialView::ComputeSweep() | |||
|       std::dynamic_pointer_cast<wsr88d::rpg::GraphicProductMessage>(message); | ||||
|    if (gpm == nullptr) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ << "Graphic Product Message not found"; | ||||
|       logger_->warn("Graphic Product Message not found"); | ||||
|       return; | ||||
|    } | ||||
|    else if (gpm == graphic_product_message()) | ||||
|  | @ -139,7 +139,7 @@ void Level3RadialView::ComputeSweep() | |||
|       gpm->symbology_block(); | ||||
|    if (descriptionBlock == nullptr || symbologyBlock == nullptr) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) << logPrefix_ << "Missing blocks"; | ||||
|       logger_->warn("Missing blocks"); | ||||
|       return; | ||||
|    } | ||||
| 
 | ||||
|  | @ -147,8 +147,7 @@ void Level3RadialView::ComputeSweep() | |||
|    uint16_t numberOfLayers = symbologyBlock->number_of_layers(); | ||||
|    if (numberOfLayers < 1) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ << "No layers present in symbology block"; | ||||
|       logger_->warn("No layers present in symbology block"); | ||||
|       return; | ||||
|    } | ||||
| 
 | ||||
|  | @ -199,7 +198,7 @@ void Level3RadialView::ComputeSweep() | |||
|    } | ||||
|    else | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "No radial data found"; | ||||
|       logger_->debug("No radial data found"); | ||||
|       return; | ||||
|    } | ||||
| 
 | ||||
|  | @ -207,8 +206,7 @@ void Level3RadialView::ComputeSweep() | |||
|    const size_t radials = radialData->number_of_radials(); | ||||
|    if (radials != 360 && radials != 720) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ << "Unsupported number of radials: " << radials; | ||||
|       logger_->warn("Unsupported number of radials: {}", radials); | ||||
|       return; | ||||
|    } | ||||
| 
 | ||||
|  | @ -223,8 +221,7 @@ void Level3RadialView::ComputeSweep() | |||
|    const uint16_t gates = radialData->number_of_range_bins(); | ||||
|    if (gates < 1) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ << "No range bins in radial data"; | ||||
|       logger_->warn("No range bins in radial data"); | ||||
|       return; | ||||
|    } | ||||
| 
 | ||||
|  | @ -368,8 +365,7 @@ void Level3RadialView::ComputeSweep() | |||
|    dataMoments8.shrink_to_fit(); | ||||
| 
 | ||||
|    timer.stop(); | ||||
|    BOOST_LOG_TRIVIAL(debug) | ||||
|       << logPrefix_ << "Vertices calculated in " << timer.format(6, "%ws"); | ||||
|    logger_->debug("Vertices calculated in {}", timer.format(6, "%ws")); | ||||
| 
 | ||||
|    UpdateColorTable(); | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,10 +1,10 @@ | |||
| #include <scwx/qt/view/level3_raster_view.hpp> | ||||
| #include <scwx/common/constants.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| #include <scwx/util/threads.hpp> | ||||
| #include <scwx/util/time.hpp> | ||||
| #include <scwx/wsr88d/rpg/raster_data_packet.hpp> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| #include <boost/range/irange.hpp> | ||||
| #include <boost/timer/timer.hpp> | ||||
| #include <GeographicLib/Geodesic.hpp> | ||||
|  | @ -16,7 +16,8 @@ namespace qt | |||
| namespace view | ||||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = "[scwx::qt::view::level3_raster_view] "; | ||||
| static const std::string logPrefix_ = "scwx::qt::view::level3_raster_view"; | ||||
| static const auto        logger_    = scwx::util::Logger::Create(logPrefix_); | ||||
| 
 | ||||
| static constexpr uint16_t RANGE_FOLDED      = 1u; | ||||
| static constexpr uint32_t VERTICES_PER_BIN  = 6u; | ||||
|  | @ -105,7 +106,7 @@ void Level3RasterView::SelectTime(std::chrono::system_clock::time_point time) | |||
| 
 | ||||
| void Level3RasterView::ComputeSweep() | ||||
| { | ||||
|    BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "ComputeSweep()"; | ||||
|    logger_->debug("ComputeSweep()"); | ||||
| 
 | ||||
|    boost::timer::cpu_timer timer; | ||||
| 
 | ||||
|  | @ -120,8 +121,7 @@ void Level3RasterView::ComputeSweep() | |||
|       std::dynamic_pointer_cast<wsr88d::rpg::GraphicProductMessage>(message); | ||||
|    if (gpm == nullptr) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ << "Graphic Product Message not found"; | ||||
|       logger_->warn("Graphic Product Message not found"); | ||||
|       return; | ||||
|    } | ||||
|    else if (gpm == graphic_product_message()) | ||||
|  | @ -139,7 +139,7 @@ void Level3RasterView::ComputeSweep() | |||
|       gpm->symbology_block(); | ||||
|    if (descriptionBlock == nullptr || symbologyBlock == nullptr) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) << logPrefix_ << "Missing blocks"; | ||||
|       logger_->warn("Missing blocks"); | ||||
|       return; | ||||
|    } | ||||
| 
 | ||||
|  | @ -147,8 +147,7 @@ void Level3RasterView::ComputeSweep() | |||
|    uint16_t numberOfLayers = symbologyBlock->number_of_layers(); | ||||
|    if (numberOfLayers < 1) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ << "No layers present in symbology block"; | ||||
|       logger_->warn("No layers present in symbology block"); | ||||
|       return; | ||||
|    } | ||||
| 
 | ||||
|  | @ -179,7 +178,7 @@ void Level3RasterView::ComputeSweep() | |||
| 
 | ||||
|    if (rasterData == nullptr) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "No raster data found"; | ||||
|       logger_->debug("No raster data found"); | ||||
|       return; | ||||
|    } | ||||
| 
 | ||||
|  | @ -193,7 +192,7 @@ void Level3RasterView::ComputeSweep() | |||
| 
 | ||||
|    if (maxColumns == 0) | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "No raster bins found"; | ||||
|       logger_->debug("No raster bins found"); | ||||
|       return; | ||||
|    } | ||||
| 
 | ||||
|  | @ -256,8 +255,7 @@ void Level3RasterView::ComputeSweep() | |||
|       }); | ||||
| 
 | ||||
|    timer.stop(); | ||||
|    BOOST_LOG_TRIVIAL(debug) | ||||
|       << logPrefix_ << "Coordinates calculated in " << timer.format(6, "%ws"); | ||||
|    logger_->debug("Coordinates calculated in {}", timer.format(6, "%ws")); | ||||
| 
 | ||||
|    // Calculate vertices
 | ||||
|    timer.start(); | ||||
|  | @ -332,8 +330,7 @@ void Level3RasterView::ComputeSweep() | |||
|    dataMoments8.shrink_to_fit(); | ||||
| 
 | ||||
|    timer.stop(); | ||||
|    BOOST_LOG_TRIVIAL(debug) | ||||
|       << logPrefix_ << "Vertices calculated in " << timer.format(6, "%ws"); | ||||
|    logger_->debug("Vertices calculated in {}", timer.format(6, "%ws")); | ||||
| 
 | ||||
|    UpdateColorTable(); | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| #include <scwx/qt/view/radar_product_view.hpp> | ||||
| #include <scwx/common/constants.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| #include <boost/range/irange.hpp> | ||||
| #include <boost/timer/timer.hpp> | ||||
| 
 | ||||
|  | @ -12,7 +12,8 @@ namespace qt | |||
| namespace view | ||||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = "[scwx::qt::view::radar_product_view] "; | ||||
| static const std::string logPrefix_ = "scwx::qt::view::radar_product_view"; | ||||
| static const auto        logger_    = scwx::util::Logger::Create(logPrefix_); | ||||
| 
 | ||||
| static const std::vector<boost::gil::rgba8_pixel_t> DEFAULT_COLOR_TABLE = { | ||||
|    boost::gil::rgba8_pixel_t(0, 128, 0, 255), | ||||
|  | @ -102,7 +103,7 @@ RadarProductView::GetCfpMomentData() const | |||
| 
 | ||||
| void RadarProductView::ComputeSweep() | ||||
| { | ||||
|    BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "ComputeSweep()"; | ||||
|    logger_->debug("ComputeSweep()"); | ||||
| 
 | ||||
|    emit SweepComputed(); | ||||
| } | ||||
|  |  | |||
|  | @ -2,11 +2,10 @@ | |||
| #include <scwx/qt/view/level2_product_view.hpp> | ||||
| #include <scwx/qt/view/level3_radial_view.hpp> | ||||
| #include <scwx/qt/view/level3_raster_view.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
| #include <unordered_set> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
|  | @ -15,7 +14,8 @@ namespace view | |||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = | ||||
|    "[scwx::qt::view::radar_product_view_factory] "; | ||||
|    "scwx::qt::view::radar_product_view_factory"; | ||||
| static const auto logger_ = scwx::util::Logger::Create(logPrefix_); | ||||
| 
 | ||||
| typedef std::function<std::shared_ptr<RadarProductView>( | ||||
|    const std::string&                            productName, | ||||
|  | @ -46,8 +46,7 @@ std::shared_ptr<RadarProductView> RadarProductViewFactory::Create( | |||
| 
 | ||||
|       if (product == common::Level2Product::Unknown) | ||||
|       { | ||||
|          BOOST_LOG_TRIVIAL(warning) | ||||
|             << logPrefix_ << "Unknown Level 2 radar product: " << productName; | ||||
|          logger_->warn("Unknown Level 2 radar product: {}", productName); | ||||
|       } | ||||
|       else | ||||
|       { | ||||
|  | @ -67,9 +66,8 @@ std::shared_ptr<RadarProductView> RadarProductViewFactory::Create( | |||
|    } | ||||
|    else | ||||
|    { | ||||
|       BOOST_LOG_TRIVIAL(warning) | ||||
|          << logPrefix_ << "Unknown radar product group: " | ||||
|          << common::GetRadarProductGroupName(productGroup); | ||||
|       logger_->warn("Unknown radar product group: {}", | ||||
|                     common::GetRadarProductGroupName(productGroup)); | ||||
|    } | ||||
| 
 | ||||
|    return view; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat