add children lost mode event
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Robin Müller 2022-03-22 20:40:30 +01:00
parent 3e9910b1d2
commit 9c6f349a08
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
3 changed files with 12 additions and 3 deletions

View File

@ -22,6 +22,7 @@ enum: uint8_t {
PL_PCDU_HANDLER = 121,
ACS_BOARD_ASS = 122,
SUS_BOARD_ASS = 123,
TCS_BOARD_ASS = 124,
COMMON_SUBSYSTEM_ID_END
};
}

View File

@ -64,9 +64,9 @@ 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 == 16) {
if (devsInWrongMode >= 3) {
if (warningSwitch) {
sif::warning << "TcsBoardAssembly::checkChildrenStateOn: All devices in"
sif::warning << "TcsBoardAssembly::checkChildrenStateOn: " << devsInWrongMode << " devices in"
<< " wrong mode" << std::endl;
warningSwitch = false;
}
@ -191,7 +191,8 @@ void TcsBoardAssembly::handleModeReached() {
}
void TcsBoardAssembly::handleChildrenLostMode(ReturnValue_t result) {
// TODO: Maybe trigger event
// TODO: Maybe try a reboot once here?
triggerEvent(CHILDREN_LOST_MODE, result);
return;
}

View File

@ -13,6 +13,10 @@ struct TcsBoardHelper {
class TcsBoardAssembly : public AssemblyBase, public ConfirmsFailuresIF {
public:
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::TCS_BOARD_ASS;
static constexpr Event CHILDREN_LOST_MODE =
event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM);
TcsBoardAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher,
power::Switch_t switcher, TcsBoardHelper helper);
@ -46,6 +50,9 @@ class TcsBoardAssembly : public AssemblyBase, public ConfirmsFailuresIF {
ReturnValue_t isModeCombinationValid(Mode_t mode, Submode_t submode) override;
void startTransition(Mode_t mode, Submode_t submode) override;
void handleModeReached() override;
// These two overrides prevent a transition of the whole assembly back to off just because
// some devices are not working
void handleChildrenLostMode(ReturnValue_t result) override;
void handleModeTransitionFailed(ReturnValue_t result) override;
};