-
Notifications
You must be signed in to change notification settings - Fork 376
Enhance and extend units conversion #1451
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
Conversation
1. Fixed rounding error. 2. Added conversions for: a) vertical speed b) metres c) temperature 3. Added support on Failsafe and OSD pages. 4. Sorted out alignment issues, due to different implementations.
|
@DzikuVx review requested as it would be handy to get this merged before I continue on another PR. |
|
@MrD-RC go with the merge |
|
@MrD-RC I noticed in the 5.0 build, the Due to this requiring a fix... I thought I would suggest an idea. And due to the current label's in the Configurator having nothing to do with the CLI commands for these set points, I thought it could be more directly worded to something like this. Which explains exactly what each of these settings do. It does require a change in the code, to swap setting 3 and 4. Which makes it more systematic, according to the landing sequence than at present. What do you think? |
|
@Jetrell I agree. Those labels have never made any sense to me. They’ve been like that since the landing stuff was changed; think that was 3.0. Can’t remember when I saw that PR? What you’ve suggested would make a lot more sense. Though there’s no need for the max values, these are set automatically in the fields and change with the unit types now. BTW, to find out the CLI commands, just hover over the input box. |
|
Nice work! Thanks Darren 👍 |
| const convertedValue = Number((oldValue / multiplier).toFixed(2)); | ||
| const newValue = Number.isInteger(convertedValue) ? Math.round(convertedValue) : convertedValue; | ||
| let newValue = ""; | ||
| if (multiplier == 'FAHREN') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
===
|
Nice to see. Great work! I wish i had time finishing my own Inav configurator i started in dart. The best i could do is try and keep an eye on the PR's and suggest some edits if you wish? Infact in the future we could try and replace some of the ever so outdated page systems with something more modern, robust and slowly strangle it out. oo That would be fun. At least bump some deps and add in some unit testing on UI. Oh yes yes now im drooling. |

a) vertical speed
b) metres
c) temperature
This should now take care of all places that need unit conversion, other than Mission Control.
Examples
Advanced Tuning
Alignment all looks fine. Note the speeds in the General Navigation Settings and Automatic landing settings are now in metres per second for vertical speeds. This matches the units used in the OSD for the digital vario. Imperial is feet per second and GA is 100 feet per second.
Failsafe
Looks the same, but quite a lot has changed. All data except for the procedure checkboxes no uses the data-setting method. This will be able to be fully converted one PR #7734 is merged. As that has the changes required to handle string over the data-setting method.
OSD
Just the alarms here. I chose to keep Fly Time as minutes. But I could change it to be hours with non-default units if people wish. You may also notice that the imperial temperatures are in Fahrenheit.
As always, open to comments or suggestions.
Half-Fixes #1428