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

docs: external a32nx repo documentation #536

Closed
wants to merge 10 commits into from
1 change: 1 addition & 0 deletions docs/dev-corner/dev-guide/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ nav:
- Resources: resources.md
- Setup Dev Environment: setup-environment.md
- Contribution Guidelines: contribute.md
- a32nx-repo-docs
- Specific Topics: specific
8 changes: 8 additions & 0 deletions docs/dev-corner/dev-guide/a32nx-repo-docs/.pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title: A32NX Repository Documentation
nav:
- Overview: index.md
- Systems: systems.md
- Systems Guidelines: systems-guidelines.md
- Custom Events: a320-events.md
- SimVars: a320-simvars.md
- ...
5 changes: 5 additions & 0 deletions docs/dev-corner/dev-guide/a32nx-repo-docs/a320-events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# A320neo Custom Events

This page is pulled externally from the A32NX repository.

{{ external_markdown('https://raw.githubusercontent.com/flybywiresim/a32nx/master/docs/a320-events.md', '') }}
5 changes: 5 additions & 0 deletions docs/dev-corner/dev-guide/a32nx-repo-docs/a320-simvars.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# A320neo Local SimVars

This page is pulled externally from the A32NX repository.

{{ external_markdown('https://raw.githubusercontent.com/flybywiresim/a32nx/master/docs/a320-simvars.md', '') }}
15 changes: 15 additions & 0 deletions docs/dev-corner/dev-guide/a32nx-repo-docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<link rel="stylesheet" href="../../../stylesheets/toc-tables.css">

# Overview

This section contains A32NX specific documentation from the [A32NX GitHub Repository](https://github.com/flybywiresim/a32nx). All pages found on this
section are pulled externally to be rendered on this site during the build process.

| Topics |
|:-------------------------------------------:|
| [Systems](systems.md) |
| [Systems Guidelines](systems-guidelines.md) |
| [Custom Events](a320-events.md) |
| [SimVars](a320-simvars.md) |


52 changes: 52 additions & 0 deletions docs/dev-corner/dev-guide/a32nx-repo-docs/systems-guidelines.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# A32NX Systems Guidelines

This page is pulled externally from the A32NX repository.

Please read through the guidelines described in this document. These guidelines are based upon pull request review comments. When reviewing pull requests, feel free to extend
this document rather than repeating the same comment on pull requests over and over again.

# General

{{ external_markdown('https://raw.githubusercontent.com/flybywiresim/a32nx/master/src/systems/guidelines.md', '# General') }}

## Units of measurement

We use the [`uom`](https://crates.io/crates/uom) crate to provide us with units of measurement types. Whenever possible use these types instead of numeric types.

**Rationale:** Reduces the risk of computational errors such as mistaking a value in pounds with a value in kilograms. Using these types also reduces the risk of passing function arguments in the wrong order.

When reading and writing `uom` types using `SimulatorReader` and `SimulatorWriter`, don't convert to a specific unit unless the unit deviates from the default unit defined in [`systems/src/simulation/mod.rs`](https://github.com/flybywiresim/a32nx/blob/master/src/systems/systems/src/simulation/mod.rs).

**Rationale**: This leads to shorter and easier to read code. The default unit works for the majority of cases.

{{ external_markdown('https://raw.githubusercontent.com/flybywiresim/a32nx/master/src/systems/guidelines.md', '## HashMap and HashSet') }}

{{ external_markdown('https://raw.githubusercontent.com/flybywiresim/a32nx/master/src/systems/guidelines.md', '## Testing') }}

{{ external_markdown('https://raw.githubusercontent.com/flybywiresim/a32nx/master/src/systems/guidelines.md', '## `assert_eq!` and `assert_ne!`') }}

{{ external_markdown('https://raw.githubusercontent.com/flybywiresim/a32nx/master/src/systems/guidelines.md', '## Law of Demeter') }}

{{ external_markdown('https://raw.githubusercontent.com/flybywiresim/a32nx/master/src/systems/guidelines.md', '## Explicit `match` pattern declaration') }}

{{ external_markdown('https://raw.githubusercontent.com/flybywiresim/a32nx/master/src/systems/guidelines.md', '## Implicit Enum variant value') }}

{{ external_markdown('https://raw.githubusercontent.com/flybywiresim/a32nx/master/src/systems/guidelines.md', '## Prefer monomorphisation') }}

{{ external_markdown('https://raw.githubusercontent.com/flybywiresim/a32nx/master/src/systems/guidelines.md', '## Passing data around') }}

{{ external_markdown('https://raw.githubusercontent.com/flybywiresim/a32nx/master/src/systems/guidelines.md', '## Do not re-read SimVars written by Rust code') }}

{{ external_markdown('https://raw.githubusercontent.com/flybywiresim/a32nx/master/src/systems/guidelines.md', '## Avoid repeating trait `where` clauses') }}

{{ external_markdown('https://raw.githubusercontent.com/flybywiresim/a32nx/master/src/systems/guidelines.md', '## Avoid copying default trait function implementations') }}

{{ external_markdown('https://raw.githubusercontent.com/flybywiresim/a32nx/master/src/systems/guidelines.md', '## Avoid `extern crate` usage') }}

{{ external_markdown('https://raw.githubusercontent.com/flybywiresim/a32nx/master/src/systems/guidelines.md', '## Limit item visibility') }}

{{ external_markdown('https://raw.githubusercontent.com/flybywiresim/a32nx/master/src/systems/guidelines.md', '## Avoid dependencies between child modules') }}

{{ external_markdown('https://raw.githubusercontent.com/flybywiresim/a32nx/master/src/systems/guidelines.md', '## Single assignment for simple `if else`') }}

{{ external_markdown('https://raw.githubusercontent.com/flybywiresim/a32nx/master/src/systems/guidelines.md', '# Style') }}
8 changes: 8 additions & 0 deletions docs/dev-corner/dev-guide/a32nx-repo-docs/systems.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# A32NX Systems

This page is pulled externally from the A32NX repository.

The `systems/` folder contains code for simulating Airbus aircraft systems. Please read through the [guidelines](systems-guidelines.md) and keep yourself up to date with those
guidelines as they might change over time. We also highly recommend reading through this document to get an overview of the software design.

{{ external_markdown('https://raw.githubusercontent.com/flybywiresim/a32nx/master/src/systems/README.md', '') }}
13 changes: 7 additions & 6 deletions docs/dev-corner/dev-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ It is structured in a series of sections which are based on each other starting

## Topics

| Quick Links | Description |
| :---- | :---- |
| [Resources](resources.md) | General information and documentation resources |
| [Setting up Development Environment](setup-environment.md) | From software to troubleshooting everything you need to successfully change and compile the code. |
| [Contribution Guidelines](contribute.md) | From General Development Process and Practices to Pull Requests - everything you need to know to collaborate and contribute to the project. |
| [Specific Development Areas](specific/) | Information for specific parts of the project like the flyPad or avionics. |
| Quick Links | Description |
|:-----------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Resources](resources.md) | General information and documentation resources |
| [Setting up Development Environment](setup-environment.md) | From software to troubleshooting everything you need to successfully change and compile the code. |
| [Contribution Guidelines](contribute.md) | From General Development Process and Practices to Pull Requests - everything you need to know to collaborate and contribute to the project. |
| [A32NX Repository Documentation](a32nx-repo-docs/) | This section contains A32NX specific developer documentation from various locations in the [A32NX GitHub Repository](https://github.com/flybywiresim/a32nx). |
| [Specific Development Areas](specific/) | Information for specific parts of the project like the flyPad or avionics. |

4 changes: 2 additions & 2 deletions docs/fbw-a32nx/a32nx-api/lvars-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ In addition to the above documentation all custom variables and custom events ar

## Docs:

- [Custom LVARs](https://github.com/flybywiresim/a32nx/blob/master/docs/a320-simvars.md){target=new}
- [Custom Events](https://github.com/flybywiresim/a32nx/blob/master/docs/a320-events.md){target=new}
- [Custom LVARs](../../dev-corner/dev-guide/a32nx-repo-docs/a320-simvars.md){target=new}
- [Custom Events](../../dev-corner/dev-guide/a32nx-repo-docs/a320-events.md){target=new}

## Templates

Expand Down