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

fix(a380x): Add PRIM/SEC/FCDC failures to EFB #9766

Merged
merged 2 commits into from
Jan 16, 2025
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
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
1. [A380X/FMS] Enable FMC reset through overhead reset panel push buttons - @flogross89 (floridude)
1. [A380X/FCU] Add TRUE indication on FCU when TRUE North reference is selected on AFS CP - @heclak (Heclak)
1. [A380X/MFD] Add airport data page into the MFD (DATA > AIRPORT) - @bulenteroglu (senolitam)
1. [A380X/EFB] Adds PRIM/SEC/FCDC failures to EFB - @flogross89 (floridude)


## 0.12.0
Expand Down
34 changes: 18 additions & 16 deletions fbw-a380x/src/systems/failures/src/a380.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,6 @@ export const A380Failure = Object.freeze({
CpcsApp3: 21048,
CpcsApp4: 21049,

Fac1: 22000, // FIXME update CPP code failures
Fac2: 22001, // FIXME update CPP code failures
Elac1: 27000, // FIXME update CPP code failures
Elac2: 27001, // FIXME update CPP code failures
Sec1: 27002, // FIXME update CPP code failures
Sec2: 27003, // FIXME update CPP code failures
Sec3: 27004, // FIXME update CPP code failures
Fcdc1: 27005, // FIXME update CPP code failures
Fcdc2: 27006, // FIXME update CPP code failures

FmcA: 22100,
FmcB: 22101,
FmcC: 22102,
Expand Down Expand Up @@ -127,6 +117,15 @@ export const A380Failure = Object.freeze({
MLGLoopA: 26017,
MLGLoopB: 26018,

Prim1: 27000,
Prim2: 27001,
Prim3: 27002,
Sec1: 27003,
Sec2: 27004,
Sec3: 27005,
Fcdc1: 27006,
Fcdc2: 27007,

GreenReservoirLeak: 29000,
YellowReservoirLeak: 29001,
GreenReservoirAirLeak: 29002,
Expand All @@ -146,9 +145,6 @@ export const A380Failure = Object.freeze({
EnginePump4AOHeat: 29016,
EnginePump4BOHeat: 29017,

LeftPfdDisplay: 31000,
RightPfdDisplay: 31001,

LgciuPowerSupply1: 32000,
LgciuPowerSupply2: 32001,
LgciuInternalError1: 32002,
Expand Down Expand Up @@ -287,6 +283,15 @@ export const A380FailureDefinitions: FailureDefinition[] = [
[26, A380Failure.MLGLoopA, 'Main Landing Gear Bay Loop A'],
[26, A380Failure.MLGLoopB, 'Main Landing Gear Bay Loop B'],

[27, A380Failure.Prim1, 'PRIM 1'],
[27, A380Failure.Prim2, 'PRIM 2'],
[27, A380Failure.Prim3, 'PRIM 3'],
[27, A380Failure.Sec1, 'SEC 1'],
[27, A380Failure.Sec2, 'SEC 2'],
[27, A380Failure.Sec3, 'SEC 3'],
[27, A380Failure.Fcdc1, 'FCDC 1'],
[27, A380Failure.Fcdc2, 'FCDC 2'],

[29, A380Failure.GreenReservoirLeak, 'Green reservoir leak'],
[29, A380Failure.YellowReservoirLeak, 'Yellow reservoir leak'],
[29, A380Failure.GreenReservoirAirLeak, 'Green reservoir air leak'],
Expand All @@ -306,9 +311,6 @@ export const A380FailureDefinitions: FailureDefinition[] = [
[29, A380Failure.EnginePump4AOHeat, 'Engine 4 pump A overheat'],
[29, A380Failure.EnginePump4BOHeat, 'Engine 4 pump B overheat'],

[31, A380Failure.LeftPfdDisplay, 'Captain PFD display'],
[31, A380Failure.RightPfdDisplay, 'F/O PFD display'],

[32, A380Failure.LgciuPowerSupply1, 'LGCIU 1 Power supply'],
[32, A380Failure.LgciuPowerSupply2, 'LGCIU 2 Power supply'],
[32, A380Failure.LgciuInternalError1, 'LGCIU 1 Internal error'],
Expand Down
15 changes: 11 additions & 4 deletions fbw-a380x/src/wasm/fbw_a380/src/FlyByWireInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1458,8 +1458,8 @@ bool FlyByWireInterface::updatePrim(double sampleTime, int primIndex) {
powerSupplyAvailable = idElecDc1BusPowered->get();
}

prims[primIndex].update(sampleTime, simData.simulationTime,
failuresConsumer.isActive(primIndex == 0 ? Failures::Elac1 : Failures::Elac2), powerSupplyAvailable);
Failures failureIndex = primIndex == 0 ? Failures::Prim1 : (primIndex == 1 ? Failures::Prim2 : Failures::Prim3);
prims[primIndex].update(sampleTime, simData.simulationTime, failuresConsumer.isActive(failureIndex), powerSupplyAvailable);

primsDiscreteOutputs[primIndex] = prims[primIndex].getDiscreteOutputs();
primsAnalogOutputs[primIndex] = prims[primIndex].getAnalogOutputs();
Expand Down Expand Up @@ -1830,8 +1830,15 @@ bool FlyByWireInterface::updateFac(double sampleTime, int facIndex) {
facsAnalogOutputs[facIndex] = simConnectInterface.getClientDataFacAnalogsOutput();
facsBusOutputs[facIndex] = simConnectInterface.getClientDataFacBusOutput();
} else {
facs[facIndex].update(sampleTime, simData.simulationTime, failuresConsumer.isActive(facIndex == 0 ? Failures::Fac1 : Failures::Fac2),
true);
// Check failure state of master PRIM
Failures failureIndex = Failures::Prim1;
for (int i = 0; i < 3; i++) {
if (primsDiscreteOutputs[i].prim_healthy) {
failureIndex = i == 0 ? Failures::Prim1 : (i == 1 ? Failures::Prim2 : Failures::Prim3);
break;
}
}
facs[facIndex].update(sampleTime, simData.simulationTime, failuresConsumer.isActive(failureIndex), true);

facsDiscreteOutputs[facIndex] = facs[facIndex].getDiscreteOutputs();
facsAnalogOutputs[facIndex] = facs[facIndex].getAnalogOutputs();
Expand Down
17 changes: 8 additions & 9 deletions fbw-a380x/src/wasm/fbw_a380/src/failures/FailureList.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#pragma once

enum class Failures {
Fac1 = 22000,
Fac2 = 22001,
Elac1 = 27000,
Elac2 = 27001,
Sec1 = 27002,
Sec2 = 27003,
Sec3 = 27004,
Fcdc1 = 27005,
Fcdc2 = 27006,
Prim1 = 27000,
Prim2 = 27001,
Prim3 = 27002,
Sec1 = 27003,
Sec2 = 27004,
Sec3 = 27005,
Fcdc1 = 27006,
Fcdc2 = 27007,
};
15 changes: 6 additions & 9 deletions fbw-a380x/src/wasm/fbw_a380/src/failures/FailuresConsumer.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#include "FailuresConsumer.h"
#include <utility>
#include <algorithm>
#include <utility>

FailuresConsumer::FailuresConsumer() {
activeFailures.emplace(std::make_pair<Failures, bool>(Failures::Elac1, false));
activeFailures.emplace(std::make_pair<Failures, bool>(Failures::Elac2, false));
activeFailures.emplace(std::make_pair<Failures, bool>(Failures::Prim1, false));
activeFailures.emplace(std::make_pair<Failures, bool>(Failures::Prim2, false));
activeFailures.emplace(std::make_pair<Failures, bool>(Failures::Prim3, false));
activeFailures.emplace(std::make_pair<Failures, bool>(Failures::Sec1, false));
activeFailures.emplace(std::make_pair<Failures, bool>(Failures::Sec2, false));
activeFailures.emplace(std::make_pair<Failures, bool>(Failures::Sec3, false));
activeFailures.emplace(std::make_pair<Failures, bool>(Failures::Fac1, false));
activeFailures.emplace(std::make_pair<Failures, bool>(Failures::Fac2, false));
activeFailures.emplace(std::make_pair<Failures, bool>(Failures::Fcdc1, false));
activeFailures.emplace(std::make_pair<Failures, bool>(Failures::Fcdc2, false));
}
Expand Down Expand Up @@ -53,10 +52,8 @@ bool FailuresConsumer::setIfFound(double identifier, bool value) {
}

bool FailuresConsumer::isAnyActive() {
if (std::any_of(activeFailures.begin(), activeFailures.end(), [](auto pair) {
return pair.second;
})) {
return true;
if (std::any_of(activeFailures.begin(), activeFailures.end(), [](auto pair) { return pair.second; })) {
return true;
}
return false;
}
Loading