# octal450/md-11 architecture

> Architecture diagram of the GitHub repository octal450/md-11, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/octal450/md-11
- Repository: https://github.com/octal450/md-11

## Overview

##### Main Components
- Simulation Engine & Core Configuration:
- FDE (Flight Dynamics Engine) directory: Contains XML configuration files (aerodynamics, mass-balance, reactions, metrics, etc.) that define how the aircraft behaves physically.
- Systems directory: Holds XML configurations that manage power, hydraulics, engine fadec, fcs/fms, and other simulation subsystems.
- Engine Models & Configurations:
- Engines directory: Contains XML files for the various engine models (GE CF6 and PW4462 variants) which affect engine thrust and performance.
- Aircraft Models & 3D Assets:
- Models directory: Contains sub-folders for the cabin, cockpit, liveries, effects, instruments, paint kits, and services (like chocks, de-icing, pushback, etc.). This area includes both 3D assets (e.g., .ac and .xml files) and 2D resources (images, XCF files).
- Simulation Logic & Scripting:
- Nasal directory: Contains scripts written in the FlightGear scripting language (Nasal). These control systems (engines, warnings, autopush, displays) and aircraft behavior.
- GUI directory: Contains XML and Nasal files responsible for user interfaces, panels, dialogs, and web panels, ensuring the pilot’s interaction with the simulation.
- Audio & Sound Resources:
- Sounds directory: Organized into various subdirectories (e.g., Cockpit, Effects, GPWS, CF6, etc.) storing sound files that enhance the realism of the simulation.
- Documentation & Support Material:
- Docs directory: Contains documentation such as the FAQ, contributing guides, and design notes.
- Other resource directories include Fonts and Licensing/Installation instructions.

##### Establish Relationships and Interactions
- Core Simulation & Configuration:
- The FDE and Systems components work together to define the aerodynamic, fuel, engine, and other operational characteristics. These are consumed by the Nasal scripting layer to simulate dynamic behavior in real time.
- Aircraft Models & Graphical Presentation:
- The Models directory is closely linked with the GUI and Nasal scripts: 3D model definitions (for the cockpit, cabin, etc.) are loaded by the simulation and combined with instrument data from systems configuration.
- Engine Implementation:
- Engine XMLs influence both the FDE and the Systems scripts, providing input for power outputs and fadec calculations.
- User Interface & Controls:
- The GUI directory (dialogs, canvas configurations, and web panels) interacts with the Nasal scripts that handle the instrument readings and simulation status.
- Audio Effects:
- Sound directories provide feedback synchronized by the simulation’s state, with scripts (in Nasal and system configurations) triggering specific sound files under certain conditions.

##### Architectural Patterns & Design Principles
- Layered Approach:
- The Base Layer consists of configuration files (FDE, Systems, Engines) defining physics and operational parameters.
- The Middle Layer includes Nasal scripts that translate these configurations into dynamic simulation behavior.
- The Top Layer consists of Models and GUI that render visuals, cockpit controls, and user interaction.
- A Support Layer handles assets like sounds, liveries, and auxiliary services (pushback, de-icing, etc.).
- Component Separation:
- Although not strictly an MVC model, there is a clear separation between data/configuration, simulation logic, and presentation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Configuration Layer"
        FDECFG["FDE Configurations"]:::config
        SYSCFG["Systems Configurations"]:::config
        ENGCFG["Engine XML Settings"]:::config
    end

    subgraph "Simulation Logic Layer"
        NASAL["Nasal Scripts"]:::logic
        GUI["GUI Components"]:::logic
    end

    subgraph "Presentation & Assets Layer"
        MODELS["3D Models & Assets"]:::presentation
    end

    subgraph "Audio Layer"
        AUDIO["Audio System"]:::audio
    end

    subgraph "Documentation & Resources"
        DOCS["Documentation (Docs)"]:::docs
        FONTS["Fonts"]:::docs
        INSTALL["INSTALL.md"]:::docs
        LICENSE["LICENSE"]:::docs
    end

    FDECFG -->|"configures"| NASAL
    SYSCFG -->|"configures"| NASAL
    ENGCFG -->|"configures"| NASAL
    NASAL -->|"updates"| MODELS
    NASAL -->|"updates"| GUI
    NASAL -->|"triggers"| AUDIO
    GUI -->|"notifies"| AUDIO

    classDef config fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef logic fill:#FFCC00,stroke:#000,stroke-width:2px;
    classDef presentation fill:#D3FFD3,stroke:#000,stroke-width:2px;
    classDef audio fill:#FFB3B3,stroke:#000,stroke-width:2px;
    classDef docs fill:#E6E6FA,stroke:#000,stroke-width:2px;

    click FDECFG "https://github.com/octal450/md-11/tree/master/FDE"
    click SYSCFG "https://github.com/octal450/md-11/tree/master/Systems"
    click ENGCFG "https://github.com/octal450/md-11/tree/master/Engines"
    click MODELS "https://github.com/octal450/md-11/tree/master/Models"
    click NASAL "https://github.com/octal450/md-11/tree/master/Nasal"
    click GUI "https://github.com/octal450/md-11/tree/master/gui"
    click AUDIO "https://github.com/octal450/md-11/tree/master/Sounds"
    click DOCS "https://github.com/octal450/md-11/tree/master/Docs"
    click FONTS "https://github.com/octal450/md-11/tree/master/Fonts"
    click INSTALL "https://github.com/octal450/md-11/blob/master/INSTALL.md"
    click LICENSE "https://github.com/octal450/md-11/tree/master/LICENSE"
```
