Disable range folding display by default when smoothing

This commit is contained in:
Dan Paulat 2024-12-15 07:21:46 -06:00
parent cc0ebcd13c
commit a65504a2cb
5 changed files with 107 additions and 32 deletions

View file

@ -41,8 +41,11 @@ public:
std::vector<std::uint8_t> dataMoments8_ {};
std::uint8_t edgeValue_ {};
bool showSmoothedRangeFolding_ {false};
std::shared_ptr<wsr88d::rpg::RasterDataPacket> lastRasterData_ {};
bool lastSmoothingEnabled_ {false};
bool lastShowSmoothedRangeFolding_ {false};
bool lastSmoothingEnabled_ {false};
float latitude_;
float longitude_;
@ -113,7 +116,9 @@ void Level3RasterView::ComputeSweep()
std::shared_ptr<manager::RadarProductManager> radarProductManager =
radar_product_manager();
const bool smoothingEnabled = smoothing_enabled();
const bool smoothingEnabled = smoothing_enabled();
p->showSmoothedRangeFolding_ = show_smoothed_range_folding();
bool& showSmoothedRangeFolding = p->showSmoothedRangeFolding_;
// Retrieve message from Radar Product Manager
std::shared_ptr<wsr88d::rpg::Level3Message> message;
@ -145,7 +150,9 @@ void Level3RasterView::ComputeSweep()
return;
}
else if (gpm == graphic_product_message() &&
smoothingEnabled == p->lastSmoothingEnabled_)
smoothingEnabled == p->lastSmoothingEnabled_ &&
(showSmoothedRangeFolding == p->lastShowSmoothedRangeFolding_ ||
!smoothingEnabled))
{
// Skip if this is the message we previously processed
Q_EMIT SweepNotComputed(types::NoUpdateReason::NoChange);
@ -153,7 +160,8 @@ void Level3RasterView::ComputeSweep()
}
set_graphic_product_message(gpm);
p->lastSmoothingEnabled_ = smoothingEnabled;
p->lastShowSmoothedRangeFolding_ = showSmoothedRangeFolding;
p->lastSmoothingEnabled_ = smoothingEnabled;
// A message with radial data should have a Product Description Block and
// Product Symbology Block
@ -364,10 +372,16 @@ void Level3RasterView::ComputeSweep()
const std::uint8_t& dm3 = nextDataMomentsArray8[bin];
const std::uint8_t& dm4 = nextDataMomentsArray8[bin + 1];
if (dm1 < snrThreshold && dm1 != RANGE_FOLDED &&
dm2 < snrThreshold && dm2 != RANGE_FOLDED &&
dm3 < snrThreshold && dm3 != RANGE_FOLDED &&
dm4 < snrThreshold && dm4 != RANGE_FOLDED)
if ((!showSmoothedRangeFolding && //
(dm1 < snrThreshold || dm1 == RANGE_FOLDED) &&
(dm2 < snrThreshold || dm2 == RANGE_FOLDED) &&
(dm3 < snrThreshold || dm3 == RANGE_FOLDED) &&
(dm4 < snrThreshold || dm4 == RANGE_FOLDED)) ||
(showSmoothedRangeFolding && //
dm1 < snrThreshold && dm1 != RANGE_FOLDED &&
dm2 < snrThreshold && dm2 != RANGE_FOLDED &&
dm3 < snrThreshold && dm3 != RANGE_FOLDED &&
dm4 < snrThreshold && dm4 != RANGE_FOLDED))
{
// Skip only if all data moments are hidden
continue;
@ -424,7 +438,8 @@ void Level3RasterView::ComputeSweep()
std::uint8_t
Level3RasterViewImpl::RemapDataMoment(std::uint8_t dataMoment) const
{
if (dataMoment != 0)
if (dataMoment != 0 &&
(dataMoment != RANGE_FOLDED || showSmoothedRangeFolding_))
{
return dataMoment;
}