A3XX: FMGC ILS improvements

This commit is contained in:
Joshua Davidson 2017-11-13 12:03:31 -05:00
parent 50035ad9ae
commit 4e26c2a787
6 changed files with 36 additions and 40 deletions

View file

@ -119,7 +119,7 @@
<path>Aircraft/IDG-A32X/Systems/it-fbw.xml</path>
</autopilot>
<autopilot n="3">
<path>Aircraft/IDG-A32X/Systems/fmgc-b.xml</path>
<path>Aircraft/IDG-A32X/Systems/fmgc-drivers.xml</path>
</autopilot>
<autopilot n="4">
<path>Aircraft/IDG-A32X/Systems/fmgc-roll-yaw.xml</path>
@ -128,7 +128,7 @@
<path>Aircraft/IDG-A32X/Systems/fmgc-pitch.xml</path>
</autopilot>
<autopilot n="6">
<path>Aircraft/IDG-A32X/Systems/custom-autothrust.xml</path>
<path>Aircraft/IDG-A32X/Systems/fmgc-thrust.xml</path>
</autopilot>
<autopilot n="7">
<path>Aircraft/IDG-A32X/Systems/libraries.xml</path>
@ -1211,7 +1211,6 @@
<libraries>
<file>Aircraft/IDG-A32X/Nasal/libraries.nas</file>
<file>Aircraft/IDG-A32X/Nasal/buttons.nas</file>
<file>Aircraft/IDG-A32X/Nasal/PFD_FMA.nas</file>
<file>Aircraft/IDG-A32X/Nasal/gpws.nas</file>
<file>Aircraft/IDG-A32X/Nasal/efis.nas</file>
<file>Aircraft/IDG-A32X/Nasal/ECAM.nas</file>
@ -1239,6 +1238,7 @@
<fmgc>
<file>Aircraft/IDG-A32X/Nasal/FMGC.nas</file>
<file>Aircraft/IDG-A32X/Nasal/FMGC-b.nas</file>
<file>Aircraft/IDG-A32X/Nasal/FMGC-c.nas</file>
</fmgc>
<mcdu1>
<file>Aircraft/IDG-A32X/Nasal/MCDU1/MCDU.nas</file>

View file

@ -16,7 +16,6 @@ setprop("/it-autoflight/internal/altitude-5-sec-ahead", 0);
setlistener("/sim/signals/fdm-initialized", func {
var trueSpeedKts = getprop("/instrumentation/airspeed-indicator/true-speed-kt");
var locdefl = getprop("/instrumentation/nav[0]/heading-needle-deflection-norm");
var locdefl_b = getprop("/instrumentation/nav[1]/heading-needle-deflection-norm");
var signal = getprop("/instrumentation/nav[0]/gs-needle-deflection-norm");
var VS = getprop("/velocities/vertical-speed-fps");
var TAS = getprop("/velocities/uBody-fps");
@ -235,14 +234,14 @@ var lateral = func {
gui.popupTip("Please make sure you have a route set, and that it is Activated!");
}
} else if (latset == 2) {
if (getprop("/it-autoflight/output/lat") == 2) {
# Do nothing because VOR/LOC is active
} else {
setprop("/instrumentation/nav[0]/signal-quality-norm", 0);
setprop("/instrumentation/nav[1]/signal-quality-norm", 0);
if (getprop("/instrumentation/nav[0]/in-range") == 1) {
if (getprop("/it-autoflight/output/lat") != 2) {
setprop("/it-autoflight/output/loc-armed", 1);
setprop("/it-autoflight/mode/arm", "LOC");
}
} else {
setprop("/instrumentation/nav[0]/signal-quality-norm", 0);
}
} else if (latset == 3) {
alandt.stop();
alandt1.stop();
@ -338,20 +337,18 @@ var vertical = func {
}
thrustmode();
} else if (vertset == 2) {
if (getprop("/it-autoflight/output/lat") == 2) {
# Do nothing because VOR/LOC is active
} else {
setprop("/instrumentation/nav[0]/signal-quality-norm", 0);
setprop("/instrumentation/nav[1]/signal-quality-norm", 0);
if (getprop("/instrumentation/nav[0]/in-range") == 1) {
if (getprop("/it-autoflight/output/lat") != 2) {
setprop("/it-autoflight/output/loc-armed", 1);
}
if ((getprop("/it-autoflight/output/vert") == 2) or (getprop("/it-autoflight/output/vert") == 6)) {
# Do nothing because G/S or LAND or FLARE is active
} else {
setprop("/instrumentation/nav[0]/gs-rate-of-climb", 0);
if (getprop("/it-autoflight/output/vert") != 2 and getprop("/it-autoflight/output/vert") != 6) {
setprop("/it-autoflight/output/appr-armed", 1);
setprop("/it-autoflight/mode/arm", "ILS");
}
} else {
setprop("/instrumentation/nav[0]/signal-quality-norm", 0);
setprop("/instrumentation/nav[0]/gs-rate-of-climb", 0);
}
} else if (vertset == 3) {
alandt.stop();
alandt1.stop();
@ -788,12 +785,10 @@ var check_arms = func {
}
var update_arms = func {
if (getprop("/instrumentation/nav[0]/in-range") == 1) {
if (getprop("/it-autoflight/output/loc-armed")) {
locdefl = getprop("/instrumentation/nav[0]/heading-needle-deflection-norm");
locdefl_b = getprop("/instrumentation/nav[1]/heading-needle-deflection-norm");
if ((locdefl < 0.9233) and (getprop("/instrumentation/nav[0]/signal-quality-norm") > 0.99) and (getprop("/FMGC/internal/loc-source") == "NAV0")) {
make_loc_active();
} else if ((locdefl_b < 0.9233) and (getprop("/instrumentation/nav[2]/signal-quality-norm") > 0.99) and (getprop("/FMGC/internal/loc-source") == "VOR0")) {
locdefl = abs(getprop("/instrumentation/nav[0]/heading-needle-deflection-norm"));
if (locdefl < 0.95 and locdefl != 0 and getprop("/instrumentation/nav[0]/signal-quality-norm") > 0.99) {
make_loc_active();
} else {
return 0;
@ -801,12 +796,13 @@ var update_arms = func {
}
if (getprop("/it-autoflight/output/appr-armed")) {
signal = getprop("/instrumentation/nav[0]/gs-needle-deflection-norm");
if (((signal < 0 and signal >= -0.30) or (signal > 0 and signal <= 0.30)) and (getprop("/FMGC/internal/loc-source") == "NAV0") and (getprop("/it-autoflight/output/lat") == 2)) {
if (((signal < 0 and signal >= -0.20) or (signal > 0 and signal <= 0.20)) and getprop("/it-autoflight/output/lat") == 2) {
make_appr_active();
} else {
return 0;
}
}
}
}
var make_loc_active = func {

View file

@ -1,5 +1,5 @@
# Airbus PFD FMA
# Joshua Davidson (it0uchpods)
# A3XX FMGC/Autoflight
# Joshua Davidson (it0uchpods) and Jonathan Redpath (legoboyvdlp)
#########################################
# Copyright (c) it0uchpods Design Group #
@ -237,9 +237,9 @@ setlistener("/it-autoflight/mode/lat", func {
var locupdate = maketimer(0.5, func {
var lat = getprop("/it-autoflight/mode/lat");
var newlat = getprop("/modes/pfd/fma/roll-mode");
var nav_defl = getprop("/it-autoflight/internal/nav-heading-error-deg");
var nav_defl = getprop("/instrumentation/nav[0]/heading-needle-deflection-norm");
if (lat == "LOC") {
if (nav_defl > -1 and nav_defl < 1) {
if (nav_defl > -0.15 and nav_defl < 0.15) {
locupdate.stop();
if (newlat != "LOC") {
setprop("/modes/pfd/fma/roll-mode", "LOC");

View file

@ -1 +1 @@
3063
3064