mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-21 07:15:13 +03:00
Merge pull request #1551 from iNavFlight/MrD_Add-expanded-labels-for-units
Add expanded labels for units
This commit is contained in:
commit
c61a56eb8e
2 changed files with 46 additions and 5 deletions
|
@ -233,14 +233,14 @@ var Settings = (function () {
|
||||||
|
|
||||||
const oldValue = element.val();
|
const oldValue = element.val();
|
||||||
|
|
||||||
//display names for the units
|
// Display names for the units
|
||||||
const unitDisplayDames = {
|
const unitDisplayNames = {
|
||||||
// Misc
|
// Misc
|
||||||
'us' : "uS",
|
|
||||||
'cw' : 'cW',
|
'cw' : 'cW',
|
||||||
'percent' : '%',
|
'percent' : '%',
|
||||||
'cmss' : 'cm/s/s',
|
'cmss' : 'cm/s/s',
|
||||||
// Time
|
// Time
|
||||||
|
'us' : "uS",
|
||||||
'msec' : 'ms',
|
'msec' : 'ms',
|
||||||
'msec-nc' : 'ms', // Milliseconds, but not converted.
|
'msec-nc' : 'ms', // Milliseconds, but not converted.
|
||||||
'dsec' : 'ds',
|
'dsec' : 'ds',
|
||||||
|
@ -275,6 +275,47 @@ var Settings = (function () {
|
||||||
'nm' : 'NM'
|
'nm' : 'NM'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hover full descriptions for the units
|
||||||
|
const unitExpandedNames = {
|
||||||
|
// Misc
|
||||||
|
'cw' : 'CentiWatts',
|
||||||
|
'percent' : 'Percent',
|
||||||
|
'cmss' : 'Centimetres per second, per second',
|
||||||
|
// Time
|
||||||
|
'us' : "Microseconds",
|
||||||
|
'msec' : 'Milliseconds',
|
||||||
|
'msec-nc' : 'Milliseconds',
|
||||||
|
'dsec' : 'Deciseconds',
|
||||||
|
'sec' : 'Seconds',
|
||||||
|
// Angles
|
||||||
|
'deg' : 'Degrees',
|
||||||
|
'decideg' : 'DeciDegrees',
|
||||||
|
'decideg-lrg' : 'DeciDegrees',
|
||||||
|
// Rotational speed
|
||||||
|
'degps' : 'Degrees per second',
|
||||||
|
'decadegps' : 'DecaDegrees per second',
|
||||||
|
// Temperature
|
||||||
|
'decidegc' : 'DeciDegrees Celsius',
|
||||||
|
'degc' : 'Degrees Celsius',
|
||||||
|
'degf' : 'Degrees Fahrenheit',
|
||||||
|
// Speed
|
||||||
|
'cms' : 'Centimetres per second',
|
||||||
|
'v-cms' : 'Centimetres per second',
|
||||||
|
'ms' : 'Metres per second',
|
||||||
|
'kmh' : 'Kilometres per hour',
|
||||||
|
'mph' : 'Miles per hour',
|
||||||
|
'hftmin' : 'Hundred feet per minute',
|
||||||
|
'fts' : 'Feet per second',
|
||||||
|
'kt' : 'Knots',
|
||||||
|
// Distance
|
||||||
|
'cm' : 'Centimetres',
|
||||||
|
'm' : 'Metres',
|
||||||
|
'km' : 'Kilometres',
|
||||||
|
'm-lrg' : 'Metres',
|
||||||
|
'ft' : 'Feet',
|
||||||
|
'mi' : 'Miles',
|
||||||
|
'nm' : 'Nautical Miles'
|
||||||
|
}
|
||||||
|
|
||||||
// Ensure we can do conversions
|
// Ensure we can do conversions
|
||||||
if (!inputUnit || !oldValue || !element) {
|
if (!inputUnit || !oldValue || !element) {
|
||||||
|
@ -463,7 +504,7 @@ var Settings = (function () {
|
||||||
element.data('setting-multiplier', multiplier);
|
element.data('setting-multiplier', multiplier);
|
||||||
|
|
||||||
// Now wrap the input in a display that shows the unit
|
// Now wrap the input in a display that shows the unit
|
||||||
element.wrap(`<div data-unit="${unitDisplayDames[unitName]}" class="unit_wrapper unit"></div>`);
|
element.wrap(`<div data-unit="${unitDisplayNames[unitName]}" title="${unitExpandedNames[unitName]}" class="unit_wrapper unit"></div>`);
|
||||||
|
|
||||||
function toFahrenheit(decidegC) {
|
function toFahrenheit(decidegC) {
|
||||||
return (decidegC / 10) * 1.8 + 32;
|
return (decidegC / 10) * 1.8 + 32;
|
||||||
|
|
|
@ -128,7 +128,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="number">
|
<div class="number">
|
||||||
<input id="pitchToThrottle" type="number" data-setting="nav_fw_pitch2thr" data-setting-multiplier="1" step="1" min="0" max="100" />
|
<input id="pitchToThrottle" type="number" data-unit="us" data-setting="nav_fw_pitch2thr" data-setting-multiplier="1" step="1" min="0" max="100" />
|
||||||
<label for="pitchToThrottle"><span data-i18n="pitchToThrottle"></span></label>
|
<label for="pitchToThrottle"><span data-i18n="pitchToThrottle"></span></label>
|
||||||
<div for="pitchToThrottle" class="helpicon cf_tip" data-i18n_title="pitchToThrottleHelp"></div>
|
<div for="pitchToThrottle" class="helpicon cf_tip" data-i18n_title="pitchToThrottleHelp"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue