Files
Industrial_Emulator/lib/README.md

1.7 KiB

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.