Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EICAS improvements #135

Draft
wants to merge 36 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
36cd697
AUTORELIGHT and Idle N2
boufogre Jan 26, 2021
4989987
EGT gauge modifications
boufogre Jan 27, 2021
5bec0b3
better idle N2 calculation
boufogre Jan 28, 2021
11310b8
Many changes
boufogre Feb 19, 2021
23deba4
NaN init value for assumed temp
boufogre Feb 19, 2021
d5062c7
TMA changes
boufogre Feb 22, 2021
18c0771
Conflict resolution with master
boufogre Feb 22, 2021
20fec8a
Conflict resolution
boufogre Feb 22, 2021
02fb7e2
Merge branch 'master' into eicas-improvements
boufogre Feb 22, 2021
e59e820
Formatting
boufogre Mar 2, 2021
c11c930
Not needed
boufogre Mar 2, 2021
3340317
Formatting
boufogre Mar 2, 2021
b937674
Formatting
boufogre Mar 2, 2021
ad3ddf8
Delete B747_8_LowerEICAS_Engine.css
boufogre Mar 2, 2021
11f5d3a
Formatting
boufogre Mar 2, 2021
e8e6dbc
Formatting
boufogre Mar 2, 2021
8b6b8ec
formatting
boufogre Mar 4, 2021
e3a03b1
Formatting
boufogre Mar 4, 2021
24ad7fc
Formatting
boufogre Mar 4, 2021
56f9417
Formatting
boufogre Mar 4, 2021
836d005
Formatting
boufogre Mar 4, 2021
76424b0
Formatting
boufogre Mar 4, 2021
291449a
Formatting
boufogre Mar 6, 2021
64dafa0
Formatting
boufogre Mar 6, 2021
8074ae3
Formatting
boufogre Mar 6, 2021
816818b
Formatting
boufogre Mar 6, 2021
9026b3b
Formatting
boufogre Mar 6, 2021
4531a74
Formatting
boufogre Mar 8, 2021
e151375
Formatting
boufogre Mar 8, 2021
6301280
Formatting
boufogre Mar 8, 2021
58452a3
Formatting
boufogre Mar 8, 2021
9302cf8
Formatting
boufogre Mar 8, 2021
58985d7
Formatting
boufogre Mar 11, 2021
659244f
Formatting
boufogre Mar 11, 2021
8b59539
Formatting
boufogre Apr 20, 2021
201c8d8
update
boufogre Sep 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,40 +77,28 @@ class B747_8_EICAS extends Airliners.BaseEICAS {
switch (level) {
case 1:
infoPanelManager.addMessage(Airliners.EICAS_INFO_PANEL_ID.PRIMARY, text, Airliners.EICAS_INFO_PANEL_MESSAGE_STYLE.INDICATION);
break;
break;
case 2:
infoPanelManager.addMessage(Airliners.EICAS_INFO_PANEL_ID.PRIMARY, text, Airliners.EICAS_INFO_PANEL_MESSAGE_STYLE.CAUTION);
break;
break;
case 3:
infoPanelManager.addMessage(Airliners.EICAS_INFO_PANEL_ID.PRIMARY, text, Airliners.EICAS_INFO_PANEL_MESSAGE_STYLE.WARNING);
break;
break;
}
}
}
if (this.annunciations) {
for (let i = this.annunciations.displayWarning.length - 1; i >= 0; i--) {
if (!this.annunciations.displayWarning[i].Acknowledged)
infoPanelManager.addMessage(
Airliners.EICAS_INFO_PANEL_ID.PRIMARY,
this.annunciations.displayWarning[i].Text,
Airliners.EICAS_INFO_PANEL_MESSAGE_STYLE.WARNING
);
infoPanelManager.addMessage(Airliners.EICAS_INFO_PANEL_ID.PRIMARY, this.annunciations.displayWarning[i].Text, Airliners.EICAS_INFO_PANEL_MESSAGE_STYLE.WARNING);
}
for (let i = this.annunciations.displayCaution.length - 1; i >= 0; i--) {
if (!this.annunciations.displayCaution[i].Acknowledged)
infoPanelManager.addMessage(
Airliners.EICAS_INFO_PANEL_ID.PRIMARY,
this.annunciations.displayCaution[i].Text,
Airliners.EICAS_INFO_PANEL_MESSAGE_STYLE.CAUTION
);
infoPanelManager.addMessage(Airliners.EICAS_INFO_PANEL_ID.PRIMARY, this.annunciations.displayCaution[i].Text, Airliners.EICAS_INFO_PANEL_MESSAGE_STYLE.CAUTION);
}
for (let i = this.annunciations.displayAdvisory.length - 1; i >= 0; i--) {
if (!this.annunciations.displayAdvisory[i].Acknowledged)
infoPanelManager.addMessage(
Airliners.EICAS_INFO_PANEL_ID.PRIMARY,
this.annunciations.displayAdvisory[i].Text,
Airliners.EICAS_INFO_PANEL_MESSAGE_STYLE.INDICATION
);
if (!this.annunciations.displayAdvisory[i].Acknowledged)
infoPanelManager.addMessage(Airliners.EICAS_INFO_PANEL_ID.PRIMARY, this.annunciations.displayAdvisory[i].Text, Airliners.EICAS_INFO_PANEL_MESSAGE_STYLE.INDICATION);
}
}
}
Expand All @@ -123,7 +111,9 @@ class B747_8_EICAS extends Airliners.BaseEICAS {
return B747_8_EngineState.IDLE;
}
getN2IdleValue() {
return 60;
let density = SimVar.GetSimVarValue("AMBIENT DENSITY", "kilogram per cubic meter");
let N2 = 214 * Math.pow(density, 6) - 1051.8 * Math.pow(density, 5) + 2087.1 * Math.pow(density, 4) - 2129.8 * Math.pow(density, 3) + 1167.7 * Math.pow(density, 2) - 315.83 * density + 87.453;
return N2;
}
getN2Value(_engineId) {
return SimVar.GetSimVarValue("ENG N2 RPM:" + _engineId, "percent");
Expand All @@ -136,49 +126,71 @@ class B747_8_EICAS extends Airliners.BaseEICAS {
let N2Value = this.getN2Value(i + 1);
switch (this.engines[i].currentState) {
case B747_8_EngineState.IDLE:
if (this.getFuelValveOpen(i + 1)) {
if (N2Value >= this.getN2IdleValue())
this.changeState(i, B747_8_EngineState.RUNNING);
else if (N2Value >= 0.05)
this.changeState(i, B747_8_EngineState.AUTOSTART);
if (this.getFuelValveOpen(i + 1)) {
if (N2Value >= this.getN2IdleValue()) {
this.changeState(i, B747_8_EngineState.RUNNING);
}
break;
case B747_8_EngineState.AUTOSTART:
if (this.getFuelValveOpen(i + 1)) {
if (N2Value >= this.getN2IdleValue())
this.changeState(i, B747_8_EngineState.RUNNING);
else if (N2Value >= 0.05) {
this.changeState(i, B747_8_EngineState.AUTOSTART);
}
else {
this.changeState(i, B747_8_EngineState.DECELERATE);
}
break;
case B747_8_EngineState.AUTOSTART:
if (this.getFuelValveOpen(i + 1)) {
if (N2Value >= this.getN2IdleValue()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are still formatting errors here and there unfortunately, this for example is not indented correctly

this.changeState(i, B747_8_EngineState.RUNNING);
}
break;
}
else {
this.changeState(i, B747_8_EngineState.DECELERATE);
}
break;
case B747_8_EngineState.RUNNING:
if (N2Value >= this.getN2IdleValue()) {
if (this.engines[i].timeInState > 30)
this.changeState(i, B747_8_EngineState.READY);
if (N2Value >= this.getN2IdleValue()) {
if (this.engines[i].timeInState > 30) {
this.changeState(i, B747_8_EngineState.READY);
}
else
else {
this.changeState(i, B747_8_EngineState.DECELERATE);
break;
}
}
break;
case B747_8_EngineState.READY:
if (N2Value < this.getN2IdleValue())
this.changeState(i, B747_8_EngineState.DECELERATE);
break;
if (N2Value < this.getN2IdleValue()) {
this.changeState(i, B747_8_EngineState.AUTORELIGHT);
}
break;
case B747_8_EngineState.DECELERATE:
if (N2Value < 0.05)
if (N2Value < this.getN2IdleValue() && this.getFuelValveOpen()) {
this.changeState(i, B747_8_EngineState.AUTORELIGHT);
}
else if (N2Value < 0.05) {
this.changeState(i, B747_8_EngineState.IDLE);
else if (N2Value >= this.getN2IdleValue())
}
else if (N2Value >= this.getN2IdleValue()) {
this.changeState(i, B747_8_EngineState.RUNNING);
break;
}
break;
case B747_8_EngineState.AUTORELIGHT:
if (N2Value >= this.getN2IdleValue()) {
this.changeState(i, B747_8_EngineState.RUNNING);
}
else if (N2Value < 0.05) {
this.changeState(i, B747_8_EngineState.IDLE);
}
else if (!this.getFuelValveOpen()) {
this.changeState(i, B747_8_EngineState.DECELERATE);
}
break;
}
this.engines[i].timeInState += _deltaTime / 1000;
}
}
changeState(_index, _state) {
if (this.engines[_index].currentState == _state)
return;
this.engines[_index].currentState = _state;
this.engines[_index].timeInState = 0;
if (this.engines[_index].currentState == _state)
return;
this.engines[_index].currentState = _state;
this.engines[_index].timeInState = 0;
}
}
var B747_8_EngineState;
Expand All @@ -188,6 +200,7 @@ var B747_8_EngineState;
B747_8_EngineState[B747_8_EngineState["RUNNING"] = 2] = "RUNNING";
B747_8_EngineState[B747_8_EngineState["READY"] = 3] = "READY";
B747_8_EngineState[B747_8_EngineState["DECELERATE"] = 4] = "DECELERATE";
B747_8_EngineState[B747_8_EngineState["AUTORELIGHT"] = 5] = "AUTORELIGHT";
})(B747_8_EngineState || (B747_8_EngineState = {}));
class B747_8_Engine {
constructor() {
Expand Down
Loading