mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 22:50:05 +00:00
Allow selection of radar smoothing
This commit is contained in:
parent
d3ae404f7a
commit
a8132ef9f1
7 changed files with 66 additions and 6 deletions
|
|
@ -131,6 +131,8 @@ public:
|
|||
std::shared_ptr<wsr88d::rda::GenericRadarData::MomentDataBlock>
|
||||
momentDataBlock0_;
|
||||
|
||||
bool prevSmoothingEnabled_ {false};
|
||||
|
||||
std::vector<float> coordinates_ {};
|
||||
std::vector<float> vertices_ {};
|
||||
std::vector<uint8_t> dataMoments8_ {};
|
||||
|
|
@ -512,6 +514,7 @@ void Level2ProductView::ComputeSweep()
|
|||
|
||||
std::shared_ptr<manager::RadarProductManager> radarProductManager =
|
||||
radar_product_manager();
|
||||
const bool smoothingEnabled = smoothing_enabled();
|
||||
|
||||
std::shared_ptr<wsr88d::rda::ElevationScan> radarData;
|
||||
std::chrono::system_clock::time_point requestedTime {selected_time()};
|
||||
|
|
@ -524,14 +527,14 @@ void Level2ProductView::ComputeSweep()
|
|||
Q_EMIT SweepNotComputed(types::NoUpdateReason::NotLoaded);
|
||||
return;
|
||||
}
|
||||
if (radarData == p->elevationScan_)
|
||||
if (radarData == p->elevationScan_ &&
|
||||
smoothingEnabled == p->prevSmoothingEnabled_)
|
||||
{
|
||||
Q_EMIT SweepNotComputed(types::NoUpdateReason::NoChange);
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Where does this come from?
|
||||
bool smoothingEnabled = false;
|
||||
p->prevSmoothingEnabled_ = smoothingEnabled;
|
||||
|
||||
logger_->debug("Computing Sweep");
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ public:
|
|||
std::mutex sweepMutex_;
|
||||
|
||||
std::chrono::system_clock::time_point selectedTime_;
|
||||
bool smoothingEnabled_ {false};
|
||||
|
||||
std::shared_ptr<manager::RadarProductManager> radarProductManager_;
|
||||
};
|
||||
|
|
@ -87,6 +88,11 @@ std::chrono::system_clock::time_point RadarProductView::selected_time() const
|
|||
return p->selectedTime_;
|
||||
}
|
||||
|
||||
bool RadarProductView::smoothing_enabled() const
|
||||
{
|
||||
return p->smoothingEnabled_;
|
||||
}
|
||||
|
||||
std::chrono::system_clock::time_point RadarProductView::sweep_time() const
|
||||
{
|
||||
return {};
|
||||
|
|
@ -105,6 +111,11 @@ void RadarProductView::set_radar_product_manager(
|
|||
ConnectRadarProductManager();
|
||||
}
|
||||
|
||||
void RadarProductView::set_smoothing_enabled(bool smoothingEnabled)
|
||||
{
|
||||
p->smoothingEnabled_ = smoothingEnabled;
|
||||
}
|
||||
|
||||
void RadarProductView::Initialize()
|
||||
{
|
||||
ComputeSweep();
|
||||
|
|
|
|||
|
|
@ -49,10 +49,12 @@ public:
|
|||
|
||||
std::shared_ptr<manager::RadarProductManager> radar_product_manager() const;
|
||||
std::chrono::system_clock::time_point selected_time() const;
|
||||
bool smoothing_enabled() const;
|
||||
std::mutex& sweep_mutex();
|
||||
|
||||
void set_radar_product_manager(
|
||||
std::shared_ptr<manager::RadarProductManager> radarProductManager);
|
||||
void set_smoothing_enabled(bool smoothingEnabled);
|
||||
|
||||
void Initialize();
|
||||
virtual void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue