Improve readability of SubsystemBase::executeTable #49

Merged
muellerr merged 2 commits from spahr/SubsystemBase into main 2025-02-19 11:26:37 +01:00
Member

The logic in SubsystemBase::executeTable handles the sending of mode commands to the respective children of some objects; and this functionality is (among other things) based on the health state of the respective child.
To determine the health state, the fsfw function ManagesHealthIF::isFaulty() was used, see here.

However, the name of this function is misleading, as it returns true if the health state is FAULTY or PERMANENT_FAULTY or NEEDS_RECOVERY.

This change aims to improve the readability of the code without modifying the function.

The logic in `SubsystemBase::executeTable` handles the sending of mode commands to the respective children of some objects; and this functionality is (among other things) based on the health state of the respective child. To determine the health state, the fsfw function `ManagesHealthIF::isFaulty()` was used, [see here](https://egit.irs.uni-stuttgart.de/KSat/fsfw/src/commit/735e341aabd6fa06c9cd4121f96b45a13ade6331/src/fsfw/health/ManagesHealthIF.h#L34). However, the name of this function is misleading, as it returns true if the health state is FAULTY or PERMANENT_FAULTY or NEEDS_RECOVERY. This change aims to improve the readability of the code **without** modifying the function.
mspahr added 1 commit 2025-02-16 17:29:38 +01:00
mspahr requested review from muellerr 2025-02-16 17:30:02 +01:00
Owner

good old switch case. Thanks for improving this, this was really confusing

good old switch case. Thanks for improving this, this was really confusing
Owner

can you rebase or merge?

can you rebase or merge?
muellerr added 1 commit 2025-02-19 11:26:28 +01:00
muellerr merged commit b8979d8f90 into main 2025-02-19 11:26:37 +01:00
muellerr deleted branch spahr/SubsystemBase 2025-02-19 11:26:38 +01:00
Sign in to join this conversation.
No description provided.