mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 20:00:05 +00:00
Additional clang-tidy action cleanup
This commit is contained in:
parent
57b773d009
commit
a3eb53a649
15 changed files with 128 additions and 117 deletions
|
|
@ -6,6 +6,7 @@ Checks:
|
||||||
- 'misc-*'
|
- 'misc-*'
|
||||||
- 'modernize-*'
|
- 'modernize-*'
|
||||||
- 'performance-*'
|
- 'performance-*'
|
||||||
|
- '-cppcoreguidelines-pro-type-reinterpret-cast'
|
||||||
- '-misc-include-cleaner'
|
- '-misc-include-cleaner'
|
||||||
- '-misc-non-private-member-variables-in-classes'
|
- '-misc-non-private-member-variables-in-classes'
|
||||||
- '-modernize-use-trailing-return-type'
|
- '-modernize-use-trailing-return-type'
|
||||||
|
|
|
||||||
|
|
@ -1098,12 +1098,12 @@ void MainWindowImpl::ConnectOtherSignals()
|
||||||
mainWindow_,
|
mainWindow_,
|
||||||
[this](Qt::CheckState state)
|
[this](Qt::CheckState state)
|
||||||
{
|
{
|
||||||
bool smoothingEnabled = (state == Qt::CheckState::Checked);
|
const bool smoothingEnabled = (state == Qt::CheckState::Checked);
|
||||||
|
|
||||||
auto it = std::find(maps_.cbegin(), maps_.cend(), activeMap_);
|
auto it = std::find(maps_.cbegin(), maps_.cend(), activeMap_);
|
||||||
if (it != maps_.cend())
|
if (it != maps_.cend())
|
||||||
{
|
{
|
||||||
std::size_t i = std::distance(maps_.cbegin(), it);
|
const std::size_t i = std::distance(maps_.cbegin(), it);
|
||||||
settings::MapSettings::Instance().smoothing_enabled(i).StageValue(
|
settings::MapSettings::Instance().smoothing_enabled(i).StageValue(
|
||||||
smoothingEnabled);
|
smoothingEnabled);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,12 +41,12 @@ public:
|
||||||
*/
|
*/
|
||||||
static void DumpRecords();
|
static void DumpRecords();
|
||||||
|
|
||||||
const std::vector<float>& coordinates(common::RadialSize radialSize,
|
[[nodiscard]] const std::vector<float>&
|
||||||
bool smoothingEnabled) const;
|
coordinates(common::RadialSize radialSize, bool smoothingEnabled) const;
|
||||||
const scwx::util::time_zone* default_time_zone() const;
|
[[nodiscard]] const scwx::util::time_zone* default_time_zone() const;
|
||||||
float gate_size() const;
|
[[nodiscard]] float gate_size() const;
|
||||||
std::string radar_id() const;
|
[[nodiscard]] std::string radar_id() const;
|
||||||
std::shared_ptr<config::RadarSite> radar_site() const;
|
[[nodiscard]] std::shared_ptr<config::RadarSite> radar_site() const;
|
||||||
|
|
||||||
void Initialize();
|
void Initialize();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ namespace map
|
||||||
|
|
||||||
struct MapSettings
|
struct MapSettings
|
||||||
{
|
{
|
||||||
explicit MapSettings() {}
|
explicit MapSettings() = default;
|
||||||
~MapSettings() = default;
|
~MapSettings() = default;
|
||||||
|
|
||||||
MapSettings(const MapSettings&) = delete;
|
MapSettings(const MapSettings&) = delete;
|
||||||
MapSettings& operator=(const MapSettings&) = delete;
|
MapSettings& operator=(const MapSettings&) = delete;
|
||||||
|
|
|
||||||
|
|
@ -39,18 +39,19 @@ public:
|
||||||
|
|
||||||
void DumpLayerList() const;
|
void DumpLayerList() const;
|
||||||
|
|
||||||
common::Level3ProductCategoryMap GetAvailableLevel3Categories();
|
[[nodiscard]] common::Level3ProductCategoryMap
|
||||||
float GetElevation() const;
|
GetAvailableLevel3Categories();
|
||||||
std::vector<float> GetElevationCuts() const;
|
[[nodiscard]] float GetElevation() const;
|
||||||
std::vector<std::string> GetLevel3Products();
|
[[nodiscard]] std::vector<float> GetElevationCuts() const;
|
||||||
std::string GetMapStyle() const;
|
[[nodiscard]] std::vector<std::string> GetLevel3Products();
|
||||||
common::RadarProductGroup GetRadarProductGroup() const;
|
[[nodiscard]] std::string GetMapStyle() const;
|
||||||
std::string GetRadarProductName() const;
|
[[nodiscard]] common::RadarProductGroup GetRadarProductGroup() const;
|
||||||
std::shared_ptr<config::RadarSite> GetRadarSite() const;
|
[[nodiscard]] std::string GetRadarProductName() const;
|
||||||
bool GetRadarWireframeEnabled() const;
|
[[nodiscard]] std::shared_ptr<config::RadarSite> GetRadarSite() const;
|
||||||
std::chrono::system_clock::time_point GetSelectedTime() const;
|
[[nodiscard]] bool GetRadarWireframeEnabled() const;
|
||||||
bool GetSmoothingEnabled() const;
|
[[nodiscard]] std::chrono::system_clock::time_point GetSelectedTime() const;
|
||||||
std::uint16_t GetVcp() const;
|
[[nodiscard]] bool GetSmoothingEnabled() const;
|
||||||
|
[[nodiscard]] std::uint16_t GetVcp() const;
|
||||||
|
|
||||||
void SelectElevation(float elevation);
|
void SelectElevation(float elevation);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -266,7 +266,7 @@ void RadarProductLayer::Render(
|
||||||
// Set OpenGL blend mode for transparency
|
// Set OpenGL blend mode for transparency
|
||||||
gl.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
gl.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
||||||
bool wireframeEnabled = context()->settings().radarWireframeEnabled_;
|
const bool wireframeEnabled = context()->settings().radarWireframeEnabled_;
|
||||||
if (wireframeEnabled)
|
if (wireframeEnabled)
|
||||||
{
|
{
|
||||||
// Set polygon mode to draw wireframe
|
// Set polygon mode to draw wireframe
|
||||||
|
|
|
||||||
|
|
@ -157,28 +157,27 @@ std::size_t MapSettings::count() const
|
||||||
return kCount_;
|
return kCount_;
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsVariable<std::string>& MapSettings::map_style(std::size_t i) const
|
SettingsVariable<std::string>& MapSettings::map_style(std::size_t i)
|
||||||
{
|
{
|
||||||
return p->map_.at(i).mapStyle_;
|
return p->map_.at(i).mapStyle_;
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsVariable<std::string>& MapSettings::radar_site(std::size_t i) const
|
SettingsVariable<std::string>& MapSettings::radar_site(std::size_t i)
|
||||||
{
|
{
|
||||||
return p->map_.at(i).radarSite_;
|
return p->map_.at(i).radarSite_;
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsVariable<std::string>&
|
SettingsVariable<std::string>& MapSettings::radar_product_group(std::size_t i)
|
||||||
MapSettings::radar_product_group(std::size_t i) const
|
|
||||||
{
|
{
|
||||||
return p->map_.at(i).radarProductGroup_;
|
return p->map_.at(i).radarProductGroup_;
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsVariable<std::string>& MapSettings::radar_product(std::size_t i) const
|
SettingsVariable<std::string>& MapSettings::radar_product(std::size_t i)
|
||||||
{
|
{
|
||||||
return p->map_.at(i).radarProduct_;
|
return p->map_.at(i).radarProduct_;
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsVariable<bool>& MapSettings::smoothing_enabled(std::size_t i) const
|
SettingsVariable<bool>& MapSettings::smoothing_enabled(std::size_t i)
|
||||||
{
|
{
|
||||||
return p->map_.at(i).smoothingEnabled_;
|
return p->map_.at(i).smoothingEnabled_;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,11 +26,11 @@ public:
|
||||||
MapSettings& operator=(MapSettings&&) noexcept;
|
MapSettings& operator=(MapSettings&&) noexcept;
|
||||||
|
|
||||||
std::size_t count() const;
|
std::size_t count() const;
|
||||||
SettingsVariable<std::string>& map_style(std::size_t i) const;
|
SettingsVariable<std::string>& map_style(std::size_t i);
|
||||||
SettingsVariable<std::string>& radar_site(std::size_t i) const;
|
SettingsVariable<std::string>& radar_site(std::size_t i);
|
||||||
SettingsVariable<std::string>& radar_product_group(std::size_t i) const;
|
SettingsVariable<std::string>& radar_product_group(std::size_t i);
|
||||||
SettingsVariable<std::string>& radar_product(std::size_t i) const;
|
SettingsVariable<std::string>& radar_product(std::size_t i);
|
||||||
SettingsVariable<bool>& smoothing_enabled(std::size_t i) const;
|
SettingsVariable<bool>& smoothing_enabled(std::size_t i);
|
||||||
|
|
||||||
bool Shutdown();
|
bool Shutdown();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -539,8 +539,8 @@ void SettingsDialogImpl::SetupGeneralTab()
|
||||||
self_,
|
self_,
|
||||||
[this](const QString& text)
|
[this](const QString& text)
|
||||||
{
|
{
|
||||||
types::UiStyle style = types::GetUiStyle(text.toStdString());
|
const types::UiStyle style = types::GetUiStyle(text.toStdString());
|
||||||
bool themeFileEnabled = style == types::UiStyle::FusionCustom;
|
const bool themeFileEnabled = style == types::UiStyle::FusionCustom;
|
||||||
|
|
||||||
self_->ui->themeFileLineEdit->setEnabled(themeFileEnabled);
|
self_->ui->themeFileLineEdit->setEnabled(themeFileEnabled);
|
||||||
self_->ui->themeFileSelectButton->setEnabled(themeFileEnabled);
|
self_->ui->themeFileSelectButton->setEnabled(themeFileEnabled);
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,9 @@ static constexpr std::uint32_t kMaxRadialGates_ =
|
||||||
common::MAX_0_5_DEGREE_RADIALS * common::MAX_DATA_MOMENT_GATES;
|
common::MAX_0_5_DEGREE_RADIALS * common::MAX_DATA_MOMENT_GATES;
|
||||||
static constexpr std::uint32_t kMaxCoordinates_ = kMaxRadialGates_ * 2u;
|
static constexpr std::uint32_t kMaxCoordinates_ = kMaxRadialGates_ * 2u;
|
||||||
|
|
||||||
|
static constexpr std::uint8_t kDataWordSize8_ = 8u;
|
||||||
|
static constexpr std::uint8_t kDataWordSize16_ = 16u;
|
||||||
|
|
||||||
static constexpr std::size_t kVerticesPerGate_ = 6u;
|
static constexpr std::size_t kVerticesPerGate_ = 6u;
|
||||||
static constexpr std::size_t kVerticesPerOriginGate_ = 3u;
|
static constexpr std::size_t kVerticesPerOriginGate_ = 3u;
|
||||||
|
|
||||||
|
|
@ -108,6 +111,12 @@ public:
|
||||||
threadPool_.join();
|
threadPool_.join();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Impl(const Impl&) = delete;
|
||||||
|
Impl& operator=(const Impl&) = delete;
|
||||||
|
|
||||||
|
Impl(Impl&&) noexcept = default;
|
||||||
|
Impl& operator=(Impl&&) noexcept = default;
|
||||||
|
|
||||||
void ComputeCoordinates(
|
void ComputeCoordinates(
|
||||||
const std::shared_ptr<wsr88d::rda::ElevationScan>& radarData,
|
const std::shared_ptr<wsr88d::rda::ElevationScan>& radarData,
|
||||||
bool smoothingEnabled);
|
bool smoothingEnabled);
|
||||||
|
|
@ -119,7 +128,7 @@ public:
|
||||||
|
|
||||||
void ComputeEdgeValue();
|
void ComputeEdgeValue();
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline T RemapDataMoment(T dataMoment) const;
|
[[nodiscard]] inline T RemapDataMoment(T dataMoment) const;
|
||||||
|
|
||||||
static bool IsRadarDataIncomplete(
|
static bool IsRadarDataIncomplete(
|
||||||
const std::shared_ptr<const wsr88d::rda::ElevationScan>& radarData);
|
const std::shared_ptr<const wsr88d::rda::ElevationScan>& radarData);
|
||||||
|
|
@ -130,7 +139,8 @@ public:
|
||||||
boost::asio::thread_pool threadPool_ {1u};
|
boost::asio::thread_pool threadPool_ {1u};
|
||||||
|
|
||||||
common::Level2Product product_;
|
common::Level2Product product_;
|
||||||
wsr88d::rda::DataBlockType dataBlockType_;
|
wsr88d::rda::DataBlockType dataBlockType_ {
|
||||||
|
wsr88d::rda::DataBlockType::Unknown};
|
||||||
|
|
||||||
float selectedElevation_;
|
float selectedElevation_;
|
||||||
|
|
||||||
|
|
@ -525,9 +535,9 @@ void Level2ProductView::ComputeSweep()
|
||||||
|
|
||||||
std::shared_ptr<manager::RadarProductManager> radarProductManager =
|
std::shared_ptr<manager::RadarProductManager> radarProductManager =
|
||||||
radar_product_manager();
|
radar_product_manager();
|
||||||
const bool smoothingEnabled = smoothing_enabled();
|
const bool smoothingEnabled = smoothing_enabled();
|
||||||
p->showSmoothedRangeFolding_ = show_smoothed_range_folding();
|
p->showSmoothedRangeFolding_ = show_smoothed_range_folding();
|
||||||
bool& showSmoothedRangeFolding = p->showSmoothedRangeFolding_;
|
const bool& showSmoothedRangeFolding = p->showSmoothedRangeFolding_;
|
||||||
|
|
||||||
std::shared_ptr<wsr88d::rda::ElevationScan> radarData;
|
std::shared_ptr<wsr88d::rda::ElevationScan> radarData;
|
||||||
std::chrono::system_clock::time_point requestedTime {selected_time()};
|
std::chrono::system_clock::time_point requestedTime {selected_time()};
|
||||||
|
|
@ -661,7 +671,7 @@ void Level2ProductView::ComputeSweep()
|
||||||
const auto& radialPair = *it;
|
const auto& radialPair = *it;
|
||||||
std::uint16_t radial = radialPair.first;
|
std::uint16_t radial = radialPair.first;
|
||||||
const auto& radialData = radialPair.second;
|
const auto& radialData = radialPair.second;
|
||||||
std::shared_ptr<wsr88d::rda::GenericRadarData::MomentDataBlock>
|
const std::shared_ptr<wsr88d::rda::GenericRadarData::MomentDataBlock>
|
||||||
momentData = radialData->moment_data_block(p->dataBlockType_);
|
momentData = radialData->moment_data_block(p->dataBlockType_);
|
||||||
|
|
||||||
if (momentData0->data_word_size() != momentData->data_word_size())
|
if (momentData0->data_word_size() != momentData->data_word_size())
|
||||||
|
|
@ -748,7 +758,7 @@ void Level2ProductView::ComputeSweep()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextMomentData->data_word_size() == 8)
|
if (nextMomentData->data_word_size() == kDataWordSize8_)
|
||||||
{
|
{
|
||||||
nextDataMomentsArray8 = reinterpret_cast<const std::uint8_t*>(
|
nextDataMomentsArray8 = reinterpret_cast<const std::uint8_t*>(
|
||||||
nextMomentData->data_moments());
|
nextMomentData->data_moments());
|
||||||
|
|
@ -783,7 +793,7 @@ void Level2ProductView::ComputeSweep()
|
||||||
{
|
{
|
||||||
if (!smoothingEnabled)
|
if (!smoothingEnabled)
|
||||||
{
|
{
|
||||||
std::uint8_t dataValue = dataMomentsArray8[i];
|
const std::uint8_t& dataValue = dataMomentsArray8[i];
|
||||||
if (dataValue < snrThreshold && dataValue != RANGE_FOLDED)
|
if (dataValue < snrThreshold && dataValue != RANGE_FOLDED)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -791,7 +801,7 @@ void Level2ProductView::ComputeSweep()
|
||||||
|
|
||||||
for (std::size_t m = 0; m < vertexCount; m++)
|
for (std::size_t m = 0; m < vertexCount; m++)
|
||||||
{
|
{
|
||||||
dataMoments8[mIndex++] = dataMomentsArray8[i];
|
dataMoments8[mIndex++] = dataValue;
|
||||||
|
|
||||||
if (cfpMomentsArray != nullptr)
|
if (cfpMomentsArray != nullptr)
|
||||||
{
|
{
|
||||||
|
|
@ -851,7 +861,7 @@ void Level2ProductView::ComputeSweep()
|
||||||
{
|
{
|
||||||
if (!smoothingEnabled)
|
if (!smoothingEnabled)
|
||||||
{
|
{
|
||||||
std::uint16_t dataValue = dataMomentsArray16[i];
|
const std::uint16_t& dataValue = dataMomentsArray16[i];
|
||||||
if (dataValue < snrThreshold && dataValue != RANGE_FOLDED)
|
if (dataValue < snrThreshold && dataValue != RANGE_FOLDED)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -859,7 +869,7 @@ void Level2ProductView::ComputeSweep()
|
||||||
|
|
||||||
for (std::size_t m = 0; m < vertexCount; m++)
|
for (std::size_t m = 0; m < vertexCount; m++)
|
||||||
{
|
{
|
||||||
dataMoments16[mIndex++] = dataMomentsArray16[i];
|
dataMoments16[mIndex++] = dataValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (gate > 0)
|
else if (gate > 0)
|
||||||
|
|
@ -924,18 +934,19 @@ void Level2ProductView::ComputeSweep()
|
||||||
|
|
||||||
const std::uint16_t baseCoord = gate - 1;
|
const std::uint16_t baseCoord = gate - 1;
|
||||||
|
|
||||||
std::size_t offset1 = ((startRadial + radial) % vertexRadials *
|
const std::size_t offset1 =
|
||||||
common::MAX_DATA_MOMENT_GATES +
|
((startRadial + radial) % vertexRadials *
|
||||||
baseCoord) *
|
common::MAX_DATA_MOMENT_GATES +
|
||||||
2;
|
baseCoord) *
|
||||||
std::size_t offset2 =
|
2;
|
||||||
|
const std::size_t offset2 =
|
||||||
offset1 + static_cast<std::size_t>(gateSize) * 2;
|
offset1 + static_cast<std::size_t>(gateSize) * 2;
|
||||||
std::size_t offset3 =
|
const std::size_t offset3 =
|
||||||
(((startRadial + radial + 1) % vertexRadials) *
|
(((startRadial + radial + 1) % vertexRadials) *
|
||||||
common::MAX_DATA_MOMENT_GATES +
|
common::MAX_DATA_MOMENT_GATES +
|
||||||
baseCoord) *
|
baseCoord) *
|
||||||
2;
|
2;
|
||||||
std::size_t offset4 =
|
const std::size_t offset4 =
|
||||||
offset3 + static_cast<std::size_t>(gateSize) * 2;
|
offset3 + static_cast<std::size_t>(gateSize) * 2;
|
||||||
|
|
||||||
vertices[vIndex++] = coordinates[offset1];
|
vertices[vIndex++] = coordinates[offset1];
|
||||||
|
|
@ -955,8 +966,6 @@ void Level2ProductView::ComputeSweep()
|
||||||
|
|
||||||
vertices[vIndex++] = coordinates[offset4];
|
vertices[vIndex++] = coordinates[offset4];
|
||||||
vertices[vIndex++] = coordinates[offset4 + 1];
|
vertices[vIndex++] = coordinates[offset4 + 1];
|
||||||
|
|
||||||
vertexCount = kVerticesPerGate_;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -980,8 +989,6 @@ void Level2ProductView::ComputeSweep()
|
||||||
|
|
||||||
vertices[vIndex++] = coordinates[offset2];
|
vertices[vIndex++] = coordinates[offset2];
|
||||||
vertices[vIndex++] = coordinates[offset2 + 1];
|
vertices[vIndex++] = coordinates[offset2 + 1];
|
||||||
|
|
||||||
vertexCount = kVerticesPerOriginGate_;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -489,8 +489,8 @@ std::uint8_t Level3ProductView::ComputeEdgeValue() const
|
||||||
{
|
{
|
||||||
std::uint8_t edgeValue = 0;
|
std::uint8_t edgeValue = 0;
|
||||||
|
|
||||||
std::shared_ptr<wsr88d::rpg::ProductDescriptionBlock> descriptionBlock =
|
const std::shared_ptr<wsr88d::rpg::ProductDescriptionBlock>
|
||||||
p->graphicMessage_->description_block();
|
descriptionBlock = p->graphicMessage_->description_block();
|
||||||
|
|
||||||
const float offset = descriptionBlock->offset();
|
const float offset = descriptionBlock->offset();
|
||||||
const float scale = descriptionBlock->scale();
|
const float scale = descriptionBlock->scale();
|
||||||
|
|
@ -498,11 +498,12 @@ std::uint8_t Level3ProductView::ComputeEdgeValue() const
|
||||||
switch (p->category_)
|
switch (p->category_)
|
||||||
{
|
{
|
||||||
case common::Level3ProductCategory::Velocity:
|
case common::Level3ProductCategory::Velocity:
|
||||||
edgeValue = (scale > 0.0f) ? (-offset / scale) : -offset;
|
edgeValue = static_cast<std::uint8_t>((scale > 0.0f) ? (-offset / scale) :
|
||||||
|
-offset);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case common::Level3ProductCategory::DifferentialReflectivity:
|
case common::Level3ProductCategory::DifferentialReflectivity:
|
||||||
edgeValue = -offset;
|
edgeValue = static_cast<std::uint8_t>(-offset);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case common::Level3ProductCategory::SpectrumWidth:
|
case common::Level3ProductCategory::SpectrumWidth:
|
||||||
|
|
@ -512,7 +513,8 @@ std::uint8_t Level3ProductView::ComputeEdgeValue() const
|
||||||
|
|
||||||
case common::Level3ProductCategory::CorrelationCoefficient:
|
case common::Level3ProductCategory::CorrelationCoefficient:
|
||||||
edgeValue = static_cast<std::uint8_t>(
|
edgeValue = static_cast<std::uint8_t>(
|
||||||
std::max<std::uint16_t>(255, descriptionBlock->number_of_levels()));
|
std::max<std::uint16_t>(std::numeric_limits<std::uint8_t>::max(),
|
||||||
|
descriptionBlock->number_of_levels()));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case common::Level3ProductCategory::Reflectivity:
|
case common::Level3ProductCategory::Reflectivity:
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ protected:
|
||||||
void DisconnectRadarProductManager() override;
|
void DisconnectRadarProductManager() override;
|
||||||
void UpdateColorTableLut() override;
|
void UpdateColorTableLut() override;
|
||||||
|
|
||||||
std::uint8_t ComputeEdgeValue() const;
|
[[nodiscard]] std::uint8_t ComputeEdgeValue() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class Impl;
|
class Impl;
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,8 @@ public:
|
||||||
const std::shared_ptr<wsr88d::rpg::GenericRadialDataPacket>& radialData,
|
const std::shared_ptr<wsr88d::rpg::GenericRadialDataPacket>& radialData,
|
||||||
bool smoothingEnabled);
|
bool smoothingEnabled);
|
||||||
|
|
||||||
inline std::uint8_t RemapDataMoment(std::uint8_t dataMoment) const;
|
[[nodiscard]] inline std::uint8_t
|
||||||
|
RemapDataMoment(std::uint8_t dataMoment) const;
|
||||||
|
|
||||||
Level3RadialView* self_;
|
Level3RadialView* self_;
|
||||||
|
|
||||||
|
|
@ -133,9 +134,9 @@ void Level3RadialView::ComputeSweep()
|
||||||
|
|
||||||
std::shared_ptr<manager::RadarProductManager> radarProductManager =
|
std::shared_ptr<manager::RadarProductManager> radarProductManager =
|
||||||
radar_product_manager();
|
radar_product_manager();
|
||||||
const bool smoothingEnabled = smoothing_enabled();
|
const bool smoothingEnabled = smoothing_enabled();
|
||||||
p->showSmoothedRangeFolding_ = show_smoothed_range_folding();
|
p->showSmoothedRangeFolding_ = show_smoothed_range_folding();
|
||||||
bool& showSmoothedRangeFolding = p->showSmoothedRangeFolding_;
|
const bool& showSmoothedRangeFolding = p->showSmoothedRangeFolding_;
|
||||||
|
|
||||||
// Retrieve message from Radar Product Manager
|
// Retrieve message from Radar Product Manager
|
||||||
std::shared_ptr<wsr88d::rpg::Level3Message> message;
|
std::shared_ptr<wsr88d::rpg::Level3Message> message;
|
||||||
|
|
@ -381,7 +382,7 @@ void Level3RadialView::ComputeSweep()
|
||||||
if (!smoothingEnabled)
|
if (!smoothingEnabled)
|
||||||
{
|
{
|
||||||
// Store data moment value
|
// Store data moment value
|
||||||
uint8_t dataValue =
|
const uint8_t dataValue =
|
||||||
(i < dataMomentsArray8.size()) ? dataMomentsArray8[i] : 0;
|
(i < dataMomentsArray8.size()) ? dataMomentsArray8[i] : 0;
|
||||||
if (dataValue < snrThreshold && dataValue != RANGE_FOLDED)
|
if (dataValue < snrThreshold && dataValue != RANGE_FOLDED)
|
||||||
{
|
{
|
||||||
|
|
@ -470,8 +471,6 @@ void Level3RadialView::ComputeSweep()
|
||||||
|
|
||||||
vertices[vIndex++] = coordinates[offset4];
|
vertices[vIndex++] = coordinates[offset4];
|
||||||
vertices[vIndex++] = coordinates[offset4 + 1];
|
vertices[vIndex++] = coordinates[offset4 + 1];
|
||||||
|
|
||||||
vertexCount = 6;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -494,8 +493,6 @@ void Level3RadialView::ComputeSweep()
|
||||||
|
|
||||||
vertices[vIndex++] = coordinates[offset2];
|
vertices[vIndex++] = coordinates[offset2];
|
||||||
vertices[vIndex++] = coordinates[offset2 + 1];
|
vertices[vIndex++] = coordinates[offset2 + 1];
|
||||||
|
|
||||||
vertexCount = 3;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -561,44 +558,46 @@ void Level3RadialView::Impl::ComputeCoordinates(
|
||||||
// size distance from the radar site
|
// size distance from the radar site
|
||||||
1.0f;
|
1.0f;
|
||||||
|
|
||||||
std::for_each(std::execution::par_unseq,
|
std::for_each(
|
||||||
radials.begin(),
|
std::execution::par_unseq,
|
||||||
radials.end(),
|
radials.begin(),
|
||||||
[&](std::uint32_t radial)
|
radials.end(),
|
||||||
{
|
[&](std::uint32_t radial)
|
||||||
float angle = radialData->start_angle(radial);
|
{
|
||||||
|
float angle = radialData->start_angle(radial);
|
||||||
|
|
||||||
if (smoothingEnabled)
|
if (smoothingEnabled)
|
||||||
{
|
{
|
||||||
angle += radialData->delta_angle(radial) * 0.5f;
|
static constexpr float kDeltaAngleFactor = 0.5f;
|
||||||
}
|
angle += radialData->delta_angle(radial) * kDeltaAngleFactor;
|
||||||
|
}
|
||||||
|
|
||||||
std::for_each(std::execution::par_unseq,
|
std::for_each(
|
||||||
gates.begin(),
|
std::execution::par_unseq,
|
||||||
gates.end(),
|
gates.begin(),
|
||||||
[&](std::uint32_t gate)
|
gates.end(),
|
||||||
{
|
[&](std::uint32_t gate)
|
||||||
const std::uint32_t radialGate =
|
{
|
||||||
radial * common::MAX_DATA_MOMENT_GATES +
|
const std::uint32_t radialGate =
|
||||||
gate;
|
radial * common::MAX_DATA_MOMENT_GATES + gate;
|
||||||
const float range =
|
const float range =
|
||||||
(gate + gateRangeOffset) * gateSize;
|
(static_cast<float>(gate) + gateRangeOffset) * gateSize;
|
||||||
const std::size_t offset = radialGate * 2;
|
const std::size_t offset = static_cast<size_t>(radialGate) * 2;
|
||||||
|
|
||||||
double latitude;
|
double latitude = 0.0;
|
||||||
double longitude;
|
double longitude = 0.0;
|
||||||
|
|
||||||
geodesic.Direct(radarLatitude,
|
geodesic.Direct(radarLatitude,
|
||||||
radarLongitude,
|
radarLongitude,
|
||||||
angle,
|
angle,
|
||||||
range,
|
range,
|
||||||
latitude,
|
latitude,
|
||||||
longitude);
|
longitude);
|
||||||
|
|
||||||
coordinates_[offset] = latitude;
|
coordinates_[offset] = static_cast<float>(latitude);
|
||||||
coordinates_[offset + 1] = longitude;
|
coordinates_[offset + 1] = static_cast<float>(longitude);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
timer.stop();
|
timer.stop();
|
||||||
logger_->debug("Coordinates calculated in {}", timer.format(6, "%ws"));
|
logger_->debug("Coordinates calculated in {}", timer.format(6, "%ws"));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,8 @@ public:
|
||||||
}
|
}
|
||||||
~Level3RasterViewImpl() { threadPool_.join(); };
|
~Level3RasterViewImpl() { threadPool_.join(); };
|
||||||
|
|
||||||
inline std::uint8_t RemapDataMoment(std::uint8_t dataMoment) const;
|
[[nodiscard]] inline std::uint8_t
|
||||||
|
RemapDataMoment(std::uint8_t dataMoment) const;
|
||||||
|
|
||||||
boost::asio::thread_pool threadPool_ {1u};
|
boost::asio::thread_pool threadPool_ {1u};
|
||||||
|
|
||||||
|
|
@ -116,9 +117,9 @@ void Level3RasterView::ComputeSweep()
|
||||||
|
|
||||||
std::shared_ptr<manager::RadarProductManager> radarProductManager =
|
std::shared_ptr<manager::RadarProductManager> radarProductManager =
|
||||||
radar_product_manager();
|
radar_product_manager();
|
||||||
const bool smoothingEnabled = smoothing_enabled();
|
const bool smoothingEnabled = smoothing_enabled();
|
||||||
p->showSmoothedRangeFolding_ = show_smoothed_range_folding();
|
p->showSmoothedRangeFolding_ = show_smoothed_range_folding();
|
||||||
bool& showSmoothedRangeFolding = p->showSmoothedRangeFolding_;
|
const bool& showSmoothedRangeFolding = p->showSmoothedRangeFolding_;
|
||||||
|
|
||||||
// Retrieve message from Radar Product Manager
|
// Retrieve message from Radar Product Manager
|
||||||
std::shared_ptr<wsr88d::rpg::Level3Message> message;
|
std::shared_ptr<wsr88d::rpg::Level3Message> message;
|
||||||
|
|
@ -344,10 +345,10 @@ void Level3RasterView::ComputeSweep()
|
||||||
{
|
{
|
||||||
if (!smoothingEnabled)
|
if (!smoothingEnabled)
|
||||||
{
|
{
|
||||||
constexpr size_t vertexCount = 6;
|
static constexpr std::size_t vertexCount = 6;
|
||||||
|
|
||||||
// Store data moment value
|
// Store data moment value
|
||||||
uint8_t dataValue = dataMomentsArray8[bin];
|
const std::uint8_t& dataValue = dataMomentsArray8[bin];
|
||||||
if (dataValue < snrThreshold && dataValue != RANGE_FOLDED)
|
if (dataValue < snrThreshold && dataValue != RANGE_FOLDED)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -47,11 +47,12 @@ public:
|
||||||
virtual std::uint16_t vcp() const = 0;
|
virtual std::uint16_t vcp() const = 0;
|
||||||
virtual const std::vector<float>& vertices() const = 0;
|
virtual const std::vector<float>& vertices() const = 0;
|
||||||
|
|
||||||
std::shared_ptr<manager::RadarProductManager> radar_product_manager() const;
|
[[nodiscard]] std::shared_ptr<manager::RadarProductManager>
|
||||||
std::chrono::system_clock::time_point selected_time() const;
|
radar_product_manager() const;
|
||||||
bool show_smoothed_range_folding() const;
|
[[nodiscard]] std::chrono::system_clock::time_point selected_time() const;
|
||||||
bool smoothing_enabled() const;
|
[[nodiscard]] bool show_smoothed_range_folding() const;
|
||||||
std::mutex& sweep_mutex();
|
[[nodiscard]] bool smoothing_enabled() const;
|
||||||
|
[[nodiscard]] std::mutex& sweep_mutex();
|
||||||
|
|
||||||
void set_radar_product_manager(
|
void set_radar_product_manager(
|
||||||
std::shared_ptr<manager::RadarProductManager> radarProductManager);
|
std::shared_ptr<manager::RadarProductManager> radarProductManager);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue