From 38312a8166cbd729e0580ecd16e7e57a61075902 Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Tue, 24 Oct 2017 13:25:19 -0400 Subject: [PATCH] A32X: Improve gear AGL calc --- Nasal/libraries.nas | 12 ------------ Systems/libraries.xml | 40 ++++++++++++++++++++++++++++++++++++++-- revision.txt | 2 +- 3 files changed, 39 insertions(+), 15 deletions(-) diff --git a/Nasal/libraries.nas b/Nasal/libraries.nas index 5619ef5c..8bf5971b 100644 --- a/Nasal/libraries.nas +++ b/Nasal/libraries.nas @@ -249,18 +249,6 @@ setlistener("/options/steep-ils", func { } }); -var aglgears = func { - var agl = getprop("/position/altitude-agl-ft") or 0; - var aglft = agl - 14.001; # is the position from the Airbus A320 above ground - var aglm = aglft * 0.3048; - setprop("/position/gear-agl-ft", aglft); - setprop("/position/gear-agl-m", aglm); - - settimer(aglgears, 0.01); -} - -aglgears(); - canvas.Text._lastText = canvas.Text["_lastText"]; canvas.Text.setText = func (text) { if (text == me._lastText) {return me;} diff --git a/Systems/libraries.xml b/Systems/libraries.xml index 964a62f2..605f249d 100644 --- a/Systems/libraries.xml +++ b/Systems/libraries.xml @@ -8,6 +8,42 @@ + + Gear AGL Altitude FT + gain + 1 + 0.05 + + + + /position/altitude-agl-ft + 15.001 + + + + /position/gear-agl-ft + 0 + 50000 + + + + Gear AGL Altitude M + gain + 1 + 0.05 + + + + /position/gear-agl-ft + 0.3048 + + + + /position/gear-agl-m + 0 + 50000 + + Gear AGL Altitude false @@ -429,7 +465,7 @@ 24000 5.70000 26000 5.20000 28000 4.70000 - 30000 4.40000 + 30000 4.40000 32000 4.00000 34000 3.60000 36000 3.30000 @@ -697,7 +733,7 @@ 24000 -52.5 26000 -50.5 28000 -48.5 - 30000 -46.5 + 30000 -46.5 32000 -44.5 34000 -38.9 36000 -33.3 diff --git a/revision.txt b/revision.txt index 5528a3ea..cfdc48c4 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -3005 \ No newline at end of file +3006 \ No newline at end of file