updated all other modules using pool
This commit is contained in:
parent
3bee42811c
commit
b4173f4e05
|
@ -1,17 +1,16 @@
|
|||
#include "../datapoolglob/GlobalDataSet.h"
|
||||
#include "InternalErrorReporter.h"
|
||||
|
||||
#include <framework/datapoolglob/GlobalDataSet.h>
|
||||
#include <framework/datapoolglob/GlobalPoolVariable.h>
|
||||
#include <framework/ipc/MutexFactory.h>
|
||||
#include "../datapoolglob/GlobalPoolVariable.h"
|
||||
#include "../ipc/MutexFactory.h"
|
||||
|
||||
#include <framework/serviceinterface/ServiceInterfaceStream.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();
|
||||
}
|
||||
|
||||
|
@ -54,7 +53,7 @@ void InternalErrorReporter::lostTm() {
|
|||
|
||||
uint32_t InternalErrorReporter::getAndResetQueueHits() {
|
||||
uint32_t value;
|
||||
mutex->lockMutex(MutexIF::NO_TIMEOUT);
|
||||
mutex->lockMutex(MutexIF::BLOCKING);
|
||||
value = queueHits;
|
||||
queueHits = 0;
|
||||
mutex->unlockMutex();
|
||||
|
@ -63,21 +62,21 @@ uint32_t InternalErrorReporter::getAndResetQueueHits() {
|
|||
|
||||
uint32_t InternalErrorReporter::getQueueHits() {
|
||||
uint32_t value;
|
||||
mutex->lockMutex(MutexIF::NO_TIMEOUT);
|
||||
mutex->lockMutex(MutexIF::BLOCKING);
|
||||
value = queueHits;
|
||||
mutex->unlockMutex();
|
||||
return value;
|
||||
}
|
||||
|
||||
void InternalErrorReporter::incrementQueueHits() {
|
||||
mutex->lockMutex(MutexIF::NO_TIMEOUT);
|
||||
mutex->lockMutex(MutexIF::BLOCKING);
|
||||
queueHits++;
|
||||
mutex->unlockMutex();
|
||||
}
|
||||
|
||||
uint32_t InternalErrorReporter::getAndResetTmHits() {
|
||||
uint32_t value;
|
||||
mutex->lockMutex(MutexIF::NO_TIMEOUT);
|
||||
mutex->lockMutex(MutexIF::BLOCKING);
|
||||
value = tmHits;
|
||||
tmHits = 0;
|
||||
mutex->unlockMutex();
|
||||
|
@ -86,14 +85,14 @@ uint32_t InternalErrorReporter::getAndResetTmHits() {
|
|||
|
||||
uint32_t InternalErrorReporter::getTmHits() {
|
||||
uint32_t value;
|
||||
mutex->lockMutex(MutexIF::NO_TIMEOUT);
|
||||
mutex->lockMutex(MutexIF::BLOCKING);
|
||||
value = tmHits;
|
||||
mutex->unlockMutex();
|
||||
return value;
|
||||
}
|
||||
|
||||
void InternalErrorReporter::incrementTmHits() {
|
||||
mutex->lockMutex(MutexIF::NO_TIMEOUT);
|
||||
mutex->lockMutex(MutexIF::BLOCKING);
|
||||
tmHits++;
|
||||
mutex->unlockMutex();
|
||||
}
|
||||
|
@ -104,7 +103,7 @@ void InternalErrorReporter::storeFull() {
|
|||
|
||||
uint32_t InternalErrorReporter::getAndResetStoreHits() {
|
||||
uint32_t value;
|
||||
mutex->lockMutex(MutexIF::NO_TIMEOUT);
|
||||
mutex->lockMutex(MutexIF::BLOCKING);
|
||||
value = storeHits;
|
||||
storeHits = 0;
|
||||
mutex->unlockMutex();
|
||||
|
@ -113,14 +112,14 @@ uint32_t InternalErrorReporter::getAndResetStoreHits() {
|
|||
|
||||
uint32_t InternalErrorReporter::getStoreHits() {
|
||||
uint32_t value;
|
||||
mutex->lockMutex(MutexIF::NO_TIMEOUT);
|
||||
mutex->lockMutex(MutexIF::BLOCKING);
|
||||
value = storeHits;
|
||||
mutex->unlockMutex();
|
||||
return value;
|
||||
}
|
||||
|
||||
void InternalErrorReporter::incrementStoreHits() {
|
||||
mutex->lockMutex(MutexIF::NO_TIMEOUT);
|
||||
mutex->lockMutex(MutexIF::BLOCKING);
|
||||
storeHits++;
|
||||
mutex->unlockMutex();
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#ifndef MONITORBASE_H_
|
||||
#define MONITORBASE_H_
|
||||
|
||||
#include <framework/datapoolglob/GlobalDataSet.h>
|
||||
#include <framework/datapoolglob/PIDReader.h>
|
||||
#include <framework/monitoring/LimitViolationReporter.h>
|
||||
#include <framework/monitoring/MonitoringIF.h>
|
||||
#include <framework/monitoring/MonitoringMessageContent.h>
|
||||
#include <framework/monitoring/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.
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#include <framework/monitoring/LimitViolationReporter.h>
|
||||
#include <framework/monitoring/MonitoringMessageContent.h>
|
||||
#include <framework/objectmanager/ObjectManagerIF.h>
|
||||
#include <framework/power/Fuse.h>
|
||||
#include <framework/serialize/SerialFixedArrayListAdapter.h>
|
||||
#include <framework/ipc/QueueFactory.h>
|
||||
#include "../monitoring/LimitViolationReporter.h"
|
||||
#include "../monitoring/MonitoringMessageContent.h"
|
||||
#include "../objectmanager/ObjectManagerIF.h"
|
||||
#include "../power/Fuse.h"
|
||||
#include "../serialize/SerialFixedArrayListAdapter.h"
|
||||
#include "../ipc/QueueFactory.h"
|
||||
|
||||
object_id_t Fuse::powerSwitchId = 0;
|
||||
|
||||
|
@ -109,7 +109,7 @@ size_t Fuse::getSerializedSize() const {
|
|||
}
|
||||
|
||||
ReturnValue_t Fuse::deSerialize(const uint8_t** buffer, size_t* size,
|
||||
Endianness streamEndianness) {
|
||||
Endianness streamEndianness) {
|
||||
ReturnValue_t result = RETURN_FAILED;
|
||||
for (DeviceList::iterator iter = devices.begin(); iter != devices.end();
|
||||
iter++) {
|
||||
|
|
20
power/Fuse.h
20
power/Fuse.h
|
@ -1,15 +1,15 @@
|
|||
#ifndef FUSE_H_
|
||||
#define FUSE_H_
|
||||
|
||||
#include <framework/datapoolglob/GlobalDataSet.h>
|
||||
#include <framework/datapoolglob/GlobalPoolVariable.h>
|
||||
#include <framework/datapoolglob/PIDReader.h>
|
||||
#include <framework/devicehandlers/HealthDevice.h>
|
||||
#include <framework/monitoring/AbsLimitMonitor.h>
|
||||
#include <framework/power/PowerComponentIF.h>
|
||||
#include <framework/power/PowerSwitchIF.h>
|
||||
#include <framework/returnvalues/HasReturnvaluesIF.h>
|
||||
#include <framework/parameters/ParameterHelper.h>
|
||||
#include "../datapoolglob/GlobalDataSet.h"
|
||||
#include "../datapoolglob/GlobalPoolVariable.h"
|
||||
#include "../datapoolglob/PIDReader.h"
|
||||
#include "../devicehandlers/HealthDevice.h"
|
||||
#include "../monitoring/AbsLimitMonitor.h"
|
||||
#include "../power/PowerComponentIF.h"
|
||||
#include "../power/PowerSwitchIF.h"
|
||||
#include "../returnvalues/HasReturnvaluesIF.h"
|
||||
#include "../parameters/ParameterHelper.h"
|
||||
#include <list>
|
||||
|
||||
namespace Factory {
|
||||
|
@ -90,7 +90,7 @@ private:
|
|||
PIDReader<float> current;
|
||||
PIDReader<uint8_t> state;
|
||||
gp_float_t power;
|
||||
MessageQueueIF *commandQueue;
|
||||
MessageQueueIF* commandQueue;
|
||||
ParameterHelper parameterHelper;
|
||||
HealthHelper healthHelper;
|
||||
static object_id_t powerSwitchId;
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
#ifndef POWERSENSOR_H_
|
||||
#define POWERSENSOR_H_
|
||||
|
||||
#include <framework/datapoolglob/GlobalDataSet.h>
|
||||
#include <framework/datapoolglob/PIDReader.h>
|
||||
#include <framework/datapoolglob/GlobalPoolVariable.h>
|
||||
#include <framework/devicehandlers/HealthDevice.h>
|
||||
#include <framework/monitoring/LimitMonitor.h>
|
||||
#include <framework/parameters/ParameterHelper.h>
|
||||
#include <framework/objectmanager/SystemObject.h>
|
||||
#include <framework/ipc/MessageQueueIF.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"
|
||||
#include "../objectmanager/SystemObject.h"
|
||||
#include "../ipc/MessageQueueIF.h"
|
||||
|
||||
class PowerController;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ CoreComponent::CoreComponent(object_id_t reportingObjectId, uint8_t domainId,
|
|||
}
|
||||
//Set thermal state once, then leave to operator.
|
||||
GlobDataSet mySet;
|
||||
gp_int8_t writableTargetState(targetStatePoolId, &mySet,
|
||||
gp_uint8_t writableTargetState(targetStatePoolId, &mySet,
|
||||
PoolVariableIF::VAR_WRITE);
|
||||
writableTargetState = initialTargetState;
|
||||
mySet.commit(PoolVariableIF::VALID);
|
||||
|
@ -71,7 +71,7 @@ float CoreComponent::getLowerOpLimit() {
|
|||
|
||||
ReturnValue_t CoreComponent::setTargetState(int8_t newState) {
|
||||
GlobDataSet mySet;
|
||||
gp_int8_t writableTargetState(targetState.getDataPoolId(),
|
||||
gp_uint8_t writableTargetState(targetState.getDataPoolId(),
|
||||
&mySet, PoolVariableIF::VAR_READ_WRITE);
|
||||
mySet.read();
|
||||
if ((writableTargetState == STATE_REQUEST_OPERATIONAL)
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
#ifndef MISSION_CONTROLLERS_TCS_CORECOMPONENT_H_
|
||||
#define MISSION_CONTROLLERS_TCS_CORECOMPONENT_H_
|
||||
|
||||
#include <framework/datapoolglob/GlobalDataSet.h>
|
||||
#include <framework/datapoolglob/GlobalPoolVariable.h>
|
||||
#include <framework/thermal/ThermalComponentIF.h>
|
||||
#include <framework/thermal/AbstractTemperatureSensor.h>
|
||||
#include <framework/thermal/ThermalModule.h>
|
||||
#include <framework/thermal/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 {
|
||||
|
|
|
@ -12,12 +12,10 @@ 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() {
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
|
||||
#include "CoreComponent.h"
|
||||
|
||||
/**
|
||||
* What is it. How to use
|
||||
*/
|
||||
class ThermalComponent: public CoreComponent {
|
||||
public:
|
||||
struct Parameters {
|
||||
|
@ -14,10 +17,31 @@ 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,
|
||||
GlobDataSet *dataSet, AbstractTemperatureSensor *sensor,
|
||||
|
@ -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,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <framework/monitoring/LimitViolationReporter.h>
|
||||
#include <framework/monitoring/MonitoringMessageContent.h>
|
||||
#include "../monitoring/LimitViolationReporter.h"
|
||||
#include "../monitoring/MonitoringMessageContent.h"
|
||||
#include "ThermalModule.h"
|
||||
|
||||
#include "AbstractTemperatureSensor.h"
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
#ifndef THERMALMODULE_H_
|
||||
#define THERMALMODULE_H_
|
||||
|
||||
#include <framework/datapoolglob/GlobalDataSet.h>
|
||||
#include <framework/datapoolglob/GlobalPoolVariable.h>
|
||||
#include <framework/devicehandlers/HealthDevice.h>
|
||||
#include <framework/events/EventReportingProxyIF.h>
|
||||
#include "../datapoolglob/GlobalDataSet.h"
|
||||
#include "../datapoolglob/GlobalPoolVariable.h"
|
||||
#include "../devicehandlers/HealthDevice.h"
|
||||
#include "../events/EventReportingProxyIF.h"
|
||||
#include "ThermalModuleIF.h"
|
||||
#include <list>
|
||||
#include "tcsDefinitions.h"
|
||||
#include "RedundantHeater.h"
|
||||
class PowerSwitchIF;
|
||||
|
||||
/**
|
||||
* @brief Allows creation of different thermal control domains within a system.
|
||||
*/
|
||||
class ThermalModule: public ThermalModuleIF {
|
||||
friend class ThermalController;
|
||||
public:
|
||||
|
|
Loading…
Reference in New Issue
Block a user