Skip to content
New issue

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

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

Already on GitHub? # to your account

feature(fws): SEAT BELTS and NO SMOKING memo #114

Merged
merged 1 commit into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -258,6 +258,7 @@ public void UpdateMemo() {
var rightMemoText = "";
var leftMemoText = "";
var hasWarning = false;
var hasMemoDisplayed = false;
foreach (var memo in _fws.fwsWarningMessageDatas)
if (memo.isVisable)
switch (memo.Type) {
Expand All @@ -271,7 +272,7 @@ public void UpdateMemo() {
switch (memo.Zone) {
// Left of the ECAM
case DisplayZone.Left:
if (!hasWarning)
if (!hasWarning && !hasMemoDisplayed)
leftMemoText +=
$"<color={GetColorHexByWarningColor(memo.TitleColor)}>{memo.WarningTitle}</color>\n";
break;
Expand All @@ -291,8 +292,10 @@ public void UpdateMemo() {
// Config Memo (Like T.O CONFIG, LDG CONFIG MEMO) and Primary System failure (Like ENG1 FIRE)
default:
if (memo.Type != WarningType.ConfigMemo) hasWarning = true;
// Do not show Config Memo when already a System Failure Warning visable
// Do not show Config Memo when already a System Failure Warning visible
if (!((memo.Type == WarningType.ConfigMemo) & hasWarning)) {
hasMemoDisplayed = true;

leftMemoText +=
$"<color={GetColorHexByWarningColor(memo.TitleColor)}>{memo.WarningGroup} {memo.WarningTitle}</color>";
// Config Memo don't require title warp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,24 @@ public partial class FWSWarningData {
private FWSWarningMessageData APU_AVAIL;
private FWSWarningMessageData APU_BLEED;
private FWSWarningMessageData PARK_BRK;
private FWSWarningMessageData SEAT_BELTS;
private FWSWarningMessageData NO_SMOKING;

private void SetupMemo() {
APU_BLEED = GetWarningMessageData(nameof(APU_BLEED));
PARK_BRK = GetWarningMessageData(nameof(PARK_BRK));
APU_AVAIL = GetWarningMessageData(nameof(APU_AVAIL));
SEAT_BELTS = GetWarningMessageData(nameof(SEAT_BELTS));
NO_SMOKING = GetWarningMessageData(nameof(NO_SMOKING));
}

private void MonitorMemo() {
SetWarnVisible(ref APU_BLEED.isVisable, FWS.equipmentData.isApuStarted);
// APU BLEED will replace APU AVAIL if APU BLEED is on, but we don't have "APU BLEED" simulate.
// SetWarnVisible(ref APU_AVAIL.IsVisable, FWS.equipmentData.IsAPURunning);
SetWarnVisible(ref PARK_BRK.isVisable, FWS.equipmentData.isParkBreakSet);
SetWarnVisible(ref SEAT_BELTS.isVisable, true);
SetWarnVisible(ref NO_SMOKING.isVisable, true);
}
}
}
Loading