tricky
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2023-03-06 17:34:04 +01:00
parent cee56f6d02
commit 2ccd2a832c
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

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