From 01081cbb29849d450afd0260b8ed4185557c3c7d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 4 Apr 2023 14:45:09 +0200 Subject: [PATCH 1/5] set health overrides --- CHANGELOG.md | 6 ++++++ mission/power/GomspaceDeviceHandler.cpp | 8 ++++++++ mission/power/GomspaceDeviceHandler.h | 3 +++ mission/tcs/Tmp1075Handler.cpp | 8 ++++++++ mission/tcs/Tmp1075Handler.h | 1 + 5 files changed, 26 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 206b2fff..4b0832b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,12 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Changed + +- PCDU components only allow setting `NEEDS_RECOVERY`, `HEALTHY` and `EXTERNAL_CONTROL` health + states now. TMP sensor components only allow `HEALTHY` , `EXTERNAL_CONTROL`, `FAULTY` and + `PERMANENT_FAULTY`. + # [v1.43.0] 2023-04-04 - q7s-package: v2.4.0 diff --git a/mission/power/GomspaceDeviceHandler.cpp b/mission/power/GomspaceDeviceHandler.cpp index 3bed8d73..80caba0c 100644 --- a/mission/power/GomspaceDeviceHandler.cpp +++ b/mission/power/GomspaceDeviceHandler.cpp @@ -642,3 +642,11 @@ ReturnValue_t GomspaceDeviceHandler::parsePduHkTable(PDU::PduCoreHk& coreHk, PDU } return returnvalue::OK; } + +ReturnValue_t GomspaceDeviceHandler::setHealth(HealthState health) { + if(health != HealthState::HEALTHY and health != HealthState::EXTERNAL_CONTROL and + health != HealthState::NEEDS_RECOVERY) { + return returnvalue::FAILED; + } + return returnvalue::OK; +} diff --git a/mission/power/GomspaceDeviceHandler.h b/mission/power/GomspaceDeviceHandler.h index c1db9044..758cc5a3 100644 --- a/mission/power/GomspaceDeviceHandler.h +++ b/mission/power/GomspaceDeviceHandler.h @@ -80,6 +80,9 @@ class GomspaceDeviceHandler : public DeviceHandlerBase { ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override; void setNormalDatapoolEntriesInvalid() override; uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; + + ReturnValue_t setHealth(HealthState health) override; + /** * @brief The command to generate a request to receive the full housekeeping table is device * specific. Thus the child has to build this command. diff --git a/mission/tcs/Tmp1075Handler.cpp b/mission/tcs/Tmp1075Handler.cpp index d1f144f0..92ac8a5c 100644 --- a/mission/tcs/Tmp1075Handler.cpp +++ b/mission/tcs/Tmp1075Handler.cpp @@ -132,3 +132,11 @@ ReturnValue_t Tmp1075Handler::initializeLocalDataPool(localpool::DataPool &local } void Tmp1075Handler::setModeNormal() { setMode(_MODE_TO_NORMAL); } + +ReturnValue_t Tmp1075Handler::setHealth(HealthState health) { + if(health != FAULTY and health != PERMANENT_FAULTY and health != HEALTHY and + health != EXTERNAL_CONTROL) { + return returnvalue::FAILED; + } + return returnvalue::OK; +} diff --git a/mission/tcs/Tmp1075Handler.h b/mission/tcs/Tmp1075Handler.h index 8d039446..02fd6823 100644 --- a/mission/tcs/Tmp1075Handler.h +++ b/mission/tcs/Tmp1075Handler.h @@ -37,6 +37,7 @@ class Tmp1075Handler : public DeviceHandlerBase { uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) override; + ReturnValue_t setHealth(HealthState health) override; private: /** From ae0413f7f6b3139858445248b994b4586d9f4889 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 4 Apr 2023 14:52:22 +0200 Subject: [PATCH 2/5] clean up code structure a bit --- mission/power/GomspaceDeviceHandler.cpp | 2 +- mission/system/acs/CMakeLists.txt | 3 ++- mission/system/{fdir => acs}/StrFdir.cpp | 0 mission/system/{fdir => acs}/StrFdir.h | 0 mission/system/fdir/CMakeLists.txt | 3 +-- mission/system/power/CMakeLists.txt | 2 ++ mission/system/{fdir => power}/GomspacePowerFdir.cpp | 0 mission/system/{fdir => power}/GomspacePowerFdir.h | 0 mission/tcs/Tmp1075Handler.cpp | 2 +- 9 files changed, 7 insertions(+), 5 deletions(-) rename mission/system/{fdir => acs}/StrFdir.cpp (100%) rename mission/system/{fdir => acs}/StrFdir.h (100%) create mode 100644 mission/system/power/CMakeLists.txt rename mission/system/{fdir => power}/GomspacePowerFdir.cpp (100%) rename mission/system/{fdir => power}/GomspacePowerFdir.h (100%) diff --git a/mission/power/GomspaceDeviceHandler.cpp b/mission/power/GomspaceDeviceHandler.cpp index 80caba0c..89fca8ee 100644 --- a/mission/power/GomspaceDeviceHandler.cpp +++ b/mission/power/GomspaceDeviceHandler.cpp @@ -644,7 +644,7 @@ ReturnValue_t GomspaceDeviceHandler::parsePduHkTable(PDU::PduCoreHk& coreHk, PDU } ReturnValue_t GomspaceDeviceHandler::setHealth(HealthState health) { - if(health != HealthState::HEALTHY and health != HealthState::EXTERNAL_CONTROL and + if (health != HealthState::HEALTHY and health != HealthState::EXTERNAL_CONTROL and health != HealthState::NEEDS_RECOVERY) { return returnvalue::FAILED; } diff --git a/mission/system/acs/CMakeLists.txt b/mission/system/acs/CMakeLists.txt index e5ef2cb8..b7f927a0 100644 --- a/mission/system/acs/CMakeLists.txt +++ b/mission/system/acs/CMakeLists.txt @@ -9,4 +9,5 @@ target_sources( SusAssembly.cpp AcsBoardFdir.cpp acsModeTree.cpp - SusFdir.cpp) + SusFdir.cpp + StrFdir.cpp) diff --git a/mission/system/fdir/StrFdir.cpp b/mission/system/acs/StrFdir.cpp similarity index 100% rename from mission/system/fdir/StrFdir.cpp rename to mission/system/acs/StrFdir.cpp diff --git a/mission/system/fdir/StrFdir.h b/mission/system/acs/StrFdir.h similarity index 100% rename from mission/system/fdir/StrFdir.h rename to mission/system/acs/StrFdir.h diff --git a/mission/system/fdir/CMakeLists.txt b/mission/system/fdir/CMakeLists.txt index fb737a3f..3f0baf01 100644 --- a/mission/system/fdir/CMakeLists.txt +++ b/mission/system/fdir/CMakeLists.txt @@ -1,2 +1 @@ -target_sources(${LIB_EIVE_MISSION} PRIVATE RtdFdir.cpp StrFdir.cpp - GomspacePowerFdir.cpp) +target_sources(${LIB_EIVE_MISSION} PRIVATE RtdFdir.cpp) diff --git a/mission/system/power/CMakeLists.txt b/mission/system/power/CMakeLists.txt new file mode 100644 index 00000000..fb737a3f --- /dev/null +++ b/mission/system/power/CMakeLists.txt @@ -0,0 +1,2 @@ +target_sources(${LIB_EIVE_MISSION} PRIVATE RtdFdir.cpp StrFdir.cpp + GomspacePowerFdir.cpp) diff --git a/mission/system/fdir/GomspacePowerFdir.cpp b/mission/system/power/GomspacePowerFdir.cpp similarity index 100% rename from mission/system/fdir/GomspacePowerFdir.cpp rename to mission/system/power/GomspacePowerFdir.cpp diff --git a/mission/system/fdir/GomspacePowerFdir.h b/mission/system/power/GomspacePowerFdir.h similarity index 100% rename from mission/system/fdir/GomspacePowerFdir.h rename to mission/system/power/GomspacePowerFdir.h diff --git a/mission/tcs/Tmp1075Handler.cpp b/mission/tcs/Tmp1075Handler.cpp index 92ac8a5c..df57aa8a 100644 --- a/mission/tcs/Tmp1075Handler.cpp +++ b/mission/tcs/Tmp1075Handler.cpp @@ -134,7 +134,7 @@ ReturnValue_t Tmp1075Handler::initializeLocalDataPool(localpool::DataPool &local void Tmp1075Handler::setModeNormal() { setMode(_MODE_TO_NORMAL); } ReturnValue_t Tmp1075Handler::setHealth(HealthState health) { - if(health != FAULTY and health != PERMANENT_FAULTY and health != HEALTHY and + if (health != FAULTY and health != PERMANENT_FAULTY and health != HEALTHY and health != EXTERNAL_CONTROL) { return returnvalue::FAILED; } From f39981decaa9fcee6a0b2039b71b52fb509b733f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 4 Apr 2023 17:55:57 +0200 Subject: [PATCH 3/5] include fix --- bsp_q7s/core/ObjectFactory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 8da0e6ec..e65df524 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include From c4516f53b8b51385aaf7d3f0d1140aa63848951e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 4 Apr 2023 17:57:07 +0200 Subject: [PATCH 4/5] another include fix --- bsp_q7s/core/ObjectFactory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index e65df524..3f29de5e 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -62,7 +62,7 @@ #include "mission/system/acs/acsModeTree.h" #include "mission/system/com/SyrlinksFdir.h" #include "mission/system/com/comModeTree.h" -#include "mission/system/fdir/GomspacePowerFdir.h" +#include "mission/system/power/GomspacePowerFdir.h" #include "mission/system/fdir/RtdFdir.h" #include "mission/system/objects/TcsBoardAssembly.h" #include "mission/system/tree/payloadModeTree.h" From 3cc48a4cea0313f6a1c4ddf570a0f6d6646400c7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 4 Apr 2023 18:21:30 +0200 Subject: [PATCH 5/5] annoying --- fsfw | 2 +- mission/system/CMakeLists.txt | 1 + mission/system/power/CMakeLists.txt | 3 +-- tmtc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fsfw b/fsfw index 9fca7581..6650c293 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 9fca7581dd75d074df343802c922e48f95b677eb +Subproject commit 6650c293da09d8851c2bd6c4d6e6c5a8390d003e diff --git a/mission/system/CMakeLists.txt b/mission/system/CMakeLists.txt index f278bbc9..44122d7e 100644 --- a/mission/system/CMakeLists.txt +++ b/mission/system/CMakeLists.txt @@ -3,5 +3,6 @@ add_subdirectory(tree) add_subdirectory(acs) add_subdirectory(com) add_subdirectory(fdir) +add_subdirectory(power) target_sources(${LIB_EIVE_MISSION} PRIVATE DualLanePowerStateMachine.cpp) diff --git a/mission/system/power/CMakeLists.txt b/mission/system/power/CMakeLists.txt index fb737a3f..8fa4967e 100644 --- a/mission/system/power/CMakeLists.txt +++ b/mission/system/power/CMakeLists.txt @@ -1,2 +1 @@ -target_sources(${LIB_EIVE_MISSION} PRIVATE RtdFdir.cpp StrFdir.cpp - GomspacePowerFdir.cpp) +target_sources(${LIB_EIVE_MISSION} PRIVATE GomspacePowerFdir.cpp) diff --git a/tmtc b/tmtc index 6975fae5..50668ca7 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 6975fae511ca7b2fdef70858f8715908f300f434 +Subproject commit 50668ca7a74edd4219456e393cd10f7858591130