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

This commit is contained in:
Robin Müller 2022-04-28 16:05:01 +02:00
parent 40b84b0576
commit 5de45a7ae7
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -17,7 +17,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& entryHelper);
void buildTargetPtSequence(Subsystem* ss, ModeListEntry& entryHelper);
// Alias for checker function
const auto CHK = checkInsert;
const auto check = checkInsert;
static const auto OFF = HasModesIF::MODE_OFF;
static const auto NML = DeviceHandlerIF::MODE_NORMAL;
@ -93,7 +93,7 @@ void buildOffSequence(Subsystem* ss, ModeListEntry& eh) {
eh.setObject(obj);
eh.setMode(mode);
eh.setSubmode(submode);
CHK(table.insert(eh), ctxc);
check(table.insert(eh), ctxc);
};
// Insert Helper Sequence
auto ihs = [&](ArrayList<ModeListEntry>& sequence, Mode_t tableId, uint32_t waitSeconds,
@ -101,11 +101,11 @@ void buildOffSequence(Subsystem* ss, ModeListEntry& eh) {
eh.setTableId(tableId);
eh.setWaitSeconds(waitSeconds);
eh.setCheckSuccess(checkSuccess);
CHK(sequence.insert(eh), ctxc);
check(sequence.insert(eh), ctxc);
};
// OFF Target table is empty
CHK(ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc);
check(ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc);
// Build OFF transition
iht(objects::ACS_CONTROLLER, OFF, 0, ACS_TABLE_OFF_TRANS.second);
@ -114,12 +114,12 @@ void buildOffSequence(Subsystem* ss, ModeListEntry& eh) {
iht(objects::ACS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second);
iht(objects::SUS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second);
iht(objects::RW_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second);
CHK(ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true), ctxc);
check(ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true), ctxc);
// Build OFF sequence
ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TGT.first, 0, false);
ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TRANS.first, 0, false);
CHK(ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first,
check(ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first,
false, true),
ctxc);
}
@ -133,7 +133,7 @@ void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) {
eh.setObject(obj);
eh.setMode(mode);
eh.setSubmode(submode);
CHK(sequence.insert(eh), ctxc);
check(sequence.insert(eh), ctxc);
};
// Insert Helper Sequence
auto ihs = [&](ArrayList<ModeListEntry>& sequence, Mode_t tableId, uint32_t waitSeconds,
@ -141,14 +141,14 @@ void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) {
eh.setTableId(tableId);
eh.setWaitSeconds(waitSeconds);
eh.setCheckSuccess(checkSuccess);
CHK(sequence.insert(eh), ctxc);
check(sequence.insert(eh), ctxc);
};
// Build SAFE target
iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TGT.second);
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TGT.second);
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second);
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second);
CHK(ss->addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc);
check(ss->addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc);
// Build SAFE transition 0
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TRANS_0.second);
@ -156,19 +156,19 @@ void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) {
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TRANS_0.second);
iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second);
iht(objects::RW_ASS, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second);
CHK(ss->addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true),
check(ss->addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true),
ctxc);
// Build SAFE transition 1
iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TRANS_1.second);
CHK(ss->addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true),
check(ss->addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true),
ctxc);
// Build SAFE sequence
ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TGT.first, 0, true);
ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_0.first, 0, false);
ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_1.first, 0, false);
CHK(ss->addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_OFF.first,
check(ss->addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_OFF.first,
false, true),
ctxc);
}
@ -182,7 +182,7 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) {
eh.setObject(obj);
eh.setMode(mode);
eh.setSubmode(submode);
CHK(sequence.insert(eh), ctxc);
check(sequence.insert(eh), ctxc);
};
// Insert Helper Sequence
auto ihs = [&](ArrayList<ModeListEntry>& sequence, Mode_t tableId, uint32_t waitSeconds,
@ -190,14 +190,14 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) {
eh.setTableId(tableId);
eh.setWaitSeconds(waitSeconds);
eh.setCheckSuccess(checkSuccess);
CHK(sequence.insert(eh), ctxc);
check(sequence.insert(eh), ctxc);
};
// Build DETUMBLE target
iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TGT.second);
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TGT.second);
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second);
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second);
CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, false, true),
check(ss->addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, false, true),
ctxc);
// Build DETUMBLE transition 0
@ -206,13 +206,13 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) {
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second);
iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second);
iht(objects::RW_ASS, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second);
CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false,
check(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false,
true),
ctxc);
// Build DETUMBLE transition 1
iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second);
CHK(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false,
check(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false,
true),
ctxc);
@ -220,7 +220,7 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) {
ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TGT.first, 0, true);
ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_0.first, 0, false);
ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_1.first, 0, false);
CHK(ss->addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first,
check(ss->addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first,
ACS_SEQUENCE_SAFE.first, false, true),
ctxc);
}
@ -234,7 +234,7 @@ void buildIdleSequence(Subsystem* ss, ModeListEntry& eh) {
eh.setObject(obj);
eh.setMode(mode);
eh.setSubmode(submode);
CHK(sequence.insert(eh), ctxc);
check(sequence.insert(eh), ctxc);
};
// Insert Helper Sequence
auto ihs = [&](ArrayList<ModeListEntry>& sequence, Mode_t tableId, uint32_t waitSeconds,
@ -242,7 +242,7 @@ void buildIdleSequence(Subsystem* ss, ModeListEntry& eh) {
eh.setTableId(tableId);
eh.setWaitSeconds(waitSeconds);
eh.setCheckSuccess(checkSuccess);
CHK(sequence.insert(eh), ctxc);
check(sequence.insert(eh), ctxc);
};
// Build IDLE target
iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, 0, ACS_TABLE_IDLE_TGT.second);
@ -281,7 +281,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) {
eh.setObject(obj);
eh.setMode(mode);
eh.setSubmode(submode);
CHK(sequence.insert(eh), ctxc);
check(sequence.insert(eh), ctxc);
};
// Insert Helper Sequence
auto ihs = [&](ArrayList<ModeListEntry>& sequence, Mode_t tableId, uint32_t waitSeconds,
@ -289,7 +289,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) {
eh.setTableId(tableId);
eh.setWaitSeconds(waitSeconds);
eh.setCheckSuccess(checkSuccess);
CHK(sequence.insert(eh), ctxc);
check(sequence.insert(eh), ctxc);
};
// Build IDLE target
iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE,
@ -297,7 +297,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) {
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second);
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second);
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second);
CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TGT.second, ACS_TABLE_IDLE_CHRG_TGT.first, false, true),
check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TGT.second, ACS_TABLE_IDLE_CHRG_TGT.first, false, true),
ctxc);
// Build IDLE transition 0
@ -306,14 +306,14 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) {
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second);
iht(objects::RW_ASS, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second);
iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second);
CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_0.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, false,
check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_0.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, false,
true),
ctxc);
// Build IDLE transition 1
iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE,
ACS_TABLE_IDLE_CHRG_TRANS_1.second);
CHK(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_1.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, false,
check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_1.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, false,
true),
ctxc);
@ -321,7 +321,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) {
ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TGT.first, 0, true);
ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, 0, true);
ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, 0, false);
CHK(ss->addSequence(&ACS_SEQUENCE_IDLE_CHRG.second, ACS_SEQUENCE_IDLE_CHRG.first,
check(ss->addSequence(&ACS_SEQUENCE_IDLE_CHRG.second, ACS_SEQUENCE_IDLE_CHRG.first,
ACS_SEQUENCE_SAFE.first, false, true),
ctxc);
}
@ -335,7 +335,7 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) {
eh.setObject(obj);
eh.setMode(mode);
eh.setSubmode(submode);
CHK(sequence.insert(eh), ctxc);
check(sequence.insert(eh), ctxc);
};
// Insert Helper Sequence
auto ihs = [&](ArrayList<ModeListEntry>& sequence, Mode_t tableId, uint32_t waitSeconds,
@ -343,7 +343,7 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) {
eh.setTableId(tableId);
eh.setWaitSeconds(waitSeconds);
eh.setCheckSuccess(checkSuccess);
CHK(sequence.insert(eh), ctxc);
check(sequence.insert(eh), ctxc);
};
// Build TARGET PT table
@ -353,7 +353,7 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) {
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second);
iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second);
iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TGT.second);
CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TGT.second, ACS_TABLE_TARGET_PT_TGT.first, false, true),
check(ss->addTable(&ACS_TABLE_TARGET_PT_TGT.second, ACS_TABLE_TARGET_PT_TGT.first, false, true),
ctxc);
// Build TARGET PT transition 0
@ -362,13 +362,13 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) {
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second);
iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second);
iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second);
CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_0.second, ACS_TABLE_TARGET_PT_TRANS_0.first, false,
check(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_0.second, ACS_TABLE_TARGET_PT_TRANS_0.first, false,
true),
ctxc);
// Build TARGET PT transition 1
iht(objects::ACS_CONTROLLER, acs::CtrlModes::TARGET_PT, 0, ACS_TABLE_TARGET_PT_TRANS_1.second);
CHK(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_1.second, ACS_TABLE_TARGET_PT_TRANS_1.first, false,
check(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_1.second, ACS_TABLE_TARGET_PT_TRANS_1.first, false,
true),
ctxc);
@ -376,7 +376,7 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) {
ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TGT.first, 0, true);
ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_0.first, 0, true);
ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_1.first, 0, false);
CHK(ss->addSequence(&ACS_SEQUENCE_TARGET_PT.second, ACS_SEQUENCE_TARGET_PT.first,
check(ss->addSequence(&ACS_SEQUENCE_TARGET_PT.second, ACS_SEQUENCE_TARGET_PT.first,
ACS_SEQUENCE_IDLE.first, false, true),
ctxc);
}