A3XX: Improve G/S Capture, improve FMA

This commit is contained in:
Joshua Davidson 2017-07-03 19:46:42 -04:00
parent 4a97e1d3b7
commit 09e6a0f2bd
2 changed files with 35 additions and 5 deletions

View file

@ -717,7 +717,7 @@ var make_loc_active = func {
var apparmcheck = func {
var signal = getprop("/instrumentation/nav[0]/gs-needle-deflection-norm");
if ((signal <= -0.000000001) and (getprop("/FMGC/internal/loc-source") == "NAV0") and (getprop("/it-autoflight/output/lat") == 2)) {
if (((signal < 0 and signal >= 0.45) or (signal > 0 and signal <= 0.30)) and (getprop("/FMGC/internal/loc-source") == "NAV0") and (getprop("/it-autoflight/output/lat") == 2)) {
make_appr_active();
} else {
return 0;

View file

@ -99,8 +99,9 @@ setlistener("/it-autoflight/mode/lat", func {
setprop("/modes/pfd/fma/roll-mode", "NAV");
}
} else if (lat == "LOC") {
if (newlat != "LOC") {
setprop("/modes/pfd/fma/roll-mode", "LOC");
if (newlat != "LOC*" and newlat != "LOC") {
setprop("/modes/pfd/fma/roll-mode", "LOC*");
locupdate.start();
}
} else if (lat == "ALGN") {
if (newlat != "LAND") {
@ -113,6 +114,20 @@ 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");
if (lat == "LOC") {
if (nav_defl > -1 and nav_defl < 1) {
locupdate.stop();
if (newlat != "LOC") {
setprop("/modes/pfd/fma/roll-mode", "LOC");
}
}
}
});
# Master Vertical
setlistener("/it-autoflight/mode/vert", func {
var vert = getprop("/it-autoflight/mode/vert");
@ -142,8 +157,9 @@ setlistener("/it-autoflight/mode/vert", func {
setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT");
}
} else if (vert == "G/S") {
if (newvert != "G/S") {
setprop("/modes/pfd/fma/pitch-mode", "G/S");
if (newvert != "G/S*" and newvert != "G/S") {
setprop("/modes/pfd/fma/pitch-mode", "G/S*");
gsupdate.start();
}
if (newvertarm != " ") {
setprop("/modes/pfd/fma/pitch-mode2-armed", " ");
@ -223,6 +239,20 @@ setlistener("/it-autoflight/mode/vert", func {
altvert();
});
var gsupdate = maketimer(0.5, func {
var vert = getprop("/it-autoflight/mode/vert");
var newvert = getprop("/modes/pfd/fma/pitch-mode");
var gs_defl = getprop("/instrumentation/nav[0]/gs-needle-deflection-norm");
if (vert == "G/S") {
if (gs_defl > -0.06 and gs_defl < 0.06) {
gsupdate.stop();
if (newvert != "G/S") {
setprop("/modes/pfd/fma/pitch-mode", "G/S");
}
}
}
});
var altvert = func {
var FMGCalt = getprop("/FMGC/internal/cruise-ft");
var MCPalt = getprop("/it-autoflight/internal/alt");