health handling for ACS brd assy
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2023-03-02 13:32:02 +01:00
parent 2e9de68e17
commit e52c909580
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
3 changed files with 31 additions and 0 deletions

View File

@ -280,3 +280,30 @@ ReturnValue_t AcsBoardAssembly::initialize() {
} }
return AssemblyBase::initialize(); return AssemblyBase::initialize();
} }
ReturnValue_t AcsBoardAssembly::checkAndHandleHealthState(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(objects::SYRLINKS_HANDLER, health);
status = NEED_TO_CHANGE_HEALTH;
} else if (health == EXTERNAL_CONTROL) {
modeHelper.setForced(true);
}
};
if(deviceSubmode == duallane::DUAL_MODE) {
overwriteHealthForOneDev(helper.mgm0Lis3IdSideA);
overwriteHealthForOneDev(helper.mgm1Rm3100IdSideA);
overwriteHealthForOneDev(helper.mgm2Lis3IdSideB);
overwriteHealthForOneDev(helper.mgm3Rm3100IdSideB);
overwriteHealthForOneDev(helper.gyro0AdisIdSideA);
overwriteHealthForOneDev(helper.gyro1L3gIdSideA);
overwriteHealthForOneDev(helper.gyro2AdisIdSideB);
overwriteHealthForOneDev(helper.gyro3L3gIdSideB);
overwriteHealthForOneDev(helper.gpsId);
}
return status;
}

View File

@ -121,6 +121,8 @@ class AcsBoardAssembly : public DualLaneAssemblyBase {
ReturnValue_t checkChildrenStateOn(Mode_t wantedMode, Submode_t wantedSubmode) override; ReturnValue_t checkChildrenStateOn(Mode_t wantedMode, Submode_t wantedSubmode) override;
ReturnValue_t handleNormalOrOnModeCmd(Mode_t mode, Submode_t submode); ReturnValue_t handleNormalOrOnModeCmd(Mode_t mode, Submode_t submode);
ReturnValue_t checkAndHandleHealthState(Mode_t deviceMode,
Submode_t deviceSubmode);
void refreshHelperModes(); void refreshHelperModes();
}; };

View File

@ -70,6 +70,8 @@ class DualLaneAssemblyBase : public AssemblyBase, public ConfirmsFailuresIF {
virtual void handleChildrenLostMode(ReturnValue_t result) override; virtual void handleChildrenLostMode(ReturnValue_t result) override;
virtual void handleModeTransitionFailed(ReturnValue_t result) override; virtual void handleModeTransitionFailed(ReturnValue_t result) override;
virtual void handleModeReached() override; virtual void handleModeReached() override;
ReturnValue_t checkAndHandleHealthState(Mode_t deviceMode,
Submode_t deviceSubmode);
MessageQueueId_t getEventReceptionQueue() override; MessageQueueId_t getEventReceptionQueue() override;