#ifndef MISSION_SYSTEM_SUSASSEMBLY_H_ #define MISSION_SYSTEM_SUSASSEMBLY_H_ #include struct SusAssHelper { public: SusAssHelper(std::array susIds) : susIds(susIds) {} std::array susIds = {objects::NO_OBJECT}; std::array susModes = {HasModesIF::MODE_OFF}; }; class PowerSwitchIF; class SusAssembly : AssemblyBase { public: static constexpr uint8_t NUMBER_SUN_SENSORS = 12; static constexpr Submode_t NOMINAL = 0; static constexpr Submode_t REDUNDANT = 1; static constexpr Submode_t DUAL_MODE = 2; SusAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher, SusAssHelper helper); private: enum class States { IDLE, SWITCHING_POWER, MODE_COMMANDING } state = States::IDLE; FixedArrayList modeTable; SusAssHelper helper; PowerSwitchIF* pwrSwitcher = nullptr; ReturnValue_t initialize() override; // AssemblyBase overrides ReturnValue_t commandChildren(Mode_t mode, Submode_t submode) override; ReturnValue_t checkChildrenStateOn(Mode_t wantedMode, Submode_t wantedSubmode) override; ReturnValue_t isModeCombinationValid(Mode_t mode, Submode_t submode) override; /** * Check whether it makes sense to send mode commands to the device * @param object * @param mode * @return */ bool isUseable(object_id_t object, Mode_t mode); void powerStateMachine(Mode_t mode, Submode_t submode); void refreshHelperModes(); }; #endif /* MISSION_SYSTEM_SUSASSEMBLY_H_ */