basic implementation for passive cooling
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit

This commit is contained in:
Robin Müller 2023-03-13 17:36:41 +01:00
parent 9d1d62aee0
commit 26a9dce0a0
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
7 changed files with 116 additions and 31 deletions

View File

@ -37,6 +37,7 @@ uint32_t AcuDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return
ReturnValue_t AcuDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, ReturnValue_t AcuDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) { LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(ACU::pool::ACU_TEMPERATURES, new PoolEntry<float>(3)); localDataPoolMap.emplace(ACU::pool::ACU_TEMPERATURES,
new PoolEntry<float>({10.0, 10.0, 10.0}, true));
return returnvalue::OK; return returnvalue::OK;
} }

View File

@ -40,7 +40,7 @@ uint32_t SyrlinksDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { r
ReturnValue_t SyrlinksDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, ReturnValue_t SyrlinksDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) { LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(syrlinks::TEMP_BASEBAND_BOARD, new PoolEntry<float>({0})); localDataPoolMap.emplace(syrlinks::TEMP_BASEBAND_BOARD, new PoolEntry<float>({10}, true));
localDataPoolMap.emplace(syrlinks::TEMP_POWER_AMPLIFIER, new PoolEntry<float>({0})); localDataPoolMap.emplace(syrlinks::TEMP_POWER_AMPLIFIER, new PoolEntry<float>({10}, true));
return returnvalue::OK; return returnvalue::OK;
} }

View File

@ -972,7 +972,7 @@ void ThermalController::ctrlAcsBoard() {
numSensors = 4; numSensors = 4;
if (selectAndReadSensorTemp()) { if (selectAndReadSensorTemp()) {
if (chooseHeater(switchNr, redSwitchNr)) { if (chooseHeater(switchNr, redSwitchNr)) {
ctrlHeater(switchNr, redSwitchNr, acsBoardLimits); checkLimitsAndCtrlHeater(switchNr, redSwitchNr, acsBoardLimits);
} }
resetSensorsArray(); resetSensorsArray();
return; return;
@ -990,14 +990,14 @@ void ThermalController::ctrlAcsBoard() {
numSensors = 4; numSensors = 4;
if (selectAndReadSensorTemp()) { if (selectAndReadSensorTemp()) {
if (chooseHeater(switchNr, redSwitchNr)) { if (chooseHeater(switchNr, redSwitchNr)) {
ctrlHeater(switchNr, redSwitchNr, acsBoardLimits); checkLimitsAndCtrlHeater(switchNr, redSwitchNr, acsBoardLimits);
} }
} else { } else {
if (chooseHeater(switchNr, redSwitchNr)) { if (chooseHeater(switchNr, redSwitchNr)) {
if (heaterHandler.checkSwitchState(switchNr)) { if (heaterHandler.checkSwitchState(switchNr)) {
heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF);
sif::info << "ThermalController::ctrlHeater: Heater" << static_cast<int>(thermalComponent) sif::info << "ThermalController::checkLimitsAndCtrlHeater: Heater"
<< " OFF" << std::endl; << static_cast<int>(thermalComponent) << " OFF" << std::endl;
} }
} }
} }
@ -1023,7 +1023,11 @@ void ThermalController::ctrlMgt() {
} }
void ThermalController::ctrlRw() { void ThermalController::ctrlRw() {
// TODO: better solution? Event eventToTrigger = 0;
bool oneIsAboveLimit = false;
std::array<uint32_t, 4> sensorTemps{};
// RW1 // RW1
thermalComponent = RW; thermalComponent = RW;
sensors[0].first = sensorTemperatures.sensor_rw1.isValid(); sensors[0].first = sensorTemperatures.sensor_rw1.isValid();
@ -1036,6 +1040,11 @@ void ThermalController::ctrlRw() {
sensors[3].second = sensorTemperatures.sensor_dro.value; sensors[3].second = sensorTemperatures.sensor_dro.value;
numSensors = 4; numSensors = 4;
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits); ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits);
sensorTemps[0] = tempFloatToU32();
if (componentAboveUpperLimit) {
oneIsAboveLimit = true;
eventToTrigger = overHeatEventToTrigger;
}
// RW2 // RW2
thermalComponent = RW; thermalComponent = RW;
@ -1049,6 +1058,13 @@ void ThermalController::ctrlRw() {
sensors[3].second = sensorTemperatures.sensor_dro.value; sensors[3].second = sensorTemperatures.sensor_dro.value;
numSensors = 4; numSensors = 4;
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits); ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits);
sensorTemps[1] = tempFloatToU32();
if (componentAboveUpperLimit) {
oneIsAboveLimit = true;
if (eventToTrigger != ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH) {
eventToTrigger = overHeatEventToTrigger;
}
}
// RW3 // RW3
thermalComponent = RW; thermalComponent = RW;
@ -1062,6 +1078,13 @@ void ThermalController::ctrlRw() {
sensors[3].second = sensorTemperatures.sensor_dro.value; sensors[3].second = sensorTemperatures.sensor_dro.value;
numSensors = 4; numSensors = 4;
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits); ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits);
sensorTemps[2] = tempFloatToU32();
if (componentAboveUpperLimit) {
oneIsAboveLimit = true;
if (eventToTrigger != ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH) {
eventToTrigger = overHeatEventToTrigger;
}
}
// RW4 // RW4
thermalComponent = RW; thermalComponent = RW;
@ -1075,6 +1098,23 @@ void ThermalController::ctrlRw() {
sensors[3].second = sensorTemperatures.sensor_dro.value; sensors[3].second = sensorTemperatures.sensor_dro.value;
numSensors = 4; numSensors = 4;
ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits); ctrlComponentTemperature(heater::HEATER_6_DRO, heater::HEATER_6_DRO, rwLimits);
sensorTemps[3] = tempFloatToU32();
if (componentAboveUpperLimit) {
oneIsAboveLimit = true;
if (eventToTrigger != ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH) {
eventToTrigger = overHeatEventToTrigger;
}
}
if (oneIsAboveLimit and not rwTooHotFlag) {
EventManagerIF::triggerEvent(objects::RW1, eventToTrigger, sensorTemps[0]);
EventManagerIF::triggerEvent(objects::RW2, eventToTrigger, sensorTemps[1]);
EventManagerIF::triggerEvent(objects::RW3, eventToTrigger, sensorTemps[2]);
EventManagerIF::triggerEvent(objects::RW4, eventToTrigger, sensorTemps[3]);
rwTooHotFlag = true;
} else if (not oneIsAboveLimit) {
rwTooHotFlag = false;
}
} }
void ThermalController::ctrlStr() { void ThermalController::ctrlStr() {
@ -1100,6 +1140,7 @@ void ThermalController::ctrlIfBoard() {
sensors[2].second = deviceTemperatures.mgm2SideB.value; sensors[2].second = deviceTemperatures.mgm2SideB.value;
numSensors = 3; numSensors = 3;
ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_3_PCDU_PDU, ifBoardLimits); ctrlComponentTemperature(heater::HEATER_2_ACS_BRD, heater::HEATER_3_PCDU_PDU, ifBoardLimits);
// TODO: special event overheating + could go back to safe mode
} }
void ThermalController::ctrlTcsBoard() { void ThermalController::ctrlTcsBoard() {
@ -1112,6 +1153,7 @@ void ThermalController::ctrlTcsBoard() {
sensors[2].second = sensorTemperatures.tmp1075Tcs1.value; sensors[2].second = sensorTemperatures.tmp1075Tcs1.value;
numSensors = 3; numSensors = 3;
ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, tcsBoardLimits); ctrlComponentTemperature(heater::HEATER_0_OBC_BRD, heater::HEATER_2_ACS_BRD, tcsBoardLimits);
// TODO: special event overheating + could go back to safe mode
} }
void ThermalController::ctrlObc() { void ThermalController::ctrlObc() {
@ -1205,7 +1247,7 @@ void ThermalController::ctrlPcduAcu() {
sensorTempAvailable = false; sensorTempAvailable = false;
} }
if (sensorTempAvailable) { if (sensorTempAvailable) {
ctrlHeater(switchNr, redSwitchNr, pcduAcuLimits); checkLimitsAndCtrlHeater(switchNr, redSwitchNr, pcduAcuLimits);
} }
} }
if (componentAboveUpperLimit and not pcduSystemTooHotFlag) { if (componentAboveUpperLimit and not pcduSystemTooHotFlag) {
@ -1402,9 +1444,9 @@ void ThermalController::performThermalModuleCtrl() {
ctrlTcsBoard(); ctrlTcsBoard();
ctrlObc(); ctrlObc();
ctrlObcIfBoard(); ctrlObcIfBoard();
// ctrlSBandTransceiver(); ctrlSBandTransceiver();
ctrlPcduP60Board(); ctrlPcduP60Board();
// ctrlPcduAcu(); ctrlPcduAcu();
ctrlPcduPdu(); ctrlPcduPdu();
ctrlPlPcduBoard(); ctrlPlPcduBoard();
ctrlPlocMissionBoard(); ctrlPlocMissionBoard();
@ -1424,15 +1466,16 @@ void ThermalController::ctrlComponentTemperature(heater::Switchers switchNr,
TempLimits& tempLimit) { TempLimits& tempLimit) {
if (selectAndReadSensorTemp()) { if (selectAndReadSensorTemp()) {
if (chooseHeater(switchNr, redSwitchNr)) { if (chooseHeater(switchNr, redSwitchNr)) {
ctrlHeater(switchNr, redSwitchNr, tempLimit); checkLimitsAndCtrlHeater(switchNr, redSwitchNr, tempLimit);
} }
} else { } else {
if (chooseHeater(switchNr, if (chooseHeater(switchNr,
redSwitchNr)) { // TODO: muss der Heater dann wirklich abgeschalten werden? redSwitchNr)) { // TODO: muss der Heater dann wirklich abgeschalten werden?
if (heaterHandler.checkSwitchState(switchNr)) { if (heaterHandler.checkSwitchState(switchNr)) {
heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF);
sif::info << "ThermalController::ctrlHeater: Heater" << static_cast<u_int8_t>(switchNr) sif::info << "ThermalController::checkLimitsAndCtrlHeater: Heater"
<< " OFF" << std::endl; // TODO: printouts löschen << static_cast<int>(thermalComponent) << " OFF"
<< std::endl; // TODO: printouts löschen
} }
} }
} }
@ -1476,17 +1519,19 @@ bool ThermalController::chooseHeater(heater::Switchers& switchNr, heater::Switch
} }
return heaterAvailable; return heaterAvailable;
} }
void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, void ThermalController::checkLimitsAndCtrlHeater(heater::Switchers switchNr,
heater::Switchers redSwitchNr,
struct TempLimits& tempLimit) { struct TempLimits& tempLimit) {
componentAboveCutOffLimit = false; componentAboveCutOffLimit = false;
componentAboveUpperLimit = false; componentAboveUpperLimit = false;
// if Heater off // if Heater off
if (not heaterStates[switchNr].switchTransition) { if (not heaterStates[switchNr].switchTransition) {
if (not heaterHandler.checkSwitchState(switchNr)) { if (not heaterHandler.checkSwitchState(switchNr)) {
// TODO: check NOP limit and maybe trigger fdir
if (sensorTemp < tempLimit.opLowerLimit) { if (sensorTemp < tempLimit.opLowerLimit) {
heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::ON); heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::ON);
sif::info << "ThermalController::ctrlHeater: Heater " << static_cast<int>(thermalComponent) sif::info << "ThermalController::checkLimitsAndCtrlHeater: Heater "
<< " ON" << std::endl; << static_cast<int>(thermalComponent) << " ON" << std::endl;
heaterStates[switchNr].switchTransition = true; heaterStates[switchNr].switchTransition = true;
thermalStates[thermalComponent].heating = true; thermalStates[thermalComponent].heating = true;
} else { } else {
@ -1498,7 +1543,7 @@ void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers
if (thermalStates[thermalComponent].heating) { if (thermalStates[thermalComponent].heating) {
if (sensorTemp >= tempLimit.opLowerLimit + TEMP_OFFSET) { if (sensorTemp >= tempLimit.opLowerLimit + TEMP_OFFSET) {
heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF);
sif::info << "ThermalController::ctrlHeater: Heater " sif::info << "ThermalController::checkLimitsAndCtrlHeater: Heater "
<< static_cast<int>(thermalComponent) << " OFF" << std::endl; << static_cast<int>(thermalComponent) << " OFF" << std::endl;
heaterStates[switchNr].switchTransition = true; heaterStates[switchNr].switchTransition = true;
thermalStates[thermalComponent].heating = false; thermalStates[thermalComponent].heating = false;
@ -1506,8 +1551,8 @@ void ThermalController::ctrlHeater(heater::Switchers switchNr, heater::Switchers
} else { } else {
auto tempTooHighHandler = [&](const char* whatLimit) { auto tempTooHighHandler = [&](const char* whatLimit) {
heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF); heaterHandler.switchHeater(switchNr, HeaterHandler::SwitchState::OFF);
sif::info << "ThermalController::ctrlHeater: Reached " << whatLimit << ": Heater " sif::info << "ThermalController::checkLimitsAndCtrlHeater: Reached " << whatLimit
<< static_cast<int>(thermalComponent) << " OFF" << std::endl; << ": Heater " << static_cast<int>(thermalComponent) << " OFF" << std::endl;
heaterStates[switchNr].switchTransition = true; heaterStates[switchNr].switchTransition = true;
if (heaterHandler.checkSwitchState(redSwitchNr)) { if (heaterHandler.checkSwitchState(redSwitchNr)) {
heaterHandler.switchHeater(redSwitchNr, HeaterHandler::SwitchState::OFF); heaterHandler.switchHeater(redSwitchNr, HeaterHandler::SwitchState::OFF);
@ -1550,7 +1595,7 @@ void ThermalController::heaterTransitionControl() {
} }
} }
} }
uint32_t ThermalController::tempFloatToU32() { uint32_t ThermalController::tempFloatToU32() const {
auto sensorTempAsFloat = static_cast<float>(sensorTemp); auto sensorTempAsFloat = static_cast<float>(sensorTemp);
uint32_t tempRaw = 0; uint32_t tempRaw = 0;
size_t dummyLen = 0; size_t dummyLen = 0;

View File

@ -164,6 +164,8 @@ class ThermalController : public ExtendedControllerBase {
TempLimits tcsBoardLimits = TempLimits(-60.0, -40.0, 80.0, 85.0, 130.0); TempLimits tcsBoardLimits = TempLimits(-60.0, -40.0, 80.0, 85.0, 130.0);
TempLimits obcLimits = TempLimits(-40.0, -40.0, 80.0, 85.0, 85.0); TempLimits obcLimits = TempLimits(-40.0, -40.0, 80.0, 85.0, 85.0);
TempLimits obcIfBoardLimits = TempLimits(-65.0, -40.0, 80.0, 85.0, 125.0); TempLimits obcIfBoardLimits = TempLimits(-65.0, -40.0, 80.0, 85.0, 125.0);
// Limits to test commading to RX Only
// TempLimits sBandTransceiverLimits = TempLimits(-40.0, -25.0, 0.0, 0.0, 5.0);
TempLimits sBandTransceiverLimits = TempLimits(-40.0, -25.0, 35.0, 40.0, 65.0); TempLimits sBandTransceiverLimits = TempLimits(-40.0, -25.0, 35.0, 40.0, 65.0);
TempLimits pcduP60BoardLimits = TempLimits(-35.0, -35.0, 80.0, 85.0, 85.0); TempLimits pcduP60BoardLimits = TempLimits(-35.0, -35.0, 80.0, 85.0, 85.0);
TempLimits pcduAcuLimits = TempLimits(-35.0, -35.0, 80.0, 85.0, 85.0); TempLimits pcduAcuLimits = TempLimits(-35.0, -35.0, 80.0, 85.0, 85.0);
@ -195,6 +197,7 @@ class ThermalController : public ExtendedControllerBase {
bool syrlinksTooHotFlag = false; bool syrlinksTooHotFlag = false;
bool obcTooHotFlag = false; bool obcTooHotFlag = false;
bool strTooHotFlag = false; bool strTooHotFlag = false;
bool rwTooHotFlag = false;
std::array<ThermalState, 30> thermalStates{}; std::array<ThermalState, 30> thermalStates{};
std::array<HeaterState, 7> heaterStates{}; std::array<HeaterState, 7> heaterStates{};
@ -225,7 +228,8 @@ class ThermalController : public ExtendedControllerBase {
void ctrlComponentTemperature(heater::Switchers switchNr, heater::Switchers redSwitchNr, void ctrlComponentTemperature(heater::Switchers switchNr, heater::Switchers redSwitchNr,
TempLimits& tempLimit); TempLimits& tempLimit);
void ctrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr, TempLimits& tempLimit); void checkLimitsAndCtrlHeater(heater::Switchers switchNr, heater::Switchers redSwitchNr,
TempLimits& tempLimit);
bool chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr); bool chooseHeater(heater::Switchers& switchNr, heater::Switchers redSwitchNr);
bool selectAndReadSensorTemp(); bool selectAndReadSensorTemp();
@ -253,7 +257,7 @@ class ThermalController : public ExtendedControllerBase {
void ctrlMpa(); void ctrlMpa();
void ctrlScexBoard(); void ctrlScexBoard();
void heaterTransitionControl(); void heaterTransitionControl();
uint32_t tempFloatToU32(); uint32_t tempFloatToU32() const;
void tooHotHandler(object_id_t object, bool& oneShotFlag); void tooHotHandler(object_id_t object, bool& oneShotFlag);
}; };

View File

@ -13,7 +13,6 @@ static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::TCS_CONTROLLER;
static constexpr Event NO_VALID_SENSOR_TEMPERATURE = MAKE_EVENT(0, severity::MEDIUM); static constexpr Event NO_VALID_SENSOR_TEMPERATURE = MAKE_EVENT(0, severity::MEDIUM);
static constexpr Event NO_HEALTHY_HEATER_AVAILABLE = MAKE_EVENT(1, severity::MEDIUM); static constexpr Event NO_HEALTHY_HEATER_AVAILABLE = MAKE_EVENT(1, severity::MEDIUM);
static constexpr Event SYRLINKS_OVERHEATING = MAKE_EVENT(2, severity::HIGH); static constexpr Event SYRLINKS_OVERHEATING = MAKE_EVENT(2, severity::HIGH);
static constexpr Event PLOC_OVERHEATING = MAKE_EVENT(3, severity::HIGH);
static constexpr Event OBC_OVERHEATING = MAKE_EVENT(4, severity::HIGH); static constexpr Event OBC_OVERHEATING = MAKE_EVENT(4, severity::HIGH);
static constexpr Event CAMERA_OVERHEATING = MAKE_EVENT(5, severity::HIGH); static constexpr Event CAMERA_OVERHEATING = MAKE_EVENT(5, severity::HIGH);
static constexpr Event PCDU_SYSTEM_OVERHEATING = MAKE_EVENT(6, severity::HIGH); static constexpr Event PCDU_SYSTEM_OVERHEATING = MAKE_EVENT(6, severity::HIGH);

View File

@ -4,11 +4,13 @@
#include <fsfw/events/EventManager.h> #include <fsfw/events/EventManager.h>
#include <fsfw/ipc/QueueFactory.h> #include <fsfw/ipc/QueueFactory.h>
#include <mission/acsDefs.h> #include <mission/acsDefs.h>
#include <mission/comDefs.h>
#include <mission/controller/controllerdefinitions/tcsCtrlDefs.h>
EiveSystem::EiveSystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, EiveSystem::EiveSystem(object_id_t setObjectId, uint32_t maxNumberOfSequences,
uint32_t maxNumberOfTables) uint32_t maxNumberOfTables)
: Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) { : Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {
auto mqArgs = MqArgs(getObjectId(), static_cast<void*>(this)); auto mqArgs = MqArgs(SubsystemBase::getObjectId(), static_cast<void*>(this));
eventQueue = eventQueue =
QueueFactory::instance()->createMessageQueue(10, EventMessage::EVENT_MESSAGE_SIZE, &mqArgs); QueueFactory::instance()->createMessageQueue(10, EventMessage::EVENT_MESSAGE_SIZE, &mqArgs);
} }
@ -67,16 +69,37 @@ ReturnValue_t EiveSystem::initialize() {
#endif #endif
return ObjectManagerIF::CHILD_INIT_FAILED; return ObjectManagerIF::CHILD_INIT_FAILED;
} }
// TODO: manager->subscribeToEvent(eventQueue->getId(), ) manager->subscribeToEvent(eventQueue->getId(), event::getEventId(tcsCtrl::SYRLINKS_OVERHEATING));
manager->subscribeToEvent(eventQueue->getId(),
event::getEventId(tcsCtrl::PCDU_SYSTEM_OVERHEATING));
manager->subscribeToEvent(eventQueue->getId(), event::getEventId(tcsCtrl::OBC_OVERHEATING));
return Subsystem::initialize(); return Subsystem::initialize();
} }
void EiveSystem::handleEventMessages() { void EiveSystem::handleEventMessages() {
EventMessage event; EventMessage event;
for (ReturnValue_t result = eventQueue->receiveMessage(&event); result == returnvalue::OK; for (ReturnValue_t status = eventQueue->receiveMessage(&event); status == returnvalue::OK;
result = eventQueue->receiveMessage(&event)) { status = eventQueue->receiveMessage(&event)) {
switch (event.getMessageId()) { switch (event.getMessageId()) {
case EventMessage::EVENT_MESSAGE: case EventMessage::EVENT_MESSAGE:
switch (event.getEvent()) {
case tcsCtrl::SYRLINKS_OVERHEATING: {
CommandMessage msg;
ModeMessage::setCmdModeMessage(msg, com::RX_ONLY, 0);
ReturnValue_t result =
commandQueue->sendMessage(childrenMap[objects::COM_SUBSYSTEM].commandQueue, &msg);
if (result != returnvalue::OK) {
sif::error << "EiveSystem: Commanding COM to RX_ONLY failed" << std::endl;
}
break;
}
case tcsCtrl::OBC_OVERHEATING:
case tcsCtrl::PCDU_SYSTEM_OVERHEATING: {
commandSelfToSafe();
break;
}
}
break; break;
default: default:
sif::debug << "AcsSubsystem::performChildOperation: Did not subscribe " sif::debug << "AcsSubsystem::performChildOperation: Did not subscribe "
@ -86,3 +109,14 @@ void EiveSystem::handleEventMessages() {
} }
} }
} }
void EiveSystem::commandSelfToSafe() {
if (fallbackCommandCd.hasTimedOut()) {
CommandMessage msg;
ModeMessage::setCmdModeMessage(msg, acs::AcsMode::SAFE, 0);
ReturnValue_t result = commandQueue->sendMessage(commandQueue->getId(), &msg);
if (result != returnvalue::OK) {
sif::error << "EiveSystem: Commanding EIVE-System to SAFE failed" << std::endl;
}
fallbackCommandCd.resetTimer();
}
}

View File

@ -8,12 +8,14 @@ class EiveSystem : public Subsystem {
EiveSystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables); EiveSystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables);
private: private:
MessageQueueIF* eventQueue = nullptr;
Countdown fallbackCommandCd = Countdown(30000);
ReturnValue_t initialize() override; ReturnValue_t initialize() override;
void performChildOperation() override; void performChildOperation() override;
void announceMode(bool recursive) override; void announceMode(bool recursive) override;
void handleEventMessages(); void handleEventMessages();
void commandSelfToSafe();
MessageQueueIF* eventQueue = nullptr;
}; };
#endif /* MISSION_SYSTEM_EIVESYSTEM_H_ */ #endif /* MISSION_SYSTEM_EIVESYSTEM_H_ */