commit
c167f48c73
|
@ -4424,12 +4424,21 @@
|
||||||
"osdDescStatTotalFlightDistance": {
|
"osdDescStatTotalFlightDistance": {
|
||||||
"message": "Total distance traveled"
|
"message": "Total distance traveled"
|
||||||
},
|
},
|
||||||
|
"osdTextStatMinRssiDbm": {
|
||||||
|
"message": "RSSI dBm minimum",
|
||||||
|
"description": "One of the statistics that can be shown at the end of the flight in the OSD"
|
||||||
|
},
|
||||||
"osdDescStatMinRssiDbm": {
|
"osdDescStatMinRssiDbm": {
|
||||||
"message": "Minimum RSSI dBm value"
|
"message": "Minimum RSSI dBm value"
|
||||||
},
|
},
|
||||||
|
"osdTextStatUnknown": {
|
||||||
|
"message": "Unknown $1",
|
||||||
|
"description": "One of the statistics that can be shown at the end of the flight in the OSD"
|
||||||
|
},
|
||||||
"osdDescStatUnknown": {
|
"osdDescStatUnknown": {
|
||||||
"message": "Unknown statistic (details to be added in a future release)"
|
"message": "Unknown statistic (details to be added in a future release)"
|
||||||
},
|
},
|
||||||
|
|
||||||
"osdDescribeFontVersion1": {
|
"osdDescribeFontVersion1": {
|
||||||
"message": "Font version: 1 (Betaflight 4.0 or older)"
|
"message": "Font version: 1 (Betaflight 4.0 or older)"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1238,6 +1238,7 @@ OSD.constants = {
|
||||||
},
|
},
|
||||||
MIN_RSSI_DBM: {
|
MIN_RSSI_DBM: {
|
||||||
name: 'MIN_RSSI_DBM',
|
name: 'MIN_RSSI_DBM',
|
||||||
|
text: 'osdTextStatMinRssiDbm',
|
||||||
desc: 'osdDescStatMinRssiDbm'
|
desc: 'osdDescStatMinRssiDbm'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1842,7 +1843,8 @@ OSD.msp = {
|
||||||
|
|
||||||
// Read all the data for any statistics we don't know about
|
// Read all the data for any statistics we don't know about
|
||||||
} else {
|
} else {
|
||||||
d.stat_items.push({name: 'UNKNOWN', desc: 'osdDescStatUnknown', index: i, enabled: v === 1 });
|
let statisticNumber = i - OSD.constants.STATISTIC_FIELDS.length + 1;
|
||||||
|
d.stat_items.push({name: 'UNKNOWN', text: ['osdTextStatUnknown', statisticNumber], desc: 'osdDescStatUnknown', index: i, enabled: v === 1 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2114,16 +2116,20 @@ TABS.osd.initialize = function (callback) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function insertOrdered(fieldList, field) {
|
function insertOrdered(fieldList, field) {
|
||||||
let added = false;
|
if (field.name == 'UNKNOWN') {
|
||||||
fieldList.children().each(function() {
|
|
||||||
if ($(this).text().localeCompare(field.text(), i18n.getCurrentLocale(), { sensitivity: 'base' }) > 0) {
|
|
||||||
$(this).before(field);
|
|
||||||
added = true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if(!added) {
|
|
||||||
fieldList.append(field);
|
fieldList.append(field);
|
||||||
|
} else {
|
||||||
|
let added = false;
|
||||||
|
fieldList.children().each(function() {
|
||||||
|
if ($(this).text().localeCompare(field.text(), i18n.getCurrentLocale(), { sensitivity: 'base' }) > 0) {
|
||||||
|
$(this).before(field);
|
||||||
|
added = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if(!added) {
|
||||||
|
fieldList.append(field);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2311,6 +2317,7 @@ TABS.osd.initialize = function (callback) {
|
||||||
);
|
);
|
||||||
$field.append('<label for="' + field.name + '" class="char-label">' + titleizeField(field) + '</label>');
|
$field.append('<label for="' + field.name + '" class="char-label">' + titleizeField(field) + '</label>');
|
||||||
|
|
||||||
|
// Insert in alphabetical order, with unknown fields at the end
|
||||||
insertOrdered($statsFields, $field);
|
insertOrdered($statsFields, $field);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2348,11 +2355,8 @@ TABS.osd.initialize = function (callback) {
|
||||||
$field.append('<label for="' + field.name + '" class="char-label">' + finalFieldName + '</label>');
|
$field.append('<label for="' + field.name + '" class="char-label">' + finalFieldName + '</label>');
|
||||||
|
|
||||||
// Insert in alphabetical order, with unknown fields at the end
|
// Insert in alphabetical order, with unknown fields at the end
|
||||||
if (field.name == 'UNKNOWN') {
|
insertOrdered($warningFields, $field);
|
||||||
$warningFields.append($field);
|
|
||||||
} else {
|
|
||||||
insertOrdered($warningFields, $field);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2482,11 +2486,8 @@ TABS.osd.initialize = function (callback) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert in alphabetical order, with unknown fields at the end
|
// Insert in alphabetical order, with unknown fields at the end
|
||||||
if (field.name == OSD.constants.UNKNOWN_DISPLAY_FIELD.name) {
|
insertOrdered($displayFields, $field);
|
||||||
$displayFields.append($field);
|
|
||||||
} else {
|
|
||||||
insertOrdered($displayFields, $field);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GUI.switchery();
|
GUI.switchery();
|
||||||
|
|
Loading…
Reference in New Issue