eive-obsw/mission/system/TcsBoardAssembly.h
Robin Mueller 3e9910b1d2
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
tcs assembly working for now
2022-03-22 20:35:37 +01:00

54 lines
1.8 KiB
C++

#ifndef MISSION_SYSTEM_TCSSUBSYSTEM_H_
#define MISSION_SYSTEM_TCSSUBSYSTEM_H_
#include <fsfw/container/FixedArrayList.h>
#include <fsfw/devicehandlers/AssemblyBase.h>
#include <fsfw/power/PowerSwitcher.h>
struct TcsBoardHelper {
TcsBoardHelper(std::array<object_id_t, 16> rtdIds) : rtdIds(rtdIds) {}
std::array<object_id_t, 16> rtdIds = {};
};
class TcsBoardAssembly : public AssemblyBase, public ConfirmsFailuresIF {
public:
TcsBoardAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher,
power::Switch_t switcher, TcsBoardHelper helper);
ReturnValue_t initialize() override;
void performChildOperation() override;
private:
static constexpr uint8_t NUMBER_RTDS = 16;
PowerSwitcher switcher;
bool warningSwitch = true;
TcsBoardHelper helper;
FixedArrayList<ModeListEntry, NUMBER_RTDS> modeTable;
MessageQueueIF* eventQueue = nullptr;
ReturnValue_t handleNormalOrOnModeCmd(Mode_t mode, Submode_t submode);
/**
* 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);
// ConfirmFailureIF implementation
MessageQueueId_t getEventReceptionQueue() override;
// AssemblyBase implementation
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;
void startTransition(Mode_t mode, Submode_t submode) override;
void handleModeReached() override;
void handleChildrenLostMode(ReturnValue_t result) override;
void handleModeTransitionFailed(ReturnValue_t result) override;
};
#endif /* MISSION_SYSTEM_TCSSUBSYSTEM_H_ */