Skip to content

Commit

Permalink
Merge branch 'master' into apu-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Taz5150 authored Oct 1, 2023
2 parents b6d1aa5 + ad7d65e commit 4c79054
Show file tree
Hide file tree
Showing 85 changed files with 5,534 additions and 1,350 deletions.
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
1. [SD] Connect SD BLEED page APU bleed pressure indication to correct ADRs - @BlueberryKing (BlueberryKing)
1. [FMS] Use station declination when appropriate for fix info and place/bearing radials - @tracernz (Mike)
1. [MCDU] Fixed the FMGC annunciator light not illuminating - @tracernz (Mike)
1. [COND] Add Air Conditioning systems failures - @mjuhe (Miquel Juhe)
1. [APU] Added xfeed APU fuel capabilities - @Taz5150 (TazX [Z+1]#0405)

## 0.10.0
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request_beta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ body:
options:
- Stable
- Development
- Experimental
validations:
required: true
- type: textarea
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
# Project folders

/fbw-a32nx/*
/fbw-a32nx/.env.local
!/fbw-a32nx/README.md
!/fbw-a32nx/mach.config.js
!/fbw-a32nx/.env
Expand All @@ -60,6 +61,7 @@
/fbw-a32nx/src/wasm/systems/a320_pneumatic_simulation_graph_data/*.txt

/fbw-a380x/*
/fbw-a380x/.env.local
!/fbw-a380x/README.md
!/fbw-a380x/docs/
!/fbw-a380x/docs/**
Expand All @@ -80,6 +82,8 @@

!/scripts/**

!/build-utils.js

!/tools/**
/tools/fdr2csv/*.exe
/tools/fdr2csv/build/
Expand Down
63 changes: 63 additions & 0 deletions build-utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
const dotenv = require('dotenv');
const path = require("path");

function defineEnvVars() {
dotenv.config({ path: '.env.local' });
dotenv.config();

const defines = {};

for (const envVar of Object.keys(process.env)) {
const value = process.env[envVar].trim();

let replacement;
if (value.trim() === 'true' || value.trim() === 'false') {
replacement = value;
} else if (!Number.isNaN(parseFloat(value))) {
replacement = parseFloat(value).toString();
} else {
replacement = `"${value}"`;
}

defines[`process.env.${envVar}`] = replacement;
}

return defines;
}

module.exports.defineEnvVars = defineEnvVars;

/**
* @param projectRoot {string} the project root folder, as a path relative to the root of the repository
* @param globalName {string|undefined} the name of the global to define in the output IIFE
* @param entryPoint {string} the entrypoint path, as an absolute path
* @param outFile {string} the output file path, as a path relative to the root of the repository
*/
function esbuildModuleBuild(projectRoot, globalName, entryPoint, outFile) {
const isProductionBuild = process.env.A32NX_PRODUCTION_BUILD === '1';

process.chdir(projectRoot);

return {
absWorkingDir: __dirname,

define: { DEBUG: 'false', ...defineEnvVars() },

entryPoints: [entryPoint],
bundle: true,
treeShaking: false,
minify: isProductionBuild,

outfile: path.join(__dirname, outFile),

format: 'iife',
globalName,

sourcemap: isProductionBuild ? undefined : 'linked',

// Target approximate CoherentGT WebKit version
target: 'safari11',
};
}

module.exports.esbuildModuleBuild = esbuildModuleBuild;
68 changes: 53 additions & 15 deletions fbw-a32nx/docs/a320-simvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -2628,6 +2628,59 @@ In the variables below, {number} should be replaced with one item in the set: {

## Air Conditioning / Pressurisation / Ventilation

- A32NX_COND_ACSC_{number}_DISCRETE_WORD_1
- Number 1 or 2
- Discrete Data word 1 of the ACSC bus output (label 060)
- Arinc429<Discrete>
- | Bit | Description |
|:---:|:----------------------------------------------------:|
| 11 | Duct overheat F/D warning |
| 12 | Duct overheat FWD warning |
| 13 | Duct overheat AFT warning |
| 14 | Not used |
| 15 | Not used |
| 16 | Not used |
| 17 | Spare |
| 18 | Trim air pressure high |
| 19 | ACSC Lane 1 Active |
| 20 | TAPRV status - close |
| 21 | ACSC Lane 1 INOP |
| 22 | ACSC Lane 2 INOP |
| 23 | Hot air switch position on |
| 24 | G + T fan off/fault |
| 25 | Recirc fan LH fault/OVHT |
| 26 | Recirc fan RH fault/OVHT |
| 27 | TAPRV disagree |
| 28 | Trim air system fault |
| 29 | ACSC Installed |

- A32NX_COND_ACSC_{number}_DISCRETE_WORD_2
- Number 1 or 2
- Discrete Data word 2 of the ACSC bus output (label 061)
- Bits with * not yet implemented
- Arinc429<Discrete>
- | Bit | Description |
|:---:|:----------------------------------------------------:|
| 11 | Spare |
| 12 | *K1 half wing anti-ice on |
| 13 | *K2 full wing anti-ice on |
| 14 | *K3 nacelle anti-ice on |
| 15 | *K4 air cond with two packs on |
| 16 | *K5 air cond with one pack on |
| 17 | *K6 air cond with two packs and one engine on |
| 18 | Trim valve F/D inop |
| 19 | Trim valve FWD inop |
| 20 | Trim valve AFT inop |
| 21 | Not used |
| 22 | Not used |
| 23 | *FCV status (Both pakcs off) |
| 24 | *One pack operation |
| 25 | *FCV status (Both pakcs on) |
| 26 | Spare |
| 27 | *Nacelle anti-ice eng 2 open |
| 28 | *Nacelle anti-ice eng 1 open |
| 29 | Spare |

- A32NX_COND_{id}_TEMP
- Degree Celsius
- Temperature as measured in each of the cabin zones and cockpit
Expand Down Expand Up @@ -2660,14 +2713,6 @@ In the variables below, {number} should be replaced with one item in the set: {
- FWD
- AFT

- A32NX_HOT_AIR_VALVE_IS_ENABLED
- Bool
- True if the trim air system is enabled (pushbutton in auto and power supplied to system)

- A32NX_HOT_AIR_VALVE_IS_OPEN
- Bool
- True if the trim air system is enabled and the hot air valve is open

- A32NX_OVHD_COND_{id}_SELECTOR_KNOB
- Percentage
- Percent rotation of the overhead temperature selectors for each of the cabin zones
Expand Down Expand Up @@ -2759,13 +2804,6 @@ In the variables below, {number} should be replaced with one item in the set: {
- Bool
- True if CAB FANS pushbutton is in the on position (no white light)

- A32NX_PACKS_{number}_IS_SUPPLYING
- Bool
- True if the corresponding pack is on and supplying air to the cabin
- {number}
- 1
- 2

## Pneumatic

- A32NX_PNEU_ENG_{number}_IP_PRESSURE:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright (c) 2021-2023 FlyByWire Simulations
//
// SPDX-License-Identifier: GPL-3.0

function translateAtsuMessageType(type) {
switch (type) {
case AtsuCommon.AtsuMessageType.Freetext:
Expand Down Expand Up @@ -38,18 +42,19 @@ const lbsToKg = (value) => {
* @param {() => void} updateView
*/
const getSimBriefOfp = (mcdu, updateView, callback = () => {}) => {
const simBriefUserId = NXDataStore.get("CONFIG_SIMBRIEF_USERID", "");
const navigraphUsername = NXDataStore.get("NAVIGRAPH_USERNAME", "");
const overrideSimBriefUserID = NXDataStore.get('CONFIG_OVERRIDE_SIMBRIEF_USERID', '');

if (!simBriefUserId) {
mcdu.setScratchpadMessage(NXFictionalMessages.noSimBriefUser);
throw new Error("No SimBrief pilot ID provided");
if (!navigraphUsername && !overrideSimBriefUserID) {
mcdu.setScratchpadMessage(NXFictionalMessages.noNavigraphUser);
throw new Error("No Navigraph username provided");
}

mcdu.simbrief["sendStatus"] = "REQUESTING";

updateView();

return SimBriefApi.getSimBriefOfp(simBriefUserId)
return SimBriefApi.getSimBriefOfp(navigraphUsername, overrideSimBriefUserID)
.then(data => {
mcdu.simbrief["units"] = data.params.units;
mcdu.simbrief["route"] = data.general.route;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright (c) 2021-2023 FlyByWire Simulations
//
// SPDX-License-Identifier: GPL-3.0

class McduMessage {
constructor(text, isAmber = false, replace = "") {
this.text = text;
Expand Down Expand Up @@ -102,7 +106,7 @@ const NXSystemMessages = {
};

const NXFictionalMessages = {
noSimBriefUser: new TypeIMessage("NO SIMBRIEF USER"),
noNavigraphUser: new TypeIMessage("NO NAVIGRAPH USER"),
noAirportSpecified: new TypeIMessage("NO AIRPORT SPECIFIED"),
fltNbrInUse: new TypeIMessage("FLT NBR IN USE"),
fltNbrMissing: new TypeIMessage("ENTER ATC FLT NBR"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
// Copyright (c) 2021-2023 FlyByWire Simulations
//
// SPDX-License-Identifier: GPL-3.0

class SimBriefApi {
static getSimBriefOfp(userId) {
if (userId) {
return fetch(`${SimBriefApi.url}&userid=${userId}`)
static getSimBriefOfp(username, overrideUserID) {
if (username || overrideUserID) {
return fetch(overrideUserID ? `${SimBriefApi.url}&userid=${overrideUserID}` : `${SimBriefApi.url}&username=${username}`)
.then((response) => {
if (!response.ok) {
throw new HttpError(response.status);
Expand All @@ -10,7 +14,7 @@ class SimBriefApi {
return response.json();
});
} else {
throw new Error("No SimBrief pilot ID provided");
throw new Error("No Navigraph username or override simbrief user id provided");
}
}
}
Expand Down
27 changes: 26 additions & 1 deletion fbw-a32nx/src/localization/flypad/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"Defueling": "اخراج الوقود ",
"EstimatedDuration": "المدة المقدرة (دقائق)",
"EstimatedTime": "Estimated Time",
"GSXFuelSyncEnabled": "GSX Fuel Sync Enabled",
"LeftInnerTank": "خزان الوقود الداخلي لأيسر",
"LeftOuterTank": "خزان الوقود الخارجي الأيسر",
"ReadyToStart": "جاهز للبدء",
Expand All @@ -156,6 +157,7 @@
"DeboardConfirmationConfirm": "Deboard",
"DeboardConfirmationTitle": "Deboard all Passengers?",
"EstimatedDurationUnit": "minutes",
"GSXPayloadSyncEnabled": "GSX Payload Sync Enabled",
"GW": "GW",
"GWCG": "GW CG",
"LoadingTime": "Loading Time",
Expand Down Expand Up @@ -224,6 +226,10 @@
"Navigraph": {
"AirportDoesNotExist": "المطار غير موجود",
"AuthenticateWithNavigraph": "مصادقة مع Navigraph",
"GoToThirdPartyOptions": {
"Button": "3rd Party Options",
"Title": "Go to 3rd Party Options to link Navigraph account"
},
"InsufficientEnv": "ملف .env غير كاف",
"IntoYourBrowserAndEnterTheCodeBelow": "في متصفحك وأدخل الرمز بالاسفل\n",
"LoadingMsg": "جارٍ التحميل…",
Expand Down Expand Up @@ -576,7 +582,26 @@
"ThirdPartyOptions": {
"GsxFuelEnabled": "GSX Fueling Synchronization",
"GsxPayloadEnabled": "GSX Payload Synchronization",
"Title": "3rd Party Options"
"NavigraphAccountLink": {
"Connected": "Connected",
"Link": "Link Account",
"LoginPage": {
"Title": "Navigraph Account Login"
},
"SettingTitle": "Navigraph Account Link",
"SubscriptionStatus": {
"None": "None",
"Unlimited": "Navigraph Unlimited"
},
"Unlink": "Unlink Account"
},
"OverrideSimBriefUserID": "Override SimBrief User ID",
"PleaseCheckThatYouHaveCorrectlyEnteredYourSimBriefUsernameOrPilotId": "Please check that you have correctly entered your SimBrief username or pilot ID.",
"TT": {
"OverrideSimBriefUserID": "Alternative SimBrief user ID to use instead of the linked Navigraph Account"
},
"Title": "3rd Party Options",
"YourSimBriefPilotIdHasBeenValidatedAndUpdatedTo": "The override SimBrief PilotID has been validated and updated to"
},
"ThrottleConfig": {
"Apply": "تطبيق",
Expand Down
27 changes: 26 additions & 1 deletion fbw-a32nx/src/localization/flypad/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"Defueling": "Odčerpávání",
"EstimatedDuration": "Odhadovaná délka (min)",
"EstimatedTime": "Odhadovaný čas",
"GSXFuelSyncEnabled": "GSX synchronizace zapnuta",
"LeftInnerTank": "Levá vnitřní nádrž",
"LeftOuterTank": "Levá vnější nádrž",
"ReadyToStart": "Připraveno",
Expand All @@ -156,6 +157,7 @@
"DeboardConfirmationConfirm": "Vyložit",
"DeboardConfirmationTitle": "Vyložit všechny cestující?",
"EstimatedDurationUnit": "minut",
"GSXPayloadSyncEnabled": "GSX synchronizace nákladu zapnuta",
"GW": "GW",
"GWCG": "GW CG",
"LoadingTime": "Loading Time",
Expand Down Expand Up @@ -224,6 +226,10 @@
"Navigraph": {
"AirportDoesNotExist": "Letiště neexistuje",
"AuthenticateWithNavigraph": "Navigraph autentizace",
"GoToThirdPartyOptions": {
"Button": "Možnosti třetích stran",
"Title": "Přejděte na Možnosti třetích stran pro propojení Navigraph účtu"
},
"InsufficientEnv": "Nedostatečný soubor .env",
"IntoYourBrowserAndEnterTheCodeBelow": "ve vašem prohlížeči a vložte následující kód\n",
"LoadingMsg": "Načítání",
Expand Down Expand Up @@ -576,7 +582,26 @@
"ThirdPartyOptions": {
"GsxFuelEnabled": "GSX synchronizace paliva",
"GsxPayloadEnabled": "GSX synchronizace cestujících a nákladu",
"Title": "Možnosti třetích stran"
"NavigraphAccountLink": {
"Connected": "Připojeno",
"Link": "Propojit účet",
"LoginPage": {
"Title": "Přihlášení k účtu Navigraph"
},
"SettingTitle": "Propojení s účtem Navigraph",
"SubscriptionStatus": {
"None": "Žádný",
"Unlimited": "Navigraph Unlimited"
},
"Unlink": "Odpojit účet"
},
"OverrideSimBriefUserID": "Přepsat uživatelské ID SimBrief",
"PleaseCheckThatYouHaveCorrectlyEnteredYourSimBriefUsernameOrPilotId": "Zkontrolujte prosím, zda jste správně zadali své SimBrief uživatelské jméno nebo ID pilota.",
"TT": {
"OverrideSimBriefUserID": "Alternativní SimBrief uživatelské ID, které se použije místo propojeného účtu Navigraph"
},
"Title": "Možnosti třetích stran",
"YourSimBriefPilotIdHasBeenValidatedAndUpdatedTo": "Přednostní SimBrief PilotID bylo ověřeno a změněno na"
},
"ThrottleConfig": {
"Apply": "Použít",
Expand Down
Loading

0 comments on commit 4c79054

Please sign in to comment.