Name updated, Categories folder to ModbuPoints, less generic to be self documented

This commit is contained in:
2025-09-15 12:51:34 -05:00
parent 5a0b02ccdf
commit 14cf23281d
24 changed files with 274 additions and 297 deletions

23
lib/README.md Normal file
View File

@@ -0,0 +1,23 @@
# Libraries
## Core Library
The `Core` library contains the fundamental building blocks and architectural patterns for the Industrial Equipment Emulator. It is designed to be reusable and independent of any specific equipment implementation.
### Directory Structure
* **`/Equipment`**: Contains the `Equipment` class, which is the central context for the state machine. It manages the current state and holds all the Modbus points.
* **`/Modbus_Points`** : Implements the **Decorator Pattern** for handling different Modbus data types.
* `Modbus_Point.h`: The base interface for all data points.
* `Modbus_PointDecorator.h`: The base class for wrappers that add functionality (e.g., scaling, float conversion).
* `Modbus_PointFactory.h`: A factory for creating and decorating Modbus points based on configuration.
* **`/States`**: Implements the **State Pattern** to define the different operating modes of the equipment (e.g., Standby, Running, Fail).
* `State.h`: The base interface for all state classes.
* Concrete states like `State_Standby.h`, `State_Running.h`, etc., are implemented in the device-specific source folders (e.g., `src/CRAH_.../`) as they contain device-specific logic.
* **`/Strategies`**: Implements the **Strategy Pattern** to define interchangeable behaviors for Modbus points within a given state.
* `Strategy_Behavior.h`: The base interface for all behavior algorithms.
* Concrete strategies like `Strategy_Ramp.h`, `Strategy_PID.h`, etc., provide reusable simulation logic.
* **`core.h`**: A central header file containing shared definitions, enumerations (`COIL`, `HR_FLOAT`, etc.), and the `modbusMap` structure used across the project.