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

Throttle curve now respects throttle scale and clip #3879

Merged

Conversation

ChrisRosser
Copy link
Contributor

@ChrisRosser ChrisRosser commented Apr 7, 2024

I think the maths for this is now sorted so I've opened a fresh PR to keep things clean. Fixes #3852

@haslinghuis Please feel free to review now. @McGiverGim Please feel free to use this in your own PR and close this PR.

Copy link

netlify bot commented Apr 7, 2024

Deploy Preview for origin-betaflight-configurator ready!

Name Link
🔨 Latest commit b3a75c4
🔍 Latest deploy log https://app.netlify.com/sites/origin-betaflight-configurator/deploys/6613ee79ba4b7200089a1b1d
😎 Deploy Preview https://deploy-preview-3879--origin-betaflight-configurator.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

src/js/tabs/pid_tuning.js Outdated Show resolved Hide resolved
src/js/tabs/pid_tuning.js Outdated Show resolved Hide resolved
@ChrisRosser
Copy link
Contributor Author

@haslinghuis I've fixed those comments.

This comment has been minimized.

@ChrisRosser
Copy link
Contributor Author

ChrisRosser commented Apr 7, 2024

@haslinghuis This is now ready to merge I think! I've added an extra line to make the little blob you get when the receiver is connected move along the new line correctly. I've also tested the build.

Copy link
Member

@haslinghuis haslinghuis left a comment

Choose a reason for hiding this comment

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

LGTM!

src/js/tabs/pid_tuning.js Outdated Show resolved Hide resolved
src/js/tabs/pid_tuning.js Outdated Show resolved Hide resolved

This comment has been minimized.

@ChrisRosser
Copy link
Contributor Author

LGTM!

Suggestions accepted. Squash and merge!

This comment has been minimized.

@ChrisRosser ChrisRosser force-pushed the add-inverse-bezier-curve-function branch from 2df2f5f to db4127a Compare April 7, 2024 16:51

This comment has been minimized.

Update pid_tuning.js

Update pid_tuning.js
@ChrisRosser ChrisRosser force-pushed the add-inverse-bezier-curve-function branch from db4127a to afafa3e Compare April 8, 2024 06:33
ChrisRosser and others added 3 commits April 8, 2024 10:26
Co-authored-by: Mark Haslinghuis <[email protected]>
Co-authored-by: Mark Haslinghuis <[email protected]>
Co-authored-by: Mark Haslinghuis <[email protected]>

This comment has been minimized.

@@ -1738,29 +1759,52 @@ pid_tuning.initialize = function (callback) {
throttleCurve.width = throttleCurve.height *
(throttleCurve.clientWidth / throttleCurve.clientHeight);

const throttleScale = throttleLimitType === THROTTLE_LIMIT_TYPES.SCALE ? throttleLimitPercent : 1;
const canvasHeight = throttleCurve.height;
const canvasWidth = throttleCurve.width;

// math magic by englishman
Copy link
Member

Choose a reason for hiding this comment

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

do we want to keep this comment or append w/ Rosser?

Copy link
Contributor Author

@ChrisRosser ChrisRosser Apr 8, 2024

Choose a reason for hiding this comment

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

I'm an englishman so I say leave it. :P

No idea who originally wrote it!


/* --- */
Copy link
Member

Choose a reason for hiding this comment

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

probably remove empty comment unless something to note here.

Copy link
Contributor Author

@ChrisRosser ChrisRosser Apr 8, 2024

Choose a reason for hiding this comment

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

I think it's just to separate function definitions from the code body?

Copy link
Member

@nerdCopter nerdCopter left a comment

Choose a reason for hiding this comment

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

  • approving. good stuff!
  • @haslinghuis , please see my prior, yet insignificant, code-reviews about code-comments before merging.

Copy link

sonarcloud bot commented Apr 8, 2024

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@sugaarK
Copy link
Member

sugaarK commented Apr 8, 2024

if this isn't a bug fix it shouldn't be added to 10.10

Copy link
Contributor

github-actions bot commented Apr 8, 2024

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

@haslinghuis haslinghuis modified the milestones: 10.10.0, 11.0 Apr 9, 2024
@nerdCopter
Copy link
Member

if this isn't a bug fix it shouldn't be added to 10.10

I have opinion of the opposite.

  • only changes the rendering of the graph.
  • does not change behavior when CLIP or SCALE is not selected.
  • it "fixes" rendering of CLIP or SCALE. (not rendering properly for a particular setting could arguably be considered a logic-bug.)
  • does not require firmware change.

@haslinghuis haslinghuis modified the milestones: 11.0, 10.10.0 Apr 9, 2024
@sugaarK
Copy link
Member

sugaarK commented Apr 9, 2024

@nerdCopter it was mislabeled. If it’s a bug fix then there is no issue

@haslinghuis haslinghuis merged commit 4bae729 into betaflight:master Apr 9, 2024
12 checks passed
chmelevskij pushed a commit to chmelevskij/betaflight-configurator that referenced this pull request Apr 27, 2024
* Update pid_tuning.js

Update pid_tuning.js

Update pid_tuning.js

* Update src/js/tabs/pid_tuning.js

Co-authored-by: Mark Haslinghuis <[email protected]>

* Update src/js/tabs/pid_tuning.js

Co-authored-by: Mark Haslinghuis <[email protected]>

* Update src/js/tabs/pid_tuning.js

Co-authored-by: Mark Haslinghuis <[email protected]>

* Update src/js/tabs/pid_tuning.js

* Update src/js/tabs/pid_tuning.js

* Update src/js/tabs/pid_tuning.js

---------

Co-authored-by: Mark Haslinghuis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: COMPLETED
Development

Successfully merging this pull request may close these issues.

Make Throttle Preview in Rates Tab Respect Throttle Limit/Scale Settings
5 participants