Skip to content
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

AP_Generator: rename fuel_remain_pct to fuel_remain_scale #23168

Merged
merged 2 commits into from
Mar 15, 2023

Conversation

peterbarker
Copy link
Contributor

This is a scale, not a percentage.

It's used as such and commented as such.

This has caused at least one bug.

This work sponsored by Harris Aerial

@peterbarker peterbarker force-pushed the pr/fuel-remain-pct branch 3 times, most recently from ee5013e to acdc64d Compare March 10, 2023 07:04
@peterbarker peterbarker changed the title AP_Generator: rename fuel_remain_pct to fuel_remain_pct AP_Generator: rename fuel_remain_pct to fuel_remain_scale Mar 10, 2023
@hendjoshsr71
Copy link
Member

Not gonna argue with fixing a bug.
So just a comment.

I would probably prefer something that moves towards keeps things in percent since we already have functions for remaining_pct?

virtual bool capacity_remaining_pct(uint8_t &percentage) const WARN_IF_UNUSED;

@@ -40,7 +40,7 @@ void AP_Generator_IE_650_800::assign_measurements(const uint32_t now)
_err_code = _parsed.err_code;

// Update variables to be returned to front end
_fuel_remain_pct = _parsed.tank_pct * 0.01;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed on the dev call and the decision was to remove the suffix or use "_proportion". I'm happy with either these ideas.

@peterbarker
Copy link
Contributor Author

Not gonna argue with fixing a bug. So just a comment.

I would probably prefer something that moves towards keeps things in percent since we already have functions for remaining_pct?

virtual bool capacity_remaining_pct(uint8_t &percentage) const WARN_IF_UNUSED;

Only fixing the AP_Generator interface here :-)

@peterbarker peterbarker merged commit a32180f into ArduPilot:master Mar 15, 2023
@peterbarker peterbarker deleted the pr/fuel-remain-pct branch March 16, 2023 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants