Added inverted threshold for radar sites

This commit is contained in:
AdenKoperczak 2024-12-10 16:11:53 -05:00
parent f7a1668c3f
commit 74066aa195
5 changed files with 12 additions and 8 deletions

View file

@ -65,7 +65,9 @@ void RadarSiteLayer::Render(
auto mapDistance = util::maplibre::GetMapDistance(params); auto mapDistance = util::maplibre::GetMapDistance(params);
auto threshold = units::length::nautical_miles<double>( auto threshold = units::length::nautical_miles<double>(
settings::GeneralSettings::Instance().radar_site_threshold().GetValue()); settings::GeneralSettings::Instance().radar_site_threshold().GetValue());
if (threshold.value() != 0.0 && mapDistance > threshold)
if (!(threshold.value() == 0.0 || mapDistance <= threshold ||
(threshold.value() < 0 && mapDistance >= -threshold)))
{ {
return; return;
} }

View file

@ -96,8 +96,8 @@ public:
loopTime_.SetMaximum(1440); loopTime_.SetMaximum(1440);
nmeaBaudRate_.SetMinimum(1); nmeaBaudRate_.SetMinimum(1);
nmeaBaudRate_.SetMaximum(999999999); nmeaBaudRate_.SetMaximum(999999999);
radarSiteThreshold_.SetMinimum(0); radarSiteThreshold_.SetMinimum(-10000);
radarSiteThreshold_.SetMaximum(999); radarSiteThreshold_.SetMaximum( 10000);
customStyleDrawLayer_.SetTransform([](const std::string& value) customStyleDrawLayer_.SetTransform([](const std::string& value)
{ return boost::trim_copy(value); }); { return boost::trim_copy(value); });

View file

@ -753,8 +753,7 @@ void SettingsDialogImpl::SetupGeneralTab()
radarSiteThreshold_.SetSettingsVariable( radarSiteThreshold_.SetSettingsVariable(
generalSettings.radar_site_threshold()); generalSettings.radar_site_threshold());
radarSiteThreshold_.SetEditWidget( radarSiteThreshold_.SetEditWidget(self_->ui->radarSiteThresholdSpinBox);
self_->ui->radarSiteThresholdSpinBox);
radarSiteThreshold_.SetResetButton(self_->ui->resetRadarSiteThresholdButton); radarSiteThreshold_.SetResetButton(self_->ui->resetRadarSiteThresholdButton);
antiAliasingEnabled_.SetSettingsVariable( antiAliasingEnabled_.SetSettingsVariable(

View file

@ -135,7 +135,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>-302</y> <y>-303</y>
<width>511</width> <width>511</width>
<height>733</height> <height>733</height>
</rect> </rect>
@ -575,8 +575,11 @@
<property name="decimals"> <property name="decimals">
<number>0</number> <number>0</number>
</property> </property>
<property name="minimum">
<double>-10000.000000000000000</double>
</property>
<property name="maximum"> <property name="maximum">
<double>999.000000000000000</double> <double>10000.000000000000000</double>
</property> </property>
<property name="stepType"> <property name="stepType">
<enum>QAbstractSpinBox::StepType::DefaultStepType</enum> <enum>QAbstractSpinBox::StepType::DefaultStepType</enum>

@ -1 +1 @@
Subproject commit 0eb475909f9e64ce81e7b8b39420d980b81b3baa Subproject commit 4b4d9c54b8218aa2297dbd457e3747091570f0d2