eive-obsw/mission/system/objects/CamSwitcher.cpp
meggert 2c30efa821
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit
aaand we revert
2023-10-10 11:54:32 +02:00

25 lines
955 B
C++

#include "CamSwitcher.h"
CamSwitcher::CamSwitcher(object_id_t objectId, PowerSwitchIF& pwrSwitcher,
power::Switch_t pwrSwitch)
: PowerSwitcherComponent(objectId, &pwrSwitcher, pwrSwitch) {}
void CamSwitcher::performFaultyOperation() {
if (not switcher.active() and switcher.getState() != PowerSwitcher::SWITCH_IS_OFF) {
switcher.turnOff();
}
}
ReturnValue_t CamSwitcher::checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode,
uint32_t* msToReachTheMode) {
if (commandedMode != MODE_OFF) {
PoolReadGuard pg(&enablePl);
if (pg.getReadResult() == returnvalue::OK) {
if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) {
return TRANS_NOT_ALLOWED;
}
}
}
return PowerSwitcherComponent::checkModeCommand(commandedMode, commandedSubmode,
msToReachTheMode);
}