|
|
|
@ -10,7 +10,7 @@
|
|
|
|
|
#include "mission/acsDefs.h"
|
|
|
|
|
#include "util.h"
|
|
|
|
|
|
|
|
|
|
Subsystem satsystem::acs::ACS_SUBSYSTEM(objects::ACS_SUBSYSTEM, 12, 24);
|
|
|
|
|
AcsSubsystem satsystem::acs::ACS_SUBSYSTEM(objects::ACS_SUBSYSTEM, 12, 24);
|
|
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
// Alias for checker function
|
|
|
|
@ -20,17 +20,23 @@ void buildOffSequence(Subsystem& ss, ModeListEntry& eh);
|
|
|
|
|
void buildDetumbleSequence(Subsystem& ss, ModeListEntry& entryHelper);
|
|
|
|
|
void buildSafeSequence(Subsystem& ss, ModeListEntry& entryHelper);
|
|
|
|
|
void buildIdleSequence(Subsystem& ss, ModeListEntry& entryHelper);
|
|
|
|
|
void buildTargetPtNadirSequence(Subsystem& ss, ModeListEntry& eh);
|
|
|
|
|
void buildTargetPtSequence(Subsystem& ss, ModeListEntry& entryHelper);
|
|
|
|
|
void buildTargetPtGsSequence(Subsystem& ss, ModeListEntry& entryHelper);
|
|
|
|
|
void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& entryHelper);
|
|
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
|
|
static const auto OFF = HasModesIF::MODE_OFF;
|
|
|
|
|
static const auto NML = DeviceHandlerIF::MODE_NORMAL;
|
|
|
|
|
|
|
|
|
|
auto ACS_SEQUENCE_OFF = std::make_pair(acs::CtrlSubmode::OFF, FixedArrayList<ModeListEntry, 2>());
|
|
|
|
|
auto ACS_SEQUENCE_OFF = std::make_pair(acs::CtrlSubmode::OFF, FixedArrayList<ModeListEntry, 3>());
|
|
|
|
|
auto ACS_TABLE_OFF_TGT =
|
|
|
|
|
std::make_pair((acs::CtrlSubmode::OFF << 24) | 1, FixedArrayList<ModeListEntry, 1>());
|
|
|
|
|
auto ACS_TABLE_OFF_TRANS =
|
|
|
|
|
std::make_pair((acs::CtrlSubmode::OFF << 24) | 2, FixedArrayList<ModeListEntry, 6>());
|
|
|
|
|
auto ACS_TABLE_OFF_TRANS_0 =
|
|
|
|
|
std::make_pair((acs::CtrlSubmode::OFF << 24) | 2, FixedArrayList<ModeListEntry, 1>());
|
|
|
|
|
auto ACS_TABLE_OFF_TRANS_1 =
|
|
|
|
|
std::make_pair((acs::CtrlSubmode::OFF << 24) | 3, FixedArrayList<ModeListEntry, 6>());
|
|
|
|
|
|
|
|
|
|
auto ACS_SEQUENCE_DETUMBLE =
|
|
|
|
|
std::make_pair(acs::CtrlSubmode::DETUMBLE, FixedArrayList<ModeListEntry, 3>());
|
|
|
|
@ -57,22 +63,65 @@ auto ACS_TABLE_IDLE_TRANS_0 =
|
|
|
|
|
auto ACS_TABLE_IDLE_TRANS_1 =
|
|
|
|
|
std::make_pair((acs::CtrlSubmode::IDLE << 24) | 3, FixedArrayList<ModeListEntry, 2>());
|
|
|
|
|
|
|
|
|
|
auto ACS_TABLE_PTG_TRANS_0 =
|
|
|
|
|
std::make_pair((acs::CtrlSubmode::PTG_TARGET << 24) | 2, FixedArrayList<ModeListEntry, 5>());
|
|
|
|
|
|
|
|
|
|
auto ACS_SEQUENCE_PTG_TARGET =
|
|
|
|
|
std::make_pair(acs::CtrlSubmode::PTG_TARGET, FixedArrayList<ModeListEntry, 3>());
|
|
|
|
|
auto ACS_TABLE_PTG_TARGET_TGT =
|
|
|
|
|
std::make_pair((acs::CtrlSubmode::PTG_TARGET << 24) | 1, FixedArrayList<ModeListEntry, 6>());
|
|
|
|
|
auto ACS_TABLE_PTG_TARGET_TRANS_0 =
|
|
|
|
|
std::make_pair((acs::CtrlSubmode::PTG_TARGET << 24) | 2, FixedArrayList<ModeListEntry, 5>());
|
|
|
|
|
auto ACS_TABLE_PTG_TARGET_TRANS_1 =
|
|
|
|
|
std::make_pair((acs::CtrlSubmode::PTG_TARGET << 24) | 3, FixedArrayList<ModeListEntry, 1>());
|
|
|
|
|
|
|
|
|
|
auto ACS_SEQUENCE_PTG_TARGET_GS =
|
|
|
|
|
std::make_pair(acs::CtrlSubmode::PTG_TARGET_GS, FixedArrayList<ModeListEntry, 3>());
|
|
|
|
|
auto ACS_TABLE_PTG_TARGET_GS_TGT =
|
|
|
|
|
std::make_pair((acs::CtrlSubmode::PTG_TARGET_GS << 24) | 1, FixedArrayList<ModeListEntry, 6>());
|
|
|
|
|
auto ACS_TABLE_PTG_TARGET_GS_TRANS_1 =
|
|
|
|
|
std::make_pair((acs::CtrlSubmode::PTG_TARGET_GS << 24) | 3, FixedArrayList<ModeListEntry, 1>());
|
|
|
|
|
|
|
|
|
|
auto ACS_SEQUENCE_PTG_TARGET_NADIR =
|
|
|
|
|
std::make_pair(acs::CtrlSubmode::PTG_TARGET_NADIR, FixedArrayList<ModeListEntry, 3>());
|
|
|
|
|
auto ACS_TABLE_PTG_TARGET_NADIR_TGT = std::make_pair((acs::CtrlSubmode::PTG_TARGET_NADIR << 24) | 1,
|
|
|
|
|
FixedArrayList<ModeListEntry, 6>());
|
|
|
|
|
auto ACS_TABLE_PTG_TARGET_NADIR_TRANS_1 = std::make_pair(
|
|
|
|
|
(acs::CtrlSubmode::PTG_TARGET_NADIR << 24) | 3, FixedArrayList<ModeListEntry, 1>());
|
|
|
|
|
|
|
|
|
|
auto ACS_SEQUENCE_PTG_TARGET_INERTIAL =
|
|
|
|
|
std::make_pair(acs::CtrlSubmode::PTG_TARGET_INERTIAL, FixedArrayList<ModeListEntry, 3>());
|
|
|
|
|
auto ACS_TABLE_PTG_TARGET_INERTIAL_TGT = std::make_pair(
|
|
|
|
|
(acs::CtrlSubmode::PTG_TARGET_INERTIAL << 24) | 1, FixedArrayList<ModeListEntry, 6>());
|
|
|
|
|
auto ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1 = std::make_pair(
|
|
|
|
|
(acs::CtrlSubmode::PTG_TARGET_INERTIAL << 24) | 3, FixedArrayList<ModeListEntry, 1>());
|
|
|
|
|
|
|
|
|
|
void satsystem::acs::init() {
|
|
|
|
|
ModeListEntry entry;
|
|
|
|
|
const char* ctxc = "satsystem::acs::init: generic target";
|
|
|
|
|
// Insert Helper Table
|
|
|
|
|
auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, ArrayList<ModeListEntry>& table) {
|
|
|
|
|
entry.setObject(obj);
|
|
|
|
|
entry.setMode(mode);
|
|
|
|
|
entry.setSubmode(submode);
|
|
|
|
|
check(table.insert(entry), "satsystem::acs::init: generic target");
|
|
|
|
|
};
|
|
|
|
|
// Build TARGET PT transition 0
|
|
|
|
|
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TRANS_0.second);
|
|
|
|
|
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TRANS_0.second);
|
|
|
|
|
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TRANS_0.second);
|
|
|
|
|
iht(objects::RW_ASS, NML, 0, ACS_TABLE_PTG_TRANS_0.second);
|
|
|
|
|
iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TRANS_0.second);
|
|
|
|
|
check(ACS_SUBSYSTEM.addTable(
|
|
|
|
|
TableEntry(ACS_TABLE_PTG_TRANS_0.first, &ACS_TABLE_PTG_TRANS_0.second)),
|
|
|
|
|
ctxc);
|
|
|
|
|
|
|
|
|
|
buildOffSequence(ACS_SUBSYSTEM, entry);
|
|
|
|
|
buildSafeSequence(ACS_SUBSYSTEM, entry);
|
|
|
|
|
buildDetumbleSequence(ACS_SUBSYSTEM, entry);
|
|
|
|
|
buildIdleSequence(ACS_SUBSYSTEM, entry);
|
|
|
|
|
buildTargetPtSequence(ACS_SUBSYSTEM, entry);
|
|
|
|
|
buildTargetPtGsSequence(ACS_SUBSYSTEM, entry);
|
|
|
|
|
buildTargetPtNadirSequence(ACS_SUBSYSTEM, entry);
|
|
|
|
|
buildTargetPtInertialSequence(ACS_SUBSYSTEM, entry);
|
|
|
|
|
ACS_SUBSYSTEM.setInitialMode(::acs::CtrlSubmode::SAFE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -98,20 +147,24 @@ void buildOffSequence(Subsystem& ss, ModeListEntry& eh) {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// OFF Target table is empty
|
|
|
|
|
check(ss.addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc);
|
|
|
|
|
check(ss.addTable(TableEntry(ACS_TABLE_OFF_TGT.first, &ACS_TABLE_OFF_TGT.second)), ctxc);
|
|
|
|
|
|
|
|
|
|
// Build OFF transition
|
|
|
|
|
iht(objects::ACS_CONTROLLER, OFF, 0, ACS_TABLE_OFF_TRANS.second);
|
|
|
|
|
iht(objects::IMTQ_HANDLER, OFF, 0, ACS_TABLE_OFF_TRANS.second);
|
|
|
|
|
iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_OFF_TRANS.second);
|
|
|
|
|
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);
|
|
|
|
|
check(ss.addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true), ctxc);
|
|
|
|
|
// Build OFF transition 0
|
|
|
|
|
iht(objects::ACS_CONTROLLER, OFF, 0, ACS_TABLE_OFF_TRANS_0.second);
|
|
|
|
|
check(ss.addTable(TableEntry(ACS_TABLE_OFF_TRANS_0.first, &ACS_TABLE_OFF_TRANS_0.second)), ctxc);
|
|
|
|
|
|
|
|
|
|
// Build OFF transition 1
|
|
|
|
|
iht(objects::IMTQ_HANDLER, OFF, 0, ACS_TABLE_OFF_TRANS_1.second);
|
|
|
|
|
iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_OFF_TRANS_1.second);
|
|
|
|
|
iht(objects::ACS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS_1.second);
|
|
|
|
|
iht(objects::SUS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS_1.second);
|
|
|
|
|
iht(objects::RW_ASS, OFF, 0, ACS_TABLE_OFF_TRANS_1.second);
|
|
|
|
|
check(ss.addTable(TableEntry(ACS_TABLE_OFF_TRANS_1.first, &ACS_TABLE_OFF_TRANS_1.second)), 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);
|
|
|
|
|
ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TRANS_0.first, 0, false);
|
|
|
|
|
ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TRANS_1.first, 0, false);
|
|
|
|
|
check(ss.addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first,
|
|
|
|
|
false, true),
|
|
|
|
|
ctxc);
|
|
|
|
@ -137,7 +190,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) {
|
|
|
|
|
check(sequence.insert(eh), ctxc);
|
|
|
|
|
};
|
|
|
|
|
// Build SAFE target
|
|
|
|
|
iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::SAFE, 0, ACS_TABLE_SAFE_TGT.second);
|
|
|
|
|
iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::SAFE, 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);
|
|
|
|
@ -153,7 +206,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) {
|
|
|
|
|
ctxc);
|
|
|
|
|
|
|
|
|
|
// Build SAFE transition 1
|
|
|
|
|
iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::SAFE, 0, ACS_TABLE_SAFE_TRANS_1.second);
|
|
|
|
|
iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::SAFE, ACS_TABLE_SAFE_TRANS_1.second);
|
|
|
|
|
check(ss.addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true),
|
|
|
|
|
ctxc);
|
|
|
|
|
|
|
|
|
@ -186,7 +239,7 @@ void buildDetumbleSequence(Subsystem& ss, ModeListEntry& eh) {
|
|
|
|
|
check(sequence.insert(eh), ctxc);
|
|
|
|
|
};
|
|
|
|
|
// Build DETUMBLE target
|
|
|
|
|
iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TGT.second);
|
|
|
|
|
iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::DETUMBLE, 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);
|
|
|
|
@ -204,7 +257,7 @@ void buildDetumbleSequence(Subsystem& ss, ModeListEntry& eh) {
|
|
|
|
|
ctxc);
|
|
|
|
|
|
|
|
|
|
// Build DETUMBLE transition 1
|
|
|
|
|
iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second);
|
|
|
|
|
iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::DETUMBLE, ACS_TABLE_DETUMBLE_TRANS_1.second);
|
|
|
|
|
check(ss.addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false,
|
|
|
|
|
true),
|
|
|
|
|
ctxc);
|
|
|
|
@ -238,7 +291,7 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) {
|
|
|
|
|
check(sequence.insert(eh), ctxc);
|
|
|
|
|
};
|
|
|
|
|
// Build IDLE target
|
|
|
|
|
iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::IDLE, 0, ACS_TABLE_IDLE_TGT.second);
|
|
|
|
|
iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::IDLE, ACS_TABLE_IDLE_TGT.second);
|
|
|
|
|
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_TGT.second);
|
|
|
|
|
iht(objects::RW_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second);
|
|
|
|
|
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second);
|
|
|
|
@ -254,13 +307,13 @@ void buildIdleSequence(Subsystem& ss, ModeListEntry& eh) {
|
|
|
|
|
ss.addTable(&ACS_TABLE_IDLE_TRANS_0.second, ACS_TABLE_IDLE_TRANS_0.first, false, true);
|
|
|
|
|
|
|
|
|
|
// Build IDLE transition 1
|
|
|
|
|
iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::IDLE, 0, ACS_TABLE_IDLE_TRANS_1.second);
|
|
|
|
|
iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::IDLE, ACS_TABLE_IDLE_TRANS_1.second);
|
|
|
|
|
ss.addTable(&ACS_TABLE_IDLE_TRANS_1.second, ACS_TABLE_IDLE_TRANS_1.first, false, true);
|
|
|
|
|
|
|
|
|
|
// Build IDLE sequence
|
|
|
|
|
ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TGT.first, 0, true);
|
|
|
|
|
ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TRANS_0.first, 0, true);
|
|
|
|
|
ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TRANS_1.first, 0, false);
|
|
|
|
|
ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TRANS_1.first, 0, true);
|
|
|
|
|
ss.addSequence(&ACS_SEQUENCE_IDLE.second, ACS_SEQUENCE_IDLE.first, ACS_SEQUENCE_SAFE.first, false,
|
|
|
|
|
true);
|
|
|
|
|
}
|
|
|
|
@ -286,7 +339,7 @@ void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Build TARGET PT table
|
|
|
|
|
iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::PTG_TARGET, 0, ACS_TABLE_PTG_TARGET_TGT.second);
|
|
|
|
|
iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET, ACS_TABLE_PTG_TARGET_TGT.second);
|
|
|
|
|
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second);
|
|
|
|
|
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second);
|
|
|
|
|
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TGT.second);
|
|
|
|
@ -295,18 +348,9 @@ void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) {
|
|
|
|
|
check(ss.addTable(&ACS_TABLE_PTG_TARGET_TGT.second, ACS_TABLE_PTG_TARGET_TGT.first, false, true),
|
|
|
|
|
ctxc);
|
|
|
|
|
|
|
|
|
|
// Build TARGET PT transition 0
|
|
|
|
|
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_TRANS_0.second);
|
|
|
|
|
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TRANS_0.second);
|
|
|
|
|
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TRANS_0.second);
|
|
|
|
|
iht(objects::RW_ASS, NML, 0, ACS_TABLE_PTG_TARGET_TRANS_0.second);
|
|
|
|
|
iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TARGET_TRANS_0.second);
|
|
|
|
|
check(ss.addTable(&ACS_TABLE_PTG_TARGET_TRANS_0.second, ACS_TABLE_PTG_TARGET_TRANS_0.first, false,
|
|
|
|
|
true),
|
|
|
|
|
ctxc);
|
|
|
|
|
|
|
|
|
|
// Transition 0 already built
|
|
|
|
|
// Build TARGET PT transition 1
|
|
|
|
|
iht(objects::ACS_CONTROLLER, acs::CtrlSubmode::PTG_TARGET, 0,
|
|
|
|
|
iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET,
|
|
|
|
|
ACS_TABLE_PTG_TARGET_TRANS_1.second);
|
|
|
|
|
check(ss.addTable(&ACS_TABLE_PTG_TARGET_TRANS_1.second, ACS_TABLE_PTG_TARGET_TRANS_1.first, false,
|
|
|
|
|
true),
|
|
|
|
@ -314,11 +358,161 @@ void buildTargetPtSequence(Subsystem& ss, ModeListEntry& eh) {
|
|
|
|
|
|
|
|
|
|
// Build IDLE sequence
|
|
|
|
|
ihs(ACS_SEQUENCE_PTG_TARGET.second, ACS_TABLE_PTG_TARGET_TGT.first, 0, true);
|
|
|
|
|
ihs(ACS_SEQUENCE_PTG_TARGET.second, ACS_TABLE_PTG_TARGET_TRANS_0.first, 0, true);
|
|
|
|
|
ihs(ACS_SEQUENCE_PTG_TARGET.second, ACS_TABLE_PTG_TARGET_TRANS_1.first, 0, false);
|
|
|
|
|
ihs(ACS_SEQUENCE_PTG_TARGET.second, ACS_TABLE_PTG_TRANS_0.first, 0, true);
|
|
|
|
|
ihs(ACS_SEQUENCE_PTG_TARGET.second, ACS_TABLE_PTG_TARGET_TRANS_1.first, 0, true);
|
|
|
|
|
check(ss.addSequence(&ACS_SEQUENCE_PTG_TARGET.second, ACS_SEQUENCE_PTG_TARGET.first,
|
|
|
|
|
ACS_SEQUENCE_IDLE.first, false, true),
|
|
|
|
|
ctxc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void buildTargetPtNadirSequence(Subsystem& ss, ModeListEntry& eh) {
|
|
|
|
|
std::string context = "satsystem::acs::buildTargetPtNadirSequence";
|
|
|
|
|
auto ctxc = context.c_str();
|
|
|
|
|
// Insert Helper Table
|
|
|
|
|
auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode,
|
|
|
|
|
ArrayList<ModeListEntry>& sequence) {
|
|
|
|
|
eh.setObject(obj);
|
|
|
|
|
eh.setMode(mode);
|
|
|
|
|
eh.setSubmode(submode);
|
|
|
|
|
check(sequence.insert(eh), ctxc);
|
|
|
|
|
};
|
|
|
|
|
// Insert Helper Sequence
|
|
|
|
|
auto ihs = [&](ArrayList<ModeListEntry>& sequence, Mode_t tableId, uint32_t waitSeconds,
|
|
|
|
|
bool checkSuccess) {
|
|
|
|
|
eh.setTableId(tableId);
|
|
|
|
|
eh.setWaitSeconds(waitSeconds);
|
|
|
|
|
eh.setCheckSuccess(checkSuccess);
|
|
|
|
|
check(sequence.insert(eh), ctxc);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Build TARGET PT table
|
|
|
|
|
iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET,
|
|
|
|
|
ACS_TABLE_PTG_TARGET_NADIR_TGT.second);
|
|
|
|
|
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second);
|
|
|
|
|
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second);
|
|
|
|
|
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second);
|
|
|
|
|
iht(objects::RW_ASS, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second);
|
|
|
|
|
iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TARGET_NADIR_TGT.second);
|
|
|
|
|
check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_NADIR_TGT.first,
|
|
|
|
|
&ACS_TABLE_PTG_TARGET_NADIR_TGT.second)),
|
|
|
|
|
ctxc);
|
|
|
|
|
|
|
|
|
|
// Transition 0 already built
|
|
|
|
|
// Build TARGET PT transition 1
|
|
|
|
|
iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_NADIR,
|
|
|
|
|
ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.second);
|
|
|
|
|
check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.first,
|
|
|
|
|
&ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.second)),
|
|
|
|
|
ctxc);
|
|
|
|
|
|
|
|
|
|
// Build IDLE sequence
|
|
|
|
|
ihs(ACS_SEQUENCE_PTG_TARGET_NADIR.second, ACS_TABLE_PTG_TARGET_NADIR_TGT.first, 0, true);
|
|
|
|
|
ihs(ACS_SEQUENCE_PTG_TARGET_NADIR.second, ACS_TABLE_PTG_TRANS_0.first, 0, true);
|
|
|
|
|
ihs(ACS_SEQUENCE_PTG_TARGET_NADIR.second, ACS_TABLE_PTG_TARGET_NADIR_TRANS_1.first, 0, true);
|
|
|
|
|
check(
|
|
|
|
|
ss.addSequence(SequenceEntry(ACS_SEQUENCE_PTG_TARGET_NADIR.first,
|
|
|
|
|
&ACS_SEQUENCE_PTG_TARGET_NADIR.second, ACS_SEQUENCE_IDLE.first)),
|
|
|
|
|
ctxc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void buildTargetPtGsSequence(Subsystem& ss, ModeListEntry& eh) {
|
|
|
|
|
std::string context = "satsystem::acs::buildTargetPtGsSequence";
|
|
|
|
|
auto ctxc = context.c_str();
|
|
|
|
|
// Insert Helper Table
|
|
|
|
|
auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode,
|
|
|
|
|
ArrayList<ModeListEntry>& sequence) {
|
|
|
|
|
eh.setObject(obj);
|
|
|
|
|
eh.setMode(mode);
|
|
|
|
|
eh.setSubmode(submode);
|
|
|
|
|
check(sequence.insert(eh), ctxc);
|
|
|
|
|
};
|
|
|
|
|
// Insert Helper Sequence
|
|
|
|
|
auto ihs = [&](ArrayList<ModeListEntry>& sequence, Mode_t tableId, uint32_t waitSeconds,
|
|
|
|
|
bool checkSuccess) {
|
|
|
|
|
eh.setTableId(tableId);
|
|
|
|
|
eh.setWaitSeconds(waitSeconds);
|
|
|
|
|
eh.setCheckSuccess(checkSuccess);
|
|
|
|
|
check(sequence.insert(eh), ctxc);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Build TARGET PT table
|
|
|
|
|
iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_GS,
|
|
|
|
|
ACS_TABLE_PTG_TARGET_GS_TGT.second);
|
|
|
|
|
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second);
|
|
|
|
|
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second);
|
|
|
|
|
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second);
|
|
|
|
|
iht(objects::RW_ASS, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second);
|
|
|
|
|
iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TARGET_GS_TGT.second);
|
|
|
|
|
check(ss.addTable(
|
|
|
|
|
TableEntry(ACS_TABLE_PTG_TARGET_GS_TGT.first, &ACS_TABLE_PTG_TARGET_GS_TGT.second)),
|
|
|
|
|
ctxc);
|
|
|
|
|
|
|
|
|
|
// Transition 0 already built
|
|
|
|
|
// Build TARGET PT transition 1
|
|
|
|
|
iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_GS,
|
|
|
|
|
ACS_TABLE_PTG_TARGET_GS_TRANS_1.second);
|
|
|
|
|
check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_GS_TRANS_1.first,
|
|
|
|
|
&ACS_TABLE_PTG_TARGET_GS_TRANS_1.second)),
|
|
|
|
|
ctxc);
|
|
|
|
|
|
|
|
|
|
// Build IDLE sequence
|
|
|
|
|
ihs(ACS_SEQUENCE_PTG_TARGET_GS.second, ACS_TABLE_PTG_TARGET_GS_TGT.first, 0, true);
|
|
|
|
|
ihs(ACS_SEQUENCE_PTG_TARGET_GS.second, ACS_TABLE_PTG_TRANS_0.first, 0, true);
|
|
|
|
|
ihs(ACS_SEQUENCE_PTG_TARGET_GS.second, ACS_TABLE_PTG_TARGET_GS_TRANS_1.first, 0, true);
|
|
|
|
|
check(ss.addSequence(SequenceEntry(ACS_SEQUENCE_PTG_TARGET_GS.first,
|
|
|
|
|
&ACS_SEQUENCE_PTG_TARGET_GS.second, ACS_SEQUENCE_IDLE.first)),
|
|
|
|
|
ctxc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void buildTargetPtInertialSequence(Subsystem& ss, ModeListEntry& eh) {
|
|
|
|
|
std::string context = "satsystem::acs::buildTargetPtInertialSequence";
|
|
|
|
|
auto ctxc = context.c_str();
|
|
|
|
|
// Insert Helper Table
|
|
|
|
|
auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode,
|
|
|
|
|
ArrayList<ModeListEntry>& sequence) {
|
|
|
|
|
eh.setObject(obj);
|
|
|
|
|
eh.setMode(mode);
|
|
|
|
|
eh.setSubmode(submode);
|
|
|
|
|
check(sequence.insert(eh), ctxc);
|
|
|
|
|
};
|
|
|
|
|
// Insert Helper Sequence
|
|
|
|
|
auto ihs = [&](ArrayList<ModeListEntry>& sequence, Mode_t tableId, uint32_t waitSeconds,
|
|
|
|
|
bool checkSuccess) {
|
|
|
|
|
eh.setTableId(tableId);
|
|
|
|
|
eh.setWaitSeconds(waitSeconds);
|
|
|
|
|
eh.setCheckSuccess(checkSuccess);
|
|
|
|
|
check(sequence.insert(eh), ctxc);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Build TARGET PT table
|
|
|
|
|
iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_INERTIAL,
|
|
|
|
|
ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second);
|
|
|
|
|
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second);
|
|
|
|
|
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second);
|
|
|
|
|
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second);
|
|
|
|
|
iht(objects::RW_ASS, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second);
|
|
|
|
|
iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second);
|
|
|
|
|
check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_INERTIAL_TGT.first,
|
|
|
|
|
&ACS_TABLE_PTG_TARGET_INERTIAL_TGT.second)),
|
|
|
|
|
ctxc);
|
|
|
|
|
|
|
|
|
|
// Transition 0 already built
|
|
|
|
|
// Build TARGET PT transition 1
|
|
|
|
|
iht(objects::ACS_CONTROLLER, NML, acs::CtrlSubmode::PTG_TARGET_INERTIAL,
|
|
|
|
|
ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.second);
|
|
|
|
|
check(ss.addTable(TableEntry(ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.first,
|
|
|
|
|
&ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.second)),
|
|
|
|
|
ctxc);
|
|
|
|
|
|
|
|
|
|
// Build IDLE sequence
|
|
|
|
|
ihs(ACS_SEQUENCE_PTG_TARGET_INERTIAL.second, ACS_TABLE_PTG_TARGET_INERTIAL_TGT.first, 0, true);
|
|
|
|
|
ihs(ACS_SEQUENCE_PTG_TARGET_INERTIAL.second, ACS_TABLE_PTG_TRANS_0.first, 0, true);
|
|
|
|
|
ihs(ACS_SEQUENCE_PTG_TARGET_INERTIAL.second, ACS_TABLE_PTG_TARGET_INERTIAL_TRANS_1.first, 0,
|
|
|
|
|
true);
|
|
|
|
|
check(ss.addSequence(SequenceEntry(ACS_SEQUENCE_PTG_TARGET_INERTIAL.first,
|
|
|
|
|
&ACS_SEQUENCE_PTG_TARGET_INERTIAL.second,
|
|
|
|
|
ACS_SEQUENCE_IDLE.first)),
|
|
|
|
|
ctxc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|