108 lines
4.2 KiB
C
108 lines
4.2 KiB
C
|
#ifndef MISSION_CONTROLLER_THERMALCONTROLLER_H_
|
||
|
#define MISSION_CONTROLLER_THERMALCONTROLLER_H_
|
||
|
|
||
|
#include <fsfw/action/HasActionsIF.h>
|
||
|
#include <fsfw/action/SimpleActionHelper.h>
|
||
|
#include <fsfw/events/EventReportingProxyIF.h>
|
||
|
#include <fsfw/parameters/ParameterHelper.h>
|
||
|
#include <fsfw/controller/ControllerBase.h>
|
||
|
#include <fsfw/datapool/ControllerSet.h>
|
||
|
#include <fsfw/datapool/DataSet.h>
|
||
|
#include <fsfw/datapool/PoolVariable.h>
|
||
|
#include <fsfw/datapool/PoolVector.h>
|
||
|
#include <fsfw/health/HealthTableIF.h>
|
||
|
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||
|
#include <mission/Controller/ArduinoTCSTemperatureSensor.h>
|
||
|
#include <mission/Controller/TCS_ThermalComponent.h>
|
||
|
#include <mission/Controller/TCS_Heater.h>
|
||
|
//#include <fsfw/thermal/ThermalModule.h>
|
||
|
#include <bsp_linux/fsfwconfig/objects/systemObjectList.h>
|
||
|
#include <bsp_linux/fsfwconfig/datapool/dataPoolInit.h>
|
||
|
|
||
|
|
||
|
class ThermalController: public ControllerBase {
|
||
|
public:
|
||
|
|
||
|
static const Mode_t MODE_ON = 1;
|
||
|
static const Mode_t MODE_OFF = 2;
|
||
|
static const Submode_t NO_REDUNDANCY = 1;
|
||
|
static const Submode_t HEATER_REDUNDANCY = 2;
|
||
|
|
||
|
static const uint8_t COMPONENT_DOMAIN_ID = 1; //!< First number n of component domain IDs
|
||
|
|
||
|
//static const Event TCS_CONTROL_STRATEGY = MAKE_EVENT(0, SEVERITY::INFO); //!< Announcement mode for the TCS controller strategy, strategy is in p1
|
||
|
|
||
|
//static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::ARDUINO_TCS;
|
||
|
//static const uint8_t INTERFACE_ID = CLASS_ID::THERMAL_CONTROLLER;
|
||
|
|
||
|
ThermalController(object_id_t objectId, object_id_t powerSwitcher, size_t commandQueueDepth);
|
||
|
virtual~ ThermalController();
|
||
|
|
||
|
ReturnValue_t initialize() override;
|
||
|
ReturnValue_t performOperation();
|
||
|
//virtual MessageQueueId_t getCommandQueue() const;
|
||
|
|
||
|
private:
|
||
|
|
||
|
//ThermalModule::Strategy strategy;
|
||
|
//SimpleActionHelper actionHelper;
|
||
|
//ParameterHelper parameterHelper;
|
||
|
object_id_t powerSwitcherId;
|
||
|
|
||
|
// definition of dataset
|
||
|
DataSet TCSData;
|
||
|
|
||
|
// definition of dataset variables from datapool
|
||
|
PoolVector <float, 36> TempValueVec;
|
||
|
|
||
|
// definition of objects
|
||
|
ArduinoTCSTemperatureSensor TEMPERATURE_SENSOR_CH1;
|
||
|
ArduinoTCSTemperatureSensor TEMPERATURE_SENSOR_CH2;
|
||
|
std::list<ArduinoTCSTemperatureSensor> sensors;
|
||
|
|
||
|
TCS_ThermalComponent TEMPERATURE_COMPONENT_1;
|
||
|
TCS_ThermalComponent TEMPERATURE_COMPONENT_2;
|
||
|
std::list<TCS_ThermalComponent> components;
|
||
|
|
||
|
TCS_Heater HEATER_1;
|
||
|
TCS_Heater REDUNDANT_HEATER_1;
|
||
|
TCS_Heater HEATER_2;
|
||
|
TCS_Heater REDUNDANT_HEATER_2;
|
||
|
std::list<TCS_Heater> heaters;
|
||
|
std::list<TCS_Heater> redundant_heaters;
|
||
|
|
||
|
/*--------------------------------------------------------------------------------*/
|
||
|
|
||
|
/*const float T_min = -50 + 273.15; // [K]
|
||
|
const float T_max = 50 + 273.15; // [K]
|
||
|
static const uint8_t margin = 5; // ESA qualification margin [K]
|
||
|
static const uint8_t DT_heater = 10; // margin of heater activation [K]
|
||
|
static const uint8_t DT_redundancy = 5; // margin of redundancy activation [K]*/
|
||
|
// Start of the clock when heater is turned-on (one clock defined for each heater), reset when heater turned-off
|
||
|
// const float Dt[36] = {0.0}; // time interval for check of heater activation [s]
|
||
|
|
||
|
//ThermalComponentIF* findComponentByObjectId(object_id_t id);
|
||
|
|
||
|
protected:
|
||
|
|
||
|
Mode_t mode;
|
||
|
Submode_t submode;
|
||
|
|
||
|
/* Extended Controller Base overrides */
|
||
|
ReturnValue_t handleCommandMessage(CommandMessage *message) override;
|
||
|
void performControlOperation() override;
|
||
|
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, uint32_t *msToReachTheMode) override;
|
||
|
void startTransition(Mode_t mode, Submode_t submode) override;
|
||
|
//void calculateStrategy(bool announce, bool redundancy);
|
||
|
|
||
|
//void modeChanged(Mode_t mode, Submode_t submode) override;
|
||
|
//void getMode(Mode_t *mode, Submode_t *submode) override;
|
||
|
//void changeHK(Mode_t mode, Submode_t submode, bool enable) override;
|
||
|
//void setToExternalControl() override;
|
||
|
//virtual ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t* data, uint32_t size) override;
|
||
|
//virtual void announceMode(bool recursive);
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif /* MISSION_CONTROLLER_THERMALCONTROLLER_H_ */
|