Chiller daikin logic added
This commit is contained in:
@@ -87,6 +87,12 @@ protected:
|
||||
* @param strategy A pointer to the Strategy_Behavior object. The State takes ownership.
|
||||
*/
|
||||
void addStrategy(const std::string& pointDescription, Strategy_Behavior* strategy);
|
||||
/**
|
||||
* @brief returns a behavior strategy for a specific Modbus point in this state.
|
||||
* @param pointDescription The description of the Modbus point your need to get.
|
||||
*/
|
||||
Strategy_Behavior* getStrategy(const std::string& pointDescription);
|
||||
|
||||
std::map<std::string, Strategy_Behavior*> _strategies; /**< @brief Map of strategies active in this state, keyed by point description. */
|
||||
};
|
||||
|
||||
@@ -110,6 +116,20 @@ template<typename T>
|
||||
void State<T>::addStrategy(const std::string& pointDescription, Strategy_Behavior* strategy){
|
||||
this->_strategies[pointDescription] = strategy;
|
||||
}
|
||||
/**
|
||||
* @brief returns a behavior strategy for a specific Modbus point in this state.
|
||||
* @param pointDescription The description of the Modbus point your need to get.
|
||||
*/
|
||||
template<typename T>
|
||||
Strategy_Behavior* State<T>::getStrategy(const std::string& pointDescription){
|
||||
{
|
||||
auto it = _strategies.find(pointDescription);
|
||||
if (it != _strategies.end()) {
|
||||
return it->second;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets the value of a Modbus point, correctly handling float types.
|
||||
|
||||
@@ -59,6 +59,17 @@ void PIDStrategy::setInput(float input) {
|
||||
_input = input;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Manually sets the lower and upper limit of the PID.
|
||||
* @note This is typically not needed as the `execute` method receives the current
|
||||
* limit value on each call from the `_applyStrategies` loop.
|
||||
* @param input The new process variable value.
|
||||
*/
|
||||
void PIDStrategy::setLimits(float lowerLimit, float upperLimit) {
|
||||
_lowerLimit = lowerLimit;
|
||||
_upperLimit = upperLimit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Executes one cycle of the PID control algorithm.
|
||||
*
|
||||
|
||||
@@ -66,7 +66,8 @@ public:
|
||||
void setGains(float kp, float ki, float kd);
|
||||
/** @brief Manually sets the process variable (input) value. */
|
||||
void setInput(float input);
|
||||
|
||||
/** @brief Manually sets the lower and upper limits of the PID. */
|
||||
void setLimits(float lowerLimit, float upperLimit);
|
||||
|
||||
private:
|
||||
float _kp; /**< @brief Proportional gain. */
|
||||
@@ -77,6 +78,8 @@ private:
|
||||
float _input; /**< @brief The current value of the process variable. */
|
||||
float _lastError; /**< @brief The error from the previous calculation. */
|
||||
float _integral; /**< @brief The accumulated integral term. */
|
||||
float _lowerLimit; /**< @brief The lower limit for the output. */
|
||||
float _upperLimit; /**< @brief The upper limit for the output. */
|
||||
std::string _inputSensorName; /**< @brief The description key for the input sensor point. */
|
||||
std::string _setpointName; /**< @brief The description key for the setpoint point. */
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user