How bogos387/rrs works
Project type and purpose
• This is a large C++/Qt–based desktop application: an open‐source Russian Railway Simulator (RRS).
• It includes a simulation engine (physics, pneumatics, electrical, coupling, train dynamics), a UI launcher, a 3D viewer, configuration editors/readers, offline conversion tools, logging, and deployment scripts.
File structure to extract architectural layers
• Top‐level subsystems:
• cfg, CfgReader, CfgEditor – configuration management (XML-based init data, device and train definitions)
• simulator/* – core simulation engine, subdivided into:
– device simulators (pneumatic, electro, brake, coupling, etc.)
– physics module
– ODE solvers (rk4, rkf5)
– model layer (data‐engine, server)
– modbus communication
– sound‐manager
– train abstraction
• simulator/udp-connection & sim-client – message‐passing between engine and viewer
• addons/* – type-specific locomotive modules (chs2t, ep20, tep70, vl60, passcar) plugged into core engine
• launcher & launcher2 – Qt Widgets and QML UIs to select routes, vehicles, simulation parameters
• viewer/* – 3D rendering subsystem (OpenSceneGraph), route loader, display engine, DMD plugin
• tools/* – offline data conversion (pathconv, profconv, routeconv)
• libJournal – unified logging API (file, syslog)
• filesystem – file‐system abstraction
• scripts & setup – deployment and installer configuration
Extract additional insights from the README
• RRS is configuration-driven (XML defines trains, devices, main resistance, routes).
• It claims full compatibility with ZDSimulator routes.
• Configuration Subsystem
• Simulation Engine
• Vehicle Addons
• Communication Layer (UDP / sim-client)
• Launcher UI (launcher, launcher2)
• Viewer (3D renderer, route loader, display)
• Tools (conversion utilities)
• Supporting Libraries (libJournal, filesystem)
• Deployment (scripts, installer)
• User → Launcher UI → writes init-data.xml (via Configuration Subsystem)
• Launcher UI → spawns Simulation Engine
• Simulation Engine loads XML configs → CfgReader → core modules → physics & solver → updates Model → logs via libJournal
• Simulation Engine → serializes simulation state → UDP → sim-client → Viewer
• Viewer → loads geometry & routes (cfg + viewer/route‐loader) → OpenSceneGraph display → user sees 3D scene
• Tools operate offline on same XML inputs → produce profiles, paths, route definitions
c. Architectural patterns and principles:
• Layered architecture: UI → Engine → Communication → Rendering
• Plugin-style modules: addons compiled into core engine offering extensibility per locomotive type
• Configuration-driven design: nearly all behavior driven by XML definitions + CfgReader/CfgEditor
• Message‐passing decoupling via UDP allows viewer and engine to run in separate processes/machines
• Separation of concerns: solver, physics, device simulation, data model, I/O, and UI each in its own module
d. Key technologies and frameworks:
• C++17, Qt Widgets & QML, QMake/CMake build system
• OpenSceneGraph for 3D rendering
• XML for configuration (parsed by CfgReader)
• Custom ODE solvers (RK4, RKF5) for physics integration
• UDP and Modbus for inter‐module communication
• libJournal for logging abstraction
• Inno Setup scripts for Windows installer