2018-07-12 16:29:32 +02:00
|
|
|
#ifndef THERMALCOMPONENT_H_
|
|
|
|
#define THERMALCOMPONENT_H_
|
|
|
|
|
|
|
|
#include "CoreComponent.h"
|
|
|
|
|
2020-02-15 18:26:25 +01:00
|
|
|
/**
|
|
|
|
* What is it. How to use
|
|
|
|
*/
|
2018-07-12 16:29:32 +02:00
|
|
|
class ThermalComponent: public CoreComponent {
|
|
|
|
public:
|
|
|
|
struct Parameters {
|
|
|
|
float lowerNopLimit;
|
|
|
|
float lowerOpLimit;
|
|
|
|
float upperOpLimit;
|
|
|
|
float upperNopLimit;
|
|
|
|
float heaterOn;
|
|
|
|
float hysteresis;
|
|
|
|
float heaterSwitchoff;
|
|
|
|
};
|
2020-01-15 13:32:21 +01:00
|
|
|
|
2020-02-15 18:26:25 +01:00
|
|
|
/**
|
|
|
|
* Non-Operational Temperatures
|
|
|
|
*/
|
2018-07-12 16:29:32 +02:00
|
|
|
struct NopParameters {
|
|
|
|
float lowerNopLimit;
|
|
|
|
float upperNopLimit;
|
|
|
|
};
|
2020-02-15 18:26:25 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* How to use.
|
|
|
|
* @param reportingObjectId
|
|
|
|
* @param domainId
|
|
|
|
* @param temperaturePoolId
|
|
|
|
* @param targetStatePoolId
|
|
|
|
* @param currentStatePoolId
|
|
|
|
* @param requestPoolId
|
|
|
|
* @param dataSet
|
|
|
|
* @param sensor
|
|
|
|
* @param firstRedundantSensor
|
|
|
|
* @param secondRedundantSensor
|
|
|
|
* @param thermalModule
|
|
|
|
* @param parameters
|
|
|
|
* @param priority
|
|
|
|
*/
|
2018-07-12 16:29:32 +02:00
|
|
|
ThermalComponent(object_id_t reportingObjectId, uint8_t domainId, uint32_t temperaturePoolId,
|
|
|
|
uint32_t targetStatePoolId, uint32_t currentStatePoolId, uint32_t requestPoolId,
|
2020-05-17 13:37:50 +02:00
|
|
|
GlobDataSet *dataSet, AbstractTemperatureSensor *sensor,
|
2018-07-12 16:29:32 +02:00
|
|
|
AbstractTemperatureSensor *firstRedundantSensor,
|
|
|
|
AbstractTemperatureSensor *secondRedundantSensor,
|
|
|
|
ThermalModuleIF *thermalModule, Parameters parameters,
|
|
|
|
Priority priority);
|
|
|
|
virtual ~ThermalComponent();
|
|
|
|
|
|
|
|
ReturnValue_t setTargetState(int8_t newState);
|
|
|
|
|
2020-04-15 15:53:46 +02:00
|
|
|
virtual ReturnValue_t setLimits( const uint8_t* data, size_t size);
|
2018-07-12 16:29:32 +02:00
|
|
|
|
|
|
|
virtual ReturnValue_t getParameter(uint8_t domainId, uint16_t parameterId,
|
|
|
|
ParameterWrapper *parameterWrapper,
|
|
|
|
const ParameterWrapper *newValues, uint16_t startAtIndex);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
NopParameters nopParameters;
|
|
|
|
|
|
|
|
State getState(float temperature, CoreComponent::Parameters parameters,
|
|
|
|
int8_t targetState);
|
|
|
|
|
|
|
|
virtual void checkLimits(State state);
|
|
|
|
|
|
|
|
virtual HeaterRequest getHeaterRequest(int8_t targetState, float temperature,
|
|
|
|
CoreComponent::Parameters parameters);
|
|
|
|
|
|
|
|
State getIgnoredState(int8_t state);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* THERMALCOMPONENT_H_ */
|