Skip to content

Commit

Permalink
chore: bring in a380x instruments @2dc636d7 (flybywiresim#8289)
Browse files Browse the repository at this point in the history
* chore: bring in a380 instruments @2dc636d7

Build scripts and imports have been adjusted for the monorepo
environment.

* fix: eslintrc path

* fix: unignore and commit mach config

* chore: copy eslintrc from a32nx

* build: disable fms-v2 tests

* build: disable a380x lint

* doc: merge local var docs from a380x repo

Co-authored-by: Sven Czarnian <devel@svcz.de>
Co-authored-by: Richard Pilbery <email@pilbery.co.uk>
Co-authored-by: Benedict Etzel <developer@beheh.de>
Co-authored-by: svengcz <64070348+svengcz@users.noreply.github.com>
Co-authored-by: BBK <22713769+BlueberryKing@users.noreply.github.com>
Co-authored-by: ErickSharp <titaninmc@gmail.com>
Co-authored-by: 2hwk <reasonstouninstall@tutanota.com>
Co-authored-by: Nufflee <zifcani@gmail.com>
Co-authored-by: davydecorps <38904654+crocket63@users.noreply.github.com>
Co-authored-by: Taz5150 <roldan5150@gmail.com>
  • Loading branch information
11 people authored Nov 12, 2023
1 parent 4b10ad4 commit e1bf51e
Show file tree
Hide file tree
Showing 538 changed files with 67,981 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
/fbw-a380x/*
/fbw-a380x/.env.local
!/fbw-a380x/README.md
!/fbw-a380x/mach.config.js
!/fbw-a380x/docs/
!/fbw-a380x/docs/**
!/fbw-a380x/src/**
Expand Down
104 changes: 104 additions & 0 deletions fbw-a380x/docs/a380-simvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,24 @@
- [Air Conditioning / Pressurisation / Ventilation ATA21](#air-conditioning-pressurisation-ventilation-ata-21)
- [Electrical ATA 24](#electrical-ata-24)
- [Indicating/Recording ATA 31](#indicating-recording-ata-31)
- [ECAM Control Panel ATA 34](#ecam-control-panel-ata-34)
- [EFIS Control Panel ATA 34](#efis-control-panel-ata-34)
- [Bleed Air ATA 36](#bleed-air-ata-36)
- [Integrated Modular Avionics ATA 42](#integrated-modular-avionics-ata-42)
- [Hydraulics](#hydraulics)
- [Sound Variables](#sound-variables)

## Uncategorized

- A380X_OVHD_ANN_LT_POSITION
- Enum
- Represents the state of the ANN LT switch
- State | Value
-------- | ----
TEST | 0
BRT | 1
DIM | 2

- A32NX_OVHD_{name}_PB_IS_AVAILABLE
- Bool
- True when the push button's AVAIL light should illuminate
Expand Down Expand Up @@ -464,6 +477,74 @@
- ArincWord852<>
- Second CAN bus of the CDS on the first officer's side

## ECAM Control Panel ATA 34

- A380X_ECAM_CP_SELECTED_PAGE
- Enum
- Currently requested page on the ECAM CP
- State | Value
-------- | ----
ENG | 0
BLEED | 1
PRESS | 2
EL/AC | 3
FUEL | 4
HYD | 5
C/B | 6
APU | 7
COND | 8
DOOR | 9
EL/DC | 10
WHEEL | 11
F/CTL | 12
VIDEO | 13

## EFIS Control Panel ATA 34

- A380X_EFIS_{side}_LS_BUTTON_IS_ON
- Boolean
- Whether the LS button is activated
- {side} = L or R

- A380X_EFIS_{side}_VV_BUTTON_IS_ON
- Boolean
- Whether the VV button is activated
- {side} = L or R

- A380X_EFIS_{side}_CSTR_BUTTON_IS_ON
- Boolean
- Whether the CSTR button is activated
- {side} = L or R

- A380X_EFIS_{side}_ACTIVE_FILTER
- Boolean
- Indicates which waypoint filter is selected
- {side} = L or R
- State | Value
-------- | ----
WPT | 0
VORD | 1
NDB | 2

- A380X_EFIS_{side}_ACTIVE_OVERLAY
- Boolean
- Indicates which waypoint filter is selected
- {side} = L or R
- State | Value
-------- | ----
WX | 0
TERR | 1

- A380X_EFIS_{side}_ARPT_BUTTON_IS_ON
- Boolean
- Whether the ARPT button is activated
- {side} = L or R

- A380X_EFIS_{side}_TRAF_BUTTON_IS_ON
- Boolean
- Whether the TRAF button is activated
- {side} = L or R

## Bleed Air ATA 36

- A32NX_PNEU_ENG_{number}_INTERMEDIATE_TRANSDUCER_PRESSURE
Expand Down Expand Up @@ -499,3 +580,26 @@
- A32NX_IOM_<NAME>_AVAIL
- Bool
- Indicates if a specific IOM system is available

## Hydraulics

- A32NX_OVHD_HYD_ENG_{ENG}AB_PUMP_DISC_PB_IS_AUTO
- Boolean
- Whether the pump disconnect pushbutton on engine {ENG} is in auto mode, i.e not disconnected
- {ENG} = 1, 2, 3, 4

- A32NX_OVHD_HYD_ENG_{ENG}AB_PUMP_DISC_PB_HAS_FAULT
- Boolean
- Whether the pump disconnect pushbutton on engine {ENG} has a fault
- {ENG} = 1, 2, 3, 4

- A32NX_HYD_ENG_{ENG}AB_PUMP_DISC
- Boolean
- Disconnected pump feedback signal
- {ENG} = 1, 2, 3, 4

## Sound Variables

- A380X_SOUND_COCKPIT_WINDOW_RATIO
- Number
- Ratio between 0-1 of the cockpit windows being physically open
66 changes: 66 additions & 0 deletions fbw-a380x/mach.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
const imagePlugin = require('esbuild-plugin-inline-image');
const postCssPlugin = require('esbuild-style-plugin');
// const tailwind = require('tailwindcss');
const postCssColorFunctionalNotation = require('postcss-color-functional-notation');
const postCssInset = require('postcss-inset');
const { typecheckingPlugin } = require("#build-utils");

/** @type { import('@synaptic-simulations/mach').MachConfig } */
module.exports = {
packageName: 'A380X',
packageDir: 'out/flybywire-aircraft-a380-842',
plugins: [
imagePlugin({ limit: -1 }),
postCssPlugin({
extract: true,
postcss: {
plugins: [
// tailwind('src/systems/instruments/src/EFB/tailwind.config.js'),

// transform: hsl(x y z / alpha) -> hsl(x, y, z, alpha)
postCssColorFunctionalNotation(),

// transform: inset: 0; -> top/right/left/bottom: 0;
postCssInset(),
],
}
}),
typecheckingPlugin(),
],
instruments: [
msfsAvionicsInstrument('PFD'),

reactInstrument('EWD'),
reactInstrument('MFD'),
reactInstrument('OIT'),
reactInstrument('RMP'),
reactInstrument('SD'),
],
};

function msfsAvionicsInstrument(name, folder = name) {
return {
name,
index: `src/systems/instruments/src/${folder}/instrument.tsx`,
simulatorPackage: {
type: 'baseInstrument',
templateId: `A380X_${name}`,
mountElementId: `${name}_CONTENT`,
fileName: name.toLowerCase(),
imports: ['/JS/dataStorage.js'],
},
};
}

function reactInstrument(name, additionalImports) {
return {
name,
index: `src/systems/instruments/src/${name}/index.tsx`,
simulatorPackage: {
type: 'react',
isInteractive: false,
fileName: name.toLowerCase(),
imports: ['/JS/dataStorage.js','/JS/fbw-a380x/A380X_Simvars.js', ...(additionalImports ?? [])],
},
};
}
141 changes: 141 additions & 0 deletions fbw-a380x/src/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
'use strict';

module.exports = {
root: true,
env: { browser: true },
extends: [
'@flybywiresim/eslint-config',
'plugin:jest/recommended',
'plugin:jest/style',
'plugin:tailwindcss/recommended',
],
plugins: [
'@typescript-eslint',
'tailwindcss',
],
parser: '@typescript-eslint/parser',
ignorePatterns: [
'mcdu-server/client/build/**',
// disabled all for now as the A380 code is not up to standard
'**/*',
],
parserOptions: {
ecmaVersion: 2021,
sourceType: 'script',
requireConfigFile: false,
},
settings: {
'tailwindcss': { groupByResponsive: true },
'import/resolver': { node: { extensions: ['.js', '.mjs', '.jsx', '.ts', '.tsx'] } },
},
overrides: [
{
files: ['*.jsx', '*.tsx'],
parserOptions: {
sourceType: 'module',
ecmaFeatures: { jsx: true },
},
},
{
files: ['*.mjs', '*.ts', '*.d.ts'],
parserOptions: { sourceType: 'module' },
},
],
// overrides airbnb, use sparingly
rules: {
'tailwindcss/no-custom-classname': 'off',
'no-bitwise': 'off',
'no-mixed-operators': 'off',
'arrow-parens': ['error', 'always'],
'brace-style': ['error', '1tbs', { allowSingleLine: false }],
'class-methods-use-this': 'off',
'curly': ['error', 'multi-line'],
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'indent': ['error', 4],
'react/jsx-filename-extension': [2, { extensions: ['.jsx', '.tsx'] }],
'react/jsx-indent': ['error', 4],
'no-restricted-syntax': 'off',
'quote-props': ['error', 'consistent-as-needed'],
'strict': ['error', 'global'],

'no-case-declarations': 'off',

'no-plusplus': 'off',
'no-shadow': 'off',
'no-continue': 'off',
'no-return-assign': 'off',
'radix': 'off',
'max-classes-per-file': 'off',
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': ['error'],
'no-empty-function': ['error', { allow: ['constructors', 'arrowFunctions'] }],
'@typescript-eslint/no-empty-function': 'off',

// buggy
'prefer-destructuring': 'off',

// Avoid typescript-eslint conflicts
'no-unused-vars': 'off',
'import/no-unresolved': 'off',
'@typescript-eslint/no-unused-vars': ['error', {
vars: 'all',
varsIgnorePattern: '^_|^FSComponent$',
args: 'after-used',
argsIgnorePattern: '^_|^node$|^deltaTime$',
}],

'no-use-before-define': 'off',

'react/jsx-indent-props': 'off',

// not relevant now
'react/no-unused-state': 'off',

// useless
'react/prop-types': 'off',
'react/require-default-props': 'off',
'react/no-unused-prop-types': 'off',
'react/destructuring-assignment': 'off',
'react/jsx-props-no-spreading': 'off',
'react/no-unescaped-entities': 'off',

// Not needed with react 17+
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',

'import/extensions': 'off',
'no-param-reassign': 'off',
'no-undef-init': 'off',
'no-undef': 'off',
'max-len': ['error', { code: 192 }],

// Irrelevant for our use
'jsx-a11y/alt-text': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/anchor-is-valid': 'off',
'object-curly-newline': ['error', { multiline: true }],
'linebreak-style': 'off',

// allow typescript overloads
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': ['error'],
'lines-between-class-members': 'off',
'@typescript-eslint/lines-between-class-members': ['error'],
'no-dupe-class-members': 'off',
'@typescript-eslint/no-dupe-class-members': ['error'],

// allow console logging
'no-console': 'off',
},
globals: {
Simplane: 'readonly',
SimVar: 'readonly',
Utils: 'readonly',
JSX: 'readonly',
Coherent: 'readonly',
ViewListener: 'readonly',
RegisterViewListener: 'readonly',
},
};
2 changes: 0 additions & 2 deletions fbw-a380x/src/base/flybywire-aircraft-a380-842/.keep

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e1bf51e

Please sign in to comment.