From 1dd38acee4d103be9dfc8657d2d39e3cc7fc7848 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 7 Jun 2023 14:30:58 +0200 Subject: [PATCH] object factory stuff --- bsp_q7s/em/emObjectFactory.cpp | 1 + bsp_q7s/fmObjectFactory.cpp | 1 + linux/ObjectFactory.h | 2 ++ mission/controller/CMakeLists.txt | 3 ++- mission/controller/PowerController.cpp | 3 ++- mission/controller/PowerController.h | 2 ++ 6 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 5b2935b7..cbf1d34a 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -155,5 +155,6 @@ void ObjectFactory::produce(void* args) { HeaterHandler* heaterHandler; createHeaterComponents(gpioComIF, pwrSwitcher, healthTable, heaterHandler); createThermalController(*heaterHandler); + createPowerController(enableHkSets); satsystem::init(); } diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index df0bbc91..fa94aeec 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -113,5 +113,6 @@ void ObjectFactory::produce(void* args) { createMiscComponents(); createThermalController(*heaterHandler); createAcsController(true, enableHkSets); + createPowerC satsystem::init(); } diff --git a/linux/ObjectFactory.h b/linux/ObjectFactory.h index 16801ba9..d8605f48 100644 --- a/linux/ObjectFactory.h +++ b/linux/ObjectFactory.h @@ -16,6 +16,7 @@ class GpioIF; class SpiComIF; class PowerSwitchIF; class AcsController; +class PowerController; namespace ObjectFactory { @@ -31,5 +32,6 @@ void createScexComponents(std::string uartDev, PowerSwitchIF* pwrSwitcher, void gpioChecker(ReturnValue_t result, std::string output); AcsController* createAcsController(bool connectSubsystem, bool enableHkSets); +PowerController* createPowerController(bool enableHkSets); } // namespace ObjectFactory diff --git a/mission/controller/CMakeLists.txt b/mission/controller/CMakeLists.txt index 6177a14b..901decc0 100644 --- a/mission/controller/CMakeLists.txt +++ b/mission/controller/CMakeLists.txt @@ -1,6 +1,7 @@ if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "") target_sources(${LIB_EIVE_MISSION} PRIVATE ThermalController.cpp - AcsController.cpp) + AcsController.cpp + PowerController.cpp) endif() add_subdirectory(acs) diff --git a/mission/controller/PowerController.cpp b/mission/controller/PowerController.cpp index 84a6a33f..9264deeb 100644 --- a/mission/controller/PowerController.cpp +++ b/mission/controller/PowerController.cpp @@ -2,13 +2,14 @@ #include PowerController::PowerController(object_id_t objectId, bool enableHkSets) - : ExtendedControllerBase(objectId), enableHkSets(enableHkSets) {} + : ExtendedControllerBase(objectId), enableHkSets(enableHkSets), parameterHelper(this) {} ReturnValue_t PowerController::initialize() { ReturnValue_t result = parameterHelper.initialize(); if (result != returnvalue::OK) { return result; } + sif::debug << "fuck you" << std::endl; return ExtendedControllerBase::initialize(); } diff --git a/mission/controller/PowerController.h b/mission/controller/PowerController.h index 70d13401..8e2f6339 100644 --- a/mission/controller/PowerController.h +++ b/mission/controller/PowerController.h @@ -32,6 +32,8 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM 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; };