Add smoothing settings

This commit is contained in:
Dan Paulat 2024-12-14 22:36:25 -06:00
parent 172203ec16
commit 3e681abfdb
5 changed files with 38 additions and 7 deletions

View file

@ -15,12 +15,15 @@ class ProductSettings::Impl
public:
explicit Impl()
{
showSmoothedRangeFolding_.SetDefault(false);
stiForecastEnabled_.SetDefault(true);
stiPastEnabled_.SetDefault(true);
}
~Impl() {}
SettingsVariable<bool> showSmoothedRangeFolding_ {
"show_smoothed_range_folding"};
SettingsVariable<bool> stiForecastEnabled_ {"sti_forecast_enabled"};
SettingsVariable<bool> stiPastEnabled_ {"sti_past_enabled"};
};
@ -28,7 +31,9 @@ public:
ProductSettings::ProductSettings() :
SettingsCategory("product"), p(std::make_unique<Impl>())
{
RegisterVariables({&p->stiForecastEnabled_, &p->stiPastEnabled_});
RegisterVariables({&p->showSmoothedRangeFolding_,
&p->stiForecastEnabled_,
&p->stiPastEnabled_});
SetDefaults();
}
ProductSettings::~ProductSettings() = default;
@ -37,6 +42,11 @@ ProductSettings::ProductSettings(ProductSettings&&) noexcept = default;
ProductSettings&
ProductSettings::operator=(ProductSettings&&) noexcept = default;
SettingsVariable<bool>& ProductSettings::show_smoothed_range_folding() const
{
return p->showSmoothedRangeFolding_;
}
SettingsVariable<bool>& ProductSettings::sti_forecast_enabled() const
{
return p->stiForecastEnabled_;
@ -66,7 +76,9 @@ ProductSettings& ProductSettings::Instance()
bool operator==(const ProductSettings& lhs, const ProductSettings& rhs)
{
return (lhs.p->stiForecastEnabled_ == rhs.p->stiForecastEnabled_ &&
return (lhs.p->showSmoothedRangeFolding_ ==
rhs.p->showSmoothedRangeFolding_ &&
lhs.p->stiForecastEnabled_ == rhs.p->stiForecastEnabled_ &&
lhs.p->stiPastEnabled_ == rhs.p->stiPastEnabled_);
}