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)/datalinklayer/*.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)/events/*.cpp)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/events/eventmatching/*.cpp)
@ -28,12 +31,25 @@ CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/*.cpp)
# select the OS
ifeq ($(OS_FSFW),rtems)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/rtems/*.cpp)
else ifeq ($(OS_FSFW),linux)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/linux/*.cpp)
else ifeq ($(OS_FSFW),freeRTOS)
CXXSRC += $(wildcard $(FRAMEWORK_PATH)/osal/FreeRTOS/*.cpp)
else ifeq ($(OS_FSFW),host)
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
$(error invalid OS_FSFW specified, valid OS_FSFW are rtems, linux, freeRTOS, host)
endif

View File

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

View File

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

View File

@ -1,7 +1,7 @@
#include "../monitoring/LimitViolationReporter.h"
#include "../monitoring/MonitoringMessageContent.h"
#include "../objectmanager/ObjectManagerIF.h"
#include "Fuse.h"
#include "../power/Fuse.h"
#include "../serialize/SerialFixedArrayListAdapter.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(
NULL), currentLimit(fuseObjectId, 1, ids.pidCurrent, confirmationCount,
maxCurrent, FUSE_CURRENT_HIGH), powerMonitor(fuseObjectId, 2,
DataPool::poolIdAndPositionToPid(ids.poolIdPower, 0),
GlobalDataPool::poolIdAndPositionToPid(ids.poolIdPower, 0),
confirmationCount), set(), voltage(ids.pidVoltage, &set), current(
ids.pidCurrent, &set), state(ids.pidState, &set), power(
ids.poolIdPower, &set, PoolVariableIF::VAR_READ_WRITE), commandQueue(

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,6 +3,9 @@
#include "CoreComponent.h"
/**
* What is it. How to use
*/
class ThermalComponent: public CoreComponent {
public:
struct Parameters {
@ -14,13 +17,34 @@ public:
float hysteresis;
float heaterSwitchoff;
};
/**
* Non-Operational Temperatures
*/
struct NopParameters {
float lowerNopLimit;
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,
uint32_t targetStatePoolId, uint32_t currentStatePoolId, uint32_t requestPoolId,
DataSet *dataSet, AbstractTemperatureSensor *sensor,
GlobDataSet *dataSet, AbstractTemperatureSensor *sensor,
AbstractTemperatureSensor *firstRedundantSensor,
AbstractTemperatureSensor *secondRedundantSensor,
ThermalModuleIF *thermalModule, Parameters parameters,
@ -29,7 +53,7 @@ public:
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,
ParameterWrapper *parameterWrapper,

View File

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

View File

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