How jordanepeer/flight-ai-super-resilient-system works
Project Type and Purpose
• This is a full-stack research dashboard (“Flight-AI-Super-Resilient-System”) whose goal is to inject control-parameters into Microsoft Flight Simulator (MSFS) via SimConnect, collect flight telemetry, store it, and run offline ML/analytics to predict whether a flight will reach its destination.
File Structure Analysis
• Top-level directory “MSFS_UseCase_Control_Dashboard” holds:
• SimConnect/… – a Python package wrapping the MSFS SimConnect API.
• server.py & Server_Description.py – the backend web server and its documentation.
• Templates/ + static/ – a Flask (or similar) templating layer and accompanying CSS/JS for the browser-based dashboard.
• Analytics/ – standalone Python scripts for data sampling, transformation, plotting, and populating the SQLite database with “bad flights.”
• DataBase.db & DataBase.sql – the SQLite persistence layer.
• requirements.txt – lists Python dependencies.
README Insights
• Confirms the system uses parameter injection into MSFS, logging via SimConnect, and ML model evaluation to classify flight outcomes.
Main Components
a. External Service:
– MS Flight Simulator (MSFS)
b. Adapter Layer:
– SimConnect Python package (Attributes, Constants, RequestList, etc.)
c. Backend Server:
– server.py (Flask or FastAPI)
– Business logic that:
• Initiates connections to MSFS via SimConnect
• Receives telemetry/events
• Reads/writes to the SQLite Database
• Exposes REST/WebSocket APIs to the front end
d. Database:
– SQLite (DataBase.db) – stores raw telemetry and “bad flight” records
e. Frontend Dashboard:
– HTML templates (index.html)
– CSS (styles.css, Styles_Description.css)
– JavaScript (app.js, App_Description.js)
– Renders real-time telemetry, classification results, and control widgets
f. Analytics & ML Pipeline (Offline):
– Python scripts in Analytics/ – perform latin-square sampling, CSV transforms, plotting, and database seeding
– ML models (assumed to be imported/trained via these scripts)
Relationships and Data Flows
1. MSFS → SimConnect Adapter → Backend Server
2. Backend Server ↔ SQLite Database
3. Backend Server → Frontend Dashboard (via REST/WebSocket)
4. Analytics Scripts → SQLite Database (read/write)
5. Analytics Scripts ↔ ML Models → Database (optional)
Architectural Patterns & Design Principles
• Layered architecture: External simulator → Adapter → Business logic → Persistence → Presentation
• Separation of concerns: Adapter isolates MSFS API; server handles HTTP and data orchestration; analytics is an offline batch process
• MVC-like pattern in the web app: Templates (View), server.py (Controller), Database (Model)
Technologies & Frameworks to Call Out
• Python 3.x
• Flask (or equivalent) for server.py
• SimConnect Python package
• SQLite for embedded storage
• HTML/CSS/JavaScript for dashboard UI
• Matplotlib/pandas (implied in plot_points.py, movetocsv.py) for analytics