mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 12:00:04 +00:00 
			
		
		
		
	Use dedicated thread pool for radar product views
This commit is contained in:
		
							parent
							
								
									608ee904b8
								
							
						
					
					
						commit
						1c159a3926
					
				
					 6 changed files with 9 additions and 14 deletions
				
			
		|  | @ -290,11 +290,6 @@ void Level2ProductViewImpl::SetProduct(common::Level2Product product) | ||||||
|    } |    } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void Level2ProductView::Update() |  | ||||||
| { |  | ||||||
|    util::async([this]() { ComputeSweep(); }); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| void Level2ProductView::UpdateColorTable() | void Level2ProductView::UpdateColorTable() | ||||||
| { | { | ||||||
|    if (p->momentDataBlock0_ == nullptr || //
 |    if (p->momentDataBlock0_ == nullptr || //
 | ||||||
|  |  | ||||||
|  | @ -39,7 +39,6 @@ public: | ||||||
|    void LoadColorTable(std::shared_ptr<common::ColorTable> colorTable) override; |    void LoadColorTable(std::shared_ptr<common::ColorTable> colorTable) override; | ||||||
|    void SelectElevation(float elevation) override; |    void SelectElevation(float elevation) override; | ||||||
|    void SelectProduct(const std::string& productName) override; |    void SelectProduct(const std::string& productName) override; | ||||||
|    void Update() override; |  | ||||||
| 
 | 
 | ||||||
|    common::RadarProductGroup GetRadarProductGroup() const override; |    common::RadarProductGroup GetRadarProductGroup() const override; | ||||||
|    std::string               GetRadarProductName() const override; |    std::string               GetRadarProductName() const override; | ||||||
|  |  | ||||||
|  | @ -1,7 +1,6 @@ | ||||||
| #include <scwx/qt/view/level3_product_view.hpp> | #include <scwx/qt/view/level3_product_view.hpp> | ||||||
| #include <scwx/common/constants.hpp> | #include <scwx/common/constants.hpp> | ||||||
| #include <scwx/util/logger.hpp> | #include <scwx/util/logger.hpp> | ||||||
| #include <scwx/util/threads.hpp> |  | ||||||
| #include <scwx/util/time.hpp> | #include <scwx/util/time.hpp> | ||||||
| #include <scwx/wsr88d/rpg/digital_radial_data_array_packet.hpp> | #include <scwx/wsr88d/rpg/digital_radial_data_array_packet.hpp> | ||||||
| #include <scwx/wsr88d/rpg/graphic_product_message.hpp> | #include <scwx/wsr88d/rpg/graphic_product_message.hpp> | ||||||
|  | @ -161,11 +160,6 @@ void Level3ProductView::LoadColorTable( | ||||||
|    UpdateColorTable(); |    UpdateColorTable(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void Level3ProductView::Update() |  | ||||||
| { |  | ||||||
|    util::async([this]() { ComputeSweep(); }); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| void Level3ProductView::UpdateColorTable() | void Level3ProductView::UpdateColorTable() | ||||||
| { | { | ||||||
|    logger_->debug("UpdateColorTable()"); |    logger_->debug("UpdateColorTable()"); | ||||||
|  |  | ||||||
|  | @ -32,7 +32,6 @@ public: | ||||||
|    std::uint16_t color_table_max() const override; |    std::uint16_t color_table_max() const override; | ||||||
| 
 | 
 | ||||||
|    void LoadColorTable(std::shared_ptr<common::ColorTable> colorTable) override; |    void LoadColorTable(std::shared_ptr<common::ColorTable> colorTable) override; | ||||||
|    void Update() override; |  | ||||||
| 
 | 
 | ||||||
|    common::RadarProductGroup GetRadarProductGroup() const override; |    common::RadarProductGroup GetRadarProductGroup() const override; | ||||||
|    std::string               GetRadarProductName() const override; |    std::string               GetRadarProductName() const override; | ||||||
|  |  | ||||||
|  | @ -2,6 +2,7 @@ | ||||||
| #include <scwx/common/constants.hpp> | #include <scwx/common/constants.hpp> | ||||||
| #include <scwx/util/logger.hpp> | #include <scwx/util/logger.hpp> | ||||||
| 
 | 
 | ||||||
|  | #include <boost/asio.hpp> | ||||||
| #include <boost/range/irange.hpp> | #include <boost/range/irange.hpp> | ||||||
| #include <boost/timer/timer.hpp> | #include <boost/timer/timer.hpp> | ||||||
| 
 | 
 | ||||||
|  | @ -36,6 +37,8 @@ public: | ||||||
|    } |    } | ||||||
|    ~RadarProductViewImpl() = default; |    ~RadarProductViewImpl() = default; | ||||||
| 
 | 
 | ||||||
|  |    boost::asio::thread_pool threadPool_ {1}; | ||||||
|  | 
 | ||||||
|    bool       initialized_; |    bool       initialized_; | ||||||
|    std::mutex sweepMutex_; |    std::mutex sweepMutex_; | ||||||
| 
 | 
 | ||||||
|  | @ -118,6 +121,11 @@ void RadarProductView::SelectTime(std::chrono::system_clock::time_point time) | ||||||
|    p->selectedTime_ = time; |    p->selectedTime_ = time; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | void RadarProductView::Update() | ||||||
|  | { | ||||||
|  |    boost::asio::post(p->threadPool_, [this]() { ComputeSweep(); }); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| bool RadarProductView::IsInitialized() const | bool RadarProductView::IsInitialized() const | ||||||
| { | { | ||||||
|    return p->initialized_; |    return p->initialized_; | ||||||
|  |  | ||||||
|  | @ -51,7 +51,7 @@ public: | ||||||
|    virtual void SelectElevation(float elevation); |    virtual void SelectElevation(float elevation); | ||||||
|    virtual void SelectProduct(const std::string& productName) = 0; |    virtual void SelectProduct(const std::string& productName) = 0; | ||||||
|    void         SelectTime(std::chrono::system_clock::time_point time); |    void         SelectTime(std::chrono::system_clock::time_point time); | ||||||
|    virtual void Update() = 0; |    void         Update(); | ||||||
| 
 | 
 | ||||||
|    bool IsInitialized() const; |    bool IsInitialized() const; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat