betaflight-configurator icon indicating copy to clipboard operation
betaflight-configurator copied to clipboard

Fix auto_profile_cell_count range

Open haslinghuis opened this issue 2 years ago • 3 comments

Fixes: #2992

haslinghuis avatar Aug 14 '22 16:08 haslinghuis

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!

github-actions[bot] avatar Aug 14 '22 16:08 github-actions[bot]

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

blckmn avatar Aug 14 '22 18:08 blckmn

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!

github-actions[bot] avatar Aug 17 '22 21:08 github-actions[bot]

Updated with suggestion from @McGiverGim

haslinghuis avatar Aug 17 '22 21:08 haslinghuis

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

sonarqubecloud[bot] avatar Sep 15 '22 19:09 sonarqubecloud[bot]

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!

github-actions[bot] avatar Sep 15 '22 19:09 github-actions[bot]

@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...

RipperDrone avatar Sep 18 '22 08:09 RipperDrone

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

haslinghuis avatar Sep 18 '22 11:09 haslinghuis

@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?

RipperDrone avatar Sep 18 '22 13:09 RipperDrone

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

McGiverGim avatar Sep 18 '22 13:09 McGiverGim

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

RipperDrone avatar Sep 18 '22 14:09 RipperDrone

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.

haslinghuis avatar Sep 18 '22 15:09 haslinghuis

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

RipperDrone avatar Sep 18 '22 18:09 RipperDrone