This commit is contained in:
parent
cee56f6d02
commit
2ccd2a832c
@ -68,10 +68,10 @@ ReturnValue_t TcsBoardAssembly::checkChildrenStateOn(Mode_t wantedMode, Submode_
|
||||
} catch (const std::out_of_range& e) {
|
||||
sif::error << "TcsBoardAssembly: Invalid children map: " << e.what() << std::endl;
|
||||
}
|
||||
if (devsInWrongMode >= 3) {
|
||||
if (devsInWrongMode == NUMBER_RTDS) {
|
||||
if (warningSwitch) {
|
||||
sif::warning << "TcsBoardAssembly::checkChildrenStateOn: " << devsInWrongMode << " devices in"
|
||||
<< " wrong mode" << std::endl;
|
||||
sif::warning << "TcsBoardAssembly::checkChildrenStateOn: All devices in wrong mode"
|
||||
<< std::endl;
|
||||
warningSwitch = false;
|
||||
}
|
||||
return NOT_ENOUGH_CHILDREN_IN_CORRECT_STATE;
|
||||
@ -193,19 +193,22 @@ void TcsBoardAssembly::handleChildrenLostMode(ReturnValue_t result) {
|
||||
ReturnValue_t TcsBoardAssembly::checkAndHandleHealthStates(Mode_t deviceMode,
|
||||
Submode_t deviceSubmode) {
|
||||
ReturnValue_t status = returnvalue::OK;
|
||||
auto overwriteHealthForOneDev = [&](object_id_t dev) {
|
||||
HealthState health = healthHelper.healthTable->getHealth(dev);
|
||||
for (const auto& dev : helper.rtdInfos) {
|
||||
HealthState health = healthHelper.healthTable->getHealth(dev.first);
|
||||
if (health == HealthState::HEALTHY) {
|
||||
return returnvalue::OK;
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& dev : helper.rtdInfos) {
|
||||
HealthState health = healthHelper.healthTable->getHealth(dev.first);
|
||||
if (health == FAULTY or health == PERMANENT_FAULTY) {
|
||||
overwriteDeviceHealth(dev, health);
|
||||
status = NEED_TO_CHANGE_HEALTH;
|
||||
} else if (health == EXTERNAL_CONTROL) {
|
||||
modeHelper.setForced(true);
|
||||
}
|
||||
};
|
||||
for (const auto& dev : helper.rtdInfos) {
|
||||
overwriteHealthForOneDev(dev.first);
|
||||
}
|
||||
return returnvalue::OK;
|
||||
return status;
|
||||
}
|
||||
|
||||
void TcsBoardAssembly::handleModeTransitionFailed(ReturnValue_t result) {
|
||||
|
Loading…
Reference in New Issue
Block a user