eive-obsw/mission/system/DualLanePowerStateMachine.h
Robin Mueller 62229cb999
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
bugfixes for NORMAL to OFF transition
2022-03-07 18:39:33 +01:00

34 lines
1.0 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::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_ */