Skip to content

Commit f53d2b1

Browse files
authored
Merge pull request #1535 from iNavFlight/MrD_Fix-unit-lables
Fixed units bug
2 parents 853faf2 + 3174f89 commit f53d2b1

File tree

4 files changed

+23
-17
lines changed

4 files changed

+23
-17
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ Depending on target operating system, _INAV Configurator_ is distributed as _sta
4343
1. Visit [release page](https://github.com/iNavFlight/inav-configurator/releases)
4444
1. Download Configurator for Linux platform (linux32 and linux64 are present)
4545
1. Extract tar.gz archive
46-
1. Make the inav-configurator file executable (chmod +x inav-configurator)
46+
1. Make the following files executable:
47+
* inav-configurator `chmod +x inav-configurator`
48+
* (5.0.0+) chrome_crashpad_handler `chmod +x chrome_crashpad_handler`
4749
1. Run INAV Configurator app from unpacked folder
4850

4951
On some Linux distros, you may be missing `libatomic`, a `NW.JS` (specially `libnode.so`) dependency. If so, please install `libatomic` using your distro's package manager, e.g:

js/settings.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,21 @@ var Settings = (function () {
6969
} else if (input.data('presentation') == 'range') {
7070

7171
let scaledMax;
72+
let scaledMin;
7273
let scalingThreshold;
7374

7475
if (input.data('normal-max')) {
7576
scaledMax = s.setting.max * 2;
7677
scalingThreshold = Math.round(scaledMax * 0.8);
78+
scaledMin = s.setting.min *2;
7779
} else {
7880
scaledMax = s.setting.max;
81+
scaledMin = s.setting.min;
7982
scalingThreshold = scaledMax;
8083
}
8184

8285

83-
let $range = $('<input type="range" min="' + s.setting.min + '" max="' + scaledMax + '" value="' + s.value + '"/>');
86+
let $range = $('<input type="range" min="' + scaledMin + '" max="' + scaledMax + '" value="' + s.value + '"/>');
8487
if (input.data('step')) {
8588
$range.attr('step', input.data('step'));
8689
}
@@ -117,16 +120,13 @@ var Settings = (function () {
117120
let val = $(this).val();
118121
let normalMax = parseInt(input.data('normal-max'));
119122

120-
console.log(val, normalMax);
121-
122123
if (normalMax) {
123124
if (val <= scalingThreshold) {
124-
val = scaleRangeInt(val, 0, scalingThreshold, 0, normalMax);
125+
val = scaleRangeInt(val, scaledMin, scalingThreshold, s.setting.min, normalMax);
125126
} else {
126127
val = scaleRangeInt(val, scalingThreshold + 1, scaledMax, normalMax + 1, s.setting.max);
127128
}
128129
}
129-
console.log(val);
130130

131131
input.val(val);
132132
});
@@ -138,7 +138,7 @@ var Settings = (function () {
138138
let normalMax = parseInt(input.data('normal-max'));
139139
if (normalMax) {
140140
if (val <= normalMax) {
141-
newVal = scaleRangeInt(val, 0, normalMax, 0, scalingThreshold);
141+
newVal = scaleRangeInt(val, s.setting.min, normalMax, scaledMin, scalingThreshold);
142142
} else {
143143
newVal = scaleRangeInt(val, normalMax + 1, s.setting.max, scalingThreshold + 1, scaledMax);
144144
}
@@ -242,6 +242,7 @@ var Settings = (function () {
242242
'cmss' : 'cm/s/s',
243243
// Time
244244
'msec' : 'ms',
245+
'msec-nc' : 'ms', // Milliseconds, but not converted.
245246
'dsec' : 'ds',
246247
'sec' : 's',
247248
// Angles
@@ -309,6 +310,9 @@ var Settings = (function () {
309310
'hftmin' : 50.8,
310311
'fts' : 30.48
311312
},
313+
'msec-nc' : {
314+
'msec-nc' : 1
315+
},
312316
'msec' : {
313317
'sec' : 1000
314318
},

tabs/advanced_tuning.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</div>
1818

1919
<div class="number">
20-
<input type="number" id="launchIdleDelay" data-unit="ms" data-setting="nav_fw_launch_idle_motor_delay" data-setting-multiplier="1" step="1" min="0" max="60000" />
20+
<input type="number" id="launchIdleDelay" data-unit="msec" data-setting="nav_fw_launch_idle_motor_delay" data-setting-multiplier="1" step="1" min="0" max="60000" />
2121
<label for="launchIdleDelay"><span data-i18n="configurationLaunchIdleDelay"></span></label>
2222
<div for="launchIdleDelay" class="helpicon cf_tip" data-i18n_title="configurationLaunchIdleDelayHelp"></div>
2323
</div>
@@ -38,22 +38,22 @@
3838
<div for="launchAccel" class="helpicon cf_tip" data-i18n_title="configurationLaunchAccelHelp"></div>
3939
</div>
4040
<div class="number">
41-
<input type="number" id="launchDetectTime" data-unit="ms" data-setting="nav_fw_launch_detect_time" data-setting-multiplier="1" step="1" min="10" max="1000" />
41+
<input type="number" id="launchDetectTime" data-unit="msec-nc" data-setting="nav_fw_launch_detect_time" data-setting-multiplier="1" step="1" min="10" max="1000" />
4242
<label for="launchDetectTime"><span data-i18n="configurationLaunchDetectTime"></span></label>
4343
<div for="launchDetectTime" class="helpicon cf_tip" data-i18n_title="configurationLaunchDetectTimeHelp"></div>
4444
</div>
4545
<div class="number">
46-
<input type="number" id="launchMotorDelay" data-unit="ms" data-setting="nav_fw_launch_motor_delay" data-setting-multiplier="1" step="1" min="0" max="5000" />
46+
<input type="number" id="launchMotorDelay" data-unit="msec-nc" data-setting="nav_fw_launch_motor_delay" data-setting-multiplier="1" step="1" min="0" max="5000" />
4747
<label for="launchMotorDelay"><span data-i18n="configurationLaunchMotorDelay"></span></label>
4848
<div for="launchMotorDelay" class="helpicon cf_tip" data-i18n_title="configurationLaunchMotorDelayHelp"></div>
4949
</div>
5050
<div class="number">
51-
<input type="number" id="launchMinTime" data-unit="ms" data-setting="nav_fw_launch_min_time" data-setting-multiplier="1" step="1" min="0" max="60000" />
51+
<input type="number" id="launchMinTime" data-unit="msec" data-setting="nav_fw_launch_min_time" data-setting-multiplier="1" step="1" min="0" max="60000" />
5252
<label for="launchMinTime"><span data-i18n="configurationLaunchMinTime"></span></label>
5353
<div for="launchMinTime" class="helpicon cf_tip" data-i18n_title="configurationLaunchMinTimeHelp"></div>
5454
</div>
5555
<div class="number">
56-
<input type="number" id="launchSpinupTime" data-unit="ms" data-setting="nav_fw_launch_spinup_time" data-setting-multiplier="1" step="1" min="0" max="1000" />
56+
<input type="number" id="launchSpinupTime" data-unit="msec-nc" data-setting="nav_fw_launch_spinup_time" data-setting-multiplier="1" step="1" min="0" max="1000" />
5757
<label for="launchSpinupTime"><span data-i18n="configurationLaunchSpinupTime"></span></label>
5858
<div for="launchSpinupTime" class="helpicon cf_tip" data-i18n_title="configurationLaunchSpinupTimeHelp"></div>
5959
</div>
@@ -68,7 +68,7 @@
6868
<div for="launchClimbAngle" class="helpicon cf_tip" data-i18n_title="configurationLaunchClimbAngleHelp"></div>
6969
</div>
7070
<div class="number">
71-
<input type="number" id="launchTimeout" data-unit="ms" data-setting="nav_fw_launch_timeout" data-setting-multiplier="1" step="1" min="0" max="60000" />
71+
<input type="number" id="launchTimeout" data-unit="msec" data-setting="nav_fw_launch_timeout" data-setting-multiplier="1" step="1" min="0" max="60000" />
7272
<label for="launchTimeout"><span data-i18n="configurationLaunchTimeout"></span></label>
7373
<div for="launchTimeout" class="helpicon cf_tip" data-i18n_title="configurationLaunchTimeoutHelp"></div>
7474
</div>
@@ -78,7 +78,7 @@
7878
<div for="launchMaxAltitude" class="helpicon cf_tip" data-i18n_title="configurationLaunchMaxAltitudeHelp"></div>
7979
</div>
8080
<div class="number">
81-
<input type="number" id="launchEndTime" data-unit="ms" data-setting="nav_fw_launch_end_time" data-setting-multiplier="1" step="1" min="0" max="5000" />
81+
<input type="number" id="launchEndTime" data-unit="msec" data-setting="nav_fw_launch_end_time" data-setting-multiplier="1" step="1" min="0" max="5000" />
8282
<label for="launchEndTime"><span data-i18n="configurationLaunchEndTime"></span></label>
8383
<div for="launchEndTime" class="helpicon cf_tip" data-i18n_title="configurationLaunchEndTimeHelp"></div>
8484
</div>
@@ -278,7 +278,7 @@
278278
</div>
279279

280280
<div class="number">
281-
<input id="brakingTimeout" type="number" data-unit="ms" data-setting="nav_mc_braking_timeout" data-setting-multiplier="1" step="1" min="100" max="5000" />
281+
<input id="brakingTimeout" type="number" data-unit="msec" data-setting="nav_mc_braking_timeout" data-setting-multiplier="1" step="1" min="100" max="5000" />
282282
<label for="brakingTimeout"><span data-i18n="brakingTimeout"></span></label>
283283
<div for="brakingTimeout" class="helpicon cf_tip" data-i18n_title="brakingTimeoutTip"></div>
284284
</div>
@@ -290,7 +290,7 @@
290290
</div>
291291

292292
<div class="number">
293-
<input id="brakingBoostTimeout" type="number" data-unit="ms" data-setting="nav_mc_braking_boost_timeout" data-setting-multiplier="1" step="1" min="0" max="5000" />
293+
<input id="brakingBoostTimeout" type="number" data-unit="msec" data-setting="nav_mc_braking_boost_timeout" data-setting-multiplier="1" step="1" min="0" max="5000" />
294294
<label for="brakingBoostTimeout"><span data-i18n="brakingBoostTimeout"></span></label>
295295
<div for="brakingBoostTimeout" class="helpicon cf_tip" data-i18n_title="brakingBoostTimeoutTip"></div>
296296
</div>

tabs/pid_tuning.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ <h3 data-i18n="axisYaw"></h3>
538538
<tr>
539539
<th data-i18n="pidTuning_FW_TPATimeConstant"></th>
540540
<td>
541-
<div class="pidTuning_number"><input id="tpaTimeConstant" type="number" class="rate-tpa_input" data-setting="fw_tpa_time_constant" data-unit="ms" /></div>
541+
<div class="pidTuning_number"><input id="tpaTimeConstant" type="number" class="rate-tpa_input" data-setting="fw_tpa_time_constant" data-unit="msec" /></div>
542542
<div for="tpaTimeConstant" class="helpicon cf_tip" data-i18n_title="pidTuning_FW_TPATimeConstantHelp"></div>
543543
</td>
544544
</tr>

0 commit comments

Comments
 (0)