diff --git a/public_html/dbloader.js b/public_html/dbloader.js index 2666cf0..2d2a545 100644 --- a/public_html/dbloader.js +++ b/public_html/dbloader.js @@ -89,9 +89,7 @@ function lookupIcaoAircraftType(aircraftData, defer) { if (typeDesignator in _aircraft_type_cache) { var typeData = _aircraft_type_cache[typeDesignator]; if (typeData.desc != undefined && typeData.desc != null && typeData.desc.length == 3) { - aircraftData.aircraftTypeCode = typeData.desc.charAt(0); - aircraftData.engineCount = parseInt(typeData.desc.charAt(1)); - aircraftData.engineTypeCode = typeData.desc.charAt(2); + aircraftData.desc = typeData.desc; } aircraftData.wtc = typeData.wtc; } diff --git a/public_html/planeObject.js b/public_html/planeObject.js index 1deb0bc..17aca6d 100644 --- a/public_html/planeObject.js +++ b/public_html/planeObject.js @@ -46,6 +46,10 @@ function PlaneObject(icao) { // request metadata this.registration = null; this.icaotype = null; + this.aircraftTypeCode = null; + this.engineCount = null; + this.engineType = null; + this.wtc = null; getAircraftData(this.icao).done(function(data) { if ("r" in data) { this.registration = data.r; @@ -55,6 +59,16 @@ function PlaneObject(icao) { this.icaotype = data.t; } + if ("desc" in data) { + this.aircraftTypeCode = data.desc.charAt(0); + this.engineCount = parseInt(data.desc.charAt(1)); + this.engineTypeCode = data.desc.charAt(2); + } + + if ("wtc" in data) { + this.wtc = data.wtc; + } + if (this.selected) { refreshSelected(); }