Skip to content

Commit

Permalink
fix(A380): Fixed ADIRS alignment time flyPad setting (#8530), fix(fcu…
Browse files Browse the repository at this point in the history
…): disable qfe mode (#8527), fix(EFB/System): add missing imports
  • Loading branch information
masterrob94 committed Feb 28, 2024
1 parent c0e79e6 commit 5ea69db
Show file tree
Hide file tree
Showing 30 changed files with 249 additions and 211 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ strip = true
opt-level=1
lto = false
debug-assertions=true
debug=true
debug=true
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@
<script type="text/html" import-script="/Pages/A318HS_Core/A32NX_Speeds.js"></script>
<script type="text/html" import-script="/Pages/A318HS_Core/A32NX_SoundManager.js"></script>
<script type="text/html" import-script="/Pages/A318HS_Core/A32NX_BaroSelector.js"></script>
<script type="text/html" import-script="/Pages/A318HS_Core/A32NX_ADIRS.js"></script>
<script type="text/html" import-script="/Pages/A318HS_Core/A32NX_BrakeTemp.js"></script>
<script type="text/html" import-script="/Pages/A318HS_Core/A32NX_Refuel.js"></script>
<script type="text/html" import-script="/Pages/A318HS_Core/A32NX_DMC.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ class A320_Neo_FCU_Component {
}
setTextElementActive(_text, _active) {
if (_text != null) {
_text.setAttribute("class", "Common " + (_active ? "Active" : "Inactive"));
if (_active === true) {
_text.classList.replace("Inactive", "Active");
} else {
_text.classList.replace("Active", "Inactive");
}
}
}
setElementVisibility(_element, _show) {
Expand Down Expand Up @@ -1380,20 +1384,20 @@ class A320_Neo_FCU_Pressure extends A320_Neo_FCU_Component {
this.currentValue = _value;
this.lightsTest = _lightsTest;
if (this.lightsTest) {
this.standardElem.style.display = "none";
this.selectedElem.style.display = "block";
this.setElementVisibility(this.standardElem, false);
this.setElementVisibility(this.selectedElem, true);
this.setTextElementActive(this.textQFE, true);
this.setTextElementActive(this.textQNH, true);
this.textValueContent = "88.88";
return;
}
if (this.currentMode == "STD") {
this.standardElem.style.display = "block";
this.selectedElem.style.display = "none";
this.setElementVisibility(this.standardElem, true);
this.setElementVisibility(this.selectedElem, false);
SimVar.SetSimVarValue("KOHLSMAN SETTING STD", "Bool", 1);
} else {
this.standardElem.style.display = "none";
this.selectedElem.style.display = "block";
this.setElementVisibility(this.standardElem, false);
this.setElementVisibility(this.selectedElem, true);
SimVar.SetSimVarValue("KOHLSMAN SETTING STD", "Bool", 0);
const isQFE = (this.currentMode == "QFE") ? true : false;
this.setTextElementActive(this.textQFE, isQFE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_Speeds.js"></script>
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_SoundManager.js"></script>
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_BaroSelector.js"></script>
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_ADIRS.js"></script>
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_BrakeTemp.js"></script>
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_Refuel.js"></script>
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_DMC.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_Speeds.js"></script>
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_SoundManager.js"></script>
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_BaroSelector.js"></script>
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_ADIRS.js"></script>
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_BrakeTemp.js"></script>
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_Refuel.js"></script>
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_DMC.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_Speeds.js"></script>
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_SoundManager.js"></script>
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_BaroSelector.js"></script>
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_ADIRS.js"></script>
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_BrakeTemp.js"></script>
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_Refuel.js"></script>
<script type="text/html" import-script="/Pages/A319HS_Core/A32NX_DMC.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ class A320_Neo_FCU_Component {
}
setTextElementActive(_text, _active) {
if (_text != null) {
_text.setAttribute("class", "Common " + (_active ? "Active" : "Inactive"));
if (_active === true) {
_text.classList.replace("Inactive", "Active");
} else {
_text.classList.replace("Active", "Inactive");
}
}
}
setElementVisibility(_element, _show) {
Expand Down Expand Up @@ -1380,20 +1384,20 @@ class A320_Neo_FCU_Pressure extends A320_Neo_FCU_Component {
this.currentValue = _value;
this.lightsTest = _lightsTest;
if (this.lightsTest) {
this.standardElem.style.display = "none";
this.selectedElem.style.display = "block";
this.setElementVisibility(this.standardElem, false);
this.setElementVisibility(this.selectedElem, true);
this.setTextElementActive(this.textQFE, true);
this.setTextElementActive(this.textQNH, true);
this.textValueContent = "88.88";
return;
}
if (this.currentMode == "STD") {
this.standardElem.style.display = "block";
this.selectedElem.style.display = "none";
this.setElementVisibility(this.standardElem, true);
this.setElementVisibility(this.selectedElem, false);
SimVar.SetSimVarValue("KOHLSMAN SETTING STD", "Bool", 1);
} else {
this.standardElem.style.display = "none";
this.selectedElem.style.display = "block";
this.setElementVisibility(this.standardElem, false);
this.setElementVisibility(this.selectedElem, true);
SimVar.SetSimVarValue("KOHLSMAN SETTING STD", "Bool", 0);
const isQFE = (this.currentMode == "QFE") ? true : false;
this.setTextElementActive(this.textQFE, isQFE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_Speeds.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_SoundManager.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_BaroSelector.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_ADIRS.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_BrakeTemp.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_Refuel.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_DMC.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_Speeds.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_SoundManager.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_BaroSelector.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_ADIRS.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_BrakeTemp.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_Refuel.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_DMC.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_Speeds.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_SoundManager.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_BaroSelector.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_ADIRS.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_BrakeTemp.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_Refuel.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_DMC.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_Speeds.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_SoundManager.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_BaroSelector.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_ADIRS.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_BrakeTemp.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_Refuel.js"></script>
<script type="text/html" import-script="/Pages/A320HS_Core/A32NX_DMC.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ class A320_Neo_FCU_Component {
}
setTextElementActive(_text, _active) {
if (_text != null) {
_text.setAttribute("class", "Common " + (_active ? "Active" : "Inactive"));
if (_active === true) {
_text.classList.replace("Inactive", "Active");
} else {
_text.classList.replace("Active", "Inactive");
}
}
}
setElementVisibility(_element, _show) {
Expand Down Expand Up @@ -1380,20 +1384,20 @@ class A320_Neo_FCU_Pressure extends A320_Neo_FCU_Component {
this.currentValue = _value;
this.lightsTest = _lightsTest;
if (this.lightsTest) {
this.standardElem.style.display = "none";
this.selectedElem.style.display = "block";
this.setElementVisibility(this.standardElem, false);
this.setElementVisibility(this.selectedElem, true);
this.setTextElementActive(this.textQFE, true);
this.setTextElementActive(this.textQNH, true);
this.textValueContent = "88.88";
return;
}
if (this.currentMode == "STD") {
this.standardElem.style.display = "block";
this.selectedElem.style.display = "none";
this.setElementVisibility(this.standardElem, true);
this.setElementVisibility(this.selectedElem, false);
SimVar.SetSimVarValue("KOHLSMAN SETTING STD", "Bool", 1);
} else {
this.standardElem.style.display = "none";
this.selectedElem.style.display = "block";
this.setElementVisibility(this.standardElem, false);
this.setElementVisibility(this.selectedElem, true);
SimVar.SetSimVarValue("KOHLSMAN SETTING STD", "Bool", 0);
const isQFE = (this.currentMode == "QFE") ? true : false;
this.setTextElementActive(this.textQFE, isQFE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@ class FMCMainDisplay extends BaseAirliners {
const dhValid = !mdaValid && inRange && typeof this.perfApprDH === 'number';

const mdaSsm = mdaValid ? Arinc429Word.SignStatusMatrix.NormalOperation : Arinc429Word.SignStatusMatrix.NoComputedData;
const dhSsm = dhValid ? Arinc429Word.SignStatusMatrix.NormalOperation : Arinc429Word.SignStatusMatrix.NoComputedData
const dhSsm = dhValid ? Arinc429Word.SignStatusMatrix.NormalOperation : Arinc429Word.SignStatusMatrix.NoComputedData;

this.arincMDA.setBnrValue(mdaValid ? this.perfApprMDA : 0, mdaSsm, 17, 131072, 0);
this.arincDH.setBnrValue(dhValid ? this.perfApprDH : 0, dhSsm, 16, 8192, 0);
Expand Down Expand Up @@ -3088,7 +3088,7 @@ class FMCMainDisplay extends BaseAirliners {
const accAlt = match[4] !== undefined ? FMCMainDisplay.round(parseInt(match[4]), 10) : undefined;

const origin = this.flightPlanManager.getPersistentOrigin();
let elevation = origin.infos.elevation !== undefined ? origin.infos.elevation : 0;
const elevation = origin.infos.elevation !== undefined ? origin.infos.elevation : 0;
const minimumAltitude = elevation + 400;

const newThrRed = thrRed !== undefined ? thrRed : plan.thrustReductionAltitude;
Expand Down Expand Up @@ -3143,7 +3143,7 @@ class FMCMainDisplay extends BaseAirliners {
const accAlt = parseInt(match[1]);

const origin = this.flightPlanManager.getPersistentOrigin();
let elevation = origin.infos.elevation !== undefined ? origin.infos.elevation : 0;
const elevation = origin.infos.elevation !== undefined ? origin.infos.elevation : 0;
const minimumAltitude = elevation + 400;

if (accAlt < minimumAltitude || accAlt > 45000) {
Expand Down Expand Up @@ -3187,7 +3187,7 @@ class FMCMainDisplay extends BaseAirliners {
const accAlt = match[4] !== undefined ? FMCMainDisplay.round(parseInt(match[4]), 10) : undefined;

const destination = this.flightPlanManager.getDestination();
let elevation = destination.infos.elevation !== undefined ? destination.infos.elevation : 0;
const elevation = destination.infos.elevation !== undefined ? destination.infos.elevation : 0;
const minimumAltitude = elevation + 400;

const newThrRed = thrRed !== undefined ? thrRed : plan.missedThrustReductionAltitude;
Expand Down Expand Up @@ -3242,7 +3242,7 @@ class FMCMainDisplay extends BaseAirliners {
const accAlt = parseInt(match[1]);

const destination = this.flightPlanManager.getDestination();
let elevation = destination.infos.elevation !== undefined ? destination.infos.elevation : 0;
const elevation = destination.infos.elevation !== undefined ? destination.infos.elevation : 0;
const minimumAltitude = elevation + 400;

if (accAlt < minimumAltitude || accAlt > 45000) {
Expand Down Expand Up @@ -3307,14 +3307,14 @@ class FMCMainDisplay extends BaseAirliners {
originTransitionAltitude !== undefined ? originTransitionAltitude : 0,
originTransitionAltitude !== undefined ? Arinc429Word.SignStatusMatrix.NormalOperation : Arinc429Word.SignStatusMatrix.NoComputedData,
17, 131072, 0,
)
);

const destinationTansitionLevel = this.flightPlanManager.destinationTransitionLevel;
this.arincTransitionLevel.setBnrValue(
destinationTansitionLevel !== undefined ? destinationTansitionLevel : 0,
destinationTansitionLevel !== undefined ? Arinc429Word.SignStatusMatrix.NormalOperation : Arinc429Word.SignStatusMatrix.NoComputedData,
9, 512, 0,
)
);
}

//Needs PR Merge #3082
Expand Down Expand Up @@ -3793,7 +3793,7 @@ class FMCMainDisplay extends BaseAirliners {
const spd = parseInt(s);
if (!Number.isFinite(spd)) {
this.setScratchpadMessage(NXSystemMessages.formatError);
return false
return false;
}

if (spd < 100 || spd > 350) {
Expand Down Expand Up @@ -4279,46 +4279,47 @@ class FMCMainDisplay extends BaseAirliners {
}

checkEFOBBelowMin() {
if (!this._minDestFobEntered) {
this.tryUpdateMinDestFob();
}
if (this._fuelPredDone) {
if (!this._minDestFobEntered) {
this.tryUpdateMinDestFob();
}

if (this._minDestFob) {
if (this._minDestFob) {
// round & only use 100kgs precision since thats how it is displayed in fuel pred
const destEfob = Math.round(this.getDestEFOB(this.isAnEngineOn()) * 10) / 10;
const roundedMinDestFob = Math.round(this._minDestFob * 10) / 10;
if (!this._isBelowMinDestFob) {
if (destEfob < roundedMinDestFob) {
this._isBelowMinDestFob = true;
// TODO should be in flight only and if fuel is below min dest efob for 2 minutes
if (this.isAnEngineOn()) {
setTimeout(() => {
const destEfob = Math.round(this.getDestEFOB(this.isAnEngineOn()) * 10) / 10;
const roundedMinDestFob = Math.round(this._minDestFob * 10) / 10;
if (!this._isBelowMinDestFob) {
if (destEfob < roundedMinDestFob) {
this._isBelowMinDestFob = true;
// TODO should be in flight only and if fuel is below min dest efob for 2 minutes
if (this.isAnEngineOn()) {
setTimeout(() => {
this.addMessageToQueue(NXSystemMessages.destEfobBelowMin, () => {
return this._EfobBelowMinClr === true;
}, () => {
this._EfobBelowMinClr = true;
});
}, 120000);
} else {
this.addMessageToQueue(NXSystemMessages.destEfobBelowMin, () => {
return this._EfobBelowMinClr === true;
}, () => {
this._EfobBelowMinClr = true;
});
}, 120000);
} else {
this.addMessageToQueue(NXSystemMessages.destEfobBelowMin, () => {
return this._EfobBelowMinClr === true;
}, () => {
this._EfobBelowMinClr = true;
});
}
}
}
} else {
} else {
// check if we are at least 300kgs above min dest efob to show green again & the ability to trigger the message
if (roundedMinDestFob) {
if (destEfob - roundedMinDestFob >= 0.3) {
this._isBelowMinDestFob = false;
this.removeMessageFromQueue(NXSystemMessages.destEfobBelowMin)
if (roundedMinDestFob) {
if (destEfob - roundedMinDestFob >= 0.3) {
this._isBelowMinDestFob = false;
this.removeMessageFromQueue(NXSystemMessages.destEfobBelowMin);
}
}
}
}
}
}
}

updateTowerHeadwind() {
if (isFinite(this.perfApprWindSpeed) && isFinite(this.perfApprWindHeading)) {
Expand Down Expand Up @@ -5209,7 +5210,7 @@ class FMCMainDisplay extends BaseAirliners {
if (Number.isFinite(mach)) {
if (mach < 0.15 || mach > 0.82) {
this.setScratchpadMessage(NXSystemMessages.entryOutOfRange);
return false
return false;
}

this.managedSpeedDescendMachPilot = mach;
Expand All @@ -5222,7 +5223,7 @@ class FMCMainDisplay extends BaseAirliners {
if (Number.isFinite(mach)) {
if (mach < 0.15 || mach > 0.82) {
this.setScratchpadMessage(NXSystemMessages.entryOutOfRange);
return false
return false;
}

this.managedSpeedDescendMachPilot = mach;
Expand Down
Loading

0 comments on commit 5ea69db

Please sign in to comment.