25 lines
955 B
C++
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);
|
|
}
|