Robin Mueller
1ebd92a17e
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
36 lines
1.1 KiB
C++
36 lines
1.1 KiB
C++
#include "TcsSubsystem.h"
|
|
|
|
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
|
|
|
|
TcsSubsystem::TcsSubsystem(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher,
|
|
power::Switch_t theSwitch, TcsBoardHelper helper)
|
|
: AssemblyBase(objectId, parentId, 24),
|
|
switcher(pwrSwitcher, theSwitch),
|
|
helper(helper) {}
|
|
|
|
void TcsSubsystem::performChildOperation() {
|
|
switcher.doStateMachine();
|
|
if (not switcher.active()) {
|
|
AssemblyBase::performChildOperation();
|
|
}
|
|
}
|
|
|
|
ReturnValue_t TcsSubsystem::checkModeCommand(Mode_t mode, Submode_t submode,
|
|
uint32_t* msToReachTheMode) {
|
|
if (mode == MODE_ON or mode == MODE_OFF or mode == DeviceHandlerIF::MODE_NORMAL) {
|
|
return RETURN_OK;
|
|
}
|
|
return HasModesIF::INVALID_MODE;
|
|
}
|
|
|
|
ReturnValue_t TcsSubsystem::initialize() {
|
|
ReturnValue_t result = RETURN_OK;
|
|
for (const auto& obj : helper.rtdIds) {
|
|
result = registerChild(obj);
|
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
|
return result;
|
|
}
|
|
}
|
|
return SubsystemBase::initialize();
|
|
}
|