Here is where the KT76c Transponder gets its altitude reading from (instead of PRESSURE ALTITUDE like it should be. So I just replaced “INDICATED ALTITUDE:3” with “PRESSURE ALTITUDE”, and the Transponder acts as it should).
getAltitude() {
return SimVar.GetSimVarValue(“INDICATED ALTITUDE:3”, “feet”);
This is where the KAP140 gets its altitude information from. Note that it is using Register :2, and that it references the fact the KAP140 has its own Kohlsman setting (:2) independent of the Kohlsman setting of the Altimeter.
getBaroHPa() {
return (fastToFixed(SimVar.GetSimVarValue("KOHLSMAN SETTING MB:2", "Millibars"), 0)).replace(/\d+(?=(\d{3}))/, '$&,');
}
getBaroInHg() {
return fastToFixed(SimVar.GetSimVarValue("KOHLSMAN SETTING HG:2", "inHg"), 3);
}
getAltitudeDifference() {
return Math.abs(SimVar.GetSimVarValue("INDICATED ALTITUDE:2", "feet") - SimVar.GetSimVarValue("AUTOPILOT ALTITUDE LOCK VAR", "feet"));
This is where the Altimeter gets its altitude information from. Note that it basically sets the index (from this.altimeterIndex) to 1 after initializing it to 0. I couldn’t find any code where it would increment beyond 1. This is from the CommonPFD_MFD.js code.
class PFD_Altimeter extends NavSystemElement {
constructor() {
super(…arguments);
this.lastAltitude = -10000;
this.lastPressure = -10000;
this.lastSelectedAltitude = -10000;
this.selectedAltWasCaptured = false;
this.blinkTime = 0;
this.alertState = 0;
this.altimeterIndex = 0;
this.readyToSet = false;
}
init(root) {
this.altimeterElement = this.gps.getChildById(“Altimeter”);
if (this.gps.instrumentXmlConfig) {
let altimeterIndexElems = this.gps.instrumentXmlConfig.getElementsByTagName(“AltimeterIndex”);
if (altimeterIndexElems.length > 0) {
this.altimeterIndex = parseInt(altimeterIndexElems[0].textContent) + 1;
}
}
}
onEnter() {
}
onUpdate(_deltaTime) {
var altitude = SimVar.GetSimVarValue(“INDICATED ALTITUDE:” + this.altimeterIndex, “feet”);
var selectedAltitude = SimVar.GetSimVarValue(“AUTOPILOT ALTITUDE LOCK VAR”, “feet”);
if (altitude != this.lastAltitude) {
this.altimeterElement.setAttribute(“Altitude”, altitude.toFixed(1));
this.lastAltitude = altitude;
}