2.0 KiB
2.0 KiB
Architecture
High-Level Overview
The application is a Java Swing desktop client that:
- subscribes to MQTT prediction events,
- stores accepted events in SQLite,
- computes risk ratios,
- updates UI state and visualization,
- exports animation state for Unreal integration.
Layers
bootstrap- builds and wires all services in
ApplicationInitializer - handles orderly shutdown in
ApplicationShutdownManager service- integration and business logic (MQTT, DB, stats, evaluation, external processes)
model- simple state and value objects (
AppState,ProblemLevel,DatabaseEntry,RatioPoint) controller- UI orchestration between state/services and Swing views
ui- window and visual components (tabs, chart, browser, status widgets)
util- shared helpers for config and logging
Runtime Data Flow
App.maininitializes look-and-feel and context.MqttClientServiceconnects totcp://localhost:1883.- Subscription on configured topic routes payloads into
BinaryEventService. BinaryEventServicevalidates JSON and storespredictionvalues.EvaluationServicegets ratio fromStatisticsService.AppStateis updated with the newProblemLevel.- Controllers listen to
AppStateand refresh UI (DashboardView, status bar). AnimationFileServicewrites the animation JSON consumed by Unreal side logic.
Main Components
vassistent.App- process entry point and shutdown hook registration
ApplicationContext- in-memory service container
DataPersistenceService- SQLite schema init and data access
MqttClientService- MQTT connect/subscribe/publish callbacks
StatisticsService- ratio and rolling-average computations
EvaluationService- ratio-to-level mapping
ProcessManagerService- optional startup/shutdown of simulator/Unreal helper processes
UI Structure
- Main window:
AppWindow - Tab 1:
PixelStreamingView(JCEF browser) - Tab 2:
DashboardView(JFreeChart +ProblemLevelBar) - Footer status bar: MQTT status + current level