Repository navigation
Conversation
Two new buttons in the button bar save the settings of BLHeli_S and Bluejay ESCs to a JSON file and load such a file back. Hardware identifiers are never saved. A file is only loaded on the same number of ESCs, each one running the same firmware, version and layout. Only described settings within the bounds of the settings screen are written, with the startup melody, never the motor direction. The changes are shown for confirmation, the current settings are saved first, and the ESCs are read back and checked after writing.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 277 |
| Duplication | 24 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
Thank you! So far this is looking very good. I have marked this as part for the next release, so I am not going to merge that at this point, instead I would ask you to add the 2nd part to this PR too. Structure is good - it was not as intrusive as I would have imagined. |
A settings file can be opened from the home page while no port is connected. Its ESCs are shown in the settings screen with a note that nothing is written to them. The settings can be changed and saved to a new file, which is then loaded on the ESCs like any other settings file. While a file is open no port can be connected and the flash buttons are disabled, so no read, write, flash or motor command reaches an ESC. Unplugging a port keeps the file open. Closing the file goes back to the home page, after asking when the changes are not saved. The "Missing ESC?" box is not shown offline.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #597 +/- ##
===========================================
+ Coverage 82.56% 83.92% +1.35%
===========================================
Files 78 79 +1
Lines 3607 3918 +311
Branches 605 702 +97
===========================================
+ Hits 2978 3288 +310
- Misses 562 563 +1
Partials 67 67 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks so Much! I added the second part: editing a settings file without ESCs connected. What it adds
Safety
Structure
Tests
|
Part 1 of #596: save the ESC settings to a JSON file and load them back. Editing a file without ESCs connected will follow in a second PR.
Save
.jsonfile, with the number of ESCs, and for each ESC its position, firmware name, layout revision and settings. No UID, signature or bootloader data.Load
MAIN_REVISION/SUB_REVISION), layout revision andLAYOUTare the same. Otherwise it is skipped and logged.bool,enum,number, and the startup melody of the same length, with its wait (never the erased value0xFFFF)). Out-of-bounds values are skipped and listed in the log.MOTOR_DIRECTIONand the identity keys are never written.ESC 1 · Beep strength: 40 → 80), then the current settings are saved to a file. Nothing is written if that save fails or the user cancels.Code
src/utils/SettingsFile.js(pure functions with tests).App/index.jsxonly wires the buttons, and writing goes through the existing write path (writeEscs, now shared with "Write settings").The version of this feature in my fork was tested on the bench with 4 Bluejay ESCs, props off. The code of this PR itself is covered by the unit and app tests only.