SoC Calculator #754
@ -2,7 +2,10 @@
|
|||||||
#include <mission/controller/PowerController.h>
|
#include <mission/controller/PowerController.h>
|
||||||
|
|
||||||
PowerController::PowerController(object_id_t objectId, bool enableHkSets)
|
PowerController::PowerController(object_id_t objectId, bool enableHkSets)
|
||||||
: ExtendedControllerBase(objectId), enableHkSets(enableHkSets), parameterHelper(this) {}
|
: ExtendedControllerBase(objectId),
|
||||||
|
enableHkSets(enableHkSets),
|
||||||
|
parameterHelper(this),
|
||||||
|
stateOfChargeData(this) {}
|
||||||
|
|
||||||
ReturnValue_t PowerController::initialize() {
|
ReturnValue_t PowerController::initialize() {
|
||||||
ReturnValue_t result = parameterHelper.initialize();
|
ReturnValue_t result = parameterHelper.initialize();
|
||||||
@ -48,9 +51,10 @@ void PowerController::performControlOperation() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case InternalState::READY: {
|
case InternalState::READY: {
|
||||||
if (mode != MODE_OFF) {
|
// if (mode != MODE_OFF) {
|
||||||
// do something
|
sif::debug << "oh shit, now i gotta do something" << std::endl;
|
||||||
}
|
// do something
|
||||||
|
//}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -5,6 +5,9 @@
|
|||||||
#include <fsfw/controller/ExtendedControllerBase.h>
|
#include <fsfw/controller/ExtendedControllerBase.h>
|
||||||
#include <fsfw/parameters/ParameterHelper.h>
|
#include <fsfw/parameters/ParameterHelper.h>
|
||||||
#include <fsfw/parameters/ReceivesParameterMessagesIF.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 {
|
class PowerController : public ExtendedControllerBase, public ReceivesParameterMessagesIF {
|
||||||
public:
|
public:
|
||||||
@ -35,6 +38,15 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM
|
|||||||
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode,
|
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode,
|
||||||
uint32_t* msToReachTheMode) override;
|
uint32_t* msToReachTheMode) override;
|
||||||
void performControlOperation() 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_ */
|
#endif /* MISSION_CONTROLLER_POWERCONTROLLER_H_ */
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
#ifndef MISSION_CONTROLLER_CONTROLLERDEFINITIONS_POWERCTRLDEFINITIONS_H_
|
||||||
|
#define MISSION_CONTROLLER_CONTROLLERDEFINITIONS_POWERCTRLDEFINITIONS_H_
|
||||||
|
|
||||||
|
#include <fsfw/datapoollocal/StaticLocalDataSet.h>
|
||||||
|
#include <fsfw/datapoollocal/localPoolDefinitions.h>
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
namespace pwrctrl {
|
||||||
|
|
||||||
|
enum SetIds : uint32_t { STATE_OF_CHARGE_DATA };
|
||||||
|
|
||||||
|
enum PoolIds : lp_id_t {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
static constexpr uint8_t STATE_OF_CHARGE_ENTRIES = 6;
|
||||||
|
|
||||||
|
class StateOfChargedData : public StaticLocalDataSet<STATE_OF_CHARGE_ENTRIES> {
|
||||||
|
public:
|
||||||
|
StateOfChargedData(HasLocalDataPoolIF* hkOwner)
|
||||||
|
: StaticLocalDataSet(hkOwner, STATE_OF_CHARGE_DATA) {}
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace pwrctrl
|
||||||
|
|
||||||
|
#endif /* MISSION_CONTROLLER_CONTROLLERDEFINITIONS_POWERCTRLDEFINITIONS_H_ */
|
Loading…
Reference in New Issue
Block a user