limit for error events thermalcontroller + dummy beta
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
This commit is contained in:
parent
9b849d10e9
commit
e13636167f
@ -186,7 +186,8 @@ void scheduling::initTasks() {
|
||||
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
||||
|
||||
PeriodicTaskIF* dummyTask = factory->createPeriodicTask(
|
||||
"DUMMY_TASK", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc);
|
||||
"DUMMY_TASK", 35, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc);
|
||||
dummyTask->addComponent(objects::THERMAL_TEMP_INSERTER);
|
||||
scheduling::scheduleTmpTempSensors(dummyTask);
|
||||
scheduling::scheduleRtdSensors(dummyTask);
|
||||
dummyTask->addComponent(objects::SUS_0_N_LOC_XFYFZM_PT_XF);
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "Max31865Dummy.h"
|
||||
|
||||
#include "fsfw/datapool/PoolReadGuard.h"
|
||||
|
||||
using namespace returnvalue;
|
||||
|
||||
Max31865Dummy::Max31865Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
|
||||
@ -35,8 +37,12 @@ ReturnValue_t Max31865Dummy::initializeLocalDataPool(localpool::DataPool &localD
|
||||
return OK;
|
||||
}
|
||||
|
||||
void Max31865Dummy::setTemperature(float temperature) {
|
||||
set.temperatureCelcius.value = temperature;
|
||||
void Max31865Dummy::setTemperature(float temperature, bool valid) {
|
||||
PoolReadGuard pg(&set);
|
||||
if(pg.getReadResult() == returnvalue::OK) {
|
||||
set.temperatureCelcius.value = temperature;
|
||||
set.setValidity(valid, true);
|
||||
}
|
||||
}
|
||||
|
||||
LocalPoolDataSetBase *Max31865Dummy::getDataSetHandle(sid_t sid) { return &set; }
|
||||
|
@ -9,7 +9,7 @@ class Max31865Dummy : public DeviceHandlerBase {
|
||||
Max31865Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie);
|
||||
Max31865Dummy(object_id_t objectId, CookieIF *comCookie);
|
||||
|
||||
void setTemperature(float temperature);
|
||||
void setTemperature(float temperature, bool setValid);
|
||||
|
||||
private:
|
||||
MAX31865::PrimarySet set;
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
|
||||
|
||||
#include "fsfw/datapool/PoolReadGuard.h"
|
||||
|
||||
P60DockDummy::P60DockDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie)
|
||||
: DeviceHandlerBase(objectId, comif, comCookie) {}
|
||||
|
||||
@ -40,7 +42,7 @@ uint32_t P60DockDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { re
|
||||
|
||||
ReturnValue_t P60DockDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
||||
LocalDataPoolManager &poolManager) {
|
||||
localDataPoolMap.emplace(P60Dock::pool::P60DOCK_TEMPERATURE_1, new PoolEntry<float>({0}));
|
||||
localDataPoolMap.emplace(P60Dock::pool::P60DOCK_TEMPERATURE_2, new PoolEntry<float>({0}));
|
||||
localDataPoolMap.emplace(P60Dock::pool::P60DOCK_TEMPERATURE_1, new PoolEntry<float>({10}, true));
|
||||
localDataPoolMap.emplace(P60Dock::pool::P60DOCK_TEMPERATURE_2, new PoolEntry<float>({10}, true));
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define DUMMIES_P60DOCKDUMMY_H_
|
||||
|
||||
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||
#include "mission/devices/devicedefinitions/GomspaceDefinitions.h"
|
||||
|
||||
class P60DockDummy : public DeviceHandlerBase {
|
||||
public:
|
||||
@ -15,6 +16,8 @@ class P60DockDummy : public DeviceHandlerBase {
|
||||
virtual ~P60DockDummy();
|
||||
|
||||
protected:
|
||||
lp_var_t<float> temp1 = lp_var_t<float>(this, P60Dock::pool::P60DOCK_TEMPERATURE_1);
|
||||
lp_var_t<float> temp2 = lp_var_t<float>(this, P60Dock::pool::P60DOCK_TEMPERATURE_2);
|
||||
void doStartUp() override;
|
||||
void doShutDown() override;
|
||||
ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override;
|
||||
|
@ -9,12 +9,14 @@
|
||||
TemperatureSensorInserter::TemperatureSensorInserter(object_id_t objectId,
|
||||
Max31865DummyMap tempSensorDummies_,
|
||||
Tmp1075DummyMap tempTmpSensorDummies_)
|
||||
: SystemObject(objects::THERMAL_TEMP_INSERTER),
|
||||
: SystemObject(objectId),
|
||||
max31865DummyMap(std::move(tempSensorDummies_)),
|
||||
tmp1075DummyMap(std::move(tempTmpSensorDummies_)) {}
|
||||
|
||||
ReturnValue_t TemperatureSensorInserter::initialize() {
|
||||
|
||||
if (performTest) {
|
||||
|
||||
if (testCase == TestCase::COOL_SYRLINKS) {
|
||||
}
|
||||
}
|
||||
@ -22,6 +24,17 @@ ReturnValue_t TemperatureSensorInserter::initialize() {
|
||||
}
|
||||
|
||||
ReturnValue_t TemperatureSensorInserter::performOperation(uint8_t opCode) {
|
||||
if(not tempsWereInitialized) {
|
||||
for(auto& rtdDummy: max31865DummyMap) {
|
||||
rtdDummy.second->setTemperature(10, true);
|
||||
}
|
||||
for(auto& tmpDummy: tmp1075DummyMap) {
|
||||
tmpDummy.second->setTemperature(10, true);
|
||||
}
|
||||
tempsWereInitialized = true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
ReturnValue_t result = max31865PlocHeatspreaderSet.read();
|
||||
if (result != returnvalue::OK) {
|
||||
@ -38,3 +51,7 @@ ReturnValue_t TemperatureSensorInserter::performOperation(uint8_t opCode) {
|
||||
*/
|
||||
return returnvalue::OK;
|
||||
}
|
||||
ReturnValue_t TemperatureSensorInserter::initializeAfterTaskCreation() {
|
||||
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject
|
||||
Tmp1075DummyMap tempTmpSensorDummies_);
|
||||
|
||||
ReturnValue_t initialize() override;
|
||||
ReturnValue_t initializeAfterTaskCreation() override;
|
||||
|
||||
protected:
|
||||
ReturnValue_t performOperation(uint8_t opCode) override;
|
||||
@ -23,6 +24,7 @@ class TemperatureSensorInserter : public ExecutableObjectIF, public SystemObject
|
||||
Tmp1075DummyMap tmp1075DummyMap;
|
||||
enum TestCase { NONE = 0, COOL_SYRLINKS = 1 };
|
||||
int iteration = 0;
|
||||
bool tempsWereInitialized = false;
|
||||
bool performTest = false;
|
||||
TestCase testCase = TestCase::NONE;
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "Tmp1075Dummy.h"
|
||||
|
||||
#include "fsfw/datapool/PoolReadGuard.h"
|
||||
#include "mission/devices/devicedefinitions/Tmp1075Definitions.h"
|
||||
|
||||
using namespace returnvalue;
|
||||
@ -24,6 +25,11 @@ ReturnValue_t Tmp1075Dummy::scanForReply(const uint8_t *start, size_t len,
|
||||
ReturnValue_t Tmp1075Dummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) {
|
||||
return 0;
|
||||
}
|
||||
void Tmp1075Dummy::setTemperature(float temperature, bool valid) {
|
||||
PoolReadGuard pg(&set);
|
||||
set.temperatureCelcius.value = temperature;
|
||||
set.setValidity(valid, true);
|
||||
}
|
||||
void Tmp1075Dummy::fillCommandAndReplyMap() {}
|
||||
uint32_t Tmp1075Dummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 1000; }
|
||||
ReturnValue_t Tmp1075Dummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
||||
|
@ -7,6 +7,7 @@
|
||||
class Tmp1075Dummy : public DeviceHandlerBase {
|
||||
public:
|
||||
Tmp1075Dummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie);
|
||||
void setTemperature(float temperature, bool setValid);
|
||||
|
||||
private:
|
||||
TMP1075::Tmp1075Dataset set;
|
||||
|
@ -150,6 +150,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) {
|
||||
objects::TMP1075_HANDLER_IF_BOARD,
|
||||
new Tmp1075Dummy(objects::TMP1075_HANDLER_IF_BOARD, objects::DUMMY_COM_IF, comCookieDummy));
|
||||
|
||||
|
||||
new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER, tempSensorDummies,
|
||||
tempTmpSensorDummies);
|
||||
}
|
||||
|
@ -91,22 +91,23 @@ void ThermalController::performControlOperation() {
|
||||
break;
|
||||
}
|
||||
|
||||
ReturnValue_t result = sensorTemperatures.read();
|
||||
if (result == returnvalue::OK) {
|
||||
copySensors();
|
||||
sensorTemperatures.commit();
|
||||
{
|
||||
PoolReadGuard pg(&sensorTemperatures);
|
||||
if (pg.getReadResult() == returnvalue::OK) {
|
||||
copySensors();
|
||||
}
|
||||
}
|
||||
|
||||
result = susTemperatures.read();
|
||||
if (result == returnvalue::OK) {
|
||||
copySus();
|
||||
susTemperatures.commit();
|
||||
{
|
||||
PoolReadGuard pg(&susTemperatures);
|
||||
if (pg.getReadResult() == returnvalue::OK) {
|
||||
copySus();
|
||||
}
|
||||
}
|
||||
|
||||
result = deviceTemperatures.read();
|
||||
if (result == returnvalue::OK) {
|
||||
copyDevices();
|
||||
deviceTemperatures.commit();
|
||||
{
|
||||
PoolReadGuard pg(&deviceTemperatures);
|
||||
if (pg.getReadResult() == returnvalue::OK) {
|
||||
copyDevices();
|
||||
}
|
||||
}
|
||||
|
||||
performThermalModuleCtrl();
|
||||
@ -1178,7 +1179,8 @@ void ThermalController::ctrlPcduAcu() {
|
||||
if (chooseHeater(switchNr, redSwitchNr)) {
|
||||
bool sensorTempAvailable = true;
|
||||
|
||||
if (deviceTemperatures.acu.value[0] != INVALID_TEMPERATURE) { //TODO: war invalid aber Wert 0 stat 999
|
||||
if (deviceTemperatures.acu.value[0] !=
|
||||
INVALID_TEMPERATURE) { // TODO: war invalid aber Wert 0 stat 999
|
||||
sensorTemp = deviceTemperatures.acu.value[0];
|
||||
} else if (deviceTemperatures.acu.value[1] != INVALID_TEMPERATURE) {
|
||||
sensorTemp = deviceTemperatures.acu.value[1];
|
||||
@ -1426,10 +1428,22 @@ bool ThermalController::selectAndReadSensorTemp() {
|
||||
for (unsigned i = 0; i < numSensors; i++) {
|
||||
if (sensors[i].first and sensors[i].second != INVALID_TEMPERATURE) {
|
||||
sensorTemp = sensors[i].second;
|
||||
errorCounters[thermalComponent] = 0;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
triggerEvent(NO_VALID_SENSOR_TEMPERATURE, thermalComponent);
|
||||
|
||||
errorCounters[thermalComponent] ++;
|
||||
if(thermalComponent != rw and thermalComponent != acsBoard){
|
||||
if (errorCounters[thermalComponent] <= 3){
|
||||
triggerEvent(NO_VALID_SENSOR_TEMPERATURE, thermalComponent);
|
||||
}
|
||||
}else{
|
||||
if (errorCounters[thermalComponent] <= 8){
|
||||
triggerEvent(NO_VALID_SENSOR_TEMPERATURE, thermalComponent);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1458,5 +1472,5 @@ void ThermalController::resetSensorsArray() {
|
||||
validValuePair.first = false;
|
||||
validValuePair.second = INVALID_TEMPERATURE;
|
||||
}
|
||||
thermalComponent = none;
|
||||
thermalComponent = NONE;
|
||||
}
|
||||
|
@ -34,31 +34,33 @@ struct TempLimits {
|
||||
float nopUpperLimit;
|
||||
};
|
||||
|
||||
enum ThermalComponents {
|
||||
none,
|
||||
acsBoard,
|
||||
mgt,
|
||||
rw,
|
||||
str,
|
||||
ifBoard,
|
||||
tcsBoard,
|
||||
obc,
|
||||
obcIfBoard,
|
||||
sBandTransceiver,
|
||||
pcduP60Board,
|
||||
pcduAcu,
|
||||
pcduPdu,
|
||||
plPcduBoard,
|
||||
plocMissionBoard,
|
||||
plocProcessingBoard,
|
||||
dac,
|
||||
camera,
|
||||
dro,
|
||||
x8,
|
||||
hpa,
|
||||
tx,
|
||||
mpa,
|
||||
scexBoard
|
||||
enum ThermalComponents: uint8_t {
|
||||
//TODO: Großbuchstaben
|
||||
NONE = 0,
|
||||
acsBoard = 1,
|
||||
mgt = 2,
|
||||
rw = 3,
|
||||
str = 4,
|
||||
ifBoard = 5,
|
||||
tcsBoard = 6,
|
||||
obc = 7,
|
||||
obcIfBoard = 8,
|
||||
sBandTransceiver = 9,
|
||||
pcduP60Board = 10,
|
||||
pcduAcu = 11,
|
||||
pcduPdu = 12,
|
||||
plPcduBoard = 13,
|
||||
plocMissionBoard = 14,
|
||||
plocProcessingBoard = 15,
|
||||
dac = 16,
|
||||
camera = 17,
|
||||
dro = 18,
|
||||
x8 = 19,
|
||||
hpa = 20,
|
||||
tx = 21,
|
||||
mpa = 22,
|
||||
scexBoard = 23,
|
||||
NUM_ENTRIES
|
||||
};
|
||||
|
||||
class ThermalController : public ExtendedControllerBase {
|
||||
@ -173,9 +175,10 @@ class ThermalController : public ExtendedControllerBase {
|
||||
TempLimits scexBoardLimits = TempLimits(-60.0, -40.0, 80.0, 85.0, 150.0);
|
||||
|
||||
double sensorTemp = INVALID_TEMPERATURE;
|
||||
ThermalComponents thermalComponent = none;
|
||||
ThermalComponents thermalComponent = NONE;
|
||||
bool redSwitchNrInUse = false;
|
||||
bool componentAboveCutOffLimit = false;
|
||||
uint8_t errorCounters[32];
|
||||
|
||||
// Initial delay to make sure all pool variables have been initialized their owners
|
||||
Countdown initialCountdown = Countdown(DELAY);
|
||||
|
Loading…
x
Reference in New Issue
Block a user