-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Radar site threshold #319
Radar site threshold #319
Changes from all commits
f7a1668
74066aa
7dabda8
9174a4d
c0b7f85
9d0c1c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,6 +78,7 @@ class GeneralSettings::Impl | |
updateNotificationsEnabled_.SetDefault(true); | ||
warningsProvider_.SetDefault(defaultWarningsProviderValue); | ||
cursorIconAlwaysOn_.SetDefault(false); | ||
radarSiteThreshold_.SetDefault(0.0); | ||
|
||
fontSizes_.SetElementMinimum(1); | ||
fontSizes_.SetElementMaximum(72); | ||
|
@@ -95,6 +96,8 @@ class GeneralSettings::Impl | |
loopTime_.SetMaximum(1440); | ||
nmeaBaudRate_.SetMinimum(1); | ||
nmeaBaudRate_.SetMaximum(999999999); | ||
radarSiteThreshold_.SetMinimum(-10000); | ||
radarSiteThreshold_.SetMaximum(10000); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: 10000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers] radarSiteThreshold_.SetMaximum(10000);
^ |
||
|
||
customStyleDrawLayer_.SetTransform([](const std::string& value) | ||
{ return boost::trim_copy(value); }); | ||
|
@@ -168,6 +171,7 @@ class GeneralSettings::Impl | |
SettingsVariable<bool> updateNotificationsEnabled_ {"update_notifications"}; | ||
SettingsVariable<std::string> warningsProvider_ {"warnings_provider"}; | ||
SettingsVariable<bool> cursorIconAlwaysOn_ {"cursor_icon_always_on"}; | ||
SettingsVariable<double> radarSiteThreshold_ {"radar_site_threshold"}; | ||
}; | ||
|
||
GeneralSettings::GeneralSettings() : | ||
|
@@ -201,7 +205,8 @@ GeneralSettings::GeneralSettings() : | |
&p->trackLocation_, | ||
&p->updateNotificationsEnabled_, | ||
&p->warningsProvider_, | ||
&p->cursorIconAlwaysOn_}); | ||
&p->cursorIconAlwaysOn_, | ||
&p->radarSiteThreshold_}); | ||
SetDefaults(); | ||
} | ||
GeneralSettings::~GeneralSettings() = default; | ||
|
@@ -356,6 +361,11 @@ SettingsVariable<bool>& GeneralSettings::cursor_icon_always_on() const | |
return p->cursorIconAlwaysOn_; | ||
} | ||
|
||
SettingsVariable<double>& GeneralSettings::radar_site_threshold() const | ||
{ | ||
return p->radarSiteThreshold_; | ||
} | ||
|
||
bool GeneralSettings::Shutdown() | ||
{ | ||
bool dataChanged = false; | ||
|
@@ -406,7 +416,8 @@ bool operator==(const GeneralSettings& lhs, const GeneralSettings& rhs) | |
lhs.p->updateNotificationsEnabled_ == | ||
rhs.p->updateNotificationsEnabled_ && | ||
lhs.p->warningsProvider_ == rhs.p->warningsProvider_ && | ||
lhs.p->cursorIconAlwaysOn_ == rhs.p->cursorIconAlwaysOn_); | ||
lhs.p->cursorIconAlwaysOn_ == rhs.p->cursorIconAlwaysOn_ && | ||
lhs.p->radarSiteThreshold_ == rhs.p->radarSiteThreshold_); | ||
} | ||
|
||
} // namespace settings | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -54,6 +54,7 @@ class GeneralSettings : public SettingsCategory | |||||
SettingsVariable<bool>& update_notifications_enabled() const; | ||||||
SettingsVariable<std::string>& warnings_provider() const; | ||||||
SettingsVariable<bool>& cursor_icon_always_on() const; | ||||||
SettingsVariable<double>& radar_site_threshold() const; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: function 'radar_site_threshold' should be marked [[nodiscard]] [modernize-use-nodiscard]
Suggested change
|
||||||
|
||||||
static GeneralSettings& Instance(); | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 10000 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]
radarSiteThreshold_.SetMinimum(-10000); ^