# aberdeenrss/flightcomputer architecture

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

- Interactive diagram: https://gitdiagram.com/aberdeenrss/flightcomputer
- Repository: https://github.com/aberdeenrss/flightcomputer

## Overview

##### Main Components

a) Core System Components:
- Flight Executor (Central Control)
- API Client System
- Flight Director
- Measurement Management System
- Sensor Systems
- Microcontroller Interface

b) Platform-Specific Components:
- Android Implementation (Kivy)
- Standalone Implementation
- Arduino Communication Layer

##### Component Relationships

- Double lines: Critical control paths

##### Detailed Component Breakdown

Flight Executor:
- To Flight Director
- Measurement flow to sinks
- Command processing pipeline

Sensor System:
- Common sensor interfaces
- Platform-specific implementations
- To measurement system

Microcontroller Interface:
- Arduino serial communication
- Command pathway
- To sensor system

##### Additional Elements

Annotations for:
- Configuration management
- File logging system
- Testing components
- External API communication

##### Implementation Notes

- The separation between platform-specific code (Kivy vs. Standalone)
- The central role of the Flight Executor
- The modularity of the sensor system
- The importance of the measurement pipeline
- The command processing system

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Platform
        KW[Kivy Wrapper]:::platform
        SA[Standalone]:::platform
    end

    subgraph Core
        FE[Flight Executor]:::core
        FC[Flight Director]:::core
        API[API Client]:::core
        MMS[Measurement Management]:::core
    end

    subgraph "Sensor Layer"
        CSI[Common Sensor Interfaces]:::sensor
        PS[Platform Sensors]:::sensor
        AS[Android Sensors]:::sensor
    end

    subgraph "Microcontroller Layer"
        MI[Microcontroller Interface]:::micro
        AC[Arduino Communication]:::micro
        SC[Serial Communication]:::micro
    end

    subgraph "Command Processing"
        GC[General Commands]:::command
        MC[Motor Commands]:::command
    end

    subgraph "Measurement Sinks"
        AMS[API Sink]:::sink
        FMS[File Sink]:::sink
    end

    subgraph "Support Systems"
        CP[Calibration Processor]:::support
        FM[Flight Models]:::support
    end

    %% Connections
    KW --> FE
    SA --> FE
    FE --> FC
    FE --> API
    FE --> MMS
    MMS --> AMS
    MMS --> FMS
    FE -.-> GC
    FE -.-> MC
    FE --> CP
    FE --> FM
    CSI --> MMS
    PS --> MMS
    AS --> MMS
    MI --> AC
    AC --> SC
    MI --> MMS

    %% Click Events
    click FE "https://github.com/AberdeenRSS/FlightComputer/blob/master/core/flight_executer.py"
    click API "https://github.com/AberdeenRSS/FlightComputer/blob/master/core/api_client.py"
    click FC "https://github.com/AberdeenRSS/FlightComputer/tree/master/core/content/flight_director/"
    click CSI "https://github.com/AberdeenRSS/FlightComputer/tree/master/core/content/common_sensor_interfaces/"
    click PS "https://github.com/AberdeenRSS/FlightComputer/tree/master/core/content/sensors/"
    click AS "https://github.com/AberdeenRSS/FlightComputer/tree/master/kivy_wrapper/app/content/sensors/android_native/"
    click MI "https://github.com/AberdeenRSS/FlightComputer/tree/master/core/content/microcontroller/"
    click AC "https://github.com/AberdeenRSS/FlightComputer/tree/master/core/content/microcontroller/arduino/"
    click SC "https://github.com/AberdeenRSS/FlightComputer/blob/master/core/content/microcontroller/arduino_serial.py"
    click AMS "https://github.com/AberdeenRSS/FlightComputer/blob/master/core/content/measurement_sinks/api_measurement_sink.py"
    click FMS "https://github.com/AberdeenRSS/FlightComputer/blob/master/core/content/measurement_sinks/file_measurement_sink.py"
    click KW "https://github.com/AberdeenRSS/FlightComputer/tree/master/kivy_wrapper/"
    click SA "https://github.com/AberdeenRSS/FlightComputer/tree/master/standalone/"
    click GC "https://github.com/AberdeenRSS/FlightComputer/tree/master/core/content/general_commands/"
    click MC "https://github.com/AberdeenRSS/FlightComputer/tree/master/core/content/motor_commands/"
    click CP "https://github.com/AberdeenRSS/FlightComputer/blob/master/core/logic/calibration/calibration_processor.py"
    click FM "https://github.com/AberdeenRSS/FlightComputer/tree/master/core/models/"

    %% Styles
    classDef platform fill:#FFA500,stroke:#333,stroke-width:2px
    classDef core fill:#3498DB,stroke:#333,stroke-width:2px
    classDef sensor fill:#2ECC71,stroke:#333,stroke-width:2px
    classDef micro fill:#9B59B6,stroke:#333,stroke-width:2px
    classDef command fill:#E74C3C,stroke:#333,stroke-width:2px
    classDef sink fill:#34495E,stroke:#333,stroke-width:2px
    classDef support fill:#95A5A6,stroke:#333,stroke-width:2px
```
