SoC Calculator #754

Merged
muellerr merged 74 commits from soc-calculator into main 2023-10-11 10:50:48 +02:00
3 changed files with 49 additions and 4 deletions
Showing only changes of commit 5a69b52b20 - Show all commits

View File

@ -2,7 +2,10 @@
#include <mission/controller/PowerController.h>
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 result = parameterHelper.initialize();
@ -48,9 +51,10 @@ void PowerController::performControlOperation() {
return;
}
case InternalState::READY: {
if (mode != MODE_OFF) {
// do something
}
// if (mode != MODE_OFF) {
sif::debug << "oh shit, now i gotta do something" << std::endl;
// do something
//}
break;
}
default:

View File

@ -5,6 +5,9 @@
#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:
@ -35,6 +38,15 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM
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_ */

View File

@ -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_ */