1
0
Fork 0

PFD: make the altitude field display flight levels with correct spacing

This commit is contained in:
Jonathan Redpath 2022-05-05 14:03:56 +01:00
parent e498edb4a3
commit b0dc826480
2 changed files with 8 additions and 10 deletions

View file

@ -687,23 +687,18 @@ var canvas_pfd = {
}), }),
props.UpdateManager.FromHashList(["altimeterHpa","altimeterInhg","altimeterInhgMode"], 0.005, func(val) { props.UpdateManager.FromHashList(["altimeterHpa","altimeterInhg","altimeterInhgMode"], 0.005, func(val) {
if (val.altimeterInhgMode == 0) { if (val.altimeterInhgMode == 0) {
obj["QNH_setting"].setText(sprintf("%4.0f", val.altimeterHpa)); obj["QNH_setting"].setText(sprintf("%4d", val.altimeterHpa));
} else { } else {
obj["QNH_setting"].setText(sprintf("%2.2f", val.altimeterInhg)); obj["QNH_setting"].setText(sprintf("%2.2f", val.altimeterInhg));
} }
}), }),
props.UpdateManager.FromHashList(["altimeterStd","altitudeAutopilot"], 1, func(val) { props.UpdateManager.FromHashList(["altimeterStd","altitudeAutopilot"], 1, func(val) {
if (val.altimeterStd == 1) { if (val.altimeterStd == 1) {
if (val.altitudeAutopilot < 10000) { obj["ALT_digit_UP"].setText(sprintf("FL%3d", val.altitudeAutopilot / 100));
obj["ALT_digit_UP"].setText(sprintf("%s", "FL " ~ val.altitudeAutopilot / 100)); obj["ALT_digit_DN"].setText(sprintf("FL%3d", val.altitudeAutopilot / 100));
obj["ALT_digit_DN"].setText(sprintf("%s", "FL " ~ val.altitudeAutopilot / 100));
} else {
obj["ALT_digit_UP"].setText(sprintf("%s", "FL " ~ val.altitudeAutopilot / 100));
obj["ALT_digit_DN"].setText(sprintf("%s", "FL " ~ val.altitudeAutopilot / 100));
}
} else { } else {
obj["ALT_digit_UP"].setText(sprintf("%5.0f", val.altitudeAutopilot)); obj["ALT_digit_UP"].setText(sprintf("%5d", val.altitudeAutopilot));
obj["ALT_digit_DN"].setText(sprintf("%5.0f", val.altitudeAutopilot)); obj["ALT_digit_DN"].setText(sprintf("%5d", val.altitudeAutopilot));
} }
}), }),
props.UpdateManager.FromHashValue("managedSpd", 1, func(val) { props.UpdateManager.FromHashValue("managedSpd", 1, func(val) {

View file

@ -192,6 +192,9 @@ var ELEC = {
me.Fail.tr1Fault.setBoolValue(0); me.Fail.tr1Fault.setBoolValue(0);
me.Fail.tr2Fault.setBoolValue(0); me.Fail.tr2Fault.setBoolValue(0);
}, },
loop: func() {
# Empty, required for Emesary
},
}; };
setlistener("/systems/fmgc/power/power-1-on", func(val) { setlistener("/systems/fmgc/power/power-1-on", func(val) {