Health handling for ACS brd assy #415
@ -280,3 +280,30 @@ ReturnValue_t AcsBoardAssembly::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;
|
||||
}
|
||||
|
@ -121,6 +121,8 @@ class AcsBoardAssembly : public DualLaneAssemblyBase {
|
||||
ReturnValue_t checkChildrenStateOn(Mode_t wantedMode, Submode_t wantedSubmode) override;
|
||||
|
||||
ReturnValue_t handleNormalOrOnModeCmd(Mode_t mode, Submode_t submode);
|
||||
ReturnValue_t checkAndHandleHealthState(Mode_t deviceMode,
|
||||
Submode_t deviceSubmode);
|
||||
void refreshHelperModes();
|
||||
};
|
||||
|
||||
|
@ -70,6 +70,8 @@ class DualLaneAssemblyBase : public AssemblyBase, public ConfirmsFailuresIF {
|
||||
virtual void handleChildrenLostMode(ReturnValue_t result) override;
|
||||
virtual void handleModeTransitionFailed(ReturnValue_t result) override;
|
||||
virtual void handleModeReached() override;
|
||||
ReturnValue_t checkAndHandleHealthState(Mode_t deviceMode,
|
||||
Submode_t deviceSubmode);
|
||||
|
||||
MessageQueueId_t getEventReceptionQueue() override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user