From 24b939c50b3ddeae101e585e28323e9b1c1185ae Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 1 Mar 2023 18:06:36 +0100 Subject: [PATCH 01/14] add syrlinks assembly --- bsp_q7s/core/CoreController.cpp | 2 +- bsp_q7s/core/ObjectFactory.cpp | 5 +++- bsp_q7s/core/scheduling.cpp | 4 +++ bsp_q7s/memory/LocalParameterHandler.h | 4 +-- common/config/eive/objects.h | 1 + common/config/eive/resultClassIds.h | 4 +-- linux/fsfwconfig/returnvalues/classIds.h | 4 +-- linux/ipcore/PdecHandler.cpp | 22 +++++++------- linux/ipcore/PdecHandler.h | 3 +- mission/system/objects/CMakeLists.txt | 1 + mission/system/objects/ComSubsystem.cpp | 3 +- mission/system/objects/ComSubsystem.h | 18 ++++++------ .../system/objects/DualLaneAssemblyBase.cpp | 5 ++++ mission/system/objects/DualLaneAssemblyBase.h | 1 + mission/system/objects/SyrlinksAssembly.cpp | 29 +++++++++++++++++++ mission/system/objects/SyrlinksAssembly.h | 17 +++++++++++ mission/system/tree/comModeTree.cpp | 16 +++++----- 17 files changed, 100 insertions(+), 39 deletions(-) create mode 100644 mission/system/objects/SyrlinksAssembly.cpp create mode 100644 mission/system/objects/SyrlinksAssembly.h diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 8977bab7..01757f28 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -1224,7 +1224,7 @@ ReturnValue_t CoreController::handleProtInfoUpdateLine(std::string nextLine) { } } wordIdx++; - if(wordIdx >= 10) { + if (wordIdx >= 10) { break; } } diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index c8eb4cc9..e4d16781 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include "OBSWConfig.h" #include "bsp_q7s/boardtest/Q7STestTask.h" @@ -579,12 +580,14 @@ void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) { syrlinks::MAX_REPLY_SIZE, UartModes::NON_CANONICAL); syrlinksUartCookie->setParityEven(); + auto* syrlinksAssy = new SyrlinksAssembly(objects::SYRLINKS_ASSY); + syrlinksAssy->connectModeTreeParent(satsystem::com::SUBSYSTEM); auto syrlinksFdir = new SyrlinksFdir(objects::SYRLINKS_HANDLER); auto syrlinksHandler = new SyrlinksHandler(objects::SYRLINKS_HANDLER, objects::UART_COM_IF, syrlinksUartCookie, pcdu::PDU1_CH1_SYRLINKS_12V, syrlinksFdir); syrlinksHandler->setPowerSwitcher(pwrSwitcher); - syrlinksHandler->connectModeTreeParent(satsystem::com::SUBSYSTEM); + syrlinksHandler->connectModeTreeParent(*syrlinksAssy); #if OBSW_DEBUG_SYRLINKS == 1 syrlinksHandler->setDebugMode(true); #endif diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index 7bb2ceec..753fa69c 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -150,6 +150,10 @@ void scheduling::initTasks() { if (result != returnvalue::OK) { scheduling::printAddObjectError("COM_SUBSYSTEM", objects::COM_SUBSYSTEM); } + result = genericSysTask->addComponent(objects::SYRLINKS_ASSY); + if (result != returnvalue::OK) { + scheduling::printAddObjectError("SYRLINKS_ASSY", objects::SYRLINKS_ASSY); + } result = genericSysTask->addComponent(objects::PL_SUBSYSTEM); if (result != returnvalue::OK) { scheduling::printAddObjectError("PL_SUBSYSTEM", objects::PL_SUBSYSTEM); diff --git a/bsp_q7s/memory/LocalParameterHandler.h b/bsp_q7s/memory/LocalParameterHandler.h index a8b96950..61b2f723 100644 --- a/bsp_q7s/memory/LocalParameterHandler.h +++ b/bsp_q7s/memory/LocalParameterHandler.h @@ -19,8 +19,8 @@ class LocalParameterHandler : public NVMParameterBase { * @brief Constructor * * @param sdRelativeName Absolute name of json file relative to mount - * directory of SD card. - * E.g. conf/example.json + * directory of + * SD card. E.g. conf/example.json * @param sdcMan Pointer to SD card manager */ LocalParameterHandler(std::string sdRelativeName, SdCardMountedIF* sdcMan); diff --git a/common/config/eive/objects.h b/common/config/eive/objects.h index c7c7cce9..b129c339 100644 --- a/common/config/eive/objects.h +++ b/common/config/eive/objects.h @@ -143,6 +143,7 @@ enum commonObjects : uint32_t { TCS_BOARD_ASS = 0x73000003, RW_ASS = 0x73000004, CAM_SWITCHER = 0x73000006, + SYRLINKS_ASSY = 0x73000007, EIVE_SYSTEM = 0x73010000, ACS_SUBSYSTEM = 0x73010001, PL_SUBSYSTEM = 0x73010002, diff --git a/common/config/eive/resultClassIds.h b/common/config/eive/resultClassIds.h index f7bf26c1..df47d935 100644 --- a/common/config/eive/resultClassIds.h +++ b/common/config/eive/resultClassIds.h @@ -40,8 +40,8 @@ enum commonClassIds : uint8_t { ACS_SAFE, // ACSSAF ACS_PTG, // ACSPTG ACS_DETUMBLE, // ACSDTB - SD_CARD_MANAGER, // SDMA - LOCAL_PARAM_HANDLER, // LPH + SD_CARD_MANAGER, // SDMA + LOCAL_PARAM_HANDLER, // LPH COMMON_CLASS_ID_END // [EXPORT] : [END] }; } diff --git a/linux/fsfwconfig/returnvalues/classIds.h b/linux/fsfwconfig/returnvalues/classIds.h index 0a71a8b6..f4db7ffa 100644 --- a/linux/fsfwconfig/returnvalues/classIds.h +++ b/linux/fsfwconfig/returnvalues/classIds.h @@ -13,8 +13,8 @@ namespace CLASS_ID { enum { CLASS_ID_START = COMMON_CLASS_ID_END, - SCRATCH_BUFFER, // SCBU - CLASS_ID_END // [EXPORT] : [END] + SCRATCH_BUFFER, // SCBU + CLASS_ID_END // [EXPORT] : [END] }; } diff --git a/linux/ipcore/PdecHandler.cpp b/linux/ipcore/PdecHandler.cpp index 80327c94..d5e5c0c8 100644 --- a/linux/ipcore/PdecHandler.cpp +++ b/linux/ipcore/PdecHandler.cpp @@ -164,8 +164,8 @@ ReturnValue_t PdecHandler::polledOperation() { // See https://yurovsky.github.io/2014/10/10/linux-uio-gpio-interrupt.html for more information. ReturnValue_t PdecHandler::irqOperation() { - ReturnValue_t result = returnvalue::OK; - int fd = -1; + ReturnValue_t result = returnvalue::OK; + int fd = -1; // Used to unmask IRQ uint32_t info = 1; @@ -183,7 +183,7 @@ ReturnValue_t PdecHandler::irqOperation() { case State::INIT: { result = handleInitState(); if (result == returnvalue::OK) { - openIrqFile(&fd); + openIrqFile(&fd); } break; } @@ -196,7 +196,7 @@ ReturnValue_t PdecHandler::irqOperation() { break; } case State::RUNNING: { - checkLocks(); + checkLocks(); checkAndHandleIrqs(fd, info); break; } @@ -238,13 +238,13 @@ ReturnValue_t PdecHandler::handleInitState() { } void PdecHandler::openIrqFile(int* fd) { - *fd = open(uioNames.irq, O_RDWR); - if (*fd < 0) { - sif::error << "PdecHandler::irqOperation: Opening UIO IRQ file" << uioNames.irq << " failed" - << std::endl; - triggerEvent(OPEN_IRQ_FILE_FAILED); - state = State::WAIT_FOR_RECOVERY; - } + *fd = open(uioNames.irq, O_RDWR); + if (*fd < 0) { + sif::error << "PdecHandler::irqOperation: Opening UIO IRQ file" << uioNames.irq << " failed" + << std::endl; + triggerEvent(OPEN_IRQ_FILE_FAILED); + state = State::WAIT_FOR_RECOVERY; + } } ReturnValue_t PdecHandler::checkAndHandleIrqs(int fd, uint32_t& info) { diff --git a/linux/ipcore/PdecHandler.h b/linux/ipcore/PdecHandler.h index e98e939c..2f0bcca2 100644 --- a/linux/ipcore/PdecHandler.h +++ b/linux/ipcore/PdecHandler.h @@ -105,8 +105,7 @@ class PdecHandler : public SystemObject, //! [EXPORT] : [COMMENT] Failed to pull PDEC reset to low static constexpr Event PDEC_RESET_FAILED = event::makeEvent(SUBSYSTEM_ID, 10, severity::HIGH); //! [EXPORT] : [COMMENT] Failed to open the IRQ uio file - static constexpr Event OPEN_IRQ_FILE_FAILED = - event::makeEvent(SUBSYSTEM_ID, 11, severity::HIGH); + static constexpr Event OPEN_IRQ_FILE_FAILED = event::makeEvent(SUBSYSTEM_ID, 11, severity::HIGH); private: static const uint8_t INTERFACE_ID = CLASS_ID::PDEC_HANDLER; diff --git a/mission/system/objects/CMakeLists.txt b/mission/system/objects/CMakeLists.txt index 0290a311..1b669047 100644 --- a/mission/system/objects/CMakeLists.txt +++ b/mission/system/objects/CMakeLists.txt @@ -7,6 +7,7 @@ target_sources( TcsSubsystem.cpp PayloadSubsystem.cpp AcsBoardAssembly.cpp + SyrlinksAssembly.cpp Stack5VHandler.cpp SusAssembly.cpp RwAssembly.cpp diff --git a/mission/system/objects/ComSubsystem.cpp b/mission/system/objects/ComSubsystem.cpp index 9df7e72b..b9ed0a05 100644 --- a/mission/system/objects/ComSubsystem.cpp +++ b/mission/system/objects/ComSubsystem.cpp @@ -30,6 +30,7 @@ void ComSubsystem::performChildOperation() { if (countdownActive) { checkTransmitterCountdown(); } + Subsystem::performChildOperation(); } @@ -184,7 +185,7 @@ void ComSubsystem::startRxAndTxLowRateSeq() { void ComSubsystem::checkTransmitterCountdown() { if (transmitterCountdown.hasTimedOut()) { - triggerEvent(TX_TIMER_EXPIRED, transmitterTimeout); + triggerEvent(TX_TIMER_EXPIRED, transmitterTimeout); startTransition(com::Submode::RX_ONLY, SUBMODE_NONE); countdownActive = false; } diff --git a/mission/system/objects/ComSubsystem.h b/mission/system/objects/ComSubsystem.h index 831b4cec..854a877b 100644 --- a/mission/system/objects/ComSubsystem.h +++ b/mission/system/objects/ComSubsystem.h @@ -1,24 +1,23 @@ #ifndef MISSION_SYSTEM_COMSUBSYSTEM_H_ #define MISSION_SYSTEM_COMSUBSYSTEM_H_ +#include #include #include #include #include -#include #include "mission/comDefs.h" class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF { public: + static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::COM_SUBSYSTEM; - static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::COM_SUBSYSTEM; - - //! [EXPORT] : [COMMENT] The transmit timer to protect the Syrlinks expired - //! P1: The current timer value - static const Event TX_TIMER_EXPIRED = MAKE_EVENT(1, severity::INFO); - //! [EXPORT] : [COMMENT] Transmitter will be turned on due to detection of bitlock - static const Event BIT_LOCK_TX_ON = MAKE_EVENT(2, severity::INFO); + //! [EXPORT] : [COMMENT] The transmit timer to protect the Syrlinks expired + //! P1: The current timer value + static const Event TX_TIMER_EXPIRED = MAKE_EVENT(1, severity::INFO); + //! [EXPORT] : [COMMENT] Transmitter will be turned on due to detection of bitlock + static const Event BIT_LOCK_TX_ON = MAKE_EVENT(2, severity::INFO); /** * @brief Constructor @@ -27,7 +26,8 @@ class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF { * @param maxNumberOfSequences * @param maxNumberOfTables * @param transmitterTimeout Maximum time the transmitter of the syrlinks - * will be enabled + * will + * be enabled */ ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables, uint32_t transmitterTimeout); diff --git a/mission/system/objects/DualLaneAssemblyBase.cpp b/mission/system/objects/DualLaneAssemblyBase.cpp index a55553a0..94f35cf0 100644 --- a/mission/system/objects/DualLaneAssemblyBase.cpp +++ b/mission/system/objects/DualLaneAssemblyBase.cpp @@ -235,3 +235,8 @@ void DualLaneAssemblyBase::setPreferredSide(duallane::Submodes submode) { } this->defaultSubmode = submode; } + +ReturnValue_t DualLaneAssemblyBase::checkAndHandleHealthState(Mode_t deviceMode, + Submode_t deviceSubmode) { + return returnvalue::OK; +} diff --git a/mission/system/objects/DualLaneAssemblyBase.h b/mission/system/objects/DualLaneAssemblyBase.h index eadfb77f..4aaf9060 100644 --- a/mission/system/objects/DualLaneAssemblyBase.h +++ b/mission/system/objects/DualLaneAssemblyBase.h @@ -74,6 +74,7 @@ class DualLaneAssemblyBase : public AssemblyBase, public ConfirmsFailuresIF { MessageQueueId_t getEventReceptionQueue() override; bool sideSwitchTransition(Mode_t mode, Submode_t submode); + ReturnValue_t checkAndHandleHealthState(Mode_t deviceMode, Submode_t deviceSubmode); /** * Implemented by user. Will be called if a full mode operation has finished. diff --git a/mission/system/objects/SyrlinksAssembly.cpp b/mission/system/objects/SyrlinksAssembly.cpp new file mode 100644 index 00000000..b25fcbc4 --- /dev/null +++ b/mission/system/objects/SyrlinksAssembly.cpp @@ -0,0 +1,29 @@ +#include "SyrlinksAssembly.h" + +#include + +using namespace returnvalue; + +SyrlinksAssembly::SyrlinksAssembly(object_id_t objectId) : AssemblyBase(objectId) {} + +ReturnValue_t SyrlinksAssembly::commandChildren(Mode_t mode, Submode_t submode) { + commandTable[0].setMode(mode); + commandTable[0].setSubmode(submode); + HybridIterator iter(commandTable.begin(), commandTable.end()); + executeTable(iter); + return returnvalue::OK; +} + +ReturnValue_t SyrlinksAssembly::checkChildrenStateOn(Mode_t wantedMode, Submode_t wantedSubmode) { + if (childrenMap[objects::SYRLINKS_HANDLER].mode != wantedMode) { + return NOT_ENOUGH_CHILDREN_IN_CORRECT_STATE; + } + return returnvalue::OK; +} + +ReturnValue_t SyrlinksAssembly::isModeCombinationValid(Mode_t mode, Submode_t submode) { + if (mode == MODE_ON or mode == DeviceHandlerIF::MODE_NORMAL or mode == MODE_OFF) { + return returnvalue::OK; + } + return returnvalue::FAILED; +} diff --git a/mission/system/objects/SyrlinksAssembly.h b/mission/system/objects/SyrlinksAssembly.h new file mode 100644 index 00000000..a44a3502 --- /dev/null +++ b/mission/system/objects/SyrlinksAssembly.h @@ -0,0 +1,17 @@ +#ifndef MISSION_SYSTEM_OBJECTS_SYRLINKSASSEMBLY_H_ +#define MISSION_SYSTEM_OBJECTS_SYRLINKSASSEMBLY_H_ +#include + +class SyrlinksAssembly : public AssemblyBase { + public: + SyrlinksAssembly(object_id_t objectId); + + private: + FixedArrayList commandTable; + + ReturnValue_t commandChildren(Mode_t mode, Submode_t submode) override; + ReturnValue_t checkChildrenStateOn(Mode_t wantedMode, Submode_t wantedSubmode) override; + ReturnValue_t isModeCombinationValid(Mode_t mode, Submode_t submode) override; +}; + +#endif /* MISSION_SYSTEM_OBJECTS_SYRLINKSASSEMBLY_H_ */ diff --git a/mission/system/tree/comModeTree.cpp b/mission/system/tree/comModeTree.cpp index 9dc85a78..dd3aa7a1 100644 --- a/mission/system/tree/comModeTree.cpp +++ b/mission/system/tree/comModeTree.cpp @@ -105,11 +105,11 @@ void buildRxOnlySequence(Subsystem& ss, ModeListEntry& eh) { // Build RX Only table. We could track the state of the CCSDS IP core handler // as well but I do not think this is necessary because enabling that should // not interfere with the Syrlinks Handler. - iht(objects::SYRLINKS_HANDLER, NML, ::com::Submode::RX_ONLY, COM_TABLE_RX_ONLY_TGT.second); + iht(objects::SYRLINKS_ASSY, NML, ::com::Submode::RX_ONLY, COM_TABLE_RX_ONLY_TGT.second); check(ss.addTable(TableEntry(COM_TABLE_RX_ONLY_TGT.first, &COM_TABLE_RX_ONLY_TGT.second)), ctxc); // Build RX Only transition 0 - iht(objects::SYRLINKS_HANDLER, NML, ::com::Submode::RX_ONLY, COM_TABLE_RX_ONLY_TRANS_0.second); + iht(objects::SYRLINKS_ASSY, NML, ::com::Submode::RX_ONLY, COM_TABLE_RX_ONLY_TRANS_0.second); check(ss.addTable(TableEntry(COM_TABLE_RX_ONLY_TRANS_0.first, &COM_TABLE_RX_ONLY_TRANS_0.second)), ctxc); @@ -147,7 +147,7 @@ void buildTxAndRxLowRateSequence(Subsystem& ss, ModeListEntry& eh) { }; // Build RX and TX low datarate table. - iht(objects::SYRLINKS_HANDLER, NML, ::com::Submode::RX_AND_TX_LOW_DATARATE, + iht(objects::SYRLINKS_ASSY, NML, ::com::Submode::RX_AND_TX_LOW_DATARATE, COM_TABLE_RX_AND_TX_LOW_RATE_TGT.second); iht(objects::CCSDS_HANDLER, ON, static_cast(::com::CcsdsSubmode::DATARATE_LOW), COM_TABLE_RX_AND_TX_LOW_RATE_TGT.second); @@ -163,7 +163,7 @@ void buildTxAndRxLowRateSequence(Subsystem& ss, ModeListEntry& eh) { ctxc); // Build TX and RX low transition 1 - iht(objects::SYRLINKS_HANDLER, NML, ::com::Submode::RX_AND_TX_LOW_DATARATE, + iht(objects::SYRLINKS_ASSY, NML, ::com::Submode::RX_AND_TX_LOW_DATARATE, COM_TABLE_RX_AND_TX_LOW_RATE_TRANS_1.second); check(ss.addTable(TableEntry(COM_TABLE_RX_AND_TX_LOW_RATE_TRANS_1.first, &COM_TABLE_RX_AND_TX_LOW_RATE_TRANS_1.second)), @@ -199,7 +199,7 @@ void buildTxAndRxHighRateSequence(Subsystem& ss, ModeListEntry& eh) { }; // Build RX and TX high datarate table. - iht(objects::SYRLINKS_HANDLER, NML, ::com::Submode::RX_AND_TX_HIGH_DATARATE, + iht(objects::SYRLINKS_ASSY, NML, ::com::Submode::RX_AND_TX_HIGH_DATARATE, COM_TABLE_RX_AND_TX_HIGH_RATE_TGT.second); iht(objects::CCSDS_HANDLER, ON, static_cast(::com::CcsdsSubmode::DATARATE_HIGH), COM_TABLE_RX_AND_TX_HIGH_RATE_TGT.second); @@ -215,7 +215,7 @@ void buildTxAndRxHighRateSequence(Subsystem& ss, ModeListEntry& eh) { ctxc); // Build TX and RX high transition 1 - iht(objects::SYRLINKS_HANDLER, NML, ::com::Submode::RX_AND_TX_HIGH_DATARATE, + iht(objects::SYRLINKS_ASSY, NML, ::com::Submode::RX_AND_TX_HIGH_DATARATE, COM_TABLE_RX_AND_TX_HIGH_RATE_TRANS_1.second); check(ss.addTable(TableEntry(COM_TABLE_RX_AND_TX_HIGH_RATE_TRANS_1.first, &COM_TABLE_RX_AND_TX_HIGH_RATE_TRANS_1.second)), @@ -253,7 +253,7 @@ void buildTxAndRxDefaultRateSequence(Subsystem& ss, ModeListEntry& eh) { }; // Build RX and TX default datarate table. - iht(objects::SYRLINKS_HANDLER, NML, ::com::Submode::RX_AND_TX_DEFAULT_DATARATE, + iht(objects::SYRLINKS_ASSY, NML, ::com::Submode::RX_AND_TX_DEFAULT_DATARATE, COM_TABLE_RX_AND_TX_DEFAULT_RATE_TGT.second); iht(objects::CCSDS_HANDLER, ON, static_cast(::com::CcsdsSubmode::DATARATE_DEFAULT), COM_TABLE_RX_AND_TX_DEFAULT_RATE_TGT.second); @@ -269,7 +269,7 @@ void buildTxAndRxDefaultRateSequence(Subsystem& ss, ModeListEntry& eh) { ctxc); // Build TX and RX default transition 1 - iht(objects::SYRLINKS_HANDLER, NML, ::com::Submode::RX_AND_TX_DEFAULT_DATARATE, + iht(objects::SYRLINKS_ASSY, NML, ::com::Submode::RX_AND_TX_DEFAULT_DATARATE, COM_TABLE_RX_AND_TX_DEFAULT_RATE_TRANS_1.second); check(ss.addTable(TableEntry(COM_TABLE_RX_AND_TX_DEFAULT_RATE_TRANS_1.first, &COM_TABLE_RX_AND_TX_DEFAULT_RATE_TRANS_1.second)), From 90175e5c9d21857b51391f072524c4b7c1e39ee1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Mar 2023 11:27:19 +0100 Subject: [PATCH 02/14] add health handling --- bsp_q7s/memory/LocalParameterHandler.h | 3 ++- mission/devices/SusHandler.h | 1 + mission/system/objects/SyrlinksAssembly.cpp | 18 ++++++++++++++++++ mission/system/objects/SyrlinksAssembly.h | 2 ++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/bsp_q7s/memory/LocalParameterHandler.h b/bsp_q7s/memory/LocalParameterHandler.h index 82c5df31..ed0bb2bd 100644 --- a/bsp_q7s/memory/LocalParameterHandler.h +++ b/bsp_q7s/memory/LocalParameterHandler.h @@ -19,7 +19,8 @@ class LocalParameterHandler : public NVMParameterBase { * @brief Constructor * * @param sdRelativeName Absolute name of json file relative to mount - * directory of SD card. E.g. conf/example.json + * directory of SD card. + * E.g. conf/example.json * @param sdcMan Pointer to SD card manager */ LocalParameterHandler(std::string sdRelativeName, SdCardMountedIF* sdcMan); diff --git a/mission/devices/SusHandler.h b/mission/devices/SusHandler.h index 9f4b35ba..6eb781db 100644 --- a/mission/devices/SusHandler.h +++ b/mission/devices/SusHandler.h @@ -3,6 +3,7 @@ #include #include + #include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "fsfw/globalfunctions/PeriodicOperationDivider.h" #include "mission/devices/devicedefinitions/acsPolling.h" diff --git a/mission/system/objects/SyrlinksAssembly.cpp b/mission/system/objects/SyrlinksAssembly.cpp index b25fcbc4..209097d9 100644 --- a/mission/system/objects/SyrlinksAssembly.cpp +++ b/mission/system/objects/SyrlinksAssembly.cpp @@ -10,6 +10,12 @@ ReturnValue_t SyrlinksAssembly::commandChildren(Mode_t mode, Submode_t submode) commandTable[0].setMode(mode); commandTable[0].setSubmode(submode); HybridIterator iter(commandTable.begin(), commandTable.end()); + if (recoveryState == RECOVERY_IDLE) { + ReturnValue_t result = checkAndHandleHealthState(mode, submode); + if (result == NEED_TO_CHANGE_HEALTH) { + return OK; + } + } executeTable(iter); return returnvalue::OK; } @@ -27,3 +33,15 @@ ReturnValue_t SyrlinksAssembly::isModeCombinationValid(Mode_t mode, Submode_t su } return returnvalue::FAILED; } + +ReturnValue_t SyrlinksAssembly::checkAndHandleHealthState(Mode_t deviceMode, + Submode_t deviceSubmode) { + HealthState health = healthHelper.healthTable->getHealth(objects::SYRLINKS_HANDLER); + if (health == FAULTY or health == PERMANENT_FAULTY) { + overwriteDeviceHealth(objects::SYRLINKS_HANDLER, health); + return NEED_TO_CHANGE_HEALTH; + } else if (health == EXTERNAL_CONTROL) { + modeHelper.setForced(true); + } + return OK; +} diff --git a/mission/system/objects/SyrlinksAssembly.h b/mission/system/objects/SyrlinksAssembly.h index a44a3502..6d7744ad 100644 --- a/mission/system/objects/SyrlinksAssembly.h +++ b/mission/system/objects/SyrlinksAssembly.h @@ -12,6 +12,8 @@ class SyrlinksAssembly : public AssemblyBase { ReturnValue_t commandChildren(Mode_t mode, Submode_t submode) override; ReturnValue_t checkChildrenStateOn(Mode_t wantedMode, Submode_t wantedSubmode) override; ReturnValue_t isModeCombinationValid(Mode_t mode, Submode_t submode) override; + + ReturnValue_t checkAndHandleHealthState(Mode_t deviceMode, Submode_t deviceSubmode); }; #endif /* MISSION_SYSTEM_OBJECTS_SYRLINKSASSEMBLY_H_ */ From 5f17b1f6e84356cc16a351ab063a67311590ca35 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Mar 2023 11:36:35 +0100 Subject: [PATCH 03/14] allow recovery for syrlinks --- mission/system/fdir/SyrlinksFdir.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mission/system/fdir/SyrlinksFdir.cpp b/mission/system/fdir/SyrlinksFdir.cpp index 524a94f6..7f7ee42d 100644 --- a/mission/system/fdir/SyrlinksFdir.cpp +++ b/mission/system/fdir/SyrlinksFdir.cpp @@ -47,8 +47,8 @@ ReturnValue_t SyrlinksFdir::eventReceived(EventMessage* event) { } // else if (missedReplyCount.incrementAndCheck()) { - // handleRecovery(event->getEvent()); - triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); + handleRecovery(event->getEvent()); + //triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); } break; case StorageManagerIF::GET_DATA_FAILED: @@ -80,7 +80,7 @@ ReturnValue_t SyrlinksFdir::eventReceived(EventMessage* event) { break; case Fuse::POWER_BELOW_LOW_LIMIT: // Device might got stuck during boot, retry. - // handleRecovery(event->getEvent()); + handleRecovery(event->getEvent()); triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); break; //****Thermal***** From 0fc17624f383c1463f23d5959e49a0e11f035fbc Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Mar 2023 14:59:27 +0100 Subject: [PATCH 04/14] sus brd assy health handling --- bsp_q7s/core/CoreController.cpp | 2 +- common/config/eive/definitions.h | 2 +- mission/core/pollingSeqTables.cpp | 224 ++++++++++++++++--------- mission/devices/ImtqHandler.cpp | 2 +- mission/devices/SusHandler.h | 1 + mission/system/objects/SusAssembly.cpp | 26 +++ mission/system/objects/SusAssembly.h | 1 + mission/system/tree/system.cpp | 10 +- 8 files changed, 182 insertions(+), 86 deletions(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 8977bab7..01757f28 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -1224,7 +1224,7 @@ ReturnValue_t CoreController::handleProtInfoUpdateLine(std::string nextLine) { } } wordIdx++; - if(wordIdx >= 10) { + if (wordIdx >= 10) { break; } } diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 3990ac26..99ce4437 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -83,7 +83,7 @@ static constexpr float SCHED_BLOCK_7_PERIOD = static_cast(SCHED_BLOCK_7_R static constexpr float SCHED_BLOCK_8_PERIOD = static_cast(SCHED_BLOCK_8_PLPCDU_MS) / 400.0; static constexpr float SCHED_BLOCK_9_PERIOD = static_cast(SCHED_BLOCK_9_RAD_SENS_MS) / 400.0; -} // namespace acs +} // namespace spiSched } // namespace config diff --git a/mission/core/pollingSeqTables.cpp b/mission/core/pollingSeqTables.cpp index 780b0e7f..88b5b95a 100644 --- a/mission/core/pollingSeqTables.cpp +++ b/mission/core/pollingSeqTables.cpp @@ -251,53 +251,77 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg DeviceHandlerIF::GET_WRITE); thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); } if (cfg.scheduleStr) { @@ -313,15 +337,20 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg if (cfg.scheduleAcsBoard) { if (enableAside) { // A side - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::spiSched::SCHED_BLOCK_3_PERIOD, + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::spiSched::SCHED_BLOCK_3_PERIOD, + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, @@ -331,23 +360,31 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, - length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); + length * config::spiSched::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_WRITE); thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, - length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_3_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, - length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_3_PERIOD, + DeviceHandlerIF::GET_READ); } if (enableBside) { // B side - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::spiSched::SCHED_BLOCK_3_PERIOD, + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::spiSched::SCHED_BLOCK_3_PERIOD, + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, @@ -357,11 +394,14 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, - length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); + length * config::spiSched::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_WRITE); thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, - length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_3_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, - length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_3_PERIOD, + DeviceHandlerIF::GET_READ); } if (enableAside) { thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, @@ -371,21 +411,29 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, - length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, - length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, - length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::spiSched::SCHED_BLOCK_3_PERIOD, + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::spiSched::SCHED_BLOCK_3_PERIOD, + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::GET_READ); } if (enableBside) { @@ -396,21 +444,29 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, - length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, - length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, - length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::spiSched::SCHED_BLOCK_3_PERIOD, + thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::spiSched::SCHED_BLOCK_3_PERIOD, + thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::GET_READ); } } @@ -429,7 +485,8 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg imtq::ComStep::READ_MEASURE_GET); } - thisSequence->addSlot(objects::ACS_CONTROLLER, length * config::spiSched::SCHED_BLOCK_4_PERIOD, 0); + thisSequence->addSlot(objects::ACS_CONTROLLER, length * config::spiSched::SCHED_BLOCK_4_PERIOD, + 0); if (cfg.scheduleImtq) { // This is the torquing cycle. @@ -491,23 +548,34 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg DeviceHandlerIF::GET_READ); } - thisSequence->addSlot(objects::SPI_RTD_COM_IF, length * config::spiSched::SCHED_BLOCK_RTD_PERIOD, 0); + thisSequence->addSlot(objects::SPI_RTD_COM_IF, length * config::spiSched::SCHED_BLOCK_RTD_PERIOD, + 0); #if OBSW_ADD_PL_PCDU == 1 - thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, + DeviceHandlerIF::GET_READ); #endif #if OBSW_ADD_RAD_SENSORS == 1 /* Radiation sensor */ - thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, + DeviceHandlerIF::GET_READ); #endif return returnvalue::OK; } diff --git a/mission/devices/ImtqHandler.cpp b/mission/devices/ImtqHandler.cpp index 5c5bdb61..0072dd08 100644 --- a/mission/devices/ImtqHandler.cpp +++ b/mission/devices/ImtqHandler.cpp @@ -849,7 +849,7 @@ void ImtqHandler::fillCalibratedMtmDataset(const uint8_t* packet) { void ImtqHandler::fillRawMtmDataset(imtq::RawMtmMeasurementSet& set, const uint8_t* packet) { PoolReadGuard rg(&set); - if(rg.getReadResult() != returnvalue::OK) { + if (rg.getReadResult() != returnvalue::OK) { sif::error << "ImtqHandler::fillRawMtmDataset: Lock failure" << std::endl; } unsigned int offset = 2; diff --git a/mission/devices/SusHandler.h b/mission/devices/SusHandler.h index 9f4b35ba..6eb781db 100644 --- a/mission/devices/SusHandler.h +++ b/mission/devices/SusHandler.h @@ -3,6 +3,7 @@ #include #include + #include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "fsfw/globalfunctions/PeriodicOperationDivider.h" #include "mission/devices/devicedefinitions/acsPolling.h" diff --git a/mission/system/objects/SusAssembly.cpp b/mission/system/objects/SusAssembly.cpp index 62a47616..9008e7e0 100644 --- a/mission/system/objects/SusAssembly.cpp +++ b/mission/system/objects/SusAssembly.cpp @@ -24,6 +24,12 @@ ReturnValue_t SusAssembly::commandChildren(Mode_t mode, Submode_t submode) { modeTable[idx].setMode(MODE_OFF); modeTable[idx].setSubmode(SUBMODE_NONE); } + if (recoveryState == RecoveryState::RECOVERY_IDLE) { + result = checkAndHandleHealthStates(mode, submode); + if (result == NEED_TO_CHANGE_HEALTH) { + return returnvalue::OK; + } + } if (recoveryState != RecoveryState::RECOVERY_STARTED) { if (mode == DeviceHandlerIF::MODE_NORMAL or mode == MODE_ON) { result = handleNormalOrOnModeCmd(mode, submode); @@ -148,3 +154,23 @@ void SusAssembly::refreshHelperModes() { helper.susModes[idx] = childrenMap[helper.susIds[idx]].mode; } } + +ReturnValue_t SusAssembly::checkAndHandleHealthStates(Mode_t deviceMode, Submode_t deviceSubmode) { + using namespace returnvalue; + ReturnValue_t status = returnvalue::OK; + auto overwriteHealthForOneDev = [&](object_id_t dev) { + HealthState health = healthHelper.healthTable->getHealth(dev); + if (health == FAULTY or health == PERMANENT_FAULTY) { + overwriteDeviceHealth(dev, health); + status = NEED_TO_CHANGE_HEALTH; + } else if (health == EXTERNAL_CONTROL) { + modeHelper.setForced(true); + } + }; + if (deviceSubmode == duallane::DUAL_MODE) { + for (uint8_t idx = 0; idx < 12; idx++) { + overwriteHealthForOneDev(helper.susIds[idx]); + } + } + return status; +} diff --git a/mission/system/objects/SusAssembly.h b/mission/system/objects/SusAssembly.h index e95803df..e993bee4 100644 --- a/mission/system/objects/SusAssembly.h +++ b/mission/system/objects/SusAssembly.h @@ -66,6 +66,7 @@ class SusAssembly : public DualLaneAssemblyBase { void powerStateMachine(Mode_t mode, Submode_t submode); ReturnValue_t handleNormalOrOnModeCmd(Mode_t mode, Submode_t submode); void refreshHelperModes(); + ReturnValue_t checkAndHandleHealthStates(Mode_t deviceMode, Submode_t deviceSubmode); }; #endif /* MISSION_SYSTEM_SUSASSEMBLY_H_ */ diff --git a/mission/system/tree/system.cpp b/mission/system/tree/system.cpp index 710698a1..195b6905 100644 --- a/mission/system/tree/system.cpp +++ b/mission/system/tree/system.cpp @@ -93,13 +93,13 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { ctxc); // Build SAFE transition 1 - //check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TRANS_1.first, &EIVE_TABLE_SAFE_TRANS_1.second)), + // check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TRANS_1.first, &EIVE_TABLE_SAFE_TRANS_1.second)), // ctxc); // Build Safe sequence ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TGT.first, 0, false); ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_0.first, 0, false); - //ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_1.first, 0, false); + // ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_1.first, 0, false); check(ss.addSequence(SequenceEntry(EIVE_SEQUENCE_SAFE.first, &EIVE_SEQUENCE_SAFE.second, EIVE_SEQUENCE_SAFE.first)), ctxc); @@ -135,13 +135,13 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { ctxc); // Build SAFE transition 1 - //check(ss.addTable(TableEntry(EIVE_TABLE_IDLE_TRANS_1.first, &EIVE_TABLE_IDLE_TRANS_1.second)), - // ctxc); + // check(ss.addTable(TableEntry(EIVE_TABLE_IDLE_TRANS_1.first, &EIVE_TABLE_IDLE_TRANS_1.second)), + // ctxc); // Build Safe sequence ihs(EIVE_SEQUENCE_IDLE.second, EIVE_TABLE_IDLE_TGT.first, 0, false); ihs(EIVE_SEQUENCE_IDLE.second, EIVE_TABLE_IDLE_TRANS_0.first, 0, false); - //ihs(EIVE_SEQUENCE_IDLE.second, EIVE_TABLE_IDLE_TRANS_1.first, 0, false); + // ihs(EIVE_SEQUENCE_IDLE.second, EIVE_TABLE_IDLE_TRANS_1.first, 0, false); check(ss.addSequence(SequenceEntry(EIVE_SEQUENCE_IDLE.first, &EIVE_SEQUENCE_IDLE.second, EIVE_SEQUENCE_SAFE.first)), ctxc); From 718a440442ce40db891296ba8fb6fd90f8e24c7d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Mar 2023 15:05:12 +0100 Subject: [PATCH 05/14] changelog update --- CHANGELOG.md | 4 + bsp_q7s/memory/LocalParameterHandler.h | 4 +- common/config/eive/definitions.h | 2 +- mission/core/pollingSeqTables.cpp | 224 ++++++++++++++++--------- mission/devices/ImtqHandler.cpp | 2 +- mission/system/fdir/SyrlinksFdir.cpp | 2 +- mission/system/tree/system.cpp | 10 +- 7 files changed, 160 insertions(+), 88 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index baad285b..af6d3c87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,10 @@ will consitute of a breaking change warranting a new major release: - IMTQ: Sets were filled with wrong data, e.g. Raw MTM was filled with calibrated MTM measurements. - Set RM3100 dataset to valid. +## Added + +- Added Syrlinks Assembly object to allow recovery handling and to fix faulty FDIR behaviour. + # [v1.33.0] eive-tmtc: v2.16.2 diff --git a/bsp_q7s/memory/LocalParameterHandler.h b/bsp_q7s/memory/LocalParameterHandler.h index ed0bb2bd..3e800fd1 100644 --- a/bsp_q7s/memory/LocalParameterHandler.h +++ b/bsp_q7s/memory/LocalParameterHandler.h @@ -19,8 +19,8 @@ class LocalParameterHandler : public NVMParameterBase { * @brief Constructor * * @param sdRelativeName Absolute name of json file relative to mount - * directory of SD card. - * E.g. conf/example.json + * directory of SD + * card. E.g. conf/example.json * @param sdcMan Pointer to SD card manager */ LocalParameterHandler(std::string sdRelativeName, SdCardMountedIF* sdcMan); diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 3990ac26..99ce4437 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -83,7 +83,7 @@ static constexpr float SCHED_BLOCK_7_PERIOD = static_cast(SCHED_BLOCK_7_R static constexpr float SCHED_BLOCK_8_PERIOD = static_cast(SCHED_BLOCK_8_PLPCDU_MS) / 400.0; static constexpr float SCHED_BLOCK_9_PERIOD = static_cast(SCHED_BLOCK_9_RAD_SENS_MS) / 400.0; -} // namespace acs +} // namespace spiSched } // namespace config diff --git a/mission/core/pollingSeqTables.cpp b/mission/core/pollingSeqTables.cpp index 780b0e7f..88b5b95a 100644 --- a/mission/core/pollingSeqTables.cpp +++ b/mission/core/pollingSeqTables.cpp @@ -251,53 +251,77 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg DeviceHandlerIF::GET_WRITE); thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_0_N_LOC_XFYFZM_PT_XF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_1_N_LOC_XBYFZM_PT_XB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_2_N_LOC_XFYBZB_PT_YB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_3_N_LOC_XFYBZF_PT_YF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_6_R_LOC_XFYBZM_PT_XF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_7_R_LOC_XBYBZM_PT_XB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_8_R_LOC_XBYBZB_PT_YB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_9_R_LOC_XBYBZB_PT_YF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, - length * config::spiSched::SCHED_BLOCK_1_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_1_PERIOD, + DeviceHandlerIF::GET_READ); } if (cfg.scheduleStr) { @@ -313,15 +337,20 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg if (cfg.scheduleAcsBoard) { if (enableAside) { // A side - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::spiSched::SCHED_BLOCK_3_PERIOD, + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * config::spiSched::SCHED_BLOCK_3_PERIOD, + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, @@ -331,23 +360,31 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, - length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); + length * config::spiSched::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_WRITE); thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, - length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_3_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, - length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_3_PERIOD, + DeviceHandlerIF::GET_READ); } if (enableBside) { // B side - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::spiSched::SCHED_BLOCK_3_PERIOD, + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * config::spiSched::SCHED_BLOCK_3_PERIOD, + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, @@ -357,11 +394,14 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, - length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); + length * config::spiSched::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_WRITE); thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, - length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::SEND_READ); + length * config::spiSched::SCHED_BLOCK_3_PERIOD, + DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, - length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::GET_READ); + length * config::spiSched::SCHED_BLOCK_3_PERIOD, + DeviceHandlerIF::GET_READ); } if (enableAside) { thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, @@ -371,21 +411,29 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, - length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, - length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, - length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::spiSched::SCHED_BLOCK_3_PERIOD, + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * config::spiSched::SCHED_BLOCK_3_PERIOD, + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::GET_READ); } if (enableBside) { @@ -396,21 +444,29 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, - length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, - length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, - length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::spiSched::SCHED_BLOCK_2_PERIOD, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::spiSched::SCHED_BLOCK_3_PERIOD, + thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * config::spiSched::SCHED_BLOCK_3_PERIOD, + thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, + length * config::spiSched::SCHED_BLOCK_2_PERIOD, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, + length * config::spiSched::SCHED_BLOCK_3_PERIOD, DeviceHandlerIF::GET_READ); } } @@ -429,7 +485,8 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg imtq::ComStep::READ_MEASURE_GET); } - thisSequence->addSlot(objects::ACS_CONTROLLER, length * config::spiSched::SCHED_BLOCK_4_PERIOD, 0); + thisSequence->addSlot(objects::ACS_CONTROLLER, length * config::spiSched::SCHED_BLOCK_4_PERIOD, + 0); if (cfg.scheduleImtq) { // This is the torquing cycle. @@ -491,23 +548,34 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg DeviceHandlerIF::GET_READ); } - thisSequence->addSlot(objects::SPI_RTD_COM_IF, length * config::spiSched::SCHED_BLOCK_RTD_PERIOD, 0); + thisSequence->addSlot(objects::SPI_RTD_COM_IF, length * config::spiSched::SCHED_BLOCK_RTD_PERIOD, + 0); #if OBSW_ADD_PL_PCDU == 1 - thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::PLPCDU_HANDLER, length * config::spiSched::SCHED_BLOCK_8_PERIOD, + DeviceHandlerIF::GET_READ); #endif #if OBSW_ADD_RAD_SENSORS == 1 /* Radiation sensor */ - thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RAD_SENSOR, length * config::spiSched::SCHED_BLOCK_9_PERIOD, + DeviceHandlerIF::GET_READ); #endif return returnvalue::OK; } diff --git a/mission/devices/ImtqHandler.cpp b/mission/devices/ImtqHandler.cpp index 5c5bdb61..0072dd08 100644 --- a/mission/devices/ImtqHandler.cpp +++ b/mission/devices/ImtqHandler.cpp @@ -849,7 +849,7 @@ void ImtqHandler::fillCalibratedMtmDataset(const uint8_t* packet) { void ImtqHandler::fillRawMtmDataset(imtq::RawMtmMeasurementSet& set, const uint8_t* packet) { PoolReadGuard rg(&set); - if(rg.getReadResult() != returnvalue::OK) { + if (rg.getReadResult() != returnvalue::OK) { sif::error << "ImtqHandler::fillRawMtmDataset: Lock failure" << std::endl; } unsigned int offset = 2; diff --git a/mission/system/fdir/SyrlinksFdir.cpp b/mission/system/fdir/SyrlinksFdir.cpp index 7f7ee42d..2bdbd21d 100644 --- a/mission/system/fdir/SyrlinksFdir.cpp +++ b/mission/system/fdir/SyrlinksFdir.cpp @@ -48,7 +48,7 @@ ReturnValue_t SyrlinksFdir::eventReceived(EventMessage* event) { // else if (missedReplyCount.incrementAndCheck()) { handleRecovery(event->getEvent()); - //triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); + // triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0); } break; case StorageManagerIF::GET_DATA_FAILED: diff --git a/mission/system/tree/system.cpp b/mission/system/tree/system.cpp index 710698a1..195b6905 100644 --- a/mission/system/tree/system.cpp +++ b/mission/system/tree/system.cpp @@ -93,13 +93,13 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { ctxc); // Build SAFE transition 1 - //check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TRANS_1.first, &EIVE_TABLE_SAFE_TRANS_1.second)), + // check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TRANS_1.first, &EIVE_TABLE_SAFE_TRANS_1.second)), // ctxc); // Build Safe sequence ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TGT.first, 0, false); ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_0.first, 0, false); - //ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_1.first, 0, false); + // ihs(EIVE_SEQUENCE_SAFE.second, EIVE_TABLE_SAFE_TRANS_1.first, 0, false); check(ss.addSequence(SequenceEntry(EIVE_SEQUENCE_SAFE.first, &EIVE_SEQUENCE_SAFE.second, EIVE_SEQUENCE_SAFE.first)), ctxc); @@ -135,13 +135,13 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { ctxc); // Build SAFE transition 1 - //check(ss.addTable(TableEntry(EIVE_TABLE_IDLE_TRANS_1.first, &EIVE_TABLE_IDLE_TRANS_1.second)), - // ctxc); + // check(ss.addTable(TableEntry(EIVE_TABLE_IDLE_TRANS_1.first, &EIVE_TABLE_IDLE_TRANS_1.second)), + // ctxc); // Build Safe sequence ihs(EIVE_SEQUENCE_IDLE.second, EIVE_TABLE_IDLE_TGT.first, 0, false); ihs(EIVE_SEQUENCE_IDLE.second, EIVE_TABLE_IDLE_TRANS_0.first, 0, false); - //ihs(EIVE_SEQUENCE_IDLE.second, EIVE_TABLE_IDLE_TRANS_1.first, 0, false); + // ihs(EIVE_SEQUENCE_IDLE.second, EIVE_TABLE_IDLE_TRANS_1.first, 0, false); check(ss.addSequence(SequenceEntry(EIVE_SEQUENCE_IDLE.first, &EIVE_SEQUENCE_IDLE.second, EIVE_SEQUENCE_SAFE.first)), ctxc); From 6530ad8f1a9b227b042c109ee1d4df052cd103c8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Mar 2023 17:08:44 +0100 Subject: [PATCH 06/14] re-gen objects --- .../fsfwconfig/events/translateEvents.cpp | 2 +- .../fsfwconfig/objects/translateObjects.cpp | 11 ++++++---- bsp_q7s/core/scheduling.cpp | 4 ++-- common/config/eive/objects.h | 2 +- generators/bsp_hosted_objects.csv | 3 ++- generators/bsp_q7s_objects.csv | 3 ++- generators/events/translateEvents.cpp | 2 +- generators/objects/translateObjects.cpp | 11 ++++++---- linux/fsfwconfig/events/translateEvents.cpp | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 11 ++++++---- mission/core/GenericFactory.cpp | 2 +- mission/system/tree/acsModeTree.cpp | 20 +++++++++---------- tmtc | 2 +- 13 files changed, 43 insertions(+), 32 deletions(-) diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp index 23a43738..8acf72a4 100644 --- a/bsp_hosted/fsfwconfig/events/translateEvents.cpp +++ b/bsp_hosted/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 267 translations. * @details - * Generated on: 2023-03-01 18:34:32 + * Generated on: 2023-03-02 17:08:11 */ #include "translateEvents.h" diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp index 5cfde56e..da4101a4 100644 --- a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp +++ b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp @@ -1,8 +1,8 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 157 translations. - * Generated on: 2023-03-01 18:34:32 + * Contains 158 translations. + * Generated on: 2023-03-02 17:08:11 */ #include "translateObjects.h" @@ -142,8 +142,9 @@ const char *HEATER_7_HPA_STRING = "HEATER_7_HPA"; const char *ACS_BOARD_ASS_STRING = "ACS_BOARD_ASS"; const char *SUS_BOARD_ASS_STRING = "SUS_BOARD_ASS"; const char *TCS_BOARD_ASS_STRING = "TCS_BOARD_ASS"; -const char *RW_ASS_STRING = "RW_ASS"; +const char *RW_ASSY_STRING = "RW_ASSY"; const char *CAM_SWITCHER_STRING = "CAM_SWITCHER"; +const char *SYRLINKS_ASSY_STRING = "SYRLINKS_ASSY"; const char *TM_FUNNEL_STRING = "TM_FUNNEL"; const char *PUS_TM_FUNNEL_STRING = "PUS_TM_FUNNEL"; const char *CFDP_TM_FUNNEL_STRING = "CFDP_TM_FUNNEL"; @@ -439,9 +440,11 @@ const char *translateObject(object_id_t object) { case 0x73000003: return TCS_BOARD_ASS_STRING; case 0x73000004: - return RW_ASS_STRING; + return RW_ASSY_STRING; case 0x73000006: return CAM_SWITCHER_STRING; + case 0x73000007: + return SYRLINKS_ASSY_STRING; case 0x73000100: return TM_FUNNEL_STRING; case 0x73000101: diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index c0959222..93f5228f 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -247,9 +247,9 @@ void scheduling::initTasks() { } #endif /* OBSW_ADD_ACS_HANDLERS */ #if OBSW_ADD_RW == 1 - result = acsSysTask->addComponent(objects::RW_ASS); + result = acsSysTask->addComponent(objects::RW_ASSY); if (result != returnvalue::OK) { - scheduling::printAddObjectError("RW_ASS", objects::RW_ASS); + scheduling::printAddObjectError("RW_ASS", objects::RW_ASSY); } #endif #if OBSW_ADD_SUS_BOARD_ASS == 1 diff --git a/common/config/eive/objects.h b/common/config/eive/objects.h index b5715b55..d294a40e 100644 --- a/common/config/eive/objects.h +++ b/common/config/eive/objects.h @@ -142,7 +142,7 @@ enum commonObjects : uint32_t { ACS_BOARD_ASS = 0x73000001, SUS_BOARD_ASS = 0x73000002, TCS_BOARD_ASS = 0x73000003, - RW_ASS = 0x73000004, + RW_ASSY = 0x73000004, CAM_SWITCHER = 0x73000006, SYRLINKS_ASSY = 0x73000007, EIVE_SYSTEM = 0x73010000, diff --git a/generators/bsp_hosted_objects.csv b/generators/bsp_hosted_objects.csv index f20c8d40..f85bfd73 100644 --- a/generators/bsp_hosted_objects.csv +++ b/generators/bsp_hosted_objects.csv @@ -134,8 +134,9 @@ 0x73000001;ACS_BOARD_ASS 0x73000002;SUS_BOARD_ASS 0x73000003;TCS_BOARD_ASS -0x73000004;RW_ASS +0x73000004;RW_ASSY 0x73000006;CAM_SWITCHER +0x73000007;SYRLINKS_ASSY 0x73000100;TM_FUNNEL 0x73000101;PUS_TM_FUNNEL 0x73000102;CFDP_TM_FUNNEL diff --git a/generators/bsp_q7s_objects.csv b/generators/bsp_q7s_objects.csv index 7dd8b859..7002b3ac 100644 --- a/generators/bsp_q7s_objects.csv +++ b/generators/bsp_q7s_objects.csv @@ -139,8 +139,9 @@ 0x73000001;ACS_BOARD_ASS 0x73000002;SUS_BOARD_ASS 0x73000003;TCS_BOARD_ASS -0x73000004;RW_ASS +0x73000004;RW_ASSY 0x73000006;CAM_SWITCHER +0x73000007;SYRLINKS_ASSY 0x73000100;TM_FUNNEL 0x73000101;PUS_TM_FUNNEL 0x73000102;CFDP_TM_FUNNEL diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 23a43738..8acf72a4 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 267 translations. * @details - * Generated on: 2023-03-01 18:34:32 + * Generated on: 2023-03-02 17:08:11 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 2eca7d22..1fe48b77 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -1,8 +1,8 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 161 translations. - * Generated on: 2023-03-01 18:34:32 + * Contains 162 translations. + * Generated on: 2023-03-02 17:08:11 */ #include "translateObjects.h" @@ -147,8 +147,9 @@ const char *HEATER_7_HPA_STRING = "HEATER_7_HPA"; const char *ACS_BOARD_ASS_STRING = "ACS_BOARD_ASS"; const char *SUS_BOARD_ASS_STRING = "SUS_BOARD_ASS"; const char *TCS_BOARD_ASS_STRING = "TCS_BOARD_ASS"; -const char *RW_ASS_STRING = "RW_ASS"; +const char *RW_ASSY_STRING = "RW_ASSY"; const char *CAM_SWITCHER_STRING = "CAM_SWITCHER"; +const char *SYRLINKS_ASSY_STRING = "SYRLINKS_ASSY"; const char *TM_FUNNEL_STRING = "TM_FUNNEL"; const char *PUS_TM_FUNNEL_STRING = "PUS_TM_FUNNEL"; const char *CFDP_TM_FUNNEL_STRING = "CFDP_TM_FUNNEL"; @@ -453,9 +454,11 @@ const char *translateObject(object_id_t object) { case 0x73000003: return TCS_BOARD_ASS_STRING; case 0x73000004: - return RW_ASS_STRING; + return RW_ASSY_STRING; case 0x73000006: return CAM_SWITCHER_STRING; + case 0x73000007: + return SYRLINKS_ASSY_STRING; case 0x73000100: return TM_FUNNEL_STRING; case 0x73000101: diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 23a43738..8acf72a4 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 267 translations. * @details - * Generated on: 2023-03-01 18:34:32 + * Generated on: 2023-03-02 17:08:11 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 2eca7d22..1fe48b77 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -1,8 +1,8 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 161 translations. - * Generated on: 2023-03-01 18:34:32 + * Contains 162 translations. + * Generated on: 2023-03-02 17:08:11 */ #include "translateObjects.h" @@ -147,8 +147,9 @@ const char *HEATER_7_HPA_STRING = "HEATER_7_HPA"; const char *ACS_BOARD_ASS_STRING = "ACS_BOARD_ASS"; const char *SUS_BOARD_ASS_STRING = "SUS_BOARD_ASS"; const char *TCS_BOARD_ASS_STRING = "TCS_BOARD_ASS"; -const char *RW_ASS_STRING = "RW_ASS"; +const char *RW_ASSY_STRING = "RW_ASSY"; const char *CAM_SWITCHER_STRING = "CAM_SWITCHER"; +const char *SYRLINKS_ASSY_STRING = "SYRLINKS_ASSY"; const char *TM_FUNNEL_STRING = "TM_FUNNEL"; const char *PUS_TM_FUNNEL_STRING = "PUS_TM_FUNNEL"; const char *CFDP_TM_FUNNEL_STRING = "CFDP_TM_FUNNEL"; @@ -453,9 +454,11 @@ const char *translateObject(object_id_t object) { case 0x73000003: return TCS_BOARD_ASS_STRING; case 0x73000004: - return RW_ASS_STRING; + return RW_ASSY_STRING; case 0x73000006: return CAM_SWITCHER_STRING; + case 0x73000007: + return SYRLINKS_ASSY_STRING; case 0x73000100: return TM_FUNNEL_STRING; case 0x73000101: diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 9e929e83..8f54c05d 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -236,7 +236,7 @@ void ObjectFactory::createRwAssy(PowerSwitchIF& pwrSwitcher, power::Switch_t the std::array rws, std::array rwIds) { RwHelper rwHelper(rwIds); - auto* rwAss = new RwAssembly(objects::RW_ASS, &pwrSwitcher, theSwitch, rwHelper); + auto* rwAss = new RwAssembly(objects::RW_ASSY, &pwrSwitcher, theSwitch, rwHelper); for (size_t idx = 0; idx < rwIds.size(); idx++) { ReturnValue_t result = rws[idx]->connectModeTreeParent(*rwAss); if (result != returnvalue::OK) { diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp index 62fb76ed..b191c1e1 100644 --- a/mission/system/tree/acsModeTree.cpp +++ b/mission/system/tree/acsModeTree.cpp @@ -110,7 +110,7 @@ Subsystem& satsystem::acs::init() { iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TRANS_0.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TRANS_0.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TRANS_0.second); - iht(objects::RW_ASS, NML, 0, ACS_TABLE_PTG_TRANS_0.second); + iht(objects::RW_ASSY, NML, 0, ACS_TABLE_PTG_TRANS_0.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TRANS_0.second); check(ACS_SUBSYSTEM.addTable( TableEntry(ACS_TABLE_PTG_TRANS_0.first, &ACS_TABLE_PTG_TRANS_0.second)), @@ -165,7 +165,7 @@ void buildOffSequence(Subsystem& ss, ModeListEntry& eh) { iht(objects::IMTQ_HANDLER, OFF, 0, ACS_TABLE_OFF_TRANS_1.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_OFF_TRANS_1.second); iht(objects::ACS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS_1.second); - iht(objects::RW_ASS, OFF, 0, ACS_TABLE_OFF_TRANS_1.second); + iht(objects::RW_ASSY, OFF, 0, ACS_TABLE_OFF_TRANS_1.second); check(ss.addTable(TableEntry(ACS_TABLE_OFF_TRANS_1.first, &ACS_TABLE_OFF_TRANS_1.second)), ctxc); // Build OFF sequence @@ -207,7 +207,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) { iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); - iht(objects::RW_ASS, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); + iht(objects::RW_ASSY, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); check(ss.addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true), ctxc); @@ -262,7 +262,7 @@ void buildDetumbleSequence(Subsystem& ss, ModeListEntry& eh) { iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); - iht(objects::RW_ASS, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::RW_ASSY, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); check(ss.addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, true), ctxc); @@ -305,7 +305,7 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { // Build IDLE target iht(objects::ACS_CONTROLLER, NML, acs::AcsMode::PTG_IDLE, ACS_TABLE_IDLE_TGT.second); iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_TGT.second); - iht(objects::RW_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); + iht(objects::RW_ASSY, NML, 0, ACS_TABLE_IDLE_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); ss.addTable(&ACS_TABLE_IDLE_TGT.second, ACS_TABLE_IDLE_TGT.first, false, true); @@ -316,7 +316,7 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) { iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); - iht(objects::RW_ASS, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); + iht(objects::RW_ASSY, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); ss.addTable(&ACS_TABLE_IDLE_TRANS_0.second, ACS_TABLE_IDLE_TRANS_0.first, false, true); @@ -358,7 +358,7 @@ void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) { iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second); - iht(objects::RW_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second); + iht(objects::RW_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second); check(ss.addTable(&ACS_TABLE_PTG_TARGET_TGT.second, ACS_TABLE_PTG_TARGET_TGT.first, false, true), ctxc); @@ -407,7 +407,7 @@ void buildTargetPtNadirSequence(Subsystem& ss, ModeListEntry& eh) { iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second); - iht(objects::RW_ASS, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second); + iht(objects::RW_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second); check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_NADIR_TGT.first, &ACS_TABLE_PTG_TARGET_NADIR_TGT.second)), @@ -458,7 +458,7 @@ void buildTargetPtGsSequence(Subsystem& ss, ModeListEntry& eh) { iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second); - iht(objects::RW_ASS, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second); + iht(objects::RW_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second); check(ss.addTable( TableEntry(ACS_TABLE_PTG_TARGET_GS_TGT.first, &ACS_TABLE_PTG_TARGET_GS_TGT.second)), @@ -508,7 +508,7 @@ void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& eh) { iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); - iht(objects::RW_ASS, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); + iht(objects::RW_ASSY, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second); check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_INERTIAL_TGT.first, &ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second)), diff --git a/tmtc b/tmtc index 2dd850f0..68c46a29 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 2dd850f0725d37256c17576bf7d3ae4423184044 +Subproject commit 68c46a299fd643a34510de315277a16e744999fe From 196aca241e8e49b18a2cf40ead3f1a6dc0499605 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Mar 2023 17:25:32 +0100 Subject: [PATCH 07/14] add missing command table init --- mission/system/objects/SyrlinksAssembly.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mission/system/objects/SyrlinksAssembly.cpp b/mission/system/objects/SyrlinksAssembly.cpp index 209097d9..88c946a9 100644 --- a/mission/system/objects/SyrlinksAssembly.cpp +++ b/mission/system/objects/SyrlinksAssembly.cpp @@ -4,7 +4,13 @@ using namespace returnvalue; -SyrlinksAssembly::SyrlinksAssembly(object_id_t objectId) : AssemblyBase(objectId) {} +SyrlinksAssembly::SyrlinksAssembly(object_id_t objectId) : AssemblyBase(objectId) { + ModeListEntry entry; + entry.setObject(objects::SYRLINKS_HANDLER); + entry.setMode(MODE_OFF); + entry.setSubmode(SUBMODE_NONE); + commandTable.insert(entry); +} ReturnValue_t SyrlinksAssembly::commandChildren(Mode_t mode, Submode_t submode) { commandTable[0].setMode(mode); From 35caddbfc44b18a6e5bcd118ba2f4be36cdc9273 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Mar 2023 17:27:47 +0100 Subject: [PATCH 08/14] handle children lost mode --- bsp_q7s/memory/LocalParameterHandler.h | 4 ++-- mission/system/objects/SyrlinksAssembly.cpp | 4 ++++ mission/system/objects/SyrlinksAssembly.h | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/memory/LocalParameterHandler.h b/bsp_q7s/memory/LocalParameterHandler.h index 3e800fd1..4aaa8cd5 100644 --- a/bsp_q7s/memory/LocalParameterHandler.h +++ b/bsp_q7s/memory/LocalParameterHandler.h @@ -19,8 +19,8 @@ class LocalParameterHandler : public NVMParameterBase { * @brief Constructor * * @param sdRelativeName Absolute name of json file relative to mount - * directory of SD - * card. E.g. conf/example.json + * directory of + * SD card. E.g. conf/example.json * @param sdcMan Pointer to SD card manager */ LocalParameterHandler(std::string sdRelativeName, SdCardMountedIF* sdcMan); diff --git a/mission/system/objects/SyrlinksAssembly.cpp b/mission/system/objects/SyrlinksAssembly.cpp index 88c946a9..b5e50924 100644 --- a/mission/system/objects/SyrlinksAssembly.cpp +++ b/mission/system/objects/SyrlinksAssembly.cpp @@ -51,3 +51,7 @@ ReturnValue_t SyrlinksAssembly::checkAndHandleHealthState(Mode_t deviceMode, } return OK; } + +void SyrlinksAssembly::handleChildrenLostMode(ReturnValue_t result) { + startTransition(mode, submode); +} diff --git a/mission/system/objects/SyrlinksAssembly.h b/mission/system/objects/SyrlinksAssembly.h index 6d7744ad..314474d3 100644 --- a/mission/system/objects/SyrlinksAssembly.h +++ b/mission/system/objects/SyrlinksAssembly.h @@ -12,6 +12,7 @@ class SyrlinksAssembly : public AssemblyBase { ReturnValue_t commandChildren(Mode_t mode, Submode_t submode) override; ReturnValue_t checkChildrenStateOn(Mode_t wantedMode, Submode_t wantedSubmode) override; ReturnValue_t isModeCombinationValid(Mode_t mode, Submode_t submode) override; + void handleChildrenLostMode(ReturnValue_t result) override; ReturnValue_t checkAndHandleHealthState(Mode_t deviceMode, Submode_t deviceSubmode); }; From d13e593f8994154a7e8b2bb987e93f27b3eeea1a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Mar 2023 17:35:36 +0100 Subject: [PATCH 09/14] more useful printout --- bsp_q7s/memory/LocalParameterHandler.h | 4 ++-- mission/core/GenericFactory.cpp | 5 +++-- mission/tmtc/TmFunnelBase.cpp | 8 ++++---- mission/tmtc/TmFunnelBase.h | 13 +++++++++---- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/bsp_q7s/memory/LocalParameterHandler.h b/bsp_q7s/memory/LocalParameterHandler.h index 4aaa8cd5..cdbcff06 100644 --- a/bsp_q7s/memory/LocalParameterHandler.h +++ b/bsp_q7s/memory/LocalParameterHandler.h @@ -19,8 +19,8 @@ class LocalParameterHandler : public NVMParameterBase { * @brief Constructor * * @param sdRelativeName Absolute name of json file relative to mount - * directory of - * SD card. E.g. conf/example.json + * directory + * of SD card. E.g. conf/example.json * @param sdcMan Pointer to SD card manager */ LocalParameterHandler(std::string sdRelativeName, SdCardMountedIF* sdcMan); diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 8f54c05d..87b08b49 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -139,9 +139,10 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun new CcsdsDistributor(config::EIVE_PUS_APID, objects::CCSDS_PACKET_DISTRIBUTOR); new PusDistributor(config::EIVE_PUS_APID, objects::PUS_PACKET_DISTRIBUTOR, ccsdsDistrib); - PusTmFunnel::FunnelCfg cfdpFunnelCfg(objects::CFDP_TM_FUNNEL, *tmStore, *ipcStore, 50); + PusTmFunnel::FunnelCfg cfdpFunnelCfg(objects::CFDP_TM_FUNNEL, "CfdpTmFunnel", *tmStore, *ipcStore, + 50); *cfdpFunnel = new CfdpTmFunnel(cfdpFunnelCfg, config::EIVE_CFDP_APID); - PusTmFunnel::FunnelCfg pusFunnelCfg(objects::PUS_TM_FUNNEL, *tmStore, *ipcStore, + PusTmFunnel::FunnelCfg pusFunnelCfg(objects::PUS_TM_FUNNEL, "PusTmFunnel", *tmStore, *ipcStore, config::MAX_PUS_FUNNEL_QUEUE_DEPTH); *pusFunnel = new PusTmFunnel(pusFunnelCfg, *timeStamper, sdcMan); #if OBSW_ADD_TCPIP_SERVERS == 1 diff --git a/mission/tmtc/TmFunnelBase.cpp b/mission/tmtc/TmFunnelBase.cpp index 6f788fc7..78a13fab 100644 --- a/mission/tmtc/TmFunnelBase.cpp +++ b/mission/tmtc/TmFunnelBase.cpp @@ -5,7 +5,7 @@ #include "fsfw/ipc/QueueFactory.h" TmFunnelBase::TmFunnelBase(FunnelCfg cfg) - : SystemObject(cfg.objectId), tmStore(cfg.tmStore), ipcStore(cfg.ipcStore) { + : SystemObject(cfg.objectId), name(cfg.name), tmStore(cfg.tmStore), ipcStore(cfg.ipcStore) { tmQueue = QueueFactory::instance()->createMessageQueue(cfg.tmMsgDepth); } @@ -37,8 +37,7 @@ ReturnValue_t TmFunnelBase::sendPacketToDestinations(store_address_t origStoreId message.setStorageId(storeId); } else { #if FSFW_CPP_OSTREAM_ENABLED == 1 - sif::error << "PusTmFunnel::handlePacket: Store too full to create data copy" - << std::endl; + sif::error << name << "::handlePacket: Store too full to create data copy" << std::endl; #endif } } else { @@ -48,7 +47,8 @@ ReturnValue_t TmFunnelBase::sendPacketToDestinations(store_address_t origStoreId result = tmQueue->sendMessage(dest.queueId, &message); if (result != returnvalue::OK) { #if FSFW_CPP_OSTREAM_ENABLED == 1 - sif::error << "PusTmFunnel::handlePacket: Error sending TM to downlink handler" << std::endl; + sif::error << name << "::handlePacket: Error sending TM to downlink handler " << dest.name + << std::endl; #endif tmStore.deleteData(message.getStorageId()); } diff --git a/mission/tmtc/TmFunnelBase.h b/mission/tmtc/TmFunnelBase.h index af65771f..ef3c6c6a 100644 --- a/mission/tmtc/TmFunnelBase.h +++ b/mission/tmtc/TmFunnelBase.h @@ -12,10 +12,15 @@ class TmFunnelBase : public AcceptsTelemetryIF, public SystemObject { public: struct FunnelCfg { - FunnelCfg(object_id_t objId, StorageManagerIF& tmStore, StorageManagerIF& ipcStore, - uint32_t tmMsgDepth) - : objectId(objId), tmStore(tmStore), ipcStore(ipcStore), tmMsgDepth(tmMsgDepth) {} + FunnelCfg(object_id_t objId, const char* name, StorageManagerIF& tmStore, + StorageManagerIF& ipcStore, uint32_t tmMsgDepth) + : objectId(objId), + name(name), + tmStore(tmStore), + ipcStore(ipcStore), + tmMsgDepth(tmMsgDepth) {} object_id_t objectId; + const char* name; StorageManagerIF& tmStore; StorageManagerIF& ipcStore; uint32_t tmMsgDepth; @@ -30,6 +35,7 @@ class TmFunnelBase : public AcceptsTelemetryIF, public SystemObject { ~TmFunnelBase() override; protected: + const char* name; StorageManagerIF& tmStore; StorageManagerIF& ipcStore; @@ -43,7 +49,6 @@ class TmFunnelBase : public AcceptsTelemetryIF, public SystemObject { }; std::vector destinations; - MessageQueueIF* tmQueue = nullptr; }; From 3e2338f3a47b1e1607abc3d648904663a78116ff Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 2 Mar 2023 17:52:36 +0100 Subject: [PATCH 10/14] fixed units used in controler calculations --- mission/controller/AcsController.cpp | 19 +++++--- mission/controller/acs/control/Detumble.cpp | 14 +++--- mission/controller/acs/control/SafeCtrl.cpp | 54 +++++++++------------ mission/controller/acs/control/SafeCtrl.h | 12 ++--- 4 files changed, 46 insertions(+), 53 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index c0853695..22d29294 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -157,20 +157,23 @@ void AcsController::performSafe() { guidance.getTargetParamsSafe(sunTargetDir, satRateSafe); // if MEKF is working double magMomMtq[3] = {0, 0, 0}, errAng = 0.0; - bool magMomMtqValid = false; if (result == MultiplicativeKalmanFilter::MEKF_RUNNING) { - safeCtrl.safeMekf(now, mekfData.quatMekf.value, mekfData.quatMekf.isValid(), - mgmDataProcessed.magIgrfModel.value, mgmDataProcessed.magIgrfModel.isValid(), - susDataProcessed.sunIjkModel.value, susDataProcessed.isValid(), - mekfData.satRotRateMekf.value, mekfData.satRotRateMekf.isValid(), - sunTargetDir, satRateSafe, &errAng, magMomMtq, &magMomMtqValid); + result = safeCtrl.safeMekf(now, mekfData.quatMekf.value, mekfData.quatMekf.isValid(), + mgmDataProcessed.magIgrfModel.value, + mgmDataProcessed.magIgrfModel.isValid(), + susDataProcessed.sunIjkModel.value, susDataProcessed.isValid(), + mekfData.satRotRateMekf.value, mekfData.satRotRateMekf.isValid(), + sunTargetDir, satRateSafe, &errAng, magMomMtq); } else { - safeCtrl.safeNoMekf( + result = safeCtrl.safeNoMekf( now, susDataProcessed.susVecTot.value, susDataProcessed.susVecTot.isValid(), susDataProcessed.susVecTotDerivative.value, susDataProcessed.susVecTotDerivative.isValid(), mgmDataProcessed.mgmVecTot.value, mgmDataProcessed.mgmVecTot.isValid(), mgmDataProcessed.mgmVecTotDerivative.value, mgmDataProcessed.mgmVecTotDerivative.isValid(), - sunTargetDir, satRateSafe, &errAng, magMomMtq, &magMomMtqValid); + sunTargetDir, satRateSafe, &errAng, magMomMtq); + } + if (result == returnvalue::FAILED) { + // ToDo: this should never ever happen or we are dead. prob add an event at least } actuatorCmd.cmdDipolMtq(magMomMtq, cmdDipolMtqs); diff --git a/mission/controller/acs/control/Detumble.cpp b/mission/controller/acs/control/Detumble.cpp index 705bf599..0e131942 100644 --- a/mission/controller/acs/control/Detumble.cpp +++ b/mission/controller/acs/control/Detumble.cpp @@ -1,11 +1,3 @@ - -/* - * Detumble.cpp - * - * Created on: 17 Aug 2022 - * Author: Robin Marquardt - */ - #include "Detumble.h" #include @@ -31,6 +23,12 @@ ReturnValue_t Detumble::bDotLaw(const double *magRate, const bool magRateValid, if (!magRateValid || !magFieldValid) { return DETUMBLE_NO_SENSORDATA; } + + // change unit from uT to T + double magFieldT[3] = {0, 0, 0}, magRateT[3] = {0, 0, 0}; + VectorOperations::mulScalar(magField, 1e-6, magFieldT, 3); + VectorOperations::mulScalar(magRate, 1e-6, magRateT, 3); + double gain = detumbleParameter->gainD; double factor = -gain / pow(VectorOperations::norm(magField, 3), 2); VectorOperations::mulScalar(magRate, factor, magMom, 3); diff --git a/mission/controller/acs/control/SafeCtrl.cpp b/mission/controller/acs/control/SafeCtrl.cpp index aa04cbb6..3a69e343 100644 --- a/mission/controller/acs/control/SafeCtrl.cpp +++ b/mission/controller/acs/control/SafeCtrl.cpp @@ -32,15 +32,13 @@ ReturnValue_t SafeCtrl::safeMekf(timeval now, double *quatBJ, bool quatBJValid, double *magFieldModel, bool magFieldModelValid, double *sunDirModel, bool sunDirModelValid, double *satRateMekf, bool rateMekfValid, double *sunDirRef, double *satRatRef, - double *outputAngle, double *outputMagMomB, bool *outputValid) { + double *outputAngle, double *outputMagMomB) { if (!quatBJValid || !magFieldModelValid || !sunDirModelValid || !rateMekfValid) { - *outputValid = false; return SAFECTRL_MEKF_INPUT_INVALID; } - double kRate = 0, kAlign = 0; - kRate = safeModeControllerParameters->k_rate_mekf; - kAlign = safeModeControllerParameters->k_align_mekf; + double kRate = safeModeControllerParameters->k_rate_mekf; + double kAlign = safeModeControllerParameters->k_align_mekf; // Calc sunDirB ,magFieldB with mekf output and model double dcmBJ[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; @@ -49,22 +47,22 @@ ReturnValue_t SafeCtrl::safeMekf(timeval now, double *quatBJ, bool quatBJValid, MatrixOperations::multiply(*dcmBJ, sunDirModel, sunDirB, 3, 3, 1); MatrixOperations::multiply(*dcmBJ, magFieldModel, magFieldB, 3, 3, 1); - double crossSun[3] = {0, 0, 0}; + // change unit from uT to T + VectorOperations::mulScalar(magFieldB, 1e-6, magFieldB, 3); + double crossSun[3] = {0, 0, 0}; VectorOperations::cross(sunDirRef, sunDirB, crossSun); double normCrossSun = VectorOperations::norm(crossSun, 3); // calc angle alpha between sunDirRef and sunDIr - double alpha = 0, dotSun = 0; - dotSun = VectorOperations::dot(sunDirRef, sunDirB); - alpha = acos(dotSun); + double dotSun = VectorOperations::dot(sunDirRef, sunDirB); + double alpha = acos(dotSun); // Law Torque calculations double torqueCmd[3] = {0, 0, 0}, torqueAlign[3] = {0, 0, 0}, torqueRate[3] = {0, 0, 0}, torqueAll[3] = {0, 0, 0}; - double scalarFac = 0; - scalarFac = kAlign * alpha / normCrossSun; + double scalarFac = kAlign * alpha / normCrossSun; VectorOperations::mulScalar(crossSun, scalarFac, torqueAlign, 3); double rateSafeMode[3] = {0, 0, 0}; @@ -82,23 +80,22 @@ ReturnValue_t SafeCtrl::safeMekf(timeval now, double *quatBJ, bool quatBJValid, VectorOperations::mulScalar(torqueMgt, 1 / pow(normMag, 2), outputMagMomB, 3); *outputAngle = alpha; - *outputValid = true; - return returnvalue::OK; } // Will be the version in worst case scenario in event of no working MEKF (nor GYRs) -void SafeCtrl::safeNoMekf(timeval now, double *susDirB, bool susDirBValid, double *sunRateB, +ReturnValue_t SafeCtrl::safeNoMekf(timeval now, double *susDirB, bool susDirBValid, double *sunRateB, bool sunRateBValid, double *magFieldB, bool magFieldBValid, double *magRateB, bool magRateBValid, double *sunDirRef, - double *satRateRef, double *outputAngle, double *outputMagMomB, - bool *outputValid) { + double *satRateRef, double *outputAngle, double *outputMagMomB) { // Check for invalid Inputs if (!susDirBValid || !magFieldBValid || !magRateBValid) { - *outputValid = false; - return; + return returnvalue::FAILED; } + // change unit from uT to T + VectorOperations::mulScalar(magFieldB, 1e-6, magFieldB, 3); + // normalize sunDir and magDir double magDirB[3] = {0, 0, 0}; VectorOperations::normalize(magFieldB, magDirB, 3); @@ -108,13 +105,11 @@ void SafeCtrl::safeNoMekf(timeval now, double *susDirB, bool susDirBValid, doubl double cosAngleSunMag = VectorOperations::dot(magDirB, susDirB); // Rate parallel to sun direction and magnetic field direction - double rateParaSun = 0, rateParaMag = 0; - double dotSunRateMag = 0, dotmagRateSun = 0, rateFactor = 0; - dotSunRateMag = VectorOperations::dot(sunRateB, magDirB); - dotmagRateSun = VectorOperations::dot(magRateB, susDirB); - rateFactor = 1 - pow(cosAngleSunMag, 2); - rateParaSun = (dotmagRateSun + cosAngleSunMag * dotSunRateMag) / rateFactor; - rateParaMag = (dotSunRateMag + cosAngleSunMag * dotmagRateSun) / rateFactor; + double dotSunRateMag = VectorOperations::dot(sunRateB, magDirB); + double dotmagRateSun = VectorOperations::dot(magRateB, susDirB); + double rateFactor = 1 - pow(cosAngleSunMag, 2); + double rateParaSun = (dotmagRateSun + cosAngleSunMag * dotSunRateMag) / rateFactor; + double rateParaMag = (dotSunRateMag + cosAngleSunMag * dotmagRateSun) / rateFactor; // Full rate or estimate double estSatRate[3] = {0, 0, 0}; @@ -130,7 +125,7 @@ void SafeCtrl::safeNoMekf(timeval now, double *susDirB, bool susDirBValid, doubl * is sufficiently large */ double angleSunMag = acos(cosAngleSunMag); if (angleSunMag < safeModeControllerParameters->sunMagAngleMin) { - return; + return returnvalue::FAILED; } // Rate for Torque Calculation @@ -138,9 +133,8 @@ void SafeCtrl::safeNoMekf(timeval now, double *susDirB, bool susDirBValid, doubl VectorOperations::subtract(estSatRate, satRateRef, diffRate, 3); // Torque Align calculation - double kRateNoMekf = 0, kAlignNoMekf = 0; - kRateNoMekf = safeModeControllerParameters->k_rate_no_mekf; - kAlignNoMekf = safeModeControllerParameters->k_align_no_mekf; + double kRateNoMekf = safeModeControllerParameters->k_rate_no_mekf; + double kAlignNoMekf = safeModeControllerParameters->k_align_no_mekf; double cosAngleAlignErr = VectorOperations::dot(sunDirRef, susDirB); double crossSusSunRef[3] = {0, 0, 0}; @@ -171,5 +165,5 @@ void SafeCtrl::safeNoMekf(timeval now, double *susDirB, bool susDirBValid, doubl std::memcpy(outputMagMomB, magMomB, 3 * sizeof(double)); *outputAngle = angleAlignErr; - *outputValid = true; + return returnvalue::OK; } diff --git a/mission/controller/acs/control/SafeCtrl.h b/mission/controller/acs/control/SafeCtrl.h index 1784f9ca..92d20313 100644 --- a/mission/controller/acs/control/SafeCtrl.h +++ b/mission/controller/acs/control/SafeCtrl.h @@ -23,14 +23,12 @@ class SafeCtrl { bool magFieldModelValid, double *sunDirModel, bool sunDirModelValid, double *satRateMekf, bool rateMekfValid, double *sunDirRef, double *satRatRef, // From Guidance (!) - double *outputAngle, double *outputMagMomB, bool *outputValid); + double *outputAngle, double *outputMagMomB); - void safeNoMekf(timeval now, double *susDirB, bool susDirBValid, double *sunRateB, - bool sunRateBValid, double *magFieldB, bool magFieldBValid, double *magRateB, - bool magRateBValid, double *sunDirRef, double *satRateRef, double *outputAngle, - double *outputMagMomB, bool *outputValid); - - void idleSunPointing(); // with reaction wheels + ReturnValue_t safeNoMekf(timeval now, double *susDirB, bool susDirBValid, double *sunRateB, + bool sunRateBValid, double *magFieldB, bool magFieldBValid, + double *magRateB, bool magRateBValid, double *sunDirRef, + double *satRateRef, double *outputAngle, double *outputMagMomB); protected: private: From 3ade660132192be2683b7d458173c7bcb201a389 Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 2 Mar 2023 17:53:59 +0100 Subject: [PATCH 11/14] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index baad285b..fb173bc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ will consitute of a breaking change warranting a new major release: - IMTQ: Sets were filled with wrong data, e.g. Raw MTM was filled with calibrated MTM measurements. - Set RM3100 dataset to valid. +- Fixed units in calculation of ACS control laws safe and detumble. # [v1.33.0] From 00834de1b77b062a929b954adc017c70c439fda5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Mar 2023 17:55:47 +0100 Subject: [PATCH 12/14] printout tweak, bump tmtc --- mission/devices/ImtqHandler.cpp | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/devices/ImtqHandler.cpp b/mission/devices/ImtqHandler.cpp index 0072dd08..c3b14727 100644 --- a/mission/devices/ImtqHandler.cpp +++ b/mission/devices/ImtqHandler.cpp @@ -395,7 +395,7 @@ LocalPoolDataSetBase* ImtqHandler::getDataSetHandle(sid_t sid) { } else if (sid == negZselfTestDataset.getSid()) { return &negZselfTestDataset; } else { - sif::error << "IMTQHandler::getDataSetHandle: Invalid sid" << std::endl; + sif::error << "ImtqHandler::getDataSetHandle: Invalid SID"<< std::endl; return nullptr; } } diff --git a/tmtc b/tmtc index 2dd850f0..77fbcede 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 2dd850f0725d37256c17576bf7d3ae4423184044 +Subproject commit 77fbcede10d44fd15dc7d5d1b3965f06c6a8e7fc From 4ec362d8496654161271186862447428929dbd75 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Mar 2023 17:56:10 +0100 Subject: [PATCH 13/14] afmt --- mission/devices/ImtqHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/devices/ImtqHandler.cpp b/mission/devices/ImtqHandler.cpp index c3b14727..b95a09c0 100644 --- a/mission/devices/ImtqHandler.cpp +++ b/mission/devices/ImtqHandler.cpp @@ -395,7 +395,7 @@ LocalPoolDataSetBase* ImtqHandler::getDataSetHandle(sid_t sid) { } else if (sid == negZselfTestDataset.getSid()) { return &negZselfTestDataset; } else { - sif::error << "ImtqHandler::getDataSetHandle: Invalid SID"<< std::endl; + sif::error << "ImtqHandler::getDataSetHandle: Invalid SID" << std::endl; return nullptr; } } From 7288a5edbd0a1bc5b34184ff0135694653e198fb Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 Mar 2023 18:27:27 +0100 Subject: [PATCH 14/14] go to off immediately --- mission/devices/SusHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mission/devices/SusHandler.cpp b/mission/devices/SusHandler.cpp index 228ea082..886c7cec 100644 --- a/mission/devices/SusHandler.cpp +++ b/mission/devices/SusHandler.cpp @@ -37,7 +37,7 @@ void SusHandler::doShutDown() { updatePeriodicReply(false, REPLY); commandExecuted = false; internalState = InternalState::NONE; - setMode(_MODE_POWER_DOWN); + setMode(MODE_OFF); } }