1
0
Fork 0

FMGC: Fix bugs on FMA

This commit is contained in:
Josh Davidson 2021-10-05 10:34:16 -04:00
parent e56672d06b
commit 410eb597ec
2 changed files with 14 additions and 14 deletions

View file

@ -925,6 +925,7 @@ var ITAF = {
} else if (Input.hdgCalc < 1) { # It's rounded, so this is ok. Otherwise do < 0.5
Input.hdgCalc = Input.hdgCalc + 360;
}
updateFma.lat();
Input.hdg.setValue(Input.hdgCalc);
},
trkFpaOff: func() {
@ -941,6 +942,7 @@ var ITAF = {
} else if (Input.hdgCalc < 1) { # It's rounded, so this is ok. Otherwise do < 0.5
Input.hdgCalc = Input.hdgCalc + 360;
}
updateFma.lat();
Input.hdg.setValue(Input.hdgCalc);
},
updateLatText: func(t) {

View file

@ -204,18 +204,6 @@ var loopFMA = maketimer(0.05, func {
}
}
trk = Custom.trkFpa.getValue();
latText = Text.lat.getValue();
if (latText == "HDG" and trk == 0) {
if (newlat != "HDG") {
Modes.PFD.FMA.rollMode.setValue("HDG");
}
} else if (latText == "HDG" and trk == 1) {
if (newlat != "TRACK") {
Modes.PFD.FMA.rollMode.setValue("TRACK");
}
}
# Boxes
elapsedtime = pts.Sim.Time.elapsedSec.getValue();
if (Modes.PFD.FMA.apModeTime.getValue() + 10 >= elapsedtime) {
@ -283,7 +271,17 @@ var updateFma = {
lat: func() {
latText = Text.lat.getValue();
newlat = Modes.PFD.FMA.rollMode.getValue();
if (latText == "LNAV") {
if (latText == "HDG") {
if (Custom.trkFpa.getValue()) {
if (newlat != "TRACK") {
Modes.PFD.FMA.rollMode.setValue("TRACK");
}
} else {
if (newlat != "HDG") {
Modes.PFD.FMA.rollMode.setValue("HDG");
}
}
} else if (latText == "LNAV") {
if (newlat != "NAV") {
Modes.PFD.FMA.rollMode.setValue("NAV");
}
@ -628,7 +626,7 @@ setlistener("/modes/pfd/fma/pitch-mode-armed", func {
}, 0, 0);
setlistener("/modes/pfd/fma/pitch-mode2-armed", func {
if (Modes.PFD.FMA.pitchMode2Armed != " ") {
if (Modes.PFD.FMA.pitchMode2Armed.getValue() != " ") {
Modes.PFD.FMA.pitchMode2ArmedTime.setValue(pts.Sim.Time.elapsedSec.getValue());
}
}, 0, 0);