eive-obsw/mission/controller/PowerController.h
meggert 1dd38acee4
Some checks failed
EIVE/eive-obsw/pipeline/pr-v4.0.0-dev There was a failure building this commit
EIVE/-/pipeline/pr-v4.0.0-dev Build queued...
object factory stuff
2023-06-07 14:30:58 +02:00

41 lines
1.6 KiB
C++

#ifndef MISSION_CONTROLLER_POWERCONTROLLER_H_
#define MISSION_CONTROLLER_POWERCONTROLLER_H_
#include <eive/objects.h>
#include <fsfw/controller/ExtendedControllerBase.h>
#include <fsfw/parameters/ParameterHelper.h>
#include <fsfw/parameters/ReceivesParameterMessagesIF.h>
class PowerController : public ExtendedControllerBase, public ReceivesParameterMessagesIF {
public:
static constexpr dur_millis_t INIT_DELAY = 500;
PowerController(object_id_t objectId, bool enableHkSets);
MessageQueueId_t getCommandQueue() const;
ReturnValue_t getParameter(uint8_t domainId, uint8_t parameterId,
ParameterWrapper* parameterWrapper, const ParameterWrapper* newValues,
uint16_t startAtIndex) override;
private:
bool enableHkSets = false;
ParameterHelper parameterHelper;
enum class InternalState { STARTUP, INITIAL_DELAY, READY };
InternalState internalState = InternalState::STARTUP;
// Initial delay to make sure all pool variables have been initialized their owners
Countdown initialCountdown = Countdown(INIT_DELAY);
ReturnValue_t initialize() override;
ReturnValue_t handleCommandMessage(CommandMessage* message) override;
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override;
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode,
uint32_t* msToReachTheMode) override;
void performControlOperation() override;
};
#endif /* MISSION_CONTROLLER_POWERCONTROLLER_H_ */