Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/iNavFlight/inav-configurator.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Spychalski <pspychalski@gmail.com>2022-05-31 08:49:03 +0300
committerGitHub <noreply@github.com>2022-05-31 08:49:03 +0300
commitf53d2b166b132043bfe46011d4be53d59343b7a1 (patch)
treed63874962aae74bf8e6b708ec03f8379727ce693
parent853faf2799c35c95da104f55be3d45b87e9cae48 (diff)
parent3174f8992701aa1877bf71e3b98a30a78ec70512 (diff)
Merge pull request #1535 from iNavFlight/MrD_Fix-unit-lables5.0.0-RC2
Fixed units bug
-rw-r--r--README.md4
-rw-r--r--js/settings.js16
-rw-r--r--tabs/advanced_tuning.html18
-rw-r--r--tabs/pid_tuning.html2
4 files changed, 23 insertions, 17 deletions
diff --git a/README.md b/README.md
index 810315c5..1d103206 100644
--- a/README.md
+++ b/README.md
@@ -43,7 +43,9 @@ Depending on target operating system, _INAV Configurator_ is distributed as _sta
1. Visit [release page](https://github.com/iNavFlight/inav-configurator/releases)
1. Download Configurator for Linux platform (linux32 and linux64 are present)
1. Extract tar.gz archive
-1. Make the inav-configurator file executable (chmod +x inav-configurator)
+1. Make the following files executable:
+ * inav-configurator `chmod +x inav-configurator`
+ * (5.0.0+) chrome_crashpad_handler `chmod +x chrome_crashpad_handler`
1. Run INAV Configurator app from unpacked folder
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:
diff --git a/js/settings.js b/js/settings.js
index 326f4c74..ccc06d10 100644
--- a/js/settings.js
+++ b/js/settings.js
@@ -69,18 +69,21 @@ var Settings = (function () {
} else if (input.data('presentation') == 'range') {
let scaledMax;
+ let scaledMin;
let scalingThreshold;
if (input.data('normal-max')) {
scaledMax = s.setting.max * 2;
scalingThreshold = Math.round(scaledMax * 0.8);
+ scaledMin = s.setting.min *2;
} else {
scaledMax = s.setting.max;
+ scaledMin = s.setting.min;
scalingThreshold = scaledMax;
}
- let $range = $('<input type="range" min="' + s.setting.min + '" max="' + scaledMax + '" value="' + s.value + '"/>');
+ let $range = $('<input type="range" min="' + scaledMin + '" max="' + scaledMax + '" value="' + s.value + '"/>');
if (input.data('step')) {
$range.attr('step', input.data('step'));
}
@@ -117,16 +120,13 @@ var Settings = (function () {
let val = $(this).val();
let normalMax = parseInt(input.data('normal-max'));
- console.log(val, normalMax);
-
if (normalMax) {
if (val <= scalingThreshold) {
- val = scaleRangeInt(val, 0, scalingThreshold, 0, normalMax);
+ val = scaleRangeInt(val, scaledMin, scalingThreshold, s.setting.min, normalMax);
} else {
val = scaleRangeInt(val, scalingThreshold + 1, scaledMax, normalMax + 1, s.setting.max);
}
}
- console.log(val);
input.val(val);
});
@@ -138,7 +138,7 @@ var Settings = (function () {
let normalMax = parseInt(input.data('normal-max'));
if (normalMax) {
if (val <= normalMax) {
- newVal = scaleRangeInt(val, 0, normalMax, 0, scalingThreshold);
+ newVal = scaleRangeInt(val, s.setting.min, normalMax, scaledMin, scalingThreshold);
} else {
newVal = scaleRangeInt(val, normalMax + 1, s.setting.max, scalingThreshold + 1, scaledMax);
}
@@ -242,6 +242,7 @@ var Settings = (function () {
'cmss' : 'cm/s/s',
// Time
'msec' : 'ms',
+ 'msec-nc' : 'ms', // Milliseconds, but not converted.
'dsec' : 'ds',
'sec' : 's',
// Angles
@@ -309,6 +310,9 @@ var Settings = (function () {
'hftmin' : 50.8,
'fts' : 30.48
},
+ 'msec-nc' : {
+ 'msec-nc' : 1
+ },
'msec' : {
'sec' : 1000
},
diff --git a/tabs/advanced_tuning.html b/tabs/advanced_tuning.html
index 3cf9f681..ef8d3806 100644
--- a/tabs/advanced_tuning.html
+++ b/tabs/advanced_tuning.html
@@ -17,7 +17,7 @@
</div>
<div class="number">
- <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" />
+ <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" />
<label for="launchIdleDelay"><span data-i18n="configurationLaunchIdleDelay"></span></label>
<div for="launchIdleDelay" class="helpicon cf_tip" data-i18n_title="configurationLaunchIdleDelayHelp"></div>
</div>
@@ -38,22 +38,22 @@
<div for="launchAccel" class="helpicon cf_tip" data-i18n_title="configurationLaunchAccelHelp"></div>
</div>
<div class="number">
- <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" />
+ <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" />
<label for="launchDetectTime"><span data-i18n="configurationLaunchDetectTime"></span></label>
<div for="launchDetectTime" class="helpicon cf_tip" data-i18n_title="configurationLaunchDetectTimeHelp"></div>
</div>
<div class="number">
- <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" />
+ <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" />
<label for="launchMotorDelay"><span data-i18n="configurationLaunchMotorDelay"></span></label>
<div for="launchMotorDelay" class="helpicon cf_tip" data-i18n_title="configurationLaunchMotorDelayHelp"></div>
</div>
<div class="number">
- <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" />
+ <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" />
<label for="launchMinTime"><span data-i18n="configurationLaunchMinTime"></span></label>
<div for="launchMinTime" class="helpicon cf_tip" data-i18n_title="configurationLaunchMinTimeHelp"></div>
</div>
<div class="number">
- <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" />
+ <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" />
<label for="launchSpinupTime"><span data-i18n="configurationLaunchSpinupTime"></span></label>
<div for="launchSpinupTime" class="helpicon cf_tip" data-i18n_title="configurationLaunchSpinupTimeHelp"></div>
</div>
@@ -68,7 +68,7 @@
<div for="launchClimbAngle" class="helpicon cf_tip" data-i18n_title="configurationLaunchClimbAngleHelp"></div>
</div>
<div class="number">
- <input type="number" id="launchTimeout" data-unit="ms" data-setting="nav_fw_launch_timeout" data-setting-multiplier="1" step="1" min="0" max="60000" />
+ <input type="number" id="launchTimeout" data-unit="msec" data-setting="nav_fw_launch_timeout" data-setting-multiplier="1" step="1" min="0" max="60000" />
<label for="launchTimeout"><span data-i18n="configurationLaunchTimeout"></span></label>
<div for="launchTimeout" class="helpicon cf_tip" data-i18n_title="configurationLaunchTimeoutHelp"></div>
</div>
@@ -78,7 +78,7 @@
<div for="launchMaxAltitude" class="helpicon cf_tip" data-i18n_title="configurationLaunchMaxAltitudeHelp"></div>
</div>
<div class="number">
- <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" />
+ <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" />
<label for="launchEndTime"><span data-i18n="configurationLaunchEndTime"></span></label>
<div for="launchEndTime" class="helpicon cf_tip" data-i18n_title="configurationLaunchEndTimeHelp"></div>
</div>
@@ -278,7 +278,7 @@
</div>
<div class="number">
- <input id="brakingTimeout" type="number" data-unit="ms" data-setting="nav_mc_braking_timeout" data-setting-multiplier="1" step="1" min="100" max="5000" />
+ <input id="brakingTimeout" type="number" data-unit="msec" data-setting="nav_mc_braking_timeout" data-setting-multiplier="1" step="1" min="100" max="5000" />
<label for="brakingTimeout"><span data-i18n="brakingTimeout"></span></label>
<div for="brakingTimeout" class="helpicon cf_tip" data-i18n_title="brakingTimeoutTip"></div>
</div>
@@ -290,7 +290,7 @@
</div>
<div class="number">
- <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" />
+ <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" />
<label for="brakingBoostTimeout"><span data-i18n="brakingBoostTimeout"></span></label>
<div for="brakingBoostTimeout" class="helpicon cf_tip" data-i18n_title="brakingBoostTimeoutTip"></div>
</div>
diff --git a/tabs/pid_tuning.html b/tabs/pid_tuning.html
index afcdd03f..eb2dd329 100644
--- a/tabs/pid_tuning.html
+++ b/tabs/pid_tuning.html
@@ -538,7 +538,7 @@
<tr>
<th data-i18n="pidTuning_FW_TPATimeConstant"></th>
<td>
- <div class="pidTuning_number"><input id="tpaTimeConstant" type="number" class="rate-tpa_input" data-setting="fw_tpa_time_constant" data-unit="ms" /></div>
+ <div class="pidTuning_number"><input id="tpaTimeConstant" type="number" class="rate-tpa_input" data-setting="fw_tpa_time_constant" data-unit="msec" /></div>
<div for="tpaTimeConstant" class="helpicon cf_tip" data-i18n_title="pidTuning_FW_TPATimeConstantHelp"></div>
</td>
</tr>