# lord-microstrain/mscl architecture

> Architecture diagram of the GitHub repository lord-microstrain/mscl, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lord-microstrain/mscl
- Repository: https://github.com/lord-microstrain/mscl

## Overview

##### Main Components Overview
The system should be divided into these major components:

a) Core Library Components:
- Communication Layer
- Device-Specific Implementations
- Wireless Devices
- Inertial Devices
- Displacement Devices
- Data Processing Layer

b) Language Bindings:
- C++ (Native)
- C# (.NET)
- Python

##### Detailed Component Breakdown

a) Communication Layer:
- Serial Connection
- TCP/IP Connection
- WebSocket Connection
- Unix Socket Connection
- Connection Debug/Monitoring

b) Device Implementation Layer:
- Create three main device branches:
1. Wireless Devices:
- Configuration
- Commands
- Packets
- Features
2. Inertial Devices:
- Commands
- Packets
- Features
3. Displacement Devices:
- Commands
- Features

c) Data Processing:
- Components for:
- Data Parsing
- Packet Collection
- Data Point Processing
- Timestamp Management

##### Architectural Patterns to Highlight

- Use a layered architecture pattern showing:
1. Hardware Interface Layer (bottom)
2. Communication Protocol Layer
3. Device Implementation Layer
4. API Layer (top)

##### Design Elements

- Blue: Core Communication Components
- Green: Device-Specific Implementations
- Yellow: Data Processing Components
- Purple: Language Bindings/APIs

b) Connection Types:

##### Implementation Details

- Relationship between:
- Base classes (e.g., Connection, WirelessNode)
- Derived implementations
- Feature sets
- Command structures

##### Cross-Platform Support

A section showing:
- Windows support (x86/x64)
- Linux support (x64/arm64/armhf)
- Different Python version support
- .NET implementation

##### Extensibility points

Remember to maintain a balance between showing enough detail to understand the system's architecture while keeping it clear and readable. Use hierarchical grouping to manage complexity, with the ability to expand specific components for more detail when needed.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Legend
        L1[Core Component]:::core
        L2[Device Implementation]:::device
        L3[Data Processing]:::data
        L4[Language Binding]:::binding
        L5[Communication]:::comm
    end

    subgraph "Language Bindings Layer"
        CPP["C++ Native API"]:::binding
        click CPP "https://github.com/LORD-MicroStrain/MSCL/blob/master/MSCL/source/mscl/mscl.h"
        CSHARP["C# (.NET)"]:::binding
        click CSHARP "https://github.com/LORD-MicroStrain/MSCL/tree/master/MSCL/source/mscl/Wrapper/CSharp/mscl/"
        PYTHON["Python (SWIG)"]:::binding
        click PYTHON "https://github.com/LORD-MicroStrain/MSCL/blob/master/BuildScripts/mscl_python_swig.cmake"
    end

    subgraph "Device Implementation Layer"
        subgraph "Wireless"
            WD["Wireless Devices"]:::device
            click WD "https://github.com/LORD-MicroStrain/MSCL/tree/master/MSCL/source/mscl/MicroStrain/Wireless/"
            WN["WirelessNode"]:::device
            click WN "https://github.com/LORD-MicroStrain/MSCL/blob/master/MSCL/source/mscl/MicroStrain/Wireless/WirelessNode.h"
            WC["Commands"]:::device
            click WC "https://github.com/LORD-MicroStrain/MSCL/tree/master/MSCL/source/mscl/MicroStrain/Wireless/Commands/"
            WF["Features"]:::device
            click WF "https://github.com/LORD-MicroStrain/MSCL/tree/master/MSCL/source/mscl/MicroStrain/Wireless/Features/"
        end

        subgraph "Inertial"
            ID["Inertial Devices"]:::device
            click ID "https://github.com/LORD-MicroStrain/MSCL/tree/master/MSCL/source/mscl/MicroStrain/Inertial/"
            IN["InertialNode"]:::device
            click IN "https://github.com/LORD-MicroStrain/MSCL/blob/master/MSCL/source/mscl/MicroStrain/Inertial/InertialNode.h"
            IC["Commands"]:::device
            click IC "https://github.com/LORD-MicroStrain/MSCL/tree/master/MSCL/source/mscl/MicroStrain/Inertial/Commands/"
            IF["Features"]:::device
            click IF "https://github.com/LORD-MicroStrain/MSCL/tree/master/MSCL/source/mscl/MicroStrain/Inertial/Features/"
        end

        subgraph "Displacement"
            DD["Displacement Devices"]:::device
            click DD "https://github.com/LORD-MicroStrain/MSCL/tree/master/MSCL/source/mscl/MicroStrain/Displacement/"
            DN["DisplacementNode"]:::device
            click DN "https://github.com/LORD-MicroStrain/MSCL/blob/master/MSCL/source/mscl/MicroStrain/Displacement/DisplacementNode.h"
            DC["Commands"]:::device
            click DC "https://github.com/LORD-MicroStrain/MSCL/tree/master/MSCL/source/mscl/MicroStrain/Displacement/Commands/"
        end
    end

    subgraph "Data Processing Layer"
        DP["Data Point Processing"]:::data
        click DP "https://github.com/LORD-MicroStrain/MSCL/blob/master/MSCL/source/mscl/MicroStrain/DataPoint.h"
        MPC["MIP Packet Collector"]:::data
        click MPC "https://github.com/LORD-MicroStrain/MSCL/blob/master/MSCL/source/mscl/MicroStrain/MIP/Packets/MipPacketCollector.h"
        WPC["Wireless Packet Collector"]:::data
        click WPC "https://github.com/LORD-MicroStrain/MSCL/blob/master/MSCL/source/mscl/MicroStrain/Wireless/Packets/WirelessPacketCollector.h"
    end

    subgraph "Communication Layer"
        BC["Base Connection"]:::comm
        click BC "https://github.com/LORD-MicroStrain/MSCL/blob/master/MSCL/source/mscl/Communication/Connection.h"
        SC["Serial Connection"]:::comm
        click SC "https://github.com/LORD-MicroStrain/MSCL/blob/master/MSCL/source/mscl/Communication/SerialConnection.h"
        TC["TCP/IP Connection"]:::comm
        click TC "https://github.com/LORD-MicroStrain/MSCL/blob/master/MSCL/source/mscl/Communication/TcpIpConnection.h"
        WS["WebSocket Connection"]:::comm
        click WS "https://github.com/LORD-MicroStrain/MSCL/blob/master/MSCL/source/mscl/Communication/WebSocketConnection.h"
        US["Unix Socket Connection"]:::comm
        click US "https://github.com/LORD-MicroStrain/MSCL/blob/master/MSCL/source/mscl/Communication/UnixSocketConnection.h"
    end

    %% Connections
    CPP & CSHARP & PYTHON --> WD & ID & DD
    WD --> WN --> WC & WF
    ID --> IN --> IC & IF
    DD --> DN --> DC
    WN & IN & DN --> DP
    WN --> WPC
    IN --> MPC
    WN & IN & DN --> BC
    BC --> SC & TC & WS & US

    %% Styles
    classDef core fill:#a8dadc,stroke:#457b9d
    classDef device fill:#90be6d,stroke:#2d6a4f
    classDef data fill:#f9c74f,stroke:#f3722c
    classDef binding fill:#8338ec,stroke:#3a0ca3
    classDef comm fill:#48cae4,stroke:#023e8a
```
