/** * @file StateUtils.h * @brief StateUtils class * @author Robert J Davis * @date 2025-10-06 * * Defines the StateUtils class, which contains utility functions used in multiple States. */ #pragma once #include "ModbusPoints/Modbus_Point.h" #include "ModbusPoints/Modbus_FloatDecorator.h" #include "Equipment/Equipment.h" #include "States/State_Standby.h" #include "States/State_Running.h" #include "States/State_Fail.h" #include "States/State.h" #include #include #if defined(USE_MODBUS_IP) #include #else #include #endif template class State; /** * @brief Updates the Control Mode based on BMS signals and writes it back to Modbus. * @param equipment Pointer to the Equipment instance. * @return The selected control mode (int). */ void updateControlMode(Equipment* equipment); /** * @brief Checks common alarms (non-fail alarms) and updates the Common Alarm Modbus point. * @param equipment Pointer to the Equipment instance. * @return true if any common alarm is active, false otherwise. */ void updateAlarms(Equipment* equipment); /** * @brief Checks common alarms (non-fail alarms) and updates the Common Alarm Modbus point. * @param equipment Pointer to the Equipment instance. * @return true if any common alarm is active, false otherwise. */ void updateAnalogs(Equipment* equipment);