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 threshold = units::length::nautical_miles<double>(
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;
}

View file

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

View file

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

View file

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