show long aircraft type in addition to type code

This commit is contained in:
Matthias Wirth
2020-08-12 17:08:42 +02:00
parent 5381893067
commit eea0cb6bc0
4 changed files with 26 additions and 6 deletions

View File

@@ -96,10 +96,10 @@ function lookupIcaoAircraftType(aircraftData, defer) {
if (typeDesignator in _aircraft_type_cache) {
let typeData = _aircraft_type_cache[typeDesignator];
if (typeData.desc != null && typeData.desc.length == 3) {
aircraftData[3] = typeData.desc;
aircraftData[5] = typeData.desc;
}
if (typeData.wtc != undefined && aircraftData.wtc === undefined) {
aircraftData[4] = typeData.wtc;
aircraftData[6] = typeData.wtc;
}
}
}

View File

@@ -182,6 +182,16 @@
</div>
</td>
</tr>
<tr>
<td>
<div class="infoHeading infoRowFluid">
<span title="Full Type">Type: </span>
</div>
<div class="infoData infoRowFluid">
<span id="selected_typelong"></span>
</div>
</td>
</tr>
<tr>
<td>
<div class="infoHeading infoRowFluid">

View File

@@ -109,6 +109,7 @@ function PlaneObject(icao) {
this.registration = registration_from_hexid(this.icao);
this.icaoType = null;
this.typeDescription = null;
this.typeLong = null;
this.wtc = null;
@@ -1975,12 +1976,16 @@ PlaneObject.prototype.getAircraftData = function() {
this.icaoTypeCache = this.icaoType;
}
if (data[3]) {
this.typeDescription = data[3];
if (data[5]) {
this.typeDescription = data[5];
}
if (data[4]) {
this.wtc = data[4];
if (data[6]) {
this.wtc = data[6];
}
if (data[3]) {
this.typeLong = data[3];
}
if (data[2]) {

View File

@@ -1799,6 +1799,11 @@ function refreshSelected() {
else
$('#selected_typedesc').text("n/a");
if (selected.typeLong)
$('#selected_typelong').text(selected.typeLong);
else
$('#selected_typelong').text("n/a");
if (showPictures && selected.icaoType){
let new_html = "<img width='150px' src='aircraft_sil/" + selected.icaoType + ".png' />";
if (new_html != selectedPhotoCache) {