taken over all changes

This commit is contained in:
Robin Müller 2020-09-06 15:25:56 +02:00
parent e9b86e51df
commit 790d3f1465
12 changed files with 114 additions and 72 deletions

16
fsfw.mk
View File

@ -9,6 +9,9 @@ CXXSRC += $(wildcard $(FRAMEWORK_PATH)/controller/*.cpp)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/coordinates/*.cpp) CXXSRC += $(wildcard $(FRAMEWORK_PATH)/coordinates/*.cpp)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/datalinklayer/*.cpp) CXXSRC += $(wildcard $(FRAMEWORK_PATH)/datalinklayer/*.cpp)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/datapool/*.cpp) CXXSRC += $(wildcard $(FRAMEWORK_PATH)/datapool/*.cpp)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/datapoolglob/*.cpp)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/datapoollocal/*.cpp)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/housekeeping/*.cpp)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/devicehandlers/*.cpp) CXXSRC += $(wildcard $(FRAMEWORK_PATH)/devicehandlers/*.cpp)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/events/*.cpp) CXXSRC += $(wildcard $(FRAMEWORK_PATH)/events/*.cpp)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/events/eventmatching/*.cpp) CXXSRC += $(wildcard $(FRAMEWORK_PATH)/events/eventmatching/*.cpp)
@ -28,12 +31,25 @@ CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/*.cpp)
# select the OS # select the OS
ifeq ($(OS_FSFW),rtems) ifeq ($(OS_FSFW),rtems)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/rtems/*.cpp) CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/rtems/*.cpp)
else ifeq ($(OS_FSFW),linux) else ifeq ($(OS_FSFW),linux)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/linux/*.cpp) CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/linux/*.cpp)
else ifeq ($(OS_FSFW),freeRTOS) else ifeq ($(OS_FSFW),freeRTOS)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/FreeRTOS/*.cpp) CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/FreeRTOS/*.cpp)
else ifeq ($(OS_FSFW),host) else ifeq ($(OS_FSFW),host)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/host/*.cpp) CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/host/*.cpp)
ifeq ($(OS),Windows_NT)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/windows/*.cpp)
else
# For now, the linux UDP bridge sources needs to be included manually by upper makefile
# for host OS because we can't be sure the OS is linux.
# Following lines can be used to do this:
# CXXSRC += $(FRAMEWORK_PATH)/osal/linux/TcUnixUdpPollingTask.cpp
# CXXSRC += $(FRAMEWORK_PATH)/osal/linux/TmTcUnixUdpBridge.cpp
endif
else else
$(error invalid OS_FSFW specified, valid OS_FSFW are rtems, linux, freeRTOS, host) $(error invalid OS_FSFW specified, valid OS_FSFW are rtems, linux, freeRTOS, host)
endif endif

View File

@ -1,17 +1,16 @@
#include "../datapoolglob/GlobalDataSet.h"
#include "InternalErrorReporter.h" #include "InternalErrorReporter.h"
#include "../datapool/DataSet.h" #include "../datapoolglob/GlobalPoolVariable.h"
#include "../datapool/PoolVariable.h"
#include "../ipc/MutexFactory.h" #include "../ipc/MutexFactory.h"
#include "../serviceinterface/ServiceInterfaceStream.h" #include "../serviceinterface/ServiceInterfaceStream.h"
InternalErrorReporter::InternalErrorReporter(object_id_t setObjectId, InternalErrorReporter::InternalErrorReporter(object_id_t setObjectId,
uint32_t queuePoolId, uint32_t tmPoolId, uint32_t storePoolId) : uint32_t queuePoolId, uint32_t tmPoolId, uint32_t storePoolId) :
SystemObject(setObjectId), mutex(NULL), queuePoolId(queuePoolId), tmPoolId( SystemObject(setObjectId), mutex(NULL), queuePoolId(queuePoolId),
tmPoolId), storePoolId( tmPoolId(tmPoolId),storePoolId(storePoolId), queueHits(0), tmHits(0),
storePoolId), queueHits(0), tmHits(0), storeHits( storeHits(0) {
0) {
mutex = MutexFactory::instance()->createMutex(); mutex = MutexFactory::instance()->createMutex();
} }
@ -21,13 +20,13 @@ InternalErrorReporter::~InternalErrorReporter() {
ReturnValue_t InternalErrorReporter::performOperation(uint8_t opCode) { ReturnValue_t InternalErrorReporter::performOperation(uint8_t opCode) {
DataSet mySet; GlobDataSet mySet;
PoolVariable<uint32_t> queueHitsInPool(queuePoolId, &mySet, gp_uint32_t queueHitsInPool(queuePoolId, &mySet,
PoolVariableIF::VAR_READ_WRITE); PoolVariableIF::VAR_READ_WRITE);
PoolVariable<uint32_t> tmHitsInPool(tmPoolId, &mySet, gp_uint32_t tmHitsInPool(tmPoolId, &mySet,
PoolVariableIF::VAR_READ_WRITE); PoolVariableIF::VAR_READ_WRITE);
PoolVariable<uint32_t> storeHitsInPool(storePoolId, &mySet, gp_uint32_t storeHitsInPool(storePoolId, &mySet,
PoolVariableIF::VAR_READ_WRITE); PoolVariableIF::VAR_READ_WRITE);
mySet.read(); mySet.read();

View File

@ -1,12 +1,12 @@
#ifndef MONITORBASE_H_ #ifndef MONITORBASE_H_
#define MONITORBASE_H_ #define MONITORBASE_H_
#include "../datapool/DataSet.h" #include "../datapoolglob/GlobalDataSet.h"
#include "../datapool/PIDReader.h" #include "../datapoolglob/PIDReader.h"
#include "LimitViolationReporter.h" #include "../monitoring/LimitViolationReporter.h"
#include "MonitoringIF.h" #include "../monitoring/MonitoringIF.h"
#include "MonitoringMessageContent.h" #include "../monitoring/MonitoringMessageContent.h"
#include "MonitorReporter.h" #include "../monitoring/MonitorReporter.h"
/** /**
* Base class for monitoring of parameters. * Base class for monitoring of parameters.
@ -48,7 +48,7 @@ public:
protected: protected:
virtual ReturnValue_t fetchSample(T* sample) { virtual ReturnValue_t fetchSample(T* sample) {
DataSet mySet; GlobDataSet mySet;
PIDReader<T> parameter(this->parameterId, &mySet); PIDReader<T> parameter(this->parameterId, &mySet);
mySet.read(); mySet.read();
if (!parameter.isValid()) { if (!parameter.isValid()) {

View File

@ -1,7 +1,7 @@
#include "../monitoring/LimitViolationReporter.h" #include "../monitoring/LimitViolationReporter.h"
#include "../monitoring/MonitoringMessageContent.h" #include "../monitoring/MonitoringMessageContent.h"
#include "../objectmanager/ObjectManagerIF.h" #include "../objectmanager/ObjectManagerIF.h"
#include "Fuse.h" #include "../power/Fuse.h"
#include "../serialize/SerialFixedArrayListAdapter.h" #include "../serialize/SerialFixedArrayListAdapter.h"
#include "../ipc/QueueFactory.h" #include "../ipc/QueueFactory.h"
@ -12,7 +12,7 @@ Fuse::Fuse(object_id_t fuseObjectId, uint8_t fuseId, VariableIds ids,
SystemObject(fuseObjectId), oldFuseState(0), fuseId(fuseId), powerIF( SystemObject(fuseObjectId), oldFuseState(0), fuseId(fuseId), powerIF(
NULL), currentLimit(fuseObjectId, 1, ids.pidCurrent, confirmationCount, NULL), currentLimit(fuseObjectId, 1, ids.pidCurrent, confirmationCount,
maxCurrent, FUSE_CURRENT_HIGH), powerMonitor(fuseObjectId, 2, maxCurrent, FUSE_CURRENT_HIGH), powerMonitor(fuseObjectId, 2,
DataPool::poolIdAndPositionToPid(ids.poolIdPower, 0), GlobalDataPool::poolIdAndPositionToPid(ids.poolIdPower, 0),
confirmationCount), set(), voltage(ids.pidVoltage, &set), current( confirmationCount), set(), voltage(ids.pidVoltage, &set), current(
ids.pidCurrent, &set), state(ids.pidState, &set), power( ids.pidCurrent, &set), state(ids.pidState, &set), power(
ids.poolIdPower, &set, PoolVariableIF::VAR_READ_WRITE), commandQueue( ids.poolIdPower, &set, PoolVariableIF::VAR_READ_WRITE), commandQueue(
@ -109,7 +109,7 @@ size_t Fuse::getSerializedSize() const {
} }
ReturnValue_t Fuse::deSerialize(const uint8_t** buffer, size_t* size, ReturnValue_t Fuse::deSerialize(const uint8_t** buffer, size_t* size,
Endianness streamEndianness) { Endianness streamEndianness) {
ReturnValue_t result = RETURN_FAILED; ReturnValue_t result = RETURN_FAILED;
for (DeviceList::iterator iter = devices.begin(); iter != devices.end(); for (DeviceList::iterator iter = devices.begin(); iter != devices.end();
iter++) { iter++) {

View File

@ -1,12 +1,13 @@
#ifndef FUSE_H_ #ifndef FUSE_H_
#define FUSE_H_ #define FUSE_H_
#include "../datapool/DataSet.h" #include "../datapoolglob/GlobalDataSet.h"
#include "../datapool/PIDReader.h" #include "../datapoolglob/GlobalPoolVariable.h"
#include "../datapoolglob/PIDReader.h"
#include "../devicehandlers/HealthDevice.h" #include "../devicehandlers/HealthDevice.h"
#include "../monitoring/AbsLimitMonitor.h" #include "../monitoring/AbsLimitMonitor.h"
#include "PowerComponentIF.h" #include "../power/PowerComponentIF.h"
#include "PowerSwitchIF.h" #include "../power/PowerSwitchIF.h"
#include "../returnvalues/HasReturnvaluesIF.h" #include "../returnvalues/HasReturnvaluesIF.h"
#include "../parameters/ParameterHelper.h" #include "../parameters/ParameterHelper.h"
#include <list> #include <list>
@ -84,12 +85,12 @@ private:
}; };
PowerMonitor powerMonitor; PowerMonitor powerMonitor;
DataSet set; GlobDataSet set;
PIDReader<float> voltage; PIDReader<float> voltage;
PIDReader<float> current; PIDReader<float> current;
PIDReader<uint8_t> state; PIDReader<uint8_t> state;
db_float_t power; gp_float_t power;
MessageQueueIF *commandQueue; MessageQueueIF* commandQueue;
ParameterHelper parameterHelper; ParameterHelper parameterHelper;
HealthHelper healthHelper; HealthHelper healthHelper;
static object_id_t powerSwitchId; static object_id_t powerSwitchId;

View File

@ -1,9 +1,9 @@
#ifndef POWERSENSOR_H_ #ifndef POWERSENSOR_H_
#define POWERSENSOR_H_ #define POWERSENSOR_H_
#include "../datapool/DataSet.h" #include "../datapoolglob/GlobalDataSet.h"
#include "../datapool/PIDReader.h" #include "../datapoolglob/GlobalPoolVariable.h"
#include "../datapool/PoolVariable.h" #include "../datapoolglob/PIDReader.h"
#include "../devicehandlers/HealthDevice.h" #include "../devicehandlers/HealthDevice.h"
#include "../monitoring/LimitMonitor.h" #include "../monitoring/LimitMonitor.h"
#include "../parameters/ParameterHelper.h" #include "../parameters/ParameterHelper.h"
@ -53,12 +53,12 @@ private:
MessageQueueIF* commandQueue; MessageQueueIF* commandQueue;
ParameterHelper parameterHelper; ParameterHelper parameterHelper;
HealthHelper healthHelper; HealthHelper healthHelper;
DataSet set; GlobDataSet set;
//Variables in //Variables in
PIDReader<float> current; PIDReader<float> current;
PIDReader<float> voltage; PIDReader<float> voltage;
//Variables out //Variables out
db_float_t power; gp_float_t power;
static const uint8_t MODULE_ID_CURRENT = 1; static const uint8_t MODULE_ID_CURRENT = 1;
static const uint8_t MODULE_ID_VOLTAGE = 2; static const uint8_t MODULE_ID_VOLTAGE = 2;

View File

@ -2,7 +2,7 @@
CoreComponent::CoreComponent(object_id_t reportingObjectId, uint8_t domainId, CoreComponent::CoreComponent(object_id_t reportingObjectId, uint8_t domainId,
uint32_t temperaturePoolId, uint32_t targetStatePoolId, uint32_t temperaturePoolId, uint32_t targetStatePoolId,
uint32_t currentStatePoolId, uint32_t requestPoolId, DataSet* dataSet, uint32_t currentStatePoolId, uint32_t requestPoolId, GlobDataSet* dataSet,
AbstractTemperatureSensor* sensor, AbstractTemperatureSensor* sensor,
AbstractTemperatureSensor* firstRedundantSensor, AbstractTemperatureSensor* firstRedundantSensor,
AbstractTemperatureSensor* secondRedundantSensor, AbstractTemperatureSensor* secondRedundantSensor,
@ -18,14 +18,14 @@ CoreComponent::CoreComponent(object_id_t reportingObjectId, uint8_t domainId,
AbstractTemperatureSensor::ZERO_KELVIN_C), parameters( AbstractTemperatureSensor::ZERO_KELVIN_C), parameters(
parameters), temperatureMonitor(reportingObjectId, parameters), temperatureMonitor(reportingObjectId,
domainId + 1, domainId + 1,
DataPool::poolIdAndPositionToPid(temperaturePoolId, 0), GlobalDataPool::poolIdAndPositionToPid(temperaturePoolId, 0),
COMPONENT_TEMP_CONFIRMATION), domainId(domainId) { COMPONENT_TEMP_CONFIRMATION), domainId(domainId) {
if (thermalModule != NULL) { if (thermalModule != NULL) {
thermalModule->registerComponent(this, priority); thermalModule->registerComponent(this, priority);
} }
//Set thermal state once, then leave to operator. //Set thermal state once, then leave to operator.
DataSet mySet; GlobDataSet mySet;
PoolVariable<int8_t> writableTargetState(targetStatePoolId, &mySet, gp_uint8_t writableTargetState(targetStatePoolId, &mySet,
PoolVariableIF::VAR_WRITE); PoolVariableIF::VAR_WRITE);
writableTargetState = initialTargetState; writableTargetState = initialTargetState;
mySet.commit(PoolVariableIF::VALID); mySet.commit(PoolVariableIF::VALID);
@ -70,8 +70,8 @@ float CoreComponent::getLowerOpLimit() {
} }
ReturnValue_t CoreComponent::setTargetState(int8_t newState) { ReturnValue_t CoreComponent::setTargetState(int8_t newState) {
DataSet mySet; GlobDataSet mySet;
PoolVariable<int8_t> writableTargetState(targetState.getDataPoolId(), gp_uint8_t writableTargetState(targetState.getDataPoolId(),
&mySet, PoolVariableIF::VAR_READ_WRITE); &mySet, PoolVariableIF::VAR_READ_WRITE);
mySet.read(); mySet.read();
if ((writableTargetState == STATE_REQUEST_OPERATIONAL) if ((writableTargetState == STATE_REQUEST_OPERATIONAL)

View File

@ -1,13 +1,14 @@
#ifndef MISSION_CONTROLLERS_TCS_CORECOMPONENT_H_ #ifndef MISSION_CONTROLLERS_TCS_CORECOMPONENT_H_
#define MISSION_CONTROLLERS_TCS_CORECOMPONENT_H_ #define MISSION_CONTROLLERS_TCS_CORECOMPONENT_H_
#include "../datapool/DataSet.h" #include "../datapoolglob/GlobalDataSet.h"
#include "../datapool/PoolVariable.h" #include "../datapoolglob/GlobalPoolVariable.h"
#include "ThermalComponentIF.h" #include "../thermal/ThermalComponentIF.h"
#include "AbstractTemperatureSensor.h" #include "../thermal/AbstractTemperatureSensor.h"
#include "ThermalModule.h" #include "../thermal/ThermalModule.h"
#include "ThermalMonitor.h" #include "../thermal/ThermalMonitor.h"
// TODO: Documentaiton, how to use this? only use Thermal Component, which inherits core component?
class CoreComponent: public ThermalComponentIF { class CoreComponent: public ThermalComponentIF {
public: public:
struct Parameters { struct Parameters {
@ -22,7 +23,7 @@ public:
CoreComponent(object_id_t reportingObjectId, uint8_t domainId, uint32_t temperaturePoolId, CoreComponent(object_id_t reportingObjectId, uint8_t domainId, uint32_t temperaturePoolId,
uint32_t targetStatePoolId, uint32_t currentStatePoolId, uint32_t targetStatePoolId, uint32_t currentStatePoolId,
uint32_t requestPoolId, DataSet *dataSet, uint32_t requestPoolId, GlobDataSet *dataSet,
AbstractTemperatureSensor *sensor, AbstractTemperatureSensor *sensor,
AbstractTemperatureSensor *firstRedundantSensor, AbstractTemperatureSensor *firstRedundantSensor,
AbstractTemperatureSensor *secondRedundantSensor, AbstractTemperatureSensor *secondRedundantSensor,
@ -57,10 +58,10 @@ protected:
AbstractTemperatureSensor *secondRedundantSensor; AbstractTemperatureSensor *secondRedundantSensor;
ThermalModuleIF *thermalModule; ThermalModuleIF *thermalModule;
db_float_t temperature; gp_float_t temperature;
db_int8_t targetState; gp_int8_t targetState;
db_int8_t currentState; gp_int8_t currentState;
db_uint8_t heaterRequest; gp_uint8_t heaterRequest;
bool isHeating; bool isHeating;

View File

@ -3,7 +3,7 @@
ThermalComponent::ThermalComponent(object_id_t reportingObjectId, ThermalComponent::ThermalComponent(object_id_t reportingObjectId,
uint8_t domainId, uint32_t temperaturePoolId, uint8_t domainId, uint32_t temperaturePoolId,
uint32_t targetStatePoolId, uint32_t currentStatePoolId, uint32_t targetStatePoolId, uint32_t currentStatePoolId,
uint32_t requestPoolId, DataSet* dataSet, uint32_t requestPoolId, GlobDataSet* dataSet,
AbstractTemperatureSensor* sensor, AbstractTemperatureSensor* sensor,
AbstractTemperatureSensor* firstRedundantSensor, AbstractTemperatureSensor* firstRedundantSensor,
AbstractTemperatureSensor* secondRedundantSensor, AbstractTemperatureSensor* secondRedundantSensor,
@ -12,20 +12,18 @@ ThermalComponent::ThermalComponent(object_id_t reportingObjectId,
CoreComponent(reportingObjectId, domainId, temperaturePoolId, CoreComponent(reportingObjectId, domainId, temperaturePoolId,
targetStatePoolId, currentStatePoolId, requestPoolId, dataSet, targetStatePoolId, currentStatePoolId, requestPoolId, dataSet,
sensor, firstRedundantSensor, secondRedundantSensor, sensor, firstRedundantSensor, secondRedundantSensor,
thermalModule, thermalModule,{ parameters.lowerOpLimit, parameters.upperOpLimit,
{ parameters.lowerOpLimit, parameters.upperOpLimit, parameters.heaterOn, parameters.hysteresis, parameters.heaterSwitchoff },
parameters.heaterOn, parameters.hysteresis, priority, ThermalComponentIF::STATE_REQUEST_NON_OPERATIONAL),
parameters.heaterSwitchoff }, priority, nopParameters({ parameters.lowerNopLimit, parameters.upperNopLimit }) {
ThermalComponentIF::STATE_REQUEST_NON_OPERATIONAL), nopParameters(
{ parameters.lowerNopLimit, parameters.upperNopLimit }) {
} }
ThermalComponent::~ThermalComponent() { ThermalComponent::~ThermalComponent() {
} }
ReturnValue_t ThermalComponent::setTargetState(int8_t newState) { ReturnValue_t ThermalComponent::setTargetState(int8_t newState) {
DataSet mySet; GlobDataSet mySet;
PoolVariable<int8_t> writableTargetState(targetState.getDataPoolId(), gp_int8_t writableTargetState(targetState.getDataPoolId(),
&mySet, PoolVariableIF::VAR_READ_WRITE); &mySet, PoolVariableIF::VAR_READ_WRITE);
mySet.read(); mySet.read();
if ((writableTargetState == STATE_REQUEST_OPERATIONAL) if ((writableTargetState == STATE_REQUEST_OPERATIONAL)
@ -42,7 +40,7 @@ ReturnValue_t ThermalComponent::setTargetState(int8_t newState) {
} }
} }
ReturnValue_t ThermalComponent::setLimits(const uint8_t* data, uint32_t size) { ReturnValue_t ThermalComponent::setLimits(const uint8_t* data, size_t size) {
if (size != 4 * sizeof(parameters.lowerOpLimit)) { if (size != 4 * sizeof(parameters.lowerOpLimit)) {
return MonitoringIF::INVALID_SIZE; return MonitoringIF::INVALID_SIZE;
} }

View File

@ -3,6 +3,9 @@
#include "CoreComponent.h" #include "CoreComponent.h"
/**
* What is it. How to use
*/
class ThermalComponent: public CoreComponent { class ThermalComponent: public CoreComponent {
public: public:
struct Parameters { struct Parameters {
@ -14,13 +17,34 @@ public:
float hysteresis; float hysteresis;
float heaterSwitchoff; float heaterSwitchoff;
}; };
/**
* Non-Operational Temperatures
*/
struct NopParameters { struct NopParameters {
float lowerNopLimit; float lowerNopLimit;
float upperNopLimit; float upperNopLimit;
}; };
/**
* 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
*/
ThermalComponent(object_id_t reportingObjectId, uint8_t domainId, uint32_t temperaturePoolId, ThermalComponent(object_id_t reportingObjectId, uint8_t domainId, uint32_t temperaturePoolId,
uint32_t targetStatePoolId, uint32_t currentStatePoolId, uint32_t requestPoolId, uint32_t targetStatePoolId, uint32_t currentStatePoolId, uint32_t requestPoolId,
DataSet *dataSet, AbstractTemperatureSensor *sensor, GlobDataSet *dataSet, AbstractTemperatureSensor *sensor,
AbstractTemperatureSensor *firstRedundantSensor, AbstractTemperatureSensor *firstRedundantSensor,
AbstractTemperatureSensor *secondRedundantSensor, AbstractTemperatureSensor *secondRedundantSensor,
ThermalModuleIF *thermalModule, Parameters parameters, ThermalModuleIF *thermalModule, Parameters parameters,
@ -29,7 +53,7 @@ public:
ReturnValue_t setTargetState(int8_t newState); ReturnValue_t setTargetState(int8_t newState);
virtual ReturnValue_t setLimits( const uint8_t* data, uint32_t size); virtual ReturnValue_t setLimits( const uint8_t* data, size_t size);
virtual ReturnValue_t getParameter(uint8_t domainId, uint16_t parameterId, virtual ReturnValue_t getParameter(uint8_t domainId, uint16_t parameterId,
ParameterWrapper *parameterWrapper, ParameterWrapper *parameterWrapper,

View File

@ -6,7 +6,7 @@
ThermalModule::ThermalModule(uint32_t moduleTemperaturePoolId, ThermalModule::ThermalModule(uint32_t moduleTemperaturePoolId,
uint32_t currentStatePoolId, uint32_t targetStatePoolId, uint32_t currentStatePoolId, uint32_t targetStatePoolId,
DataSet *dataSet, Parameters parameters, GlobDataSet *dataSet, Parameters parameters,
RedundantHeater::Parameters heaterParameters) : RedundantHeater::Parameters heaterParameters) :
oldStrategy(ACTIVE_SINGLE), survivalTargetTemp(0), targetTemp(0), heating( oldStrategy(ACTIVE_SINGLE), survivalTargetTemp(0), targetTemp(0), heating(
false), parameters(parameters), moduleTemperature( false), parameters(parameters), moduleTemperature(
@ -16,7 +16,7 @@ ThermalModule::ThermalModule(uint32_t moduleTemperaturePoolId,
heater = new RedundantHeater(heaterParameters); heater = new RedundantHeater(heaterParameters);
} }
ThermalModule::ThermalModule(uint32_t moduleTemperaturePoolId, DataSet* dataSet) : ThermalModule::ThermalModule(uint32_t moduleTemperaturePoolId, GlobDataSet* dataSet) :
oldStrategy(ACTIVE_SINGLE), survivalTargetTemp(0), targetTemp(0), heating( oldStrategy(ACTIVE_SINGLE), survivalTargetTemp(0), targetTemp(0), heating(
false), parameters( { 0, 0 }), moduleTemperature( false), parameters( { 0, 0 }), moduleTemperature(
moduleTemperaturePoolId, dataSet, PoolVariableIF::VAR_WRITE), heater( moduleTemperaturePoolId, dataSet, PoolVariableIF::VAR_WRITE), heater(
@ -250,8 +250,8 @@ bool ThermalModule::calculateModuleHeaterRequestAndSetModuleStatus(
} }
void ThermalModule::setHeating(bool on) { void ThermalModule::setHeating(bool on) {
DataSet mySet; GlobDataSet mySet;
PoolVariable<int8_t> writableTargetState(targetState.getDataPoolId(), gp_int8_t writableTargetState(targetState.getDataPoolId(),
&mySet, PoolVariableIF::VAR_WRITE); &mySet, PoolVariableIF::VAR_WRITE);
if (on) { if (on) {
writableTargetState = STATE_REQUEST_HEATING; writableTargetState = STATE_REQUEST_HEATING;

View File

@ -1,8 +1,8 @@
#ifndef THERMALMODULE_H_ #ifndef THERMALMODULE_H_
#define THERMALMODULE_H_ #define THERMALMODULE_H_
#include "../datapool/DataSet.h" #include "../datapoolglob/GlobalDataSet.h"
#include "../datapool/PoolVariable.h" #include "../datapoolglob/GlobalPoolVariable.h"
#include "../devicehandlers/HealthDevice.h" #include "../devicehandlers/HealthDevice.h"
#include "../events/EventReportingProxyIF.h" #include "../events/EventReportingProxyIF.h"
#include "ThermalModuleIF.h" #include "ThermalModuleIF.h"
@ -11,6 +11,9 @@
#include "RedundantHeater.h" #include "RedundantHeater.h"
class PowerSwitchIF; class PowerSwitchIF;
/**
* @brief Allows creation of different thermal control domains within a system.
*/
class ThermalModule: public ThermalModuleIF { class ThermalModule: public ThermalModuleIF {
friend class ThermalController; friend class ThermalController;
public: public:
@ -20,10 +23,10 @@ public:
}; };
ThermalModule(uint32_t moduleTemperaturePoolId, uint32_t currentStatePoolId, ThermalModule(uint32_t moduleTemperaturePoolId, uint32_t currentStatePoolId,
uint32_t targetStatePoolId, DataSet *dataSet, Parameters parameters, uint32_t targetStatePoolId, GlobDataSet *dataSet, Parameters parameters,
RedundantHeater::Parameters heaterParameters); RedundantHeater::Parameters heaterParameters);
ThermalModule(uint32_t moduleTemperaturePoolId, DataSet *dataSet); ThermalModule(uint32_t moduleTemperaturePoolId, GlobDataSet *dataSet);
virtual ~ThermalModule(); virtual ~ThermalModule();
@ -67,12 +70,12 @@ protected:
Parameters parameters; Parameters parameters;
db_float_t moduleTemperature; gp_float_t moduleTemperature;
RedundantHeater *heater; RedundantHeater *heater;
db_int8_t currentState; gp_int8_t currentState;
db_int8_t targetState; gp_int8_t targetState;
std::list<AbstractTemperatureSensor *> sensors; std::list<AbstractTemperatureSensor *> sensors;
std::list<ComponentData> components; std::list<ComponentData> components;