testArduino/mission/Controller/TCS_ThermalComponent.h

62 lines
1.9 KiB
C
Raw Normal View History

#ifndef TCS_THERMALCOMPONENT_H_
#define TCS_THERMALCOMPONENT_H_
#include <fsfw/thermal/CoreComponent.h>
#include <fsfw/thermal/ThermalModuleIF.h>
#include <mission/Controller/ArduinoTCSTemperatureSensor.h>
#include <mission/Controller/TCS_Heater.h>
//#include <fsfw/thermal/Heater.h>
class TCS_ThermalComponent: public CoreComponent {
public:
struct Parameters {
float lowerNopLimit;
float lowerOpLimit;
float upperOpLimit;
float upperNopLimit;
float heaterOn;
float hysteresis;
float heaterSwitchoff;
};
struct NopParameters {
float lowerNopLimit;
float upperNopLimit;
};
TCS_ThermalComponent(object_id_t reportingObjectId, uint8_t domainId, uint32_t temperaturePoolId,
uint32_t targetStatePoolId, uint32_t currentStatePoolId, uint32_t requestPoolId,
DataSet *dataSet, ArduinoTCSTemperatureSensor *sensor,
ArduinoTCSTemperatureSensor *firstRedundantSensor,
ArduinoTCSTemperatureSensor *secondRedundantSensor,
TCS_Heater *Heater, TCS_Heater *RedundantHeater,
ThermalModuleIF *thermalModule, Parameters parameters,
Priority priority);
virtual ~TCS_ThermalComponent();
virtual HeaterRequest performOperation(uint8_t opCode, bool redundancy, bool dual);
ReturnValue_t setTargetState(int8_t newState) override;
virtual ReturnValue_t setLimits( const uint8_t* data, uint32_t size);
protected:
NopParameters nopParameters;
TCS_Heater *Heater;
TCS_Heater *RedundantHeater;
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);
enum Informee {
ALL, SAFE, NONE
};
//void informComponentsAboutHeaterState(bool heaterIsOn, Informee whomToInform, Priority priority, HeaterRequest request);
//Strategy oldStrategy;
};
#endif /* TCS_THERMALCOMPONENT_H_ */