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

Arrange configuration and motor tab #2356

Merged
merged 1 commit into from Feb 13, 2021

Conversation

haslinghuis
Copy link
Member

@haslinghuis haslinghuis commented Dec 25, 2020

Fixes: #2304

Summary:

  • Move mixer and motor/esc features from configuration to motor tab
  • Move servo test to servos tab

Suggestions:

  • Styling changes notice, mixer and buttons @asizon / @limonspb
  • Fix MOTOR_STOP alignment with ESC_SENSOR and align padding on different places @TheIsotopes
  • Move reorder Motors and Motor direction to Mixer settings @ZZYZX / @limonspb
  • Move mixer from graph to configuration and put configuration before testing @McGiverGim
  • Stop motor testing when making configuration changes (+ disable motor test after making changes before reboot) @mikeller

Thanks @asizon @bizmar @chmelevskij @limonspb @McGiverGim @mikeller @TheIsotopes @ZZYZX

@haslinghuis haslinghuis force-pushed the rearrange_motor_sensor branch 8 times, most recently from bdd6c35 to 048b3a6 Compare December 26, 2020 09:53
Comment on lines 14 to 21
Promise
.resolve(true)
.then(() => MSP.promise(MSPCodes.MSP_SERVO_CONFIGURATIONS))
.then(() => MSP.promise(MSPCodes.MSP_SERVO_MIX_RULES))
.then(() => MSP.promise(MSPCodes.MSP_RC))
.then(() => MSP.promise(MSPCodes.MSP_BOXNAMES))
.then(load_html)
.catch((error) => console.log(error.message));
Copy link
Member

Choose a reason for hiding this comment

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

Do these need to be run in parallel or they can be in sequence?

If we make initialise async we could do something like for the sequential

try {
  await MSP.promise(MSPCodes.MSP_SERVO_CONFIGURATIONS);
  await MSP.promise(MSPCodes.MSP_SERVO_MIX_RULES);
  await MSP.promise(MSPCodes.MSP_RC);
  await MSP.promise(MSPCodes.MSP_BOXNAMES);
  load_html();
} catch(error) {
  console.log(error)
}

Or for parallel

try {
  await Promise.all([
    MSP.promise(MSPCodes.MSP_SERVO_CONFIGURATIONS),
    MSP.promise(MSPCodes.MSP_SERVO_MIX_RULES),
    MSP.promise(MSPCodes.MSP_RC),
    MSP.promise(MSPCodes.MSP_BOXNAMES),
  ])
  load_html();
} catch(error) {
  console.log(error)
}

Copy link
Member Author

Choose a reason for hiding this comment

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

There is no particular sequence as they don't depend on each other. So the first solution would work but I'm in doubt in what advantage the parallel solution has over the former.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @chmelevskij - it's working 😜 Updated configuration.js, motors.js and servos.js.

Copy link
Member

Choose a reason for hiding this comment

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

If id doesn't matter about the sequence I'd use Promise.all, bunch of awaits will block and wait for the previous to finish so you might get a bit of a lag if execution time adds up to 1s or smth

Copy link
Member

Choose a reason for hiding this comment

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

We added some time ago one MSP command to execute various MSP commands at once. I don't remember the ID but can be useful for that.

Copy link
Member

Choose a reason for hiding this comment

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

I found it: #1605

Copy link
Member

Choose a reason for hiding this comment

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

MSP commands can definitely not be run in parallel - the firmware and the protocol lack the means to sequentialise / recombine responses.

Copy link
Member

Choose a reason for hiding this comment

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

As for MSP_MULTIPLE_MSP, I'd be reluctant to use this as a wrapper to group multiple commands in configurator - this will break and require another rewrite as soon as one of the combined frames (request or response) exceeds 255 bytes in length, which will happen sooner or later due to the MSP protocol's nature of having commands grow in lenght with every change.

@haslinghuis haslinghuis force-pushed the rearrange_motor_sensor branch 5 times, most recently from 17b1cf6 to c126e58 Compare December 26, 2020 23:10
@mikeller
Copy link
Member

@haslinghuis: Seeing how much change is still going on in this pull request, can you please change this to 'draft' status so reviewers can hold off until it is ready for review?

@haslinghuis haslinghuis marked this pull request as draft December 27, 2020 22:15
@haslinghuis haslinghuis force-pushed the rearrange_motor_sensor branch 11 times, most recently from 6511d53 to bc9f42a Compare December 29, 2020 05:03
@McGiverGim
Copy link
Member

@haslinghuis did you see my comment about MSP_MULTIPLE_MSP above?

@haslinghuis
Copy link
Member Author

@McGiverGim yes but there is no example how to call it. And I was very very busy trying to fix the servos test. Motor tab and configuration tab are ready and @asizon offered to look at servos because I am on dead trail with it.

@haslinghuis haslinghuis force-pushed the rearrange_motor_sensor branch 2 times, most recently from d392dac to 61e883e Compare January 21, 2021 04:35
@haslinghuis
Copy link
Member Author

Thanks @McGiverGim - your review was very helpfull. Addressed your points and it should be good to go now:

Screenshot from 2021-01-21 05-11-53

McGiverGim
McGiverGim previously approved these changes Jan 21, 2021
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.

LGTM, but as I said, others will not think the same :)

@haslinghuis
Copy link
Member Author

haslinghuis commented Jan 25, 2021

Minor improvement on width in motor testing (E values were too condensed on a smaller screen) and moved @limonspb buttons to the content_toolbar. The mixer section now does also comply with the ESC/Motor Features styling.

@mikeller having addressed stopping of motors properly when changing settings please take a look again.

Screenshot from 2021-01-25 05-07-08

Screenshot from 2021-01-25 05-08-11

@haslinghuis
Copy link
Member Author

haslinghuis commented Jan 26, 2021

Maybe should hide the motor direction and reorder motors buttons also when testing is active - implemented.

Screenshot from 2021-01-26 02-53-04

@haslinghuis
Copy link
Member Author

haslinghuis commented Jan 26, 2021

Tools are disabled after changing settings too now.

@sonarcloud
Copy link

sonarcloud bot commented Jan 27, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 13 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

@McGiverGim
Copy link
Member

@mikeller can we merge this? It seems finished to me. Some change is pending?

@mikeller
Copy link
Member

@McGiverGim: I'll review. This has had so many repetitive changes pushed into it that I stopped looking at it.

@mikeller mikeller merged commit ad15724 into betaflight:master Feb 13, 2021
@haslinghuis haslinghuis deleted the rearrange_motor_sensor branch February 13, 2021 23:37
@mikeller mikeller added this to the 10.8.0 milestone Feb 13, 2021
@limonspb
Copy link
Member

Congratulations, @haslinghuis very good job! :)

@haslinghuis haslinghuis mentioned this pull request Apr 13, 2023
4 tasks
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.

Rearrange configuration, motor and servo tab
7 participants