eive-obsw/mission/system/acs/RwAssembly.h

47 lines
1.4 KiB
C
Raw Normal View History

2022-04-21 16:56:46 +02:00
#ifndef MISSION_SYSTEM_RWASS_H_
#define MISSION_SYSTEM_RWASS_H_
#include <fsfw/devicehandlers/AssemblyBase.h>
2022-04-22 10:28:29 +02:00
#include <fsfw/power/PowerSwitcher.h>
2022-04-21 16:56:46 +02:00
struct RwHelper {
RwHelper(std::array<object_id_t, 4> rwIds) : rwIds(rwIds) {}
std::array<object_id_t, 4> rwIds = {};
};
2022-04-22 10:28:29 +02:00
class RwAssembly : public AssemblyBase {
public:
2022-09-30 14:30:30 +02:00
RwAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, power::Switch_t switcher,
RwHelper helper);
2022-04-22 10:28:29 +02:00
private:
static constexpr uint8_t NUMBER_RWS = 4;
2022-04-21 16:56:46 +02:00
RwHelper helper;
2022-04-22 10:28:29 +02:00
PowerSwitcher switcher;
bool warningSwitch = true;
bool modeTransitionFailedSwitch = true;
2022-04-22 10:28:29 +02:00
FixedArrayList<ModeListEntry, NUMBER_RWS> modeTable;
ReturnValue_t initialize() override;
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);
// AssemblyBase implementation
void performChildOperation() override;
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;
2022-04-21 16:56:46 +02:00
};
#endif /* MISSION_SYSTEM_RWASS_H_ */