add health handling
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
This commit is contained in:
parent
c4cd6332f8
commit
90175e5c9d
@ -19,7 +19,8 @@ class LocalParameterHandler : public NVMParameterBase {
|
|||||||
* @brief Constructor
|
* @brief Constructor
|
||||||
*
|
*
|
||||||
* @param sdRelativeName Absolute name of json file relative to mount
|
* @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
|
* @param sdcMan Pointer to SD card manager
|
||||||
*/
|
*/
|
||||||
LocalParameterHandler(std::string sdRelativeName, SdCardMountedIF* sdcMan);
|
LocalParameterHandler(std::string sdRelativeName, SdCardMountedIF* sdcMan);
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <eive/eventSubsystemIds.h>
|
#include <eive/eventSubsystemIds.h>
|
||||||
#include <eive/resultClassIds.h>
|
#include <eive/resultClassIds.h>
|
||||||
|
|
||||||
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
||||||
#include "fsfw/globalfunctions/PeriodicOperationDivider.h"
|
#include "fsfw/globalfunctions/PeriodicOperationDivider.h"
|
||||||
#include "mission/devices/devicedefinitions/acsPolling.h"
|
#include "mission/devices/devicedefinitions/acsPolling.h"
|
||||||
|
@ -10,6 +10,12 @@ ReturnValue_t SyrlinksAssembly::commandChildren(Mode_t mode, Submode_t submode)
|
|||||||
commandTable[0].setMode(mode);
|
commandTable[0].setMode(mode);
|
||||||
commandTable[0].setSubmode(submode);
|
commandTable[0].setSubmode(submode);
|
||||||
HybridIterator<ModeListEntry> iter(commandTable.begin(), commandTable.end());
|
HybridIterator<ModeListEntry> 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);
|
executeTable(iter);
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
@ -27,3 +33,15 @@ ReturnValue_t SyrlinksAssembly::isModeCombinationValid(Mode_t mode, Submode_t su
|
|||||||
}
|
}
|
||||||
return returnvalue::FAILED;
|
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;
|
||||||
|
}
|
||||||
|
@ -12,6 +12,8 @@ class SyrlinksAssembly : public AssemblyBase {
|
|||||||
ReturnValue_t commandChildren(Mode_t mode, Submode_t submode) override;
|
ReturnValue_t commandChildren(Mode_t mode, Submode_t submode) override;
|
||||||
ReturnValue_t checkChildrenStateOn(Mode_t wantedMode, Submode_t wantedSubmode) override;
|
ReturnValue_t checkChildrenStateOn(Mode_t wantedMode, Submode_t wantedSubmode) override;
|
||||||
ReturnValue_t isModeCombinationValid(Mode_t mode, Submode_t submode) 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_ */
|
#endif /* MISSION_SYSTEM_OBJECTS_SYRLINKSASSEMBLY_H_ */
|
||||||
|
Loading…
Reference in New Issue
Block a user