-
-
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
Conversation
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.
clang-tidy made some suggestions
@@ -95,6 +96,8 @@ class GeneralSettings::Impl | |||
loopTime_.SetMaximum(1440); | |||
nmeaBaudRate_.SetMinimum(1); | |||
nmeaBaudRate_.SetMaximum(999999999); | |||
radarSiteThreshold_.SetMinimum(-10000); |
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);
^
@@ -95,6 +96,8 @@ | |||
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 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_.SetMaximum(10000);
^
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'radar_site_threshold' should be marked [[nodiscard]] [modernize-use-nodiscard]
SettingsVariable<double>& radar_site_threshold() const; | |
[[nodiscard]] SettingsVariable<double>& radar_site_threshold() const; |
I agree a tooltip would be appropriate here. A checkbox and second setting could be used too, but I don't think it's necessary. I do think 0 to disable is fine, but with placefiles, >= 999 also disables (at least in the shader, although placefile text doesn't respect this).
I agree following the distance units option for consistency is best. Most users don't deal directly with placefile contents, so I don't think consistency there is necessary.
I agree with both linting suggestions, and that both can be taken care of in another PR. |
9c06bcb
to
7b1b56e
Compare
I added tooltip to this and alert radius, and changed the units to match with alert radius. |
7b1b56e
to
9d0c1c5
Compare
Another quality of life feature for looking at nationwide radar/placefiles.
Settings
Linting
NOLINTBEGIN(readability-magic-numbers)
/NOLINTEND
+ comment to avoid this in the future if you agree.[[nodiscard]]
. This should probably be fixed for all settings in one pull or commit.I can make a separate pull request for these if you think that would be best.