final testing before publishing
This commit is contained in:
50
src/BMS/CRAH/CRAH_UMAS_TCP/StateUtils.h
Normal file
50
src/BMS/CRAH/CRAH_UMAS_TCP/StateUtils.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* @file config.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 <vector>
|
||||
#include <string>
|
||||
|
||||
#if defined(USE_MODBUS_IP)
|
||||
#include <ModbusIP_ESP8266.h>
|
||||
#else
|
||||
#include <ModbusRTU.h>
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
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<ModbusIP>* 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<ModbusIP>* 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<ModbusIP>* equipment);
|
||||
Reference in New Issue
Block a user