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

Fix auto_profile_cell_count range #2993

Merged

Conversation

haslinghuis
Copy link
Member

Fixes: #2992

@haslinghuis haslinghuis added this to the 10.9.0 milestone Aug 14, 2022
@haslinghuis haslinghuis self-assigned this Aug 14, 2022
@github-actions

This comment has been minimized.

@blckmn
Copy link
Member

blckmn commented Aug 14, 2022

AUTOMERGE: (FAIL)

  • github identifies PR as mergeable -> FAIL
  • assigned to a milestone -> PASS
  • cooling off period lapsed -> PASS
  • commit count less or equal to three -> PASS
  • Don't merge label NOT found -> PASS
  • at least one RN: label found -> PASS
  • Tested label found -> PASS
  • assigned to an approver -> PASS
  • approver count at least three -> FAIL

Copy link
Member

@McGiverGim McGiverGim left a comment

Choose a reason for hiding this comment

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

To me is complicated to know what is 0 and 1. Maybe change this to a select? With -1 and 0 with some text like "Switch" and "Stay" and the 1 to 8 elements with something like 1S to 8S? With this and some tooltip describing the values will be great: betaflight/betaflight#7516

@haslinghuis haslinghuis force-pushed the fix-auto-profile-cell-count-range branch 3 times, most recently from 2eccf71 to b821527 Compare August 17, 2022 21:12
@github-actions

This comment has been minimized.

@haslinghuis
Copy link
Member Author

Updated with suggestion from @McGiverGim

asizon
asizon previously approved these changes Aug 30, 2022
},
"pidTuningCellCountStay": {
"message": "Disable",
"desciption": "Disable cell count for this profile"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"desciption": "Disable cell count for this profile"
"description": "Disable cell count for this profile"

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy pasta error. Fixed.

},
"pidTuningCellCountChange": {
"message": "Switch",
"desciption": "Use this profile if there no profiles matching cell count"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"desciption": "Use this profile if there no profiles matching cell count"
"description": "Use this profile if there no profiles matching cell count"

Copy link
Member

Choose a reason for hiding this comment

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

The description is used to give context to translators. I'm not too sure if this description can help. Is more a good tooltip than a context for the word.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@sonarcloud
Copy link

sonarcloud bot commented Sep 15, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@McGiverGim McGiverGim left a comment

Choose a reason for hiding this comment

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

The descriptions can be better but I approve it.
Think that translators only see a word "switch" and the description. It's good give information about the context: one of the options for auto profile switching depending on the battery capacity.

@github-actions
Copy link
Contributor

Do you want to test this code? Here you have an automated build:
Betaflight-Configurator-Android
Betaflight-Configurator-Linux
Betaflight-Configurator-macOS
Betaflight-Configurator-Windows
WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!

@haslinghuis haslinghuis moved this from Configurator to Ready to merge in Finalizing Firmware 4.4 Release Sep 17, 2022
@blckmn blckmn merged commit 0718559 into betaflight:master Sep 17, 2022
Finalizing Firmware 4.4 Release automation moved this from Ready to merge to Closed Sep 17, 2022
@haslinghuis haslinghuis deleted the fix-auto-profile-cell-count-range branch September 18, 2022 08:14
@RipperDrone
Copy link
Contributor

RipperDrone commented Sep 18, 2022

@McGiverGim Great addition, didn't even think so far. Perfect clarity now 👍❤️. Is it backwards compatible also, e.g. when users had set the switch to - 1 for 'default for all other cases where battery S is not covered by a distinct profile'? This would be of great value...

@haslinghuis
Copy link
Member Author

@RipperDrone in GUI -1 was not selectable before this change.

@RipperDrone
Copy link
Contributor

RipperDrone commented Sep 18, 2022

@haslinghuis Maybe - I even remember I DID set it up in BFC (though I might be wrong). Anyway, it was a well documented CLI setting which then DID show up in the GUI - and which I have now preset on my 50+ quads... PITA to change 'em all :-(. Why not just keep the numbering scheme of designators whilest displaying a more descriptive text in BFC which definitely is a good thing to do?

@McGiverGim
Copy link
Member

You don't understand how this works. The description has nothing to do with the internal value. Check nightly and you will see

@RipperDrone
Copy link
Contributor

RipperDrone commented Sep 18, 2022

You don't understand how this works. The description has nothing to do with the internal value. Check nightly and you will see

sry, I'm not an experienced coder to be fully able to interpret the code. However, looking at your assignments in the code snippet below, I'm assuming there is a NEW meaning of -1 as a value now (?), therefore my interpretation was that the code now is NOT backwards compatible anymore to quads that have had a '-1' setting stored in their diffs (= fallback profile to be used in case there was no distinct matching cell count found in any other profile).

Can you pls confirm whether backwards compatibility to previous CLI values/enum is preserved or broken?

image

@haslinghuis
Copy link
Member Author

This PR only fixes the bug that -1 value in UI was not selectable and added a switch and meaningful labels for the available range. Cli is using it's own interface to communicate with firmware and has not been changed.

@RipperDrone
Copy link
Contributor

RipperDrone commented Sep 18, 2022

Thank you for explaining 👍😍. I must have been misreading the code assuming the -1 setting got a new meaning...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants