From b5e096abcbad244e21eefa6226a4b92eb834c46b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 10:40:39 +0100 Subject: [PATCH 01/10] start work on EM satsystem --- bsp_q7s/em/emObjectFactory.cpp | 3 ++- dummies/helpers.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 1a838b17..693da405 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "OBSWConfig.h" #include "bsp_q7s/core/CoreController.h" @@ -115,5 +116,5 @@ void ObjectFactory::produce(void* args) { HeaterHandler* heaterHandler = nullptr; ObjectFactory::createGenericHeaterComponents(*gpioComIF, *pwrSwitcher, heaterHandler); createThermalController(*heaterHandler); - satsystem::com::init(); + satsystem::init(); } diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index 7c8fab1c..d6bbf70f 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -24,6 +24,7 @@ #include "TemperatureSensorInserter.h" #include "dummies/Max31865Dummy.h" #include "dummies/Tmp1075Dummy.h" +#include "mission/system/tree/acsModeTree.h" using namespace dummy; @@ -48,6 +49,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { } auto* imtqDummy = new ImtqDummy(objects::IMTQ_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); imtqDummy->enableThermalModule(ThermalStateCfg()); + imtqDummy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); if (cfg.addPowerDummies) { new AcuDummy(objects::ACU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); new PduDummy(objects::PDU1_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); -- 2.43.0 From 59a0a740327ce1b438460cfcc204d42d58602b10 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 11:49:26 +0100 Subject: [PATCH 02/10] start adding assy components for EM --- bsp_q7s/core/ObjectFactory.cpp | 21 ++++---------- bsp_q7s/fmObjectFactory.cpp | 2 +- dummies/helpers.cpp | 51 ++++++++++++++++++++++----------- linux/ObjectFactory.cpp | 23 +++++---------- linux/ObjectFactory.h | 2 +- mission/core/GenericFactory.cpp | 41 ++++++++++++++++++++++++++ mission/core/GenericFactory.h | 7 +++++ 7 files changed, 98 insertions(+), 49 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 17170252..65a12ba7 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -692,33 +692,24 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF, std::array rwIds = {objects::RW1, objects::RW2, objects::RW3, objects::RW4}; std::array rwGpioIds = {gpioIds::EN_RW1, gpioIds::EN_RW2, gpioIds::EN_RW3, gpioIds::EN_RW4}; - std::array rws = {}; + std::array rws = {}; for (uint8_t idx = 0; idx < rwCookies.size(); idx++) { rwCookies[idx] = new SpiCookie(rwCookieParams[idx].first, rwCookieParams[idx].second, RwDefinitions::MAX_REPLY_SIZE, spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr); - rws[idx] = new RwHandler(rwIds[idx], objects::SPI_RW_COM_IF, rwCookies[idx], gpioComIF, - rwGpioIds[idx]); + auto* rwHandler = new RwHandler(rwIds[idx], objects::SPI_RW_COM_IF, rwCookies[idx], gpioComIF, + rwGpioIds[idx]); rwCookies[idx]->setCallbackArgs(rws[idx]); #if OBSW_TEST_RW == 1 rws[idx]->setStartUpImmediately(); #endif #if OBSW_DEBUG_RW == 1 - rws[idx]->setDebugMode(true); + rwHandler->setDebugMode(true); #endif + rws[idx] = rwHandler; } - RwHelper rwHelper(rwIds); - auto* rwAss = - new RwAssembly(objects::RW_ASS, pwrSwitcher, pcdu::Switches::PDU2_CH2_RW_5V, rwHelper); - for (uint8_t idx = 0; idx < rws.size(); idx++) { - ReturnValue_t result = rws[idx]->connectModeTreeParent(*rwAss); - if (result != returnvalue::OK) { - sif::error << "Connecting RW " << static_cast(idx) << " to RW assembly failed" - << std::endl; - } - } - rwAss->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); + createRwAssy(*pwrSwitcher, pcdu::Switches::PDU2_CH2_RW_5V, rws, rwIds); #endif /* OBSW_ADD_RW == 1 */ } diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 4ca45e43..034b7cc1 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -39,7 +39,7 @@ void ObjectFactory::produce(void* args) { createRadSensorComponent(gpioComIF, *stackHandler); #endif #if OBSW_ADD_SUN_SENSORS == 1 - createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV, true); + createSunSensorComponents(gpioComIF, spiMainComIF, *pwrSwitcher, q7s::SPI_DEFAULT_DEV, true); #endif #if OBSW_ADD_ACS_BOARD == 1 diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index d6bbf70f..20d1555b 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -24,6 +24,8 @@ #include "TemperatureSensorInserter.h" #include "dummies/Max31865Dummy.h" #include "dummies/Tmp1075Dummy.h" +#include "mission/core/GenericFactory.h" +#include "mission/devices/devicedefinitions/GomspaceDefinitions.h" #include "mission/system/tree/acsModeTree.h" using namespace dummy; @@ -38,10 +40,13 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { if (cfg.addRtdComIFDummy) { new ComIFDummy(objects::SPI_RTD_COM_IF); } - new RwDummy(objects::RW1, objects::DUMMY_COM_IF, comCookieDummy); - new RwDummy(objects::RW2, objects::DUMMY_COM_IF, comCookieDummy); - new RwDummy(objects::RW3, objects::DUMMY_COM_IF, comCookieDummy); - new RwDummy(objects::RW4, objects::DUMMY_COM_IF, comCookieDummy); + std::array rwIds = {objects::RW1, objects::RW2, objects::RW3, objects::RW4}; + std::array rws; + rws[0] = new RwDummy(objects::RW1, objects::DUMMY_COM_IF, comCookieDummy); + rws[1] = new RwDummy(objects::RW2, objects::DUMMY_COM_IF, comCookieDummy); + rws[2] = new RwDummy(objects::RW3, objects::DUMMY_COM_IF, comCookieDummy); + rws[3] = new RwDummy(objects::RW4, objects::DUMMY_COM_IF, comCookieDummy); + ObjectFactory::createRwAssy(pwrSwitch, pcdu::Switches::PDU2_CH2_RW_5V, rws, rwIds); new SaDeplDummy(objects::SOLAR_ARRAY_DEPL_HANDLER); new StarTrackerDummy(objects::STAR_TRACKER, objects::DUMMY_COM_IF, comCookieDummy); if (cfg.addSyrlinksDummies) { @@ -70,18 +75,32 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { } if (cfg.addSusDummies) { - new SusDummy(objects::SUS_0_N_LOC_XFYFZM_PT_XF, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_1_N_LOC_XBYFZM_PT_XB, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_2_N_LOC_XFYBZB_PT_YB, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_3_N_LOC_XFYBZF_PT_YF, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_6_R_LOC_XFYBZM_PT_XF, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_7_R_LOC_XBYBZM_PT_XB, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_8_R_LOC_XBYBZB_PT_YB, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_9_R_LOC_XBYBZB_PT_YF, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, objects::DUMMY_COM_IF, comCookieDummy); - new SusDummy(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, objects::DUMMY_COM_IF, comCookieDummy); + std::array suses; + suses[0] = + new SusDummy(objects::SUS_0_N_LOC_XFYFZM_PT_XF, objects::DUMMY_COM_IF, comCookieDummy); + suses[1] = + new SusDummy(objects::SUS_1_N_LOC_XBYFZM_PT_XB, objects::DUMMY_COM_IF, comCookieDummy); + suses[2] = + new SusDummy(objects::SUS_2_N_LOC_XFYBZB_PT_YB, objects::DUMMY_COM_IF, comCookieDummy); + suses[3] = + new SusDummy(objects::SUS_3_N_LOC_XFYBZF_PT_YF, objects::DUMMY_COM_IF, comCookieDummy); + suses[4] = + new SusDummy(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, objects::DUMMY_COM_IF, comCookieDummy); + suses[5] = + new SusDummy(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, objects::DUMMY_COM_IF, comCookieDummy); + suses[6] = + new SusDummy(objects::SUS_6_R_LOC_XFYBZM_PT_XF, objects::DUMMY_COM_IF, comCookieDummy); + suses[7] = + new SusDummy(objects::SUS_7_R_LOC_XBYBZM_PT_XB, objects::DUMMY_COM_IF, comCookieDummy); + suses[8] = + new SusDummy(objects::SUS_8_R_LOC_XBYBZB_PT_YB, objects::DUMMY_COM_IF, comCookieDummy); + suses[9] = + new SusDummy(objects::SUS_9_R_LOC_XBYBZB_PT_YF, objects::DUMMY_COM_IF, comCookieDummy); + suses[10] = + new SusDummy(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, objects::DUMMY_COM_IF, comCookieDummy); + suses[11] = + new SusDummy(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, objects::DUMMY_COM_IF, comCookieDummy); + ObjectFactory::createSusAssy(pwrSwitch, suses); } if (cfg.addTempSensorDummies) { diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 1003ead4..add6a755 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -29,7 +30,7 @@ #include "mission/system/tree/tcsModeTree.h" void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF, - PowerSwitchIF* pwrSwitcher, std::string spiDev, + PowerSwitchIF& pwrSwitcher, std::string spiDev, bool swap0And6) { using namespace gpio; GpioCookie* gpioCookieSus = new GpioCookie(); @@ -173,22 +174,8 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo fdir = new SusFdir(objects::SUS_11_R_LOC_XBYMZB_PT_ZB); susHandlers[11]->setCustomFdir(fdir); - std::array susIds = { - objects::SUS_0_N_LOC_XFYFZM_PT_XF, objects::SUS_1_N_LOC_XBYFZM_PT_XB, - objects::SUS_2_N_LOC_XFYBZB_PT_YB, objects::SUS_3_N_LOC_XFYBZF_PT_YF, - objects::SUS_4_N_LOC_XMYFZF_PT_ZF, objects::SUS_5_N_LOC_XFYMZB_PT_ZB, - objects::SUS_6_R_LOC_XFYBZM_PT_XF, objects::SUS_7_R_LOC_XBYBZM_PT_XB, - objects::SUS_8_R_LOC_XBYBZB_PT_YB, objects::SUS_9_R_LOC_XBYBZB_PT_YF, - objects::SUS_10_N_LOC_XMYBZF_PT_ZF, objects::SUS_11_R_LOC_XBYMZB_PT_ZB}; - SusAssHelper susAssHelper = SusAssHelper(susIds); - auto susAss = new SusAssembly(objects::SUS_BOARD_ASS, pwrSwitcher, susAssHelper); for (auto& sus : susHandlers) { if (sus != nullptr) { - ReturnValue_t result = sus->connectModeTreeParent(*susAss); - if (result != returnvalue::OK) { - sif::error << "Connecting SUS " << sus->getObjectId() << " to SUS assembly failed" - << std::endl; - } #if OBSW_TEST_SUS == 1 sus->setStartUpImmediately(); sus->setToGoToNormalMode(true); @@ -198,7 +185,11 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo #endif } } - susAss->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); + std::array susDhbs; + for (unsigned i = 0; i < susDhbs.size(); i++) { + susDhbs[i] = susHandlers[i]; + } + createSusAssy(pwrSwitcher, susDhbs); #endif /* OBSW_ADD_SUN_SENSORS == 1 */ } diff --git a/linux/ObjectFactory.h b/linux/ObjectFactory.h index c7b12f9b..0a7ab516 100644 --- a/linux/ObjectFactory.h +++ b/linux/ObjectFactory.h @@ -20,7 +20,7 @@ class AcsController; namespace ObjectFactory { -void createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF, PowerSwitchIF* pwrSwitcher, +void createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF, PowerSwitchIF& pwrSwitcher, std::string spiDev, bool swap0And6); void createRtdComponents(std::string spiDev, GpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher, SpiComIF* comIF); diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 8c05ed4f..56ca3d97 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #include #include @@ -35,6 +37,8 @@ #include "eive/definitions.h" #include "fsfw/pus/Service11TelecommandScheduling.h" #include "mission/cfdp/Config.h" +#include "mission/system/objects/RwAssembly.h" +#include "mission/system/tree/acsModeTree.h" #include "mission/system/tree/tcsModeTree.h" #include "objects/systemObjectList.h" #include "tmtc/pusIds.h" @@ -218,3 +222,40 @@ void ObjectFactory::createThermalController(HeaterHandler& heaterHandler) { auto* tcsCtrl = new ThermalController(objects::THERMAL_CONTROLLER, heaterHandler); tcsCtrl->connectModeTreeParent(satsystem::tcs::SUBSYSTEM); } +void ObjectFactory::createRwAssy(PowerSwitchIF& pwrSwitcher, power::Switch_t theSwitch, + std::array rws, + std::array rwIds) { + RwHelper rwHelper(rwIds); + auto* rwAss = new RwAssembly(objects::RW_ASS, &pwrSwitcher, theSwitch, rwHelper); + for (uint8_t idx = 0; idx < rwIds.size(); idx++) { + ReturnValue_t result = rws[idx]->connectModeTreeParent(*rwAss); + if (result != returnvalue::OK) { + sif::error << "Connecting RW " << static_cast(idx) << " to RW assembly failed" + << std::endl; + } + } + rwAss->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); +} + +void ObjectFactory::createSusAssy(PowerSwitchIF& pwrSwitcher, + std::array suses) { + std::array susIds = { + objects::SUS_0_N_LOC_XFYFZM_PT_XF, objects::SUS_1_N_LOC_XBYFZM_PT_XB, + objects::SUS_2_N_LOC_XFYBZB_PT_YB, objects::SUS_3_N_LOC_XFYBZF_PT_YF, + objects::SUS_4_N_LOC_XMYFZF_PT_ZF, objects::SUS_5_N_LOC_XFYMZB_PT_ZB, + objects::SUS_6_R_LOC_XFYBZM_PT_XF, objects::SUS_7_R_LOC_XBYBZM_PT_XB, + objects::SUS_8_R_LOC_XBYBZB_PT_YB, objects::SUS_9_R_LOC_XBYBZB_PT_YF, + objects::SUS_10_N_LOC_XMYBZF_PT_ZF, objects::SUS_11_R_LOC_XBYMZB_PT_ZB}; + SusAssHelper susAssHelper = SusAssHelper(susIds); + auto susAss = new SusAssembly(objects::SUS_BOARD_ASS, &pwrSwitcher, susAssHelper); + for (auto& sus : suses) { + if (sus != nullptr) { + ReturnValue_t result = sus->connectModeTreeParent(*susAss); + if (result != returnvalue::OK) { + sif::error << "Connecting SUS " << sus->getObjectId() << " to SUS assembly failed" + << std::endl; + } + } + } + susAss->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); +} diff --git a/mission/core/GenericFactory.h b/mission/core/GenericFactory.h index 04802d51..89d7f0d5 100644 --- a/mission/core/GenericFactory.h +++ b/mission/core/GenericFactory.h @@ -1,6 +1,9 @@ #ifndef MISSION_CORE_GENERICFACTORY_H_ #define MISSION_CORE_GENERICFACTORY_H_ +#include + +#include "fsfw/objectmanager/SystemObjectIF.h" #include "fsfw/power/PowerSwitchIF.h" #include "fsfw_hal/common/gpio/GpioIF.h" @@ -17,6 +20,10 @@ void createGenericHeaterComponents(GpioIF& gpioIF, PowerSwitchIF& pwrSwitcher, HeaterHandler*& heaterHandler); void createThermalController(HeaterHandler& heaterHandler); +void createRwAssy(PowerSwitchIF& pwrSwitcher, power::Switch_t theSwitch, + std::array rws, std::array rwIds); +void createSusAssy(PowerSwitchIF& pwrSwitcher, std::array suses); + } // namespace ObjectFactory #endif /* MISSION_CORE_GENERICFACTORY_H_ */ -- 2.43.0 From 97a001a1da86ce464eddfb3bffc989bbc0c80950 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 13:53:13 +0100 Subject: [PATCH 03/10] continue satsytem for EM --- bsp_q7s/core/ObjectFactory.cpp | 37 +++++++---------------- bsp_q7s/core/ObjectFactory.h | 2 +- bsp_q7s/fmObjectFactory.cpp | 2 +- dummies/CMakeLists.txt | 3 +- dummies/GpsCtrlDummy.cpp | 3 ++ dummies/GpsCtrlDummy.h | 12 ++++++++ dummies/{GpsDummy.cpp => GpsDhbDummy.cpp} | 27 ++++++++--------- dummies/{GpsDummy.h => GpsDhbDummy.h} | 12 ++++---- dummies/helpers.cpp | 30 +++++++++--------- dummies/helpers.h | 2 +- fsfw | 2 +- mission/core/GenericFactory.cpp | 22 ++++++++++++++ mission/core/GenericFactory.h | 3 ++ 13 files changed, 92 insertions(+), 65 deletions(-) create mode 100644 dummies/GpsCtrlDummy.cpp create mode 100644 dummies/GpsCtrlDummy.h rename dummies/{GpsDummy.cpp => GpsDhbDummy.cpp} (64%) rename dummies/{GpsDummy.h => GpsDhbDummy.h} (82%) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 65a12ba7..16ba3325 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -239,10 +239,10 @@ ReturnValue_t ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF, } void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialComIF* uartComIF, - PowerSwitchIF* pwrSwitcher) { + PowerSwitchIF& pwrSwitcher) { using namespace gpio; GpioCookie* gpioCookieAcsBoard = new GpioCookie(); - std::vector> assemblyChildren; + std::array assemblyChildren; std::stringstream consumer; GpiodRegularByLineName* gpio = nullptr; @@ -352,7 +352,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo objects::MGM_0_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::LIS3_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_0_LIS3_HANDLER); mgmLis3Handler0->setCustomFdir(fdir); - assemblyChildren.push_back(*mgmLis3Handler0); + assemblyChildren[0] = mgmLis3Handler0; #if OBSW_TEST_ACS == 1 mgmLis3Handler->setStartUpImmediately(); mgmLis3Handler->setToGoToNormalMode(true); @@ -369,7 +369,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo spi::RM3100_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_1_RM3100_HANDLER); mgmRm3100Handler1->setCustomFdir(fdir); - assemblyChildren.push_back(*mgmRm3100Handler1); + assemblyChildren[1] = mgmRm3100Handler1; #if OBSW_TEST_ACS == 1 mgmRm3100Handler->setStartUpImmediately(); mgmRm3100Handler->setToGoToNormalMode(true); @@ -385,7 +385,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo objects::MGM_2_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::LIS3_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_2_LIS3_HANDLER); mgmLis3Handler2->setCustomFdir(fdir); - assemblyChildren.push_back(*mgmLis3Handler2); + assemblyChildren[2] = mgmLis3Handler2; #if OBSW_TEST_ACS == 1 mgmLis3Handler->setStartUpImmediately(); mgmLis3Handler->setToGoToNormalMode(true); @@ -402,7 +402,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo spi::RM3100_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_3_RM3100_HANDLER); mgmRm3100Handler3->setCustomFdir(fdir); - assemblyChildren.push_back(*mgmRm3100Handler3); + assemblyChildren[3] = mgmRm3100Handler3; #if OBSW_TEST_ACS == 1 mgmRm3100Handler->setStartUpImmediately(); mgmRm3100Handler->setToGoToNormalMode(true); @@ -421,7 +421,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo ADIS1650X::Type::ADIS16505); fdir = new AcsBoardFdir(objects::GYRO_0_ADIS_HANDLER); adisHandler->setCustomFdir(fdir); - assemblyChildren.push_back(*adisHandler); + assemblyChildren[4] = adisHandler; #if OBSW_TEST_ACS == 1 adisHandler->setStartUpImmediately(); adisHandler->setToGoToNormalModeImmediately(); @@ -437,7 +437,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo objects::GYRO_1_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::L3G_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::GYRO_1_L3G_HANDLER); gyroL3gHandler1->setCustomFdir(fdir); - assemblyChildren.push_back(*gyroL3gHandler1); + assemblyChildren[5] = gyroL3gHandler1; #if OBSW_TEST_ACS == 1 gyroL3gHandler->setStartUpImmediately(); gyroL3gHandler->setToGoToNormalMode(true); @@ -454,7 +454,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo spiCookie, ADIS1650X::Type::ADIS16505); fdir = new AcsBoardFdir(objects::GYRO_2_ADIS_HANDLER); adisHandler->setCustomFdir(fdir); - assemblyChildren.push_back(*adisHandler); + assemblyChildren[6] = adisHandler; #if OBSW_TEST_ACS == 1 adisHandler->setStartUpImmediately(); adisHandler->setToGoToNormalModeImmediately(); @@ -467,7 +467,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo objects::GYRO_3_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::L3G_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::GYRO_3_L3G_HANDLER); gyroL3gHandler3->setCustomFdir(fdir); - assemblyChildren.push_back(*gyroL3gHandler3); + assemblyChildren[7] = gyroL3gHandler3; #if OBSW_TEST_ACS == 1 gyroL3gHandler->setStartUpImmediately(); gyroL3gHandler->setToGoToNormalMode(true); @@ -485,22 +485,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo new GpsHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps); gpsCtrl->setResetPinTriggerFunction(gps::triggerGpioResetPin, &RESET_ARGS_GNSS); - AcsBoardHelper acsBoardHelper = AcsBoardHelper( - objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER, - objects::MGM_3_RM3100_HANDLER, objects::GYRO_0_ADIS_HANDLER, objects::GYRO_1_L3G_HANDLER, - objects::GYRO_2_ADIS_HANDLER, objects::GYRO_3_L3G_HANDLER, objects::GPS_CONTROLLER); - auto acsAss = - new AcsBoardAssembly(objects::ACS_BOARD_ASS, pwrSwitcher, acsBoardHelper, gpioComIF); - static_cast(acsAss); - for (auto& assChild : assemblyChildren) { - ReturnValue_t result = assChild.get().connectModeTreeParent(*acsAss); - if (result != returnvalue::OK) { - sif::error << "Connecting assembly for ACS board component " << assChild.get().getObjectId() - << " failed" << std::endl; - } - } - gpsCtrl->connectModeTreeParent(*acsAss); - acsAss->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); + ObjectFactory::createAcsBoardAssy(pwrSwitcher, assemblyChildren, gpsCtrl, gpioComIF); #endif /* OBSW_ADD_ACS_HANDLERS == 1 */ } diff --git a/bsp_q7s/core/ObjectFactory.h b/bsp_q7s/core/ObjectFactory.h index 61b629c8..9d0e4ea3 100644 --- a/bsp_q7s/core/ObjectFactory.h +++ b/bsp_q7s/core/ObjectFactory.h @@ -33,7 +33,7 @@ void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF, void createTmpComponents(); ReturnValue_t createRadSensorComponent(LinuxLibgpioIF* gpioComIF, Stack5VHandler& handler); void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialComIF* uartComIF, - PowerSwitchIF* pwrSwitcher); + PowerSwitchIF& pwrSwitcher); void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable, HeaterHandler*& heaterHandler); void createImtqComponents(PowerSwitchIF* pwrSwitcher); diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 034b7cc1..f04766eb 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -43,7 +43,7 @@ void ObjectFactory::produce(void* args) { #endif #if OBSW_ADD_ACS_BOARD == 1 - createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); + createAcsBoardComponents(gpioComIF, uartComIF, *pwrSwitcher); #endif HeaterHandler* heaterHandler; createHeaterComponents(gpioComIF, pwrSwitcher, healthTable, heaterHandler); diff --git a/dummies/CMakeLists.txt b/dummies/CMakeLists.txt index 330aecfe..38527dd6 100644 --- a/dummies/CMakeLists.txt +++ b/dummies/CMakeLists.txt @@ -14,7 +14,8 @@ target_sources( PduDummy.cpp P60DockDummy.cpp SaDeploymentDummy.cpp - GpsDummy.cpp + GpsDhbDummy.cpp + GpsCtrlDummy.cpp GyroAdisDummy.cpp GyroL3GD20Dummy.cpp MgmLIS3MDLDummy.cpp diff --git a/dummies/GpsCtrlDummy.cpp b/dummies/GpsCtrlDummy.cpp new file mode 100644 index 00000000..3a1f61ba --- /dev/null +++ b/dummies/GpsCtrlDummy.cpp @@ -0,0 +1,3 @@ +#include "GpsCtrlDummy.h" + +GpsCtrlDummy::GpsCtrlDummy(object_id_t objectId): ExtendedControllerBase(objectId, 20) {} diff --git a/dummies/GpsCtrlDummy.h b/dummies/GpsCtrlDummy.h new file mode 100644 index 00000000..3d6f40bc --- /dev/null +++ b/dummies/GpsCtrlDummy.h @@ -0,0 +1,12 @@ +#ifndef DUMMIES_GPSCTRLDUMMY_H_ +#define DUMMIES_GPSCTRLDUMMY_H_ + +#include + +class GpsCtrlDummy: public ExtendedControllerBase { +public: + GpsCtrlDummy(object_id_t objectId); +private: +}; + +#endif /* DUMMIES_GPSCTRLDUMMY_H_ */ diff --git a/dummies/GpsDummy.cpp b/dummies/GpsDhbDummy.cpp similarity index 64% rename from dummies/GpsDummy.cpp rename to dummies/GpsDhbDummy.cpp index 893e8464..84c82da4 100644 --- a/dummies/GpsDummy.cpp +++ b/dummies/GpsDhbDummy.cpp @@ -1,41 +1,40 @@ -#include "GpsDummy.h" - +#include #include -GpsDummy::GpsDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) +GpsDhbDummy::GpsDhbDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) : DeviceHandlerBase(objectId, comif, comCookie) {} -GpsDummy::~GpsDummy() {} +GpsDhbDummy::~GpsDhbDummy() {} -void GpsDummy::doStartUp() {} +void GpsDhbDummy::doStartUp() {} -void GpsDummy::doShutDown() {} +void GpsDhbDummy::doShutDown() {} -ReturnValue_t GpsDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } +ReturnValue_t GpsDhbDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } -ReturnValue_t GpsDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) { +ReturnValue_t GpsDhbDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } -ReturnValue_t GpsDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand, +ReturnValue_t GpsDhbDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData, size_t commandDataLen) { return returnvalue::OK; } -ReturnValue_t GpsDummy::scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, +ReturnValue_t GpsDhbDummy::scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, size_t *foundLen) { return returnvalue::OK; } -ReturnValue_t GpsDummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) { +ReturnValue_t GpsDhbDummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) { return returnvalue::OK; } -void GpsDummy::fillCommandAndReplyMap() {} +void GpsDhbDummy::fillCommandAndReplyMap() {} -uint32_t GpsDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; } +uint32_t GpsDhbDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; } -ReturnValue_t GpsDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, +ReturnValue_t GpsDhbDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { localDataPoolMap.emplace(GpsHyperion::LATITUDE, new PoolEntry({0.0}, 1)); localDataPoolMap.emplace(GpsHyperion::LONGITUDE, new PoolEntry({0.0}, 1)); diff --git a/dummies/GpsDummy.h b/dummies/GpsDhbDummy.h similarity index 82% rename from dummies/GpsDummy.h rename to dummies/GpsDhbDummy.h index b32b7f17..a1df7e45 100644 --- a/dummies/GpsDummy.h +++ b/dummies/GpsDhbDummy.h @@ -1,9 +1,9 @@ -#ifndef DUMMIES_GPSDUMMY_H_ -#define DUMMIES_GPSDUMMY_H_ +#ifndef DUMMIES_GPSDHBDUMMY_H_ +#define DUMMIES_GPSDHBDUMMY_H_ #include -class GpsDummy : public DeviceHandlerBase { +class GpsDhbDummy : public DeviceHandlerBase { public: static const DeviceCommandId_t SIMPLE_COMMAND = 1; static const DeviceCommandId_t PERIODIC_REPLY = 2; @@ -11,8 +11,8 @@ class GpsDummy : public DeviceHandlerBase { static const uint8_t SIMPLE_COMMAND_DATA = 1; static const uint8_t PERIODIC_REPLY_DATA = 2; - GpsDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie); - virtual ~GpsDummy(); + GpsDhbDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie); + virtual ~GpsDhbDummy(); protected: void doStartUp() override; @@ -30,4 +30,4 @@ class GpsDummy : public DeviceHandlerBase { LocalDataPoolManager &poolManager) override; }; -#endif /* DUMMIES_GPSDUMMY_H_ */ +#endif /* DUMMIES_GPSDHBDUMMY_H_ */ diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index 20d1555b..1fd8a37c 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include @@ -30,7 +30,7 @@ using namespace dummy; -void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { +void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpioIF) { new ComIFDummy(objects::DUMMY_COM_IF); auto* comCookieDummy = new ComCookieDummy(); new BpxDummy(objects::BPX_BATT_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); @@ -46,7 +46,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { rws[1] = new RwDummy(objects::RW2, objects::DUMMY_COM_IF, comCookieDummy); rws[2] = new RwDummy(objects::RW3, objects::DUMMY_COM_IF, comCookieDummy); rws[3] = new RwDummy(objects::RW4, objects::DUMMY_COM_IF, comCookieDummy); - ObjectFactory::createRwAssy(pwrSwitch, pcdu::Switches::PDU2_CH2_RW_5V, rws, rwIds); + ObjectFactory::createRwAssy(pwrSwitcher, pcdu::Switches::PDU2_CH2_RW_5V, rws, rwIds); new SaDeplDummy(objects::SOLAR_ARRAY_DEPL_HANDLER); new StarTrackerDummy(objects::STAR_TRACKER, objects::DUMMY_COM_IF, comCookieDummy); if (cfg.addSyrlinksDummies) { @@ -63,15 +63,17 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { } if (cfg.addAcsBoardDummies) { - new GyroAdisDummy(objects::GYRO_0_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - new GyroL3GD20Dummy(objects::GYRO_1_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - new GyroAdisDummy(objects::GYRO_2_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - new GyroL3GD20Dummy(objects::GYRO_3_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - new MgmLIS3MDLDummy(objects::MGM_0_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - new MgmLIS3MDLDummy(objects::MGM_2_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - new MgmRm3100Dummy(objects::MGM_1_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - new MgmRm3100Dummy(objects::MGM_3_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - new GpsDummy(objects::GPS_CONTROLLER, objects::DUMMY_COM_IF, comCookieDummy); + std::array assemblyDhbs; + assemblyDhbs[0] = new MgmLIS3MDLDummy(objects::MGM_0_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[1] = new MgmLIS3MDLDummy(objects::MGM_2_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[2] = new MgmRm3100Dummy(objects::MGM_1_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[3] = new MgmRm3100Dummy(objects::MGM_3_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[4] = new GyroAdisDummy(objects::GYRO_0_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[5] = new GyroL3GD20Dummy(objects::GYRO_1_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[6] = new GyroAdisDummy(objects::GYRO_2_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[7] = new GyroL3GD20Dummy(objects::GYRO_3_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + auto* gpsCtrl = new GpsDhbDummy(objects::GPS_CONTROLLER, objects::DUMMY_COM_IF, comCookieDummy); + ObjectFactory::createAcsBoardAssy(pwrSwitcher, assemblyDhbs, gpsCtrl, gpioIF); } if (cfg.addSusDummies) { @@ -100,7 +102,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { new SusDummy(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, objects::DUMMY_COM_IF, comCookieDummy); suses[11] = new SusDummy(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, objects::DUMMY_COM_IF, comCookieDummy); - ObjectFactory::createSusAssy(pwrSwitch, suses); + ObjectFactory::createSusAssy(pwrSwitcher, suses); } if (cfg.addTempSensorDummies) { @@ -174,6 +176,6 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch) { new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER, tempSensorDummies, tempTmpSensorDummies); } - new CamSwitcher(objects::CAM_SWITCHER, pwrSwitch, power::NO_SWITCH); + new CamSwitcher(objects::CAM_SWITCHER, pwrSwitcher, power::NO_SWITCH); new PlPcduDummy(objects::PLPCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); } diff --git a/dummies/helpers.h b/dummies/helpers.h index bbaab34d..1d30f451 100644 --- a/dummies/helpers.h +++ b/dummies/helpers.h @@ -14,6 +14,6 @@ struct DummyCfg { bool addRtdComIFDummy = true; }; -void createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch); +void createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch, GpioIF* gpioIF); } // namespace dummy diff --git a/fsfw b/fsfw index dac2d210..f0b8457b 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit dac2d210b597adfaf45bd5ae6a4c027599927601 +Subproject commit f0b8457ba2d9a34a42b10314c3cdccfd46ebf168 diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 56ca3d97..6506c184 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -26,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -259,3 +261,23 @@ void ObjectFactory::createSusAssy(PowerSwitchIF& pwrSwitcher, } susAss->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); } + +void ObjectFactory::createAcsBoardAssy(PowerSwitchIF& pwrSwitcher, + std::array assemblyDhbs, + ExtendedControllerBase* gpsCtrl, GpioIF* gpioComIF) { + AcsBoardHelper acsBoardHelper = AcsBoardHelper( + objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER, + objects::MGM_3_RM3100_HANDLER, objects::GYRO_0_ADIS_HANDLER, objects::GYRO_1_L3G_HANDLER, + objects::GYRO_2_ADIS_HANDLER, objects::GYRO_3_L3G_HANDLER, objects::GPS_CONTROLLER); + auto acsAss = + new AcsBoardAssembly(objects::ACS_BOARD_ASS, &pwrSwitcher, acsBoardHelper, gpioComIF); + for (auto& assChild : assemblyDhbs) { + ReturnValue_t result = assChild->connectModeTreeParent(*acsAss); + if (result != returnvalue::OK) { + sif::error << "Connecting assembly for ACS board component " << assChild->getObjectId() + << " failed" << std::endl; + } + } + gpsCtrl->connectModeTreeParent(*acsAss); + acsAss->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); +} diff --git a/mission/core/GenericFactory.h b/mission/core/GenericFactory.h index 89d7f0d5..4b380336 100644 --- a/mission/core/GenericFactory.h +++ b/mission/core/GenericFactory.h @@ -11,6 +11,7 @@ class HeaterHandler; class HealthTableIF; class PusTmFunnel; class CfdpTmFunnel; +class ExtendedControllerBase; namespace ObjectFactory { @@ -23,6 +24,8 @@ void createThermalController(HeaterHandler& heaterHandler); void createRwAssy(PowerSwitchIF& pwrSwitcher, power::Switch_t theSwitch, std::array rws, std::array rwIds); void createSusAssy(PowerSwitchIF& pwrSwitcher, std::array suses); +void createAcsBoardAssy(PowerSwitchIF& pwrSwitcher, std::array assemblyDhbs, + ExtendedControllerBase* gpsCtrl, GpioIF* gpioComIF); } // namespace ObjectFactory -- 2.43.0 From e2f8ca752f70d698de1d2138241c67f80610fb34 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 15:59:44 +0100 Subject: [PATCH 04/10] continue satsystem --- dummies/GpsCtrlDummy.cpp | 20 +++++++++++++++++++- dummies/GpsCtrlDummy.h | 14 +++++++++++--- dummies/GpsDhbDummy.cpp | 13 ++++++++----- dummies/helpers.cpp | 27 ++++++++++++++++++--------- dummies/helpers.h | 2 ++ 5 files changed, 58 insertions(+), 18 deletions(-) diff --git a/dummies/GpsCtrlDummy.cpp b/dummies/GpsCtrlDummy.cpp index 3a1f61ba..e69261b4 100644 --- a/dummies/GpsCtrlDummy.cpp +++ b/dummies/GpsCtrlDummy.cpp @@ -1,3 +1,21 @@ #include "GpsCtrlDummy.h" -GpsCtrlDummy::GpsCtrlDummy(object_id_t objectId): ExtendedControllerBase(objectId, 20) {} +GpsCtrlDummy::GpsCtrlDummy(object_id_t objectId) : ExtendedControllerBase(objectId, 20) {} + +ReturnValue_t GpsCtrlDummy::handleCommandMessage(CommandMessage* message) { + return returnvalue::OK; +} + +void GpsCtrlDummy::performControlOperation() {} + +ReturnValue_t GpsCtrlDummy::checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t* msToReachTheMode) { + return returnvalue::OK; +} + +ReturnValue_t GpsCtrlDummy::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) { + return returnvalue::OK; +} + +LocalPoolDataSetBase* GpsCtrlDummy::getDataSetHandle(sid_t sid) { return nullptr; } diff --git a/dummies/GpsCtrlDummy.h b/dummies/GpsCtrlDummy.h index 3d6f40bc..128a9a85 100644 --- a/dummies/GpsCtrlDummy.h +++ b/dummies/GpsCtrlDummy.h @@ -3,10 +3,18 @@ #include -class GpsCtrlDummy: public ExtendedControllerBase { -public: +class GpsCtrlDummy : public ExtendedControllerBase { + public: GpsCtrlDummy(object_id_t objectId); -private: + + private: + ReturnValue_t handleCommandMessage(CommandMessage* message) override; + void performControlOperation() override; + ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t* msToReachTheMode) override; + ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) override; + LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; }; #endif /* DUMMIES_GPSCTRLDUMMY_H_ */ diff --git a/dummies/GpsDhbDummy.cpp b/dummies/GpsDhbDummy.cpp index 84c82da4..d46e6265 100644 --- a/dummies/GpsDhbDummy.cpp +++ b/dummies/GpsDhbDummy.cpp @@ -10,19 +10,22 @@ void GpsDhbDummy::doStartUp() {} void GpsDhbDummy::doShutDown() {} -ReturnValue_t GpsDhbDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } +ReturnValue_t GpsDhbDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { + return NOTHING_TO_SEND; +} ReturnValue_t GpsDhbDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } ReturnValue_t GpsDhbDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand, - const uint8_t *commandData, size_t commandDataLen) { + const uint8_t *commandData, + size_t commandDataLen) { return returnvalue::OK; } -ReturnValue_t GpsDhbDummy::scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, - size_t *foundLen) { +ReturnValue_t GpsDhbDummy::scanForReply(const uint8_t *start, size_t len, + DeviceCommandId_t *foundId, size_t *foundLen) { return returnvalue::OK; } @@ -35,7 +38,7 @@ void GpsDhbDummy::fillCommandAndReplyMap() {} uint32_t GpsDhbDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; } ReturnValue_t GpsDhbDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, - LocalDataPoolManager &poolManager) { + LocalDataPoolManager &poolManager) { localDataPoolMap.emplace(GpsHyperion::LATITUDE, new PoolEntry({0.0}, 1)); localDataPoolMap.emplace(GpsHyperion::LONGITUDE, new PoolEntry({0.0}, 1)); localDataPoolMap.emplace(GpsHyperion::ALTITUDE, new PoolEntry({0.0})); diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index 1fd8a37c..b983f221 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -64,15 +65,23 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio if (cfg.addAcsBoardDummies) { std::array assemblyDhbs; - assemblyDhbs[0] = new MgmLIS3MDLDummy(objects::MGM_0_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[1] = new MgmLIS3MDLDummy(objects::MGM_2_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[2] = new MgmRm3100Dummy(objects::MGM_1_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[3] = new MgmRm3100Dummy(objects::MGM_3_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[4] = new GyroAdisDummy(objects::GYRO_0_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[5] = new GyroL3GD20Dummy(objects::GYRO_1_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[6] = new GyroAdisDummy(objects::GYRO_2_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - assemblyDhbs[7] = new GyroL3GD20Dummy(objects::GYRO_3_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); - auto* gpsCtrl = new GpsDhbDummy(objects::GPS_CONTROLLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[0] = + new MgmLIS3MDLDummy(objects::MGM_0_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[1] = + new MgmLIS3MDLDummy(objects::MGM_2_LIS3_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[2] = + new MgmRm3100Dummy(objects::MGM_1_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[3] = + new MgmRm3100Dummy(objects::MGM_3_RM3100_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[4] = + new GyroAdisDummy(objects::GYRO_0_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[5] = + new GyroL3GD20Dummy(objects::GYRO_1_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[6] = + new GyroAdisDummy(objects::GYRO_2_ADIS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + assemblyDhbs[7] = + new GyroL3GD20Dummy(objects::GYRO_3_L3G_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + auto* gpsCtrl = new GpsCtrlDummy(objects::GPS_CONTROLLER); ObjectFactory::createAcsBoardAssy(pwrSwitcher, assemblyDhbs, gpsCtrl, gpioIF); } diff --git a/dummies/helpers.h b/dummies/helpers.h index 1d30f451..878702e3 100644 --- a/dummies/helpers.h +++ b/dummies/helpers.h @@ -2,6 +2,8 @@ #include +class GpioIF; + namespace dummy { struct DummyCfg { -- 2.43.0 From 6c0234149ea3be3361d2ab8c05f1cf73a46a909a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 16:19:14 +0100 Subject: [PATCH 05/10] compile fixes --- bsp_q7s/em/emObjectFactory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 693da405..1f94e0d6 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -55,7 +55,7 @@ void ObjectFactory::produce(void* args) { createPcduComponents(gpioComIF, &pwrSwitcher); #endif - dummy::createDummies(dummyCfg, *pwrSwitcher); + dummy::createDummies(dummyCfg, *pwrSwitcher, gpioComIF); new CoreController(objects::CORE_CONTROLLER); @@ -75,7 +75,7 @@ void ObjectFactory::produce(void* args) { // createRadSensorComponent(gpioComIF); #if OBSW_ADD_ACS_BOARD == 1 - createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); + createAcsBoardComponents(gpioComIF, uartComIF, *pwrSwitcher); #endif #if OBSW_ADD_MGT == 1 -- 2.43.0 From 2813d229bbf6034eb075bf2b5c08577c183168ad Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 13 Feb 2023 16:39:26 +0100 Subject: [PATCH 06/10] comntinue --- bsp_q7s/core/ObjectFactory.cpp | 1 - dummies/helpers.cpp | 8 ++++++-- mission/core/GenericFactory.cpp | 2 ++ mission/core/GenericFactory.h | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 16ba3325..e202105b 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -242,7 +242,6 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo PowerSwitchIF& pwrSwitcher) { using namespace gpio; GpioCookie* gpioCookieAcsBoard = new GpioCookie(); - std::array assemblyChildren; std::stringstream consumer; GpiodRegularByLineName* gpio = nullptr; diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index b983f221..98474289 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -28,6 +28,7 @@ #include "mission/core/GenericFactory.h" #include "mission/devices/devicedefinitions/GomspaceDefinitions.h" #include "mission/system/tree/acsModeTree.h" +#include "mission/system/tree/payloadModeTree.h" using namespace dummy; @@ -49,7 +50,9 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio rws[3] = new RwDummy(objects::RW4, objects::DUMMY_COM_IF, comCookieDummy); ObjectFactory::createRwAssy(pwrSwitcher, pcdu::Switches::PDU2_CH2_RW_5V, rws, rwIds); new SaDeplDummy(objects::SOLAR_ARRAY_DEPL_HANDLER); - new StarTrackerDummy(objects::STAR_TRACKER, objects::DUMMY_COM_IF, comCookieDummy); + auto* strDummy = + new StarTrackerDummy(objects::STAR_TRACKER, objects::DUMMY_COM_IF, comCookieDummy); + strDummy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); if (cfg.addSyrlinksDummies) { new SyrlinksDummy(objects::SYRLINKS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); } @@ -185,6 +188,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER, tempSensorDummies, tempTmpSensorDummies); } - new CamSwitcher(objects::CAM_SWITCHER, pwrSwitcher, power::NO_SWITCH); + auto* camSwitcher = new CamSwitcher(objects::CAM_SWITCHER, pwrSwitcher, power::NO_SWITCH); + camSwitcher->connectModeTreeParent(satsystem::pl::SUBSYSTEM); new PlPcduDummy(objects::PLPCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); } diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 6506c184..7c8bd689 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -281,3 +281,5 @@ void ObjectFactory::createAcsBoardAssy(PowerSwitchIF& pwrSwitcher, gpsCtrl->connectModeTreeParent(*acsAss); acsAss->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); } + +void ObjectFactory::createTcsBoardAssy(PowerSwitchIF& pwrSwitcher) {} diff --git a/mission/core/GenericFactory.h b/mission/core/GenericFactory.h index 4b380336..dd7c6b18 100644 --- a/mission/core/GenericFactory.h +++ b/mission/core/GenericFactory.h @@ -26,6 +26,7 @@ void createRwAssy(PowerSwitchIF& pwrSwitcher, power::Switch_t theSwitch, void createSusAssy(PowerSwitchIF& pwrSwitcher, std::array suses); void createAcsBoardAssy(PowerSwitchIF& pwrSwitcher, std::array assemblyDhbs, ExtendedControllerBase* gpsCtrl, GpioIF* gpioComIF); +void createTcsBoardAssy(PowerSwitchIF& pwrSwitcher); } // namespace ObjectFactory -- 2.43.0 From 17fa9a6e82f217c88fa830651e450da2247867a4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 13 Feb 2023 17:04:04 +0100 Subject: [PATCH 07/10] add TCS board assy for EM --- bsp_q7s/core/ObjectFactory.cpp | 1 + dummies/helpers.cpp | 5 +++++ linux/ObjectFactory.cpp | 33 +++++++-------------------------- mission/core/GenericFactory.cpp | 9 ++++++++- mission/core/GenericFactory.h | 23 ++++++++++++++++++++++- 5 files changed, 43 insertions(+), 28 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index e202105b..2bf36743 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -343,6 +343,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, SerialCo #if OBSW_ADD_ACS_BOARD == 1 std::string spiDev = q7s::SPI_DEFAULT_DEV; + std::array assemblyChildren; SpiCookie* spiCookie = new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index 98474289..2115867f 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include "TemperatureSensorInserter.h" #include "dummies/Max31865Dummy.h" @@ -187,6 +188,10 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER, tempSensorDummies, tempTmpSensorDummies); + TcsBoardAssembly* tcsBoardAssy = ObjectFactory::createTcsBoardAssy(pwrSwitcher); + for (auto& rtd : tempSensorDummies) { + rtd.second->connectModeTreeParent(*tcsBoardAssy); + } } auto* camSwitcher = new CamSwitcher(objects::CAM_SWITCHER, pwrSwitcher, power::NO_SWITCH); camSwitcher->connectModeTreeParent(satsystem::pl::SUBSYSTEM); diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index add6a755..1686eb03 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -270,32 +270,13 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, {addresses::RTD_IC_18, gpioIds::RTD_IC_18}, }}; // HSPD: Heatspreader - std::array, NUM_RTDS> rtdInfos = {{ - {objects::RTD_0_IC3_PLOC_HEATSPREADER, "RTD_0_PLOC_HSPD"}, - {objects::RTD_1_IC4_PLOC_MISSIONBOARD, "RTD_1_PLOC_MISSIONBRD"}, - {objects::RTD_2_IC5_4K_CAMERA, "RTD_2_4K_CAMERA"}, - {objects::RTD_3_IC6_DAC_HEATSPREADER, "RTD_3_DAC_HSPD"}, - {objects::RTD_4_IC7_STARTRACKER, "RTD_4_STARTRACKER"}, - {objects::RTD_5_IC8_RW1_MX_MY, "RTD_5_RW1_MX_MY"}, - {objects::RTD_6_IC9_DRO, "RTD_6_DRO"}, - {objects::RTD_7_IC10_SCEX, "RTD_7_SCEX"}, - {objects::RTD_8_IC11_X8, "RTD_8_X8"}, - {objects::RTD_9_IC12_HPA, "RTD_9_HPA"}, - {objects::RTD_10_IC13_PL_TX, "RTD_10_PL_TX,"}, - {objects::RTD_11_IC14_MPA, "RTD_11_MPA"}, - {objects::RTD_12_IC15_ACU, "RTD_12_ACU"}, - {objects::RTD_13_IC16_PLPCDU_HEATSPREADER, "RTD_13_PLPCDU_HSPD"}, - {objects::RTD_14_IC17_TCS_BOARD, "RTD_14_TCS_BOARD"}, - {objects::RTD_15_IC18_IMTQ, "RTD_15_IMTQ"}, - }}; + std::array rtdCookies = {}; std::array rtds = {}; RtdFdir* rtdFdir = nullptr; - TcsBoardHelper helper(rtdInfos); - TcsBoardAssembly* tcsBoardAss = new TcsBoardAssembly( - objects::TCS_BOARD_ASS, pwrSwitcher, pcdu::Switches::PDU1_CH0_TCS_BOARD_3V3, helper); - tcsBoardAss->connectModeTreeParent(satsystem::tcs::SUBSYSTEM); + TcsBoardAssembly* tcsBoardAss = ObjectFactory::createTcsBoardAssy(*pwrSwitcher); + // Create special low level reader communication interface new Max31865RtdReader(objects::SPI_RTD_COM_IF, comIF, gpioComIF); for (uint8_t idx = 0; idx < NUM_RTDS; idx++) { @@ -303,16 +284,16 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, MAX31865::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); rtdCookies[idx]->setMutexParams(MutexIF::TimeoutType::WAITING, spi::RTD_CS_TIMEOUT); Max31865ReaderCookie* rtdLowLevelCookie = - new Max31865ReaderCookie(rtdInfos[idx].first, idx, rtdInfos[idx].second, rtdCookies[idx]); + new Max31865ReaderCookie(RTD_INFOS[idx].first, idx, RTD_INFOS[idx].second, rtdCookies[idx]); rtds[idx] = - new Max31865EiveHandler(rtdInfos[idx].first, objects::SPI_RTD_COM_IF, rtdLowLevelCookie); - rtds[idx]->setDeviceInfo(idx, rtdInfos[idx].second); + new Max31865EiveHandler(RTD_INFOS[idx].first, objects::SPI_RTD_COM_IF, rtdLowLevelCookie); + rtds[idx]->setDeviceInfo(idx, RTD_INFOS[idx].second); ReturnValue_t result = rtds[idx]->connectModeTreeParent(*tcsBoardAss); if (result != returnvalue::OK) { sif::error << "Connecting RTD " << static_cast(idx) << " to RTD Assembly failed" << std::endl; } - rtdFdir = new RtdFdir(rtdInfos[idx].first); + rtdFdir = new RtdFdir(RTD_INFOS[idx].first); rtds[idx]->setCustomFdir(rtdFdir); #if OBSW_DEBUG_RTD == 1 rtds[idx]->setDebugMode(true, 5); diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 7c8bd689..992c0093 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -282,4 +283,10 @@ void ObjectFactory::createAcsBoardAssy(PowerSwitchIF& pwrSwitcher, acsAss->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); } -void ObjectFactory::createTcsBoardAssy(PowerSwitchIF& pwrSwitcher) {} +TcsBoardAssembly* ObjectFactory::createTcsBoardAssy(PowerSwitchIF& pwrSwitcher) { + TcsBoardHelper helper(RTD_INFOS); + TcsBoardAssembly* tcsBoardAss = new TcsBoardAssembly( + objects::TCS_BOARD_ASS, &pwrSwitcher, pcdu::Switches::PDU1_CH0_TCS_BOARD_3V3, helper); + tcsBoardAss->connectModeTreeParent(satsystem::tcs::SUBSYSTEM); + return tcsBoardAss; +} diff --git a/mission/core/GenericFactory.h b/mission/core/GenericFactory.h index dd7c6b18..30f2d6bb 100644 --- a/mission/core/GenericFactory.h +++ b/mission/core/GenericFactory.h @@ -6,12 +6,33 @@ #include "fsfw/objectmanager/SystemObjectIF.h" #include "fsfw/power/PowerSwitchIF.h" #include "fsfw_hal/common/gpio/GpioIF.h" +#include "mission/devices/devicedefinitions/Max31865Definitions.h" class HeaterHandler; class HealthTableIF; class PusTmFunnel; class CfdpTmFunnel; class ExtendedControllerBase; +class TcsBoardAssembly; + +const std::array, EiveMax31855::NUM_RTDS> RTD_INFOS = {{ + {objects::RTD_0_IC3_PLOC_HEATSPREADER, "RTD_0_PLOC_HSPD"}, + {objects::RTD_1_IC4_PLOC_MISSIONBOARD, "RTD_1_PLOC_MISSIONBRD"}, + {objects::RTD_2_IC5_4K_CAMERA, "RTD_2_4K_CAMERA"}, + {objects::RTD_3_IC6_DAC_HEATSPREADER, "RTD_3_DAC_HSPD"}, + {objects::RTD_4_IC7_STARTRACKER, "RTD_4_STARTRACKER"}, + {objects::RTD_5_IC8_RW1_MX_MY, "RTD_5_RW1_MX_MY"}, + {objects::RTD_6_IC9_DRO, "RTD_6_DRO"}, + {objects::RTD_7_IC10_SCEX, "RTD_7_SCEX"}, + {objects::RTD_8_IC11_X8, "RTD_8_X8"}, + {objects::RTD_9_IC12_HPA, "RTD_9_HPA"}, + {objects::RTD_10_IC13_PL_TX, "RTD_10_PL_TX,"}, + {objects::RTD_11_IC14_MPA, "RTD_11_MPA"}, + {objects::RTD_12_IC15_ACU, "RTD_12_ACU"}, + {objects::RTD_13_IC16_PLPCDU_HEATSPREADER, "RTD_13_PLPCDU_HSPD"}, + {objects::RTD_14_IC17_TCS_BOARD, "RTD_14_TCS_BOARD"}, + {objects::RTD_15_IC18_IMTQ, "RTD_15_IMTQ"}, +}}; namespace ObjectFactory { @@ -26,7 +47,7 @@ void createRwAssy(PowerSwitchIF& pwrSwitcher, power::Switch_t theSwitch, void createSusAssy(PowerSwitchIF& pwrSwitcher, std::array suses); void createAcsBoardAssy(PowerSwitchIF& pwrSwitcher, std::array assemblyDhbs, ExtendedControllerBase* gpsCtrl, GpioIF* gpioComIF); -void createTcsBoardAssy(PowerSwitchIF& pwrSwitcher); +TcsBoardAssembly* createTcsBoardAssy(PowerSwitchIF& pwrSwitcher); } // namespace ObjectFactory -- 2.43.0 From f5092b27ba86c36716d00476b8018ee5a81cb27c Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 13 Feb 2023 17:24:56 +0100 Subject: [PATCH 08/10] add SCEX dummy --- dummies/CMakeLists.txt | 1 + dummies/ScexDummy.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ dummies/ScexDummy.h | 34 ++++++++++++++++++++++++++++++++++ dummies/helpers.cpp | 3 +++ 4 files changed, 78 insertions(+) create mode 100644 dummies/ScexDummy.cpp create mode 100644 dummies/ScexDummy.h diff --git a/dummies/CMakeLists.txt b/dummies/CMakeLists.txt index 38527dd6..1e41f7d2 100644 --- a/dummies/CMakeLists.txt +++ b/dummies/CMakeLists.txt @@ -20,6 +20,7 @@ target_sources( GyroL3GD20Dummy.cpp MgmLIS3MDLDummy.cpp PlPcduDummy.cpp + ScexDummy.cpp CoreControllerDummy.cpp helpers.cpp MgmRm3100Dummy.cpp diff --git a/dummies/ScexDummy.cpp b/dummies/ScexDummy.cpp new file mode 100644 index 00000000..303570ff --- /dev/null +++ b/dummies/ScexDummy.cpp @@ -0,0 +1,40 @@ +#include "ScexDummy.h" + +ScexDummy::ScexDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) + : DeviceHandlerBase(objectId, comif, comCookie) {} + +ScexDummy::~ScexDummy() {} + +void ScexDummy::doStartUp() {} + +void ScexDummy::doShutDown() {} + +ReturnValue_t ScexDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { return NOTHING_TO_SEND; } + +ReturnValue_t ScexDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) { + return NOTHING_TO_SEND; +} + +ReturnValue_t ScexDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand, + const uint8_t *commandData, + size_t commandDataLen) { + return returnvalue::OK; +} + +ReturnValue_t ScexDummy::scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, + size_t *foundLen) { + return returnvalue::OK; +} + +ReturnValue_t ScexDummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) { + return returnvalue::OK; +} + +void ScexDummy::fillCommandAndReplyMap() {} + +uint32_t ScexDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; } + +ReturnValue_t ScexDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) { + return returnvalue::OK; +} diff --git a/dummies/ScexDummy.h b/dummies/ScexDummy.h new file mode 100644 index 00000000..dc0cc73a --- /dev/null +++ b/dummies/ScexDummy.h @@ -0,0 +1,34 @@ +#ifndef DUMMIES_SCEXDUMMY_H_ +#define DUMMIES_SCEXDUMMY_H_ + +#include + +class ScexDummy : public DeviceHandlerBase { + public: + static const DeviceCommandId_t SIMPLE_COMMAND = 1; + static const DeviceCommandId_t PERIODIC_REPLY = 2; + + static const uint8_t SIMPLE_COMMAND_DATA = 1; + static const uint8_t PERIODIC_REPLY_DATA = 2; + + ScexDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie); + virtual ~ScexDummy(); + + protected: + void doStartUp() override; + void doShutDown() override; + ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData, + size_t commandDataLen) override; + ReturnValue_t scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, + size_t *foundLen) override; + ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override; + void fillCommandAndReplyMap() override; + uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; + ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) override; +}; + + +#endif /* DUMMIES_SCEXDUMMY_H_ */ diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index 2115867f..ee509788 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -195,5 +196,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio } auto* camSwitcher = new CamSwitcher(objects::CAM_SWITCHER, pwrSwitcher, power::NO_SWITCH); camSwitcher->connectModeTreeParent(satsystem::pl::SUBSYSTEM); + auto* scexDummy = new ScexDummy(objects::SCEX, objects::DUMMY_COM_IF, comCookieDummy); + scexDummy->connectModeTreeParent(satsystem::pl::SUBSYSTEM); new PlPcduDummy(objects::PLPCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); } -- 2.43.0 From 4cccafbe01bba0298c9a60837f93a37a6a98ecad Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 13 Feb 2023 17:59:08 +0100 Subject: [PATCH 09/10] no error im happy --- dummies/CMakeLists.txt | 2 + dummies/PlocMpsocDummy.cpp | 42 +++++++++++++++ dummies/PlocMpsocDummy.h | 30 +++++++++++ dummies/PlocSupervisorDummy.cpp | 44 +++++++++++++++ dummies/PlocSupervisorDummy.h | 30 +++++++++++ dummies/ScexDummy.h | 6 +-- dummies/helpers.cpp | 94 ++++++++++++++++++++------------- dummies/helpers.h | 1 + 8 files changed, 206 insertions(+), 43 deletions(-) create mode 100644 dummies/PlocMpsocDummy.cpp create mode 100644 dummies/PlocMpsocDummy.h create mode 100644 dummies/PlocSupervisorDummy.cpp create mode 100644 dummies/PlocSupervisorDummy.h diff --git a/dummies/CMakeLists.txt b/dummies/CMakeLists.txt index 1e41f7d2..810cc048 100644 --- a/dummies/CMakeLists.txt +++ b/dummies/CMakeLists.txt @@ -22,6 +22,8 @@ target_sources( PlPcduDummy.cpp ScexDummy.cpp CoreControllerDummy.cpp + PlocMpsocDummy.cpp + PlocSupervisorDummy.cpp helpers.cpp MgmRm3100Dummy.cpp Tmp1075Dummy.cpp) diff --git a/dummies/PlocMpsocDummy.cpp b/dummies/PlocMpsocDummy.cpp new file mode 100644 index 00000000..2df55b1d --- /dev/null +++ b/dummies/PlocMpsocDummy.cpp @@ -0,0 +1,42 @@ +#include "PlocMpsocDummy.h" + +PlocMpsocDummy::PlocMpsocDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie) + : DeviceHandlerBase(objectId, comif, comCookie) {} + +PlocMpsocDummy::~PlocMpsocDummy() {} + +void PlocMpsocDummy::doStartUp() {} + +void PlocMpsocDummy::doShutDown() {} + +ReturnValue_t PlocMpsocDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { + return NOTHING_TO_SEND; +} + +ReturnValue_t PlocMpsocDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) { + return NOTHING_TO_SEND; +} + +ReturnValue_t PlocMpsocDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand, + const uint8_t *commandData, + size_t commandDataLen) { + return returnvalue::OK; +} + +ReturnValue_t PlocMpsocDummy::scanForReply(const uint8_t *start, size_t len, + DeviceCommandId_t *foundId, size_t *foundLen) { + return returnvalue::OK; +} + +ReturnValue_t PlocMpsocDummy::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) { + return returnvalue::OK; +} + +void PlocMpsocDummy::fillCommandAndReplyMap() {} + +uint32_t PlocMpsocDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; } + +ReturnValue_t PlocMpsocDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) { + return returnvalue::OK; +} diff --git a/dummies/PlocMpsocDummy.h b/dummies/PlocMpsocDummy.h new file mode 100644 index 00000000..7beaa76b --- /dev/null +++ b/dummies/PlocMpsocDummy.h @@ -0,0 +1,30 @@ +#pragma once + +#include + +class PlocMpsocDummy : public DeviceHandlerBase { + public: + static const DeviceCommandId_t SIMPLE_COMMAND = 1; + static const DeviceCommandId_t PERIODIC_REPLY = 2; + + static const uint8_t SIMPLE_COMMAND_DATA = 1; + static const uint8_t PERIODIC_REPLY_DATA = 2; + + PlocMpsocDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie); + virtual ~PlocMpsocDummy(); + + protected: + void doStartUp() override; + void doShutDown() override; + ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData, + size_t commandDataLen) override; + ReturnValue_t scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, + size_t *foundLen) override; + ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override; + void fillCommandAndReplyMap() override; + uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; + ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) override; +}; diff --git a/dummies/PlocSupervisorDummy.cpp b/dummies/PlocSupervisorDummy.cpp new file mode 100644 index 00000000..d4730fe9 --- /dev/null +++ b/dummies/PlocSupervisorDummy.cpp @@ -0,0 +1,44 @@ +#include "PlocSupervisorDummy.h" + +PlocSupervisorDummy::PlocSupervisorDummy(object_id_t objectId, object_id_t comif, + CookieIF *comCookie) + : DeviceHandlerBase(objectId, comif, comCookie) {} + +PlocSupervisorDummy::~PlocSupervisorDummy() {} + +void PlocSupervisorDummy::doStartUp() {} + +void PlocSupervisorDummy::doShutDown() {} + +ReturnValue_t PlocSupervisorDummy::buildNormalDeviceCommand(DeviceCommandId_t *id) { + return NOTHING_TO_SEND; +} + +ReturnValue_t PlocSupervisorDummy::buildTransitionDeviceCommand(DeviceCommandId_t *id) { + return NOTHING_TO_SEND; +} + +ReturnValue_t PlocSupervisorDummy::buildCommandFromCommand(DeviceCommandId_t deviceCommand, + const uint8_t *commandData, + size_t commandDataLen) { + return returnvalue::OK; +} + +ReturnValue_t PlocSupervisorDummy::scanForReply(const uint8_t *start, size_t len, + DeviceCommandId_t *foundId, size_t *foundLen) { + return returnvalue::OK; +} + +ReturnValue_t PlocSupervisorDummy::interpretDeviceReply(DeviceCommandId_t id, + const uint8_t *packet) { + return returnvalue::OK; +} + +void PlocSupervisorDummy::fillCommandAndReplyMap() {} + +uint32_t PlocSupervisorDummy::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; } + +ReturnValue_t PlocSupervisorDummy::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) { + return returnvalue::OK; +} diff --git a/dummies/PlocSupervisorDummy.h b/dummies/PlocSupervisorDummy.h new file mode 100644 index 00000000..4118c893 --- /dev/null +++ b/dummies/PlocSupervisorDummy.h @@ -0,0 +1,30 @@ +#pragma once + +#include + +class PlocSupervisorDummy : public DeviceHandlerBase { + public: + static const DeviceCommandId_t SIMPLE_COMMAND = 1; + static const DeviceCommandId_t PERIODIC_REPLY = 2; + + static const uint8_t SIMPLE_COMMAND_DATA = 1; + static const uint8_t PERIODIC_REPLY_DATA = 2; + + PlocSupervisorDummy(object_id_t objectId, object_id_t comif, CookieIF *comCookie); + virtual ~PlocSupervisorDummy(); + + protected: + void doStartUp() override; + void doShutDown() override; + ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t *id) override; + ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t *commandData, + size_t commandDataLen) override; + ReturnValue_t scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, + size_t *foundLen) override; + ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override; + void fillCommandAndReplyMap() override; + uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; + ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) override; +}; diff --git a/dummies/ScexDummy.h b/dummies/ScexDummy.h index dc0cc73a..98762db3 100644 --- a/dummies/ScexDummy.h +++ b/dummies/ScexDummy.h @@ -1,5 +1,4 @@ -#ifndef DUMMIES_SCEXDUMMY_H_ -#define DUMMIES_SCEXDUMMY_H_ +#pragma once #include @@ -29,6 +28,3 @@ class ScexDummy : public DeviceHandlerBase { ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) override; }; - - -#endif /* DUMMIES_SCEXDUMMY_H_ */ diff --git a/dummies/helpers.cpp b/dummies/helpers.cpp index ee509788..a5b84451 100644 --- a/dummies/helpers.cpp +++ b/dummies/helpers.cpp @@ -15,12 +15,15 @@ #include #include #include +#include +#include #include #include #include #include #include #include +#include #include #include @@ -30,9 +33,9 @@ #include "mission/core/GenericFactory.h" #include "mission/devices/devicedefinitions/GomspaceDefinitions.h" #include "mission/system/tree/acsModeTree.h" +#include "mission/system/tree/comModeTree.h" #include "mission/system/tree/payloadModeTree.h" - -using namespace dummy; +#include "mission/system/tree/tcsModeTree.h" void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpioIF) { new ComIFDummy(objects::DUMMY_COM_IF); @@ -56,7 +59,9 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio new StarTrackerDummy(objects::STAR_TRACKER, objects::DUMMY_COM_IF, comCookieDummy); strDummy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); if (cfg.addSyrlinksDummies) { - new SyrlinksDummy(objects::SYRLINKS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + auto* syrlinksDummy = + new SyrlinksDummy(objects::SYRLINKS_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + syrlinksDummy->connectModeTreeParent(satsystem::com::SUBSYSTEM); } auto* imtqDummy = new ImtqDummy(objects::IMTQ_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); imtqDummy->enableThermalModule(ThermalStateCfg()); @@ -120,83 +125,96 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio } if (cfg.addTempSensorDummies) { - std::map tempSensorDummies; - tempSensorDummies.emplace(objects::RTD_0_IC3_PLOC_HEATSPREADER, - new Max31865Dummy(objects::RTD_0_IC3_PLOC_HEATSPREADER, - objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace(objects::RTD_1_IC4_PLOC_MISSIONBOARD, - new Max31865Dummy(objects::RTD_1_IC4_PLOC_MISSIONBOARD, - objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + std::map rtdSensorDummies; + rtdSensorDummies.emplace(objects::RTD_0_IC3_PLOC_HEATSPREADER, + new Max31865Dummy(objects::RTD_0_IC3_PLOC_HEATSPREADER, + objects::DUMMY_COM_IF, comCookieDummy)); + rtdSensorDummies.emplace(objects::RTD_1_IC4_PLOC_MISSIONBOARD, + new Max31865Dummy(objects::RTD_1_IC4_PLOC_MISSIONBOARD, + objects::DUMMY_COM_IF, comCookieDummy)); + rtdSensorDummies.emplace( objects::RTD_2_IC5_4K_CAMERA, new Max31865Dummy(objects::RTD_2_IC5_4K_CAMERA, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace(objects::RTD_3_IC6_DAC_HEATSPREADER, - new Max31865Dummy(objects::RTD_3_IC6_DAC_HEATSPREADER, - objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace(objects::RTD_3_IC6_DAC_HEATSPREADER, + new Max31865Dummy(objects::RTD_3_IC6_DAC_HEATSPREADER, + objects::DUMMY_COM_IF, comCookieDummy)); + rtdSensorDummies.emplace( objects::RTD_4_IC7_STARTRACKER, new Max31865Dummy(objects::RTD_4_IC7_STARTRACKER, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace( objects::RTD_5_IC8_RW1_MX_MY, new Max31865Dummy(objects::RTD_5_IC8_RW1_MX_MY, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace( objects::RTD_6_IC9_DRO, new Max31865Dummy(objects::RTD_6_IC9_DRO, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace( objects::RTD_7_IC10_SCEX, new Max31865Dummy(objects::RTD_7_IC10_SCEX, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace( objects::RTD_8_IC11_X8, new Max31865Dummy(objects::RTD_8_IC11_X8, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace( objects::RTD_9_IC12_HPA, new Max31865Dummy(objects::RTD_9_IC12_HPA, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace( objects::RTD_10_IC13_PL_TX, new Max31865Dummy(objects::RTD_10_IC13_PL_TX, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace( objects::RTD_11_IC14_MPA, new Max31865Dummy(objects::RTD_11_IC14_MPA, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace( objects::RTD_12_IC15_ACU, new Max31865Dummy(objects::RTD_12_IC15_ACU, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace(objects::RTD_13_IC16_PLPCDU_HEATSPREADER, - new Max31865Dummy(objects::RTD_13_IC16_PLPCDU_HEATSPREADER, - objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace(objects::RTD_13_IC16_PLPCDU_HEATSPREADER, + new Max31865Dummy(objects::RTD_13_IC16_PLPCDU_HEATSPREADER, + objects::DUMMY_COM_IF, comCookieDummy)); + rtdSensorDummies.emplace( objects::RTD_14_IC17_TCS_BOARD, new Max31865Dummy(objects::RTD_14_IC17_TCS_BOARD, objects::DUMMY_COM_IF, comCookieDummy)); - tempSensorDummies.emplace( + rtdSensorDummies.emplace( objects::RTD_15_IC18_IMTQ, new Max31865Dummy(objects::RTD_15_IC18_IMTQ, objects::DUMMY_COM_IF, comCookieDummy)); - std::map tempTmpSensorDummies; - tempTmpSensorDummies.emplace( + std::map tmpSensorDummies; + tmpSensorDummies.emplace( objects::TMP1075_HANDLER_TCS_0, new Tmp1075Dummy(objects::TMP1075_HANDLER_TCS_0, objects::DUMMY_COM_IF, comCookieDummy)); - tempTmpSensorDummies.emplace( + tmpSensorDummies.emplace( objects::TMP1075_HANDLER_TCS_1, new Tmp1075Dummy(objects::TMP1075_HANDLER_TCS_1, objects::DUMMY_COM_IF, comCookieDummy)); - tempTmpSensorDummies.emplace( + tmpSensorDummies.emplace( objects::TMP1075_HANDLER_PLPCDU_0, new Tmp1075Dummy(objects::TMP1075_HANDLER_PLPCDU_0, objects::DUMMY_COM_IF, comCookieDummy)); - tempTmpSensorDummies.emplace( + tmpSensorDummies.emplace( objects::TMP1075_HANDLER_PLPCDU_1, new Tmp1075Dummy(objects::TMP1075_HANDLER_PLPCDU_1, objects::DUMMY_COM_IF, comCookieDummy)); - tempTmpSensorDummies.emplace( + tmpSensorDummies.emplace( objects::TMP1075_HANDLER_IF_BOARD, new Tmp1075Dummy(objects::TMP1075_HANDLER_IF_BOARD, objects::DUMMY_COM_IF, comCookieDummy)); - new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER, tempSensorDummies, - tempTmpSensorDummies); + new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER, rtdSensorDummies, + tmpSensorDummies); TcsBoardAssembly* tcsBoardAssy = ObjectFactory::createTcsBoardAssy(pwrSwitcher); - for (auto& rtd : tempSensorDummies) { + for (auto& rtd : rtdSensorDummies) { rtd.second->connectModeTreeParent(*tcsBoardAssy); } + for (auto& tmp : tmpSensorDummies) { + tmp.second->connectModeTreeParent(satsystem::tcs::SUBSYSTEM); + } } auto* camSwitcher = new CamSwitcher(objects::CAM_SWITCHER, pwrSwitcher, power::NO_SWITCH); camSwitcher->connectModeTreeParent(satsystem::pl::SUBSYSTEM); auto* scexDummy = new ScexDummy(objects::SCEX, objects::DUMMY_COM_IF, comCookieDummy); scexDummy->connectModeTreeParent(satsystem::pl::SUBSYSTEM); - new PlPcduDummy(objects::PLPCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + auto* plPcduDummy = + new PlPcduDummy(objects::PLPCDU_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + plPcduDummy->connectModeTreeParent(satsystem::pl::SUBSYSTEM); + if (cfg.addPlocDummies) { + auto* plocMpsocDummy = + new PlocMpsocDummy(objects::PLOC_MPSOC_HANDLER, objects::DUMMY_COM_IF, comCookieDummy); + plocMpsocDummy->connectModeTreeParent(satsystem::pl::SUBSYSTEM); + auto* plocSupervisorDummy = new PlocSupervisorDummy(objects::PLOC_SUPERVISOR_HANDLER, + objects::DUMMY_COM_IF, comCookieDummy); + plocSupervisorDummy->connectModeTreeParent(satsystem::pl::SUBSYSTEM); + } } diff --git a/dummies/helpers.h b/dummies/helpers.h index 878702e3..2181c79c 100644 --- a/dummies/helpers.h +++ b/dummies/helpers.h @@ -14,6 +14,7 @@ struct DummyCfg { bool addSusDummies = true; bool addTempSensorDummies = true; bool addRtdComIFDummy = true; + bool addPlocDummies = true; }; void createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitch, GpioIF* gpioIF); -- 2.43.0 From 6a1d4bd52fb922e7e1877625ad47a4631b60f1bb Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 13 Feb 2023 18:01:16 +0100 Subject: [PATCH 10/10] continue --- bsp_q7s/core/scheduling.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index cc3108e8..b23a0e98 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -233,12 +233,10 @@ void scheduling::initTasks() { if (result != returnvalue::OK) { scheduling::printAddObjectError("TCS_SUBSYSTEM", objects::TCS_SUBSYSTEM); } -#if OBSW_ADD_RTD_DEVICES == 1 result = tcsSystemTask->addComponent(objects::TCS_BOARD_ASS); if (result != returnvalue::OK) { scheduling::printAddObjectError("TCS_BOARD_ASS", objects::TCS_BOARD_ASS); } -#endif /* OBSW_ADD_RTD_DEVICES */ #if OBSW_ADD_TCS_CTRL == 1 result = tcsSystemTask->addComponent(objects::THERMAL_CONTROLLER); if (result != returnvalue::OK) { -- 2.43.0