55 lines
1.5 KiB
C++
55 lines
1.5 KiB
C++
#include <fsfw/datapool/PoolReadGuard.h>
|
|
#include <mission/controller/PowerController.h>
|
|
|
|
PowerController::PowerController(object_id_t objectId, bool enableHkSets)
|
|
: ExtendedControllerBase(objectId), enableHkSets(enableHkSets) {}
|
|
|
|
ReturnValue_t PowerController::initialize() {
|
|
ReturnValue_t result = parameterHelper.initialize();
|
|
if (result != returnvalue::OK) {
|
|
return result;
|
|
}
|
|
return ExtendedControllerBase::initialize();
|
|
}
|
|
|
|
ReturnValue_t PowerController::handleCommandMessage(CommandMessage *message) {
|
|
ReturnValue_t result = actionHelper.handleActionMessage(message);
|
|
if (result == returnvalue::OK) {
|
|
return result;
|
|
}
|
|
result = parameterHelper.handleParameterMessage(message);
|
|
if (result == returnvalue::OK) {
|
|
return result;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
void PowerController::performControlOperation() {
|
|
switch (internalState) {
|
|
case InternalState::STARTUP: {
|
|
initialCountdown.resetTimer();
|
|
internalState = InternalState::INITIAL_DELAY;
|
|
return;
|
|
}
|
|
case InternalState::INITIAL_DELAY: {
|
|
if (initialCountdown.hasTimedOut()) {
|
|
internalState = InternalState::READY;
|
|
}
|
|
return;
|
|
}
|
|
case InternalState::READY: {
|
|
if (mode != MODE_OFF) {
|
|
// do something
|
|
}
|
|
break;
|
|
}
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
ReturnValue_t PowerController::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
|
LocalDataPoolManager &poolManager) {
|
|
return returnvalue::OK;
|
|
}
|