eive-obsw/mission/system/TcsBoardAssembly.h

51 lines
1.6 KiB
C
Raw Normal View History

#ifndef MISSION_SYSTEM_TCSSUBSYSTEM_H_
#define MISSION_SYSTEM_TCSSUBSYSTEM_H_
2022-03-22 15:49:22 +01:00
#include <fsfw/container/FixedArrayList.h>
2022-03-22 17:58:05 +01:00
#include <fsfw/devicehandlers/AssemblyBase.h>
2022-03-22 15:49:22 +01:00
#include <fsfw/power/PowerSwitcher.h>
2022-03-21 10:12:17 +01:00
2022-03-22 11:57:48 +01:00
struct TcsBoardHelper {
2022-03-22 15:49:22 +01:00
TcsBoardHelper(std::array<object_id_t, 16> rtdIds) : rtdIds(rtdIds) {}
2022-03-21 10:12:17 +01:00
2022-03-22 11:57:48 +01:00
std::array<object_id_t, 16> rtdIds = {};
};
2022-03-22 18:48:03 +01:00
class TcsBoardAssembly : public AssemblyBase, public ConfirmsFailuresIF {
2022-03-22 15:49:22 +01:00
public:
2022-03-22 18:48:03 +01:00
TcsBoardAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher,
power::Switch_t switcher, TcsBoardHelper helper);
2022-03-22 14:30:42 +01:00
ReturnValue_t initialize() override;
2022-03-22 17:58:05 +01:00
void performChildOperation() override;
2022-03-22 18:00:05 +01:00
2022-03-22 15:49:22 +01:00
private:
static constexpr uint8_t NUMBER_RTDS = 16;
PowerSwitcher switcher;
TcsBoardHelper helper;
FixedArrayList<ModeListEntry, NUMBER_RTDS> modeTable;
2022-03-22 18:48:03 +01:00
MessageQueueIF* eventQueue = nullptr;
2022-03-22 15:49:22 +01:00
2022-03-22 18:48:03 +01:00
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
2022-03-22 17:58:05 +01:00
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;
2022-03-22 18:48:03 +01:00
void startTransition(Mode_t mode, Submode_t submode) override;
void handleModeReached() override;
2022-03-21 10:12:17 +01:00
};
#endif /* MISSION_SYSTEM_TCSSUBSYSTEM_H_ */