meggert
5a69b52b20
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
53 lines
2.2 KiB
C++
53 lines
2.2 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>
|
|
#include <mission/controller/controllerdefinitions/PowerCtrlDefinitions.h>
|
|
#include <mission/power/bpxBattDefs.h>
|
|
#include <mission/power/gsDefs.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;
|
|
|
|
// HK Datasets for Calculation
|
|
BpxBatteryHk bpxBatteryHk = BpxBatteryHk(objects::BPX_BATT_HANDLER);
|
|
P60Dock::CoreHkSet p60CoreHk = P60Dock::CoreHkSet(objects::P60DOCK_HANDLER);
|
|
PDU1::Pdu1CoreHk pdu1CoreHk = PDU1::Pdu1CoreHk(objects::PDU1_HANDLER);
|
|
PDU2::Pdu2CoreHk pdu2CoreHk = PDU2::Pdu2CoreHk(objects::PDU2_HANDLER);
|
|
ACU::CoreHk acuCoreHk = ACU::CoreHk(objects::ACU_HANDLER);
|
|
// Output Dataset
|
|
pwrctrl::StateOfChargedData stateOfChargeData;
|
|
};
|
|
|
|
#endif /* MISSION_CONTROLLER_POWERCONTROLLER_H_ */
|