mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-25 01:05:12 +03:00
improved hinting
This commit is contained in:
parent
c6b2e40cbb
commit
a722f89973
3 changed files with 28 additions and 22 deletions
|
@ -1861,5 +1861,8 @@
|
||||||
},
|
},
|
||||||
"sensorPitot": {
|
"sensorPitot": {
|
||||||
"message": "Pitot tube"
|
"message": "Pitot tube"
|
||||||
|
},
|
||||||
|
"manualEnablingTemplate": {
|
||||||
|
"message": "To enable via CLI use <strong>feature {name}</strong> command"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
31
js/fc.js
31
js/fc.js
|
@ -331,23 +331,24 @@ var FC = {
|
||||||
var features = [
|
var features = [
|
||||||
{bit: 0, group: 'rxMode', mode: 'group', name: 'RX_PPM'},
|
{bit: 0, group: 'rxMode', mode: 'group', name: 'RX_PPM'},
|
||||||
{bit: 1, group: 'batteryVoltage', name: 'VBAT'},
|
{bit: 1, group: 'batteryVoltage', name: 'VBAT'},
|
||||||
{bit: 2, group: 'other', name: 'INFLIGHT_ACC_CAL'},
|
{bit: 2, group: 'other', name: 'INFLIGHT_ACC_CAL', showNameInTip: true},
|
||||||
{bit: 3, group: 'rxMode', mode: 'group', name: 'RX_SERIAL'},
|
{bit: 3, group: 'rxMode', mode: 'group', name: 'RX_SERIAL'},
|
||||||
{bit: 4, group: 'esc', name: 'MOTOR_STOP'},
|
{bit: 4, group: 'esc', name: 'MOTOR_STOP'},
|
||||||
{bit: 5, group: 'other', name: 'SERVO_TILT'},
|
{bit: 5, group: 'other', name: 'SERVO_TILT', showNameInTip: true},
|
||||||
{bit: 6, group: 'other', name: 'SOFTSERIAL', haveTip: true},
|
{bit: 6, group: 'other', name: 'SOFTSERIAL', haveTip: true, showNameInTip: true},
|
||||||
{bit: 7, group: 'gps', name: 'GPS', haveTip: true},
|
{bit: 7, group: 'gps', name: 'GPS', haveTip: true},
|
||||||
{bit: 8, group: 'rxFailsafe', name: 'FAILSAFE'},
|
{bit: 8, group: 'rxFailsafe', name: 'FAILSAFE'},
|
||||||
{bit: 9, group: 'other', name: 'SONAR'},
|
{bit: 9, group: 'other', name: 'SONAR', showNameInTip: true},
|
||||||
{bit: 10, group: 'other', name: 'TELEMETRY'},
|
{bit: 10, group: 'other', name: 'TELEMETRY', showNameInTip: true},
|
||||||
{bit: 11, group: 'batteryCurrent', name: 'CURRENT_METER'},
|
{bit: 11, group: 'batteryCurrent', name: 'CURRENT_METER'},
|
||||||
{bit: 12, group: 'other', name: '3D'},
|
{bit: 12, group: 'other', name: '3D', showNameInTip: true},
|
||||||
{bit: 13, group: 'rxMode', mode: 'group', name: 'RX_PARALLEL_PWM'},
|
{bit: 13, group: 'rxMode', mode: 'group', name: 'RX_PARALLEL_PWM'},
|
||||||
{bit: 14, group: 'rxMode', mode: 'group', name: 'RX_MSP'},
|
{bit: 14, group: 'rxMode', mode: 'group', name: 'RX_MSP'},
|
||||||
{bit: 15, group: 'other', name: 'RSSI_ADC', haveTip: true},
|
{bit: 15, group: 'other', name: 'RSSI_ADC', haveTip: true, showNameInTip: true},
|
||||||
{bit: 16, group: 'other', name: 'LED_STRIP'},
|
{bit: 16, group: 'other', name: 'LED_STRIP', showNameInTip: true},
|
||||||
{bit: 17, group: 'other', name: 'DISPLAY'},
|
{bit: 17, group: 'other', name: 'DISPLAY', showNameInTip: true},
|
||||||
{bit: 19, group: 'other', name: 'BLACKBOX', haveTip: true}
|
{bit: 19, group: 'other', name: 'BLACKBOX', haveTip: true, showNameInTip: true},
|
||||||
|
{bit: 20, group: 'other', name: 'CHANNEL_FORWARDING', showNameInTip: true}
|
||||||
];
|
];
|
||||||
|
|
||||||
if (semver.lt(CONFIG.flightControllerVersion, "1.3.0")) {
|
if (semver.lt(CONFIG.flightControllerVersion, "1.3.0")) {
|
||||||
|
@ -364,15 +365,9 @@ var FC = {
|
||||||
$('.features.esc-priority').parent().hide();
|
$('.features.esc-priority').parent().hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (semver.gte(CONFIG.apiVersion, "1.12.0")) {
|
|
||||||
features.push(
|
|
||||||
{bit: 20, group: 'other', name: 'CHANNEL_FORWARDING'}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (semver.gte(CONFIG.apiVersion, "1.16.0")) {
|
if (semver.gte(CONFIG.apiVersion, "1.16.0")) {
|
||||||
features.push(
|
features.push(
|
||||||
{bit: 21, group: 'other', name: 'TRANSPONDER', haveTip: true}
|
{bit: 21, group: 'other', name: 'TRANSPONDER', haveTip: true, showNameInTip: true}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -385,7 +380,7 @@ var FC = {
|
||||||
|
|
||||||
if (semver.gte(CONFIG.flightControllerVersion, '1.3.0')) {
|
if (semver.gte(CONFIG.flightControllerVersion, '1.3.0')) {
|
||||||
features.push(
|
features.push(
|
||||||
{bit: 27, group: 'other', name: 'PWM_SERVO_DRIVER', haveTip: true}
|
{bit: 27, group: 'other', name: 'PWM_SERVO_DRIVER', haveTip: true, showNameInTip: true}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return features.reverse();
|
return features.reverse();
|
||||||
|
|
|
@ -110,11 +110,20 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
|
|
||||||
var features_e = $('.features');
|
var features_e = $('.features');
|
||||||
for (i = 0; i < features.length; i++) {
|
for (i = 0; i < features.length; i++) {
|
||||||
var row_e;
|
var row_e,
|
||||||
|
tips = [],
|
||||||
|
feature_tip_html = '';
|
||||||
|
|
||||||
|
if (features[i].showNameInTip) {
|
||||||
|
tips.push(chrome.i18n.getMessage("manualEnablingTemplate").replace("{name}", features[i].name));
|
||||||
|
}
|
||||||
|
|
||||||
var feature_tip_html = '';
|
|
||||||
if (features[i].haveTip) {
|
if (features[i].haveTip) {
|
||||||
feature_tip_html = '<div class="helpicon cf_tip" data-i18n_title="feature' + features[i].name + 'Tip"></div>';
|
tips.push(chrome.i18n.getMessage("feature" + features[i].name + "Tip"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tips.length > 0) {
|
||||||
|
feature_tip_html = '<div class="helpicon cf_tip" title="' + tips.join("<br><br>") + '"></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (features[i].mode === 'group') {
|
if (features[i].mode === 'group') {
|
||||||
|
@ -524,7 +533,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
|
|
||||||
$('input[type="checkbox"].feature').change(function () {
|
$('input[type="checkbox"].feature').change(function () {
|
||||||
|
|
||||||
console.log('we have change');
|
|
||||||
var element = $(this),
|
var element = $(this),
|
||||||
index = element.data('bit'),
|
index = element.data('bit'),
|
||||||
state = element.is(':checked');
|
state = element.is(':checked');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue