eive-obsw/mission/system/DualLanePowerStateMachine.h
Robin Mueller acd0307591
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
continued ACS board + SUS board assemblies
- Handling and Testing of basic FDIR
2022-03-17 19:23:39 +01:00

35 lines
1.1 KiB
C++

#ifndef MISSION_SYSTEM_DUALLANEPOWERSTATEMACHINE_H_
#define MISSION_SYSTEM_DUALLANEPOWERSTATEMACHINE_H_
#include <devices/powerSwitcherList.h>
#include <fsfw/modes/HasModesIF.h>
#include "definitions.h"
class AssemblyBase;
class PowerSwitchIF;
class DualLanePowerStateMachine : public HasReturnvaluesIF {
public:
DualLanePowerStateMachine(pcduSwitches::Switches switchA, pcduSwitches::Switches switchB,
PowerSwitchIF* pwrSwitcher, dur_millis_t checkTimeout = 5000);
void setCheckTimeout(dur_millis_t timeout);
void reset();
void start(Mode_t mode, Submode_t submode);
bool active();
duallane::PwrStates getState() const;
duallane::OpCodes powerStateMachine();
const pcduSwitches::Switches SWITCH_A;
const pcduSwitches::Switches SWITCH_B;
private:
duallane::OpCodes opResult = duallane::OpCodes::NONE;
duallane::PwrStates state = duallane::PwrStates::IDLE;
PowerSwitchIF* pwrSwitcher = nullptr;
Mode_t targetMode = HasModesIF::MODE_OFF;
Submode_t targetSubmode = 0;
Countdown checkTimeout;
};
#endif /* MISSION_SYSTEM_DUALLANEPOWERSTATEMACHINE_H_ */