eive-obsw/mission/system/objects/CamSwitcher.cpp

25 lines
955 B
C++
Raw Permalink Normal View History

2022-11-03 22:59:51 +01:00
#include "CamSwitcher.h"
2023-09-29 15:26:21 +02:00
CamSwitcher::CamSwitcher(object_id_t objectId, PowerSwitchIF& pwrSwitcher,
2022-11-03 22:59:51 +01:00
power::Switch_t pwrSwitch)
: PowerSwitcherComponent(objectId, &pwrSwitcher, pwrSwitch) {}
void CamSwitcher::performFaultyOperation() {
if (not switcher.active() and switcher.getState() != PowerSwitcher::SWITCH_IS_OFF) {
switcher.turnOff();
}
}
2023-09-29 15:26:21 +02:00
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) {
2023-10-10 11:54:32 +02:00
if (enablePl.plUseAllowed.isValid() and not enablePl.plUseAllowed.value) {
return TRANS_NOT_ALLOWED;
2023-09-29 15:26:21 +02:00
}
}
}
return PowerSwitcherComponent::checkModeCommand(commandedMode, commandedSubmode,
msToReachTheMode);
}