mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-11-01 05:50:05 +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()
|
||||
{
|
||||
if (p->momentDataBlock0_ == nullptr || //
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ public:
|
|||
void LoadColorTable(std::shared_ptr<common::ColorTable> colorTable) override;
|
||||
void SelectElevation(float elevation) override;
|
||||
void SelectProduct(const std::string& productName) override;
|
||||
void Update() override;
|
||||
|
||||
common::RadarProductGroup GetRadarProductGroup() const override;
|
||||
std::string GetRadarProductName() const override;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#include <scwx/qt/view/level3_product_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/graphic_product_message.hpp>
|
||||
|
|
@ -161,11 +160,6 @@ void Level3ProductView::LoadColorTable(
|
|||
UpdateColorTable();
|
||||
}
|
||||
|
||||
void Level3ProductView::Update()
|
||||
{
|
||||
util::async([this]() { ComputeSweep(); });
|
||||
}
|
||||
|
||||
void Level3ProductView::UpdateColorTable()
|
||||
{
|
||||
logger_->debug("UpdateColorTable()");
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ public:
|
|||
std::uint16_t color_table_max() const override;
|
||||
|
||||
void LoadColorTable(std::shared_ptr<common::ColorTable> colorTable) override;
|
||||
void Update() override;
|
||||
|
||||
common::RadarProductGroup GetRadarProductGroup() const override;
|
||||
std::string GetRadarProductName() const override;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#include <scwx/common/constants.hpp>
|
||||
#include <scwx/util/logger.hpp>
|
||||
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/range/irange.hpp>
|
||||
#include <boost/timer/timer.hpp>
|
||||
|
||||
|
|
@ -36,6 +37,8 @@ public:
|
|||
}
|
||||
~RadarProductViewImpl() = default;
|
||||
|
||||
boost::asio::thread_pool threadPool_ {1};
|
||||
|
||||
bool initialized_;
|
||||
std::mutex sweepMutex_;
|
||||
|
||||
|
|
@ -118,6 +121,11 @@ void RadarProductView::SelectTime(std::chrono::system_clock::time_point time)
|
|||
p->selectedTime_ = time;
|
||||
}
|
||||
|
||||
void RadarProductView::Update()
|
||||
{
|
||||
boost::asio::post(p->threadPool_, [this]() { ComputeSweep(); });
|
||||
}
|
||||
|
||||
bool RadarProductView::IsInitialized() const
|
||||
{
|
||||
return p->initialized_;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public:
|
|||
virtual void SelectElevation(float elevation);
|
||||
virtual void SelectProduct(const std::string& productName) = 0;
|
||||
void SelectTime(std::chrono::system_clock::time_point time);
|
||||
virtual void Update() = 0;
|
||||
void Update();
|
||||
|
||||
bool IsInitialized() const;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue