Skip to content

Commit

Permalink
Merge pull request #1 from flybywiresim/master
Browse files Browse the repository at this point in the history
Added functionality to the ECAM ALL button (flybywiresim#1467)
  • Loading branch information
RichardPilbery authored Oct 21, 2020
2 parents 30405b7 + c3d1f8f commit 8859b8f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
1. [ECAM] Fixed LDG/TO memo showing at incorrect times - @MMontalto (PiCcy)
1. [MISC] Fixed DECEL always show up on left button only - @jokey2k (JoKeY | Markus#0001 on discord)
1. [ECAM] Engine bleed valve closes at N2 > 50% @RichardPilbery (Richard Pilbery)
1. [ECAM] Added ECAM ALL button functionality @MikeKuijper (Mike Kuijper)

## 2020/09
1. [General] Add CHANGELOG.md - @nathaninnes (Nathan Innes)
Expand All @@ -74,4 +75,4 @@
1. [ECAM] Lower ECAM DOOR Page Colour Fix - @nathaninnes (Nathan Innes)
1. [ND] Add DME distances, VOR/ADF needles and functioning ADF2 - @blitzcaster (bltzcstr)
1. [OVHD] Fixed Battery Indicator Colour - @nathaninnes (Nathan Innes)
1. [MISC] Removed Fuel Patch from MSFS Update 1.8.3 - @nathaninnes (Nathan Innes)
1. [MISC] Removed Fuel Patch from MSFS Update 1.8.3 - @nathaninnes (Nathan Innes)
4 changes: 3 additions & 1 deletion A32NX/ModelBehaviorDefs/Asobo/Airliner/Airbus.xml
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,9 @@
<UseTemplate Name="A32NX_ECAM_ALL_BUTTON_Template">
<BASE_NAME>ALL</BASE_NAME>
<PART_ID>ECAM_ALL</PART_ID>
<TOOLTIPID>Cycle through ECAM pages (INOP)</TOOLTIPID>
<SWITCH_POSITION_TYPE>L</SWITCH_POSITION_TYPE>
<SWITCH_POSITION_VAR>A32NX_ECAM_ALL_Push</SWITCH_POSITION_VAR>
<TOOLTIPID>Cycle through ECAM pages</TOOLTIPID>
</UseTemplate>

<UseTemplate Name="ASOBO_ECAM_PAGE_BUTTON_Template">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ class A320_Neo_EICAS extends Airliners.BaseEICAS {
SimVar.SetSimVarValue("LIGHT POTENTIOMETER:91", "FLOAT64", 0.1);
SimVar.SetSimVarValue("LIGHT POTENTIOMETER:92", "FLOAT64", 0.1);
SimVar.SetSimVarValue("LIGHT POTENTIOMETER:93", "FLOAT64", 0.1);

this.ecamAllButtonPrevState = false;
}

onUpdate() {
Expand Down Expand Up @@ -269,22 +271,7 @@ class A320_Neo_EICAS extends Airliners.BaseEICAS {
const sFailPage = SimVar.GetSimVarValue("L:A32NX_ECAM_SFAIL", "Enum");

if (sFailPage != -1) {
const ECAMPageIndices = {
0: "ENG",
1: "BLEED",
2: "PRESS",
3: "ELEC",
4: "HYD",
5: "FUEL",
6: "APU",
7: "COND",
8: "DOOR",
9: "WHEEL",
10: "FTCL",
11: "STS"
};

this.pageNameWhenUnselected = ECAMPageIndices[sFailPage];
this.pageNameWhenUnselected = this.lowerScreenPages[sFailPage].name;

// Disable user selected page when new failure detected
if (this.PrevFailPage !== sFailPage) {
Expand All @@ -296,9 +283,21 @@ class A320_Neo_EICAS extends Airliners.BaseEICAS {
// switch page when desired page was changed, or new Failure detected
if ((this.pageNameWhenUnselected != prevPage && this.currentPage == -1) || (this.PrevFailPage !== sFailPage)) {
this.SwitchToPageName(this.LOWER_SCREEN_GROUP_NAME, this.pageNameWhenUnselected);
}

// ECAM all button
this.ecamAllButtonState = SimVar.GetSimVarValue("L:A32NX_ECAM_ALL_Push_IsDown", "Bool");

if (this.ecamAllButtonState && !this.ecamAllButtonPrevState) { // button press
this.changePage(this.lowerScreenPages[(this.currentPage + 1) % this.lowerScreenPages.length].name);
this.ecamCycleInterval = setInterval(() => {
this.changePage(this.lowerScreenPages[(this.currentPage + 1) % this.lowerScreenPages.length].name);
}, 1000);
} else if (!this.ecamAllButtonState && this.ecamAllButtonPrevState) { // button release
clearInterval(this.ecamCycleInterval);
}

this.ecamAllButtonPrevState = this.ecamAllButtonState;
this.PrevFailPage = sFailPage;
}

Expand Down

0 comments on commit 8859b8f

Please sign in to comment.