How indeemasoftware/qsimplescada works
Main Components
• QScadaBoardController: This is the central controller that orchestrates the system. It initializes boards, manages connections, handles events (like double-clicks on widgets) and oversees updating values.
• QScadaDevice: Represents individual IoT devices by encapsulating device info (name, IP, etc.). Each device, identified uniquely by an IP address, can be connected to several dashboards.
• QScadaBoard: Acts as a dashboard for visualizing data. A device can have multiple boards (dashboards), and each board comprises multiple visual components.
• QScadaObject: The widgets/components that appear on a board. They are defined both as classic C++ widgets and as QML components, supporting dynamic user interfaces.
• QScadaEntity: Likely provides base or preference entities related to connected devices or general SCADA entities, enabling extensible and reusable code.
• QML Integration: Though not a separate module folder, the project includes QML files and a qmldir resource; this indicates that there is an interface and lifecycle management for QML-based custom widgets.
Relationships and Data Flows
• QScadaBoardController imports and manages QScadaDevice(s) – maintaining a collection where each device (identified by its IP) can host one or more QScadaBoard instances.
• QScadaBoard is responsible for managing QScadaObject elements (widgets) and invoking methods to create or update these objects. It provides APIs to handle events and persistence (saving to an XML file or .irp file, as mentioned).
• QScadaObject and related QScadaEntity classes ensure proper encapsulation of widget-specific details. They may interact with QScadaBoard to update widget data (using methods such as updateValue) and notify the main controller of interactions (e.g., double-click events).
• Additionally, QML components (via QScadaObject.qml and related files) provide a separate stream of dynamic widget creation that can be loaded on the fly.
Architectural Patterns and Design Principles
• Separation of Concerns: The system clearly separates device management, dashboard management, and widget handling into dedicated component groups. This separation simplifies maintenance and enhances extensibility.
• Modular and Extensible Design: With distinct directories and components for devices, boards, and objects, each piece is designed to be potentially extended or replaced. The integration of QML further underscores this flexibility.
• SDK and UI Decoupling: There’s a clear split between the logic (implemented in C++) and the UI components (both classic widgets and QML), demonstrating a modular architecture.