diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cceecb3..2000c4f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ list yields a list of all related PRs for each release. - Fix for EM SW: Always create ACS Task - Added Scex device handler and Scex uart reader PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/303 +- ACS Subsystem. PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/228 # [v1.13.0] 24.08.2022 diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index f4607de4..29b1dda8 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -65,6 +65,6 @@ void ObjectFactory::produce(void* args) { dummy::createDummies(cfg); new TemperatureSensorsDummy(); new SusDummy(); - new ThermalController(objects::THERMAL_CONTROLLER, objects::NO_OBJECT); + new ThermalController(objects::THERMAL_CONTROLLER); new TestTask(objects::TEST_TASK); } diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index b7da3e20..5a807b64 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -31,10 +31,7 @@ xsc::Chip CoreController::CURRENT_CHIP = xsc::Chip::NO_CHIP; xsc::Copy CoreController::CURRENT_COPY = xsc::Copy::NO_COPY; CoreController::CoreController(object_id_t objectId) - : ExtendedControllerBase(objectId, objects::NO_OBJECT, 5), - opDivider5(5), - opDivider10(10), - hkSet(this) { + : ExtendedControllerBase(objectId, 5), opDivider5(5), opDivider10(10), hkSet(this) { ReturnValue_t result = returnvalue::OK; try { result = initWatchdogFifo(); diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index fb75964a..67dbfabb 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -184,6 +184,10 @@ void initmission::initTasks() { initmission::printAddObjectError("SUS_BOARD_ASS", objects::SUS_BOARD_ASS); } #endif + result = acsSysTask->addComponent(objects::ACS_SUBSYSTEM); + if (result != returnvalue::OK) { + initmission::printAddObjectError("ACS_SUBSYSTEM", objects::ACS_SUBSYSTEM); + } #if OBSW_ADD_RTD_DEVICES == 1 PeriodicTaskIF* tcsPollingTask = factory->createPeriodicTask( @@ -192,6 +196,7 @@ void initmission::initTasks() { if (result != returnvalue::OK) { initmission::printAddObjectError("SPI_RTD_POLLING", objects::SPI_RTD_COM_IF); } + PeriodicTaskIF* tcsTask = factory->createPeriodicTask( "TCS_TASK", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc); std::array rtdIds = { diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 949fb1db..fe6e112d 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -1,7 +1,5 @@ #include "ObjectFactory.h" -#include - #include "OBSWConfig.h" #include "bsp_q7s/boardtest/Q7STestTask.h" #include "bsp_q7s/callbacks/gnssCallback.h" @@ -23,6 +21,7 @@ #include "linux/callbacks/gpioCallbacks.h" #include "linux/csp/CspComIF.h" #include "linux/devices/GPSHyperionLinuxController.h" +#include "linux/devices/ScexUartReader.h" #include "linux/devices/devicedefinitions/PlocMPSoCDefinitions.h" #include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" #include "linux/devices/ploc/PlocMPSoCHandler.h" @@ -37,12 +36,15 @@ #include "linux/ipcore/Ptme.h" #include "linux/ipcore/PtmeConfig.h" #include "mission/csp/CspCookie.h" -#include "mission/system/RwAssembly.h" #include "mission/system/fdir/AcsBoardFdir.h" #include "mission/system/fdir/GomspacePowerFdir.h" #include "mission/system/fdir/RtdFdir.h" #include "mission/system/fdir/SusFdir.h" #include "mission/system/fdir/SyrlinksFdir.h" +#include "mission/system/objects/AcsSubsystem.h" +#include "mission/system/objects/RwAssembly.h" +#include "mission/system/objects/TcsBoardAssembly.h" +#include "mission/system/tree/acsModeTree.h" #include "tmtc/pusIds.h" #if OBSW_TEST_LIBGPIOD == 1 #include "linux/boardtest/LibgpiodTest.h" @@ -89,7 +91,7 @@ #include "mission/devices/devicedefinitions/RwDefinitions.h" #include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" #include "mission/devices/devicedefinitions/payloadPcduDefinitions.h" -#include "mission/system/AcsBoardAssembly.h" +#include "mission/system/objects/AcsBoardAssembly.h" #include "mission/tmtc/CcsdsIpCoreHandler.h" #include "mission/tmtc/TmFunnelHandler.h" #include "mission/tmtc/VirtualChannel.h" @@ -228,6 +230,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI PowerSwitchIF* pwrSwitcher) { using namespace gpio; GpioCookie* gpioCookieAcsBoard = new GpioCookie(); + std::vector> assemblyChildren; std::stringstream consumer; GpiodRegularByLineName* gpio = nullptr; @@ -332,11 +335,11 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI 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); - auto mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_0_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, - spiCookie, spi::LIS3_TRANSITION_DELAY); + auto mgmLis3Handler0 = new MgmLIS3MDLHandler( + objects::MGM_0_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::LIS3_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_0_LIS3_HANDLER); - mgmLis3Handler->setCustomFdir(fdir); - static_cast(mgmLis3Handler); + mgmLis3Handler0->setCustomFdir(fdir); + assemblyChildren.push_back(*mgmLis3Handler0); #if OBSW_TEST_ACS == 1 mgmLis3Handler->setStartUpImmediately(); mgmLis3Handler->setToGoToNormalMode(true); @@ -347,13 +350,12 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI spiCookie = new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); - auto mgmRm3100Handler = + auto mgmRm3100Handler1 = new MgmRM3100Handler(objects::MGM_1_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::RM3100_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_1_RM3100_HANDLER); - mgmRm3100Handler->setCustomFdir(fdir); - mgmRm3100Handler->setParent(objects::ACS_BOARD_ASS); - static_cast(mgmRm3100Handler); + mgmRm3100Handler1->setCustomFdir(fdir); + assemblyChildren.push_back(*mgmRm3100Handler1); #if OBSW_TEST_ACS == 1 mgmRm3100Handler->setStartUpImmediately(); mgmRm3100Handler->setToGoToNormalMode(true); @@ -364,12 +366,11 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI spiCookie = new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); - mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_2_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, - spiCookie, spi::LIS3_TRANSITION_DELAY); + auto* mgmLis3Handler2 = new MgmLIS3MDLHandler( + objects::MGM_2_LIS3_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::LIS3_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_2_LIS3_HANDLER); - mgmLis3Handler->setCustomFdir(fdir); - mgmLis3Handler->setParent(objects::ACS_BOARD_ASS); - static_cast(mgmLis3Handler); + mgmLis3Handler2->setCustomFdir(fdir); + assemblyChildren.push_back(*mgmLis3Handler2); #if OBSW_TEST_ACS == 1 mgmLis3Handler->setStartUpImmediately(); mgmLis3Handler->setToGoToNormalMode(true); @@ -380,11 +381,12 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI spiCookie = new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); - mgmRm3100Handler = new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, - spiCookie, spi::RM3100_TRANSITION_DELAY); + auto* mgmRm3100Handler3 = + new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, + spi::RM3100_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::MGM_3_RM3100_HANDLER); - mgmRm3100Handler->setCustomFdir(fdir); - mgmRm3100Handler->setParent(objects::ACS_BOARD_ASS); + mgmRm3100Handler3->setCustomFdir(fdir); + assemblyChildren.push_back(*mgmRm3100Handler3); #if OBSW_TEST_ACS == 1 mgmRm3100Handler->setStartUpImmediately(); mgmRm3100Handler->setToGoToNormalMode(true); @@ -402,8 +404,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI ADIS1650X::Type::ADIS16505); fdir = new AcsBoardFdir(objects::GYRO_0_ADIS_HANDLER); adisHandler->setCustomFdir(fdir); - adisHandler->setParent(objects::ACS_BOARD_ASS); - static_cast(adisHandler); + assemblyChildren.push_back(*adisHandler); #if OBSW_TEST_ACS == 1 adisHandler->setStartUpImmediately(); adisHandler->setToGoToNormalModeImmediately(); @@ -414,12 +415,11 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI // Gyro 1 Side A spiCookie = new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); - auto gyroL3gHandler = new GyroHandlerL3GD20H( + auto gyroL3gHandler1 = new GyroHandlerL3GD20H( objects::GYRO_1_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::L3G_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::GYRO_1_L3G_HANDLER); - gyroL3gHandler->setCustomFdir(fdir); - gyroL3gHandler->setParent(objects::ACS_BOARD_ASS); - static_cast(gyroL3gHandler); + gyroL3gHandler1->setCustomFdir(fdir); + assemblyChildren.push_back(*gyroL3gHandler1); #if OBSW_TEST_ACS == 1 gyroL3gHandler->setStartUpImmediately(); gyroL3gHandler->setToGoToNormalMode(true); @@ -435,7 +435,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI spiCookie, ADIS1650X::Type::ADIS16505); fdir = new AcsBoardFdir(objects::GYRO_2_ADIS_HANDLER); adisHandler->setCustomFdir(fdir); - adisHandler->setParent(objects::ACS_BOARD_ASS); + assemblyChildren.push_back(*adisHandler); #if OBSW_TEST_ACS == 1 adisHandler->setStartUpImmediately(); adisHandler->setToGoToNormalModeImmediately(); @@ -443,11 +443,11 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI // Gyro 3 Side B spiCookie = new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); - gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_3_L3G_HANDLER, objects::SPI_MAIN_COM_IF, - spiCookie, spi::L3G_TRANSITION_DELAY); + auto gyroL3gHandler3 = new GyroHandlerL3GD20H( + objects::GYRO_3_L3G_HANDLER, objects::SPI_MAIN_COM_IF, spiCookie, spi::L3G_TRANSITION_DELAY); fdir = new AcsBoardFdir(objects::GYRO_3_L3G_HANDLER); - gyroL3gHandler->setCustomFdir(fdir); - gyroL3gHandler->setParent(objects::ACS_BOARD_ASS); + gyroL3gHandler3->setCustomFdir(fdir); + assemblyChildren.push_back(*gyroL3gHandler3); #if OBSW_TEST_ACS == 1 gyroL3gHandler->setStartUpImmediately(); gyroL3gHandler->setToGoToNormalMode(true); @@ -464,14 +464,22 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI auto gpsCtrl = 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, objects::NO_OBJECT, pwrSwitcher, - acsBoardHelper, gpioComIF); + 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_SUBSYSTEM); #endif /* OBSW_ADD_ACS_HANDLERS == 1 */ } @@ -684,9 +692,16 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF, } RwHelper rwHelper(rwIds); - auto* rwAss = new RwAssembly(objects::RW_ASS, objects::NO_OBJECT, pwrSwitcher, - pcdu::Switches::PDU2_CH2_RW_5V, rwHelper); - static_cast(rwAss); + 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_SUBSYSTEM); #endif /* OBSW_ADD_RW == 1 */ } @@ -882,6 +897,7 @@ void ObjectFactory::createStrComponents(PowerSwitchIF* pwrSwitcher) { new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie, strHelper, pcdu::PDU1_CH2_STAR_TRACKER_5V); starTracker->setPowerSwitcher(pwrSwitcher); + starTracker->connectModeTreeParent(satsystem::ACS_SUBSYSTEM); } void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher) { @@ -890,6 +906,7 @@ void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher) { auto imtqHandler = new ImtqHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie, pcdu::Switches::PDU1_CH3_MGT_5V); imtqHandler->setPowerSwitcher(pwrSwitcher); + imtqHandler->connectModeTreeParent(satsystem::ACS_SUBSYSTEM); static_cast(imtqHandler); #if OBSW_TEST_IMTQ == 1 imtqHandler->setStartUpImmediately(); diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index b38d1274..a36b25d9 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -11,6 +11,7 @@ #include "linux/ObjectFactory.h" #include "linux/callbacks/gpioCallbacks.h" #include "mission/core/GenericFactory.h" +#include "mission/system/tree/acsModeTree.h" void ObjectFactory::produce(void* args) { ObjectFactory::setStatics(); @@ -81,5 +82,6 @@ void ObjectFactory::produce(void* args) { createMiscComponents(); createThermalController(); - createAcsController(); + createAcsController(true); + satsystem::initAcsSubsystem(objects::NO_OBJECT); } diff --git a/common/config/eive/objects.h b/common/config/eive/objects.h index 25bebe25..5e2990ab 100644 --- a/common/config/eive/objects.h +++ b/common/config/eive/objects.h @@ -127,6 +127,8 @@ enum commonObjects : uint32_t { SUS_BOARD_ASS = 0x73000002, TCS_BOARD_ASS = 0x73000003, RW_ASS = 0x73000004, + ACS_SUBSYSTEM = 0x73010001, + EIVE_SYSTEM = 0x73010000, CFDP_HANDLER = 0x73000005, CFDP_DISTRIBUTOR = 0x73000006, TM_FUNNEL = 0x73000100, diff --git a/fsfw b/fsfw index 24612091..7600ed1e 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 24612091690f191d799f30ba38b5f750d0617fa3 +Subproject commit 7600ed1ea70ef2998739800f84722dd7cadb7552 diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index b3f2fc73..05354cdc 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -181,15 +181,15 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 12709;0x31a5;I_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h 12710;0x31a6;U_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h 12711;0x31a7;I_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h -12800;0x3200;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/AcsBoardAssembly.h -12801;0x3201;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/AcsBoardAssembly.h -12802;0x3202;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/AcsBoardAssembly.h -12803;0x3203;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/AcsBoardAssembly.h -12900;0x3264;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/SusAssembly.h -12901;0x3265;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/SusAssembly.h -12902;0x3266;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/SusAssembly.h -12903;0x3267;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/SusAssembly.h -13000;0x32c8;CHILDREN_LOST_MODE;MEDIUM;;mission/system/TcsBoardAssembly.h +12800;0x3200;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/objects/AcsBoardAssembly.h +12801;0x3201;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/objects/AcsBoardAssembly.h +12802;0x3202;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/objects/AcsBoardAssembly.h +12803;0x3203;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/objects/AcsBoardAssembly.h +12900;0x3264;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/objects/SusAssembly.h +12901;0x3265;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/objects/SusAssembly.h +12902;0x3266;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/objects/SusAssembly.h +12903;0x3267;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/objects/SusAssembly.h +13000;0x32c8;CHILDREN_LOST_MODE;MEDIUM;;mission/system/objects/TcsBoardAssembly.h 13100;0x332c;GPS_FIX_CHANGE;INFO;Fix has changed. P1: Old fix. P2: New fix 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix;mission/devices/devicedefinitions/GPSDefinitions.h 13200;0x3390;P60_BOOT_COUNT;INFO;P60 boot count is broadcasted once at SW startup. P1: Boot count;mission/devices/P60DockHandler.h 13201;0x3391;BATT_MODE;INFO;Battery mode is broadcasted at startup. P1: Mode;mission/devices/P60DockHandler.h diff --git a/generators/bsp_q7s_objects.csv b/generators/bsp_q7s_objects.csv index 1e44c67b..20cd0923 100644 --- a/generators/bsp_q7s_objects.csv +++ b/generators/bsp_q7s_objects.csv @@ -136,5 +136,7 @@ 0x73000100;TM_FUNNEL 0x73000101;PUS_TM_FUNNEL 0x73000102;CFDP_TM_FUNNEL +0x73010000;EIVE_SYSTEM +0x73010001;ACS_SUBSYSTEM 0x73500000;CCSDS_IP_CORE_BRIDGE 0xFFFFFFFF;NO_OBJECT diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index c49fa15a..435474e8 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 233 translations. * @details - * Generated on: 2022-10-27 09:03:07 + * Generated on: 2022-10-27 09:17:50 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 157ad167..2fca9350 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -1,8 +1,8 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 140 translations. - * Generated on: 2022-10-27 09:03:07 + * Contains 142 translations. + * Generated on: 2022-10-27 09:17:50 */ #include "translateObjects.h" @@ -144,6 +144,8 @@ const char *CFDP_DISTRIBUTOR_STRING = "CFDP_DISTRIBUTOR"; const char *TM_FUNNEL_STRING = "TM_FUNNEL"; const char *PUS_TM_FUNNEL_STRING = "PUS_TM_FUNNEL"; const char *CFDP_TM_FUNNEL_STRING = "CFDP_TM_FUNNEL"; +const char *EIVE_SYSTEM_STRING = "EIVE_SYSTEM"; +const char *ACS_SUBSYSTEM_STRING = "ACS_SUBSYSTEM"; const char *CCSDS_IP_CORE_BRIDGE_STRING = "CCSDS_IP_CORE_BRIDGE"; const char *NO_OBJECT_STRING = "NO_OBJECT"; @@ -425,6 +427,10 @@ const char *translateObject(object_id_t object) { return PUS_TM_FUNNEL_STRING; case 0x73000102: return CFDP_TM_FUNNEL_STRING; + case 0x73010000: + return EIVE_SYSTEM_STRING; + case 0x73010001: + return ACS_SUBSYSTEM_STRING; case 0x73500000: return CCSDS_IP_CORE_BRIDGE_STRING; case 0xFFFFFFFF: diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index a573d345..271875d6 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -1,6 +1,7 @@ #include "ObjectFactory.h" #include +#include #include #include #include @@ -15,8 +16,6 @@ #include #include #include -#include -#include #include #include @@ -25,6 +24,9 @@ #include "devices/addresses.h" #include "devices/gpioIds.h" #include "eive/definitions.h" +#include "mission/system/objects/SusAssembly.h" +#include "mission/system/objects/TcsBoardAssembly.h" +#include "mission/system/tree/acsModeTree.h" void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF, PowerSwitchIF* pwrSwitcher, std::string spiDev) { @@ -79,7 +81,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[0] = new SusHandler(objects::SUS_0_N_LOC_XFYFZM_PT_XF, 0, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_0_N_LOC_XFYFZM_PT_XF); - susHandlers[0]->setParent(objects::SUS_BOARD_ASS); susHandlers[0]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_1, gpioIds::CS_SUS_1, SUS::MAX_CMD_SIZE, @@ -87,7 +88,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[1] = new SusHandler(objects::SUS_1_N_LOC_XBYFZM_PT_XB, 1, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_1_N_LOC_XBYFZM_PT_XB); - susHandlers[1]->setParent(objects::SUS_BOARD_ASS); susHandlers[1]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_2, gpioIds::CS_SUS_2, SUS::MAX_CMD_SIZE, @@ -95,7 +95,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[2] = new SusHandler(objects::SUS_2_N_LOC_XFYBZB_PT_YB, 2, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_2_N_LOC_XFYBZB_PT_YB); - susHandlers[2]->setParent(objects::SUS_BOARD_ASS); susHandlers[2]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_3, gpioIds::CS_SUS_3, SUS::MAX_CMD_SIZE, @@ -103,7 +102,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[3] = new SusHandler(objects::SUS_3_N_LOC_XFYBZF_PT_YF, 3, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_3_N_LOC_XFYBZF_PT_YF); - susHandlers[3]->setParent(objects::SUS_BOARD_ASS); susHandlers[3]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_4, gpioIds::CS_SUS_4, SUS::MAX_CMD_SIZE, @@ -111,7 +109,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[4] = new SusHandler(objects::SUS_4_N_LOC_XMYFZF_PT_ZF, 4, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_4_N_LOC_XMYFZF_PT_ZF); - susHandlers[4]->setParent(objects::SUS_BOARD_ASS); susHandlers[4]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_5, gpioIds::CS_SUS_5, SUS::MAX_CMD_SIZE, @@ -119,7 +116,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[5] = new SusHandler(objects::SUS_5_N_LOC_XFYMZB_PT_ZB, 5, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_5_N_LOC_XFYMZB_PT_ZB); - susHandlers[5]->setParent(objects::SUS_BOARD_ASS); susHandlers[5]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, SUS::MAX_CMD_SIZE, @@ -127,7 +123,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[6] = new SusHandler(objects::SUS_6_R_LOC_XFYBZM_PT_XF, 6, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_6_R_LOC_XFYBZM_PT_XF); - susHandlers[6]->setParent(objects::SUS_BOARD_ASS); susHandlers[6]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_7, gpioIds::CS_SUS_7, SUS::MAX_CMD_SIZE, @@ -135,7 +130,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[7] = new SusHandler(objects::SUS_7_R_LOC_XBYBZM_PT_XB, 7, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_7_R_LOC_XBYBZM_PT_XB); - susHandlers[7]->setParent(objects::SUS_BOARD_ASS); susHandlers[7]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_8, gpioIds::CS_SUS_8, SUS::MAX_CMD_SIZE, @@ -143,7 +137,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[8] = new SusHandler(objects::SUS_8_R_LOC_XBYBZB_PT_YB, 8, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_8_R_LOC_XBYBZB_PT_YB); - susHandlers[8]->setParent(objects::SUS_BOARD_ASS); susHandlers[8]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_9, gpioIds::CS_SUS_9, SUS::MAX_CMD_SIZE, @@ -151,7 +144,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[9] = new SusHandler(objects::SUS_9_R_LOC_XBYBZB_PT_YF, 9, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_9_R_LOC_XBYBZB_PT_YF); - susHandlers[9]->setParent(objects::SUS_BOARD_ASS); susHandlers[9]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_10, gpioIds::CS_SUS_10, SUS::MAX_CMD_SIZE, @@ -159,7 +151,6 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[10] = new SusHandler(objects::SUS_10_N_LOC_XMYBZF_PT_ZF, 10, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_10_N_LOC_XMYBZF_PT_ZF); - susHandlers[10]->setParent(objects::SUS_BOARD_ASS); susHandlers[10]->setCustomFdir(fdir); spiCookie = new SpiCookie(addresses::SUS_11, gpioIds::CS_SUS_11, SUS::MAX_CMD_SIZE, @@ -167,11 +158,24 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo susHandlers[11] = new SusHandler(objects::SUS_11_R_LOC_XBYMZB_PT_ZB, 11, objects::SPI_MAIN_COM_IF, spiCookie); fdir = new SusFdir(objects::SUS_11_R_LOC_XBYMZB_PT_ZB); - susHandlers[11]->setParent(objects::SUS_BOARD_ASS); 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); @@ -181,17 +185,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo #endif } } - 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, objects::NO_OBJECT, pwrSwitcher, susAssHelper); - static_cast(susAss); + susAss->connectModeTreeParent(satsystem::ACS_SUBSYSTEM); #endif /* OBSW_ADD_SUN_SENSORS == 1 */ } @@ -293,6 +287,11 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, 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); + static_cast(tcsBoardAss); // 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++) { @@ -304,7 +303,11 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, rtds[idx] = new Max31865EiveHandler(rtdInfos[idx].first, objects::SPI_RTD_COM_IF, rtdLowLevelCookie); rtds[idx]->setDeviceInfo(idx, rtdInfos[idx].second); - rtds[idx]->setParent(objects::TCS_BOARD_ASS); + 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); rtds[idx]->setCustomFdir(rtdFdir); #if OBSW_DEBUG_RTD == 1 @@ -316,11 +319,6 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, #endif } - TcsBoardHelper helper(rtdInfos); - TcsBoardAssembly* tcsBoardAss = - new TcsBoardAssembly(objects::TCS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher, - pcdu::Switches::PDU1_CH0_TCS_BOARD_3V3, helper); - static_cast(tcsBoardAss); #endif // OBSW_ADD_RTD_DEVICES == 1 } @@ -341,10 +339,16 @@ void ObjectFactory::createScexComponents(std::string uartDev, PowerSwitchIF* pwr } void ObjectFactory::createThermalController() { - new ThermalController(objects::THERMAL_CONTROLLER, objects::NO_OBJECT); + new ThermalController(objects::THERMAL_CONTROLLER); } -void ObjectFactory::createAcsController() { new AcsController(objects::ACS_CONTROLLER); } +AcsController* ObjectFactory::createAcsController(bool connectSubsystem) { + auto acsCtrl = new AcsController(objects::ACS_CONTROLLER); + if (connectSubsystem) { + acsCtrl->connectModeTreeParent(satsystem::ACS_SUBSYSTEM); + } + return acsCtrl; +} void ObjectFactory::gpioChecker(ReturnValue_t result, std::string output) { if (result != returnvalue::OK) { diff --git a/linux/ObjectFactory.h b/linux/ObjectFactory.h index d0fd62e9..3704e9bd 100644 --- a/linux/ObjectFactory.h +++ b/linux/ObjectFactory.h @@ -14,6 +14,7 @@ class GpioIF; class SpiComIF; class PowerSwitchIF; +class AcsController; namespace ObjectFactory { @@ -29,7 +30,7 @@ void createScexComponents(std::string uartDev, PowerSwitchIF* pwrSwitcher, void gpioChecker(ReturnValue_t result, std::string output); void createThermalController(); -void createAcsController(); +AcsController* createAcsController(bool connectSubsystem); void addTmtcIpCoresToFunnels(CcsdsIpCoreHandler& ipCoreHandler, PusTmFunnel& pusFunnel, CfdpTmFunnel& cfdpFunnel); diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index 84200baf..1799ef4a 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -18,9 +18,7 @@ GPSHyperionLinuxController::GPSHyperionLinuxController(object_id_t objectId, object_id_t parentId, bool debugHyperionGps) - : ExtendedControllerBase(objectId, objects::NO_OBJECT), - gpsSet(this), - debugHyperionGps(debugHyperionGps) { + : ExtendedControllerBase(objectId), gpsSet(this), debugHyperionGps(debugHyperionGps) { timeUpdateCd.resetTimer(); } diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index c49fa15a..435474e8 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 233 translations. * @details - * Generated on: 2022-10-27 09:03:07 + * Generated on: 2022-10-27 09:17:50 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 157ad167..2fca9350 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -1,8 +1,8 @@ /** * @brief Auto-generated object translation file. * @details - * Contains 140 translations. - * Generated on: 2022-10-27 09:03:07 + * Contains 142 translations. + * Generated on: 2022-10-27 09:17:50 */ #include "translateObjects.h" @@ -144,6 +144,8 @@ const char *CFDP_DISTRIBUTOR_STRING = "CFDP_DISTRIBUTOR"; const char *TM_FUNNEL_STRING = "TM_FUNNEL"; const char *PUS_TM_FUNNEL_STRING = "PUS_TM_FUNNEL"; const char *CFDP_TM_FUNNEL_STRING = "CFDP_TM_FUNNEL"; +const char *EIVE_SYSTEM_STRING = "EIVE_SYSTEM"; +const char *ACS_SUBSYSTEM_STRING = "ACS_SUBSYSTEM"; const char *CCSDS_IP_CORE_BRIDGE_STRING = "CCSDS_IP_CORE_BRIDGE"; const char *NO_OBJECT_STRING = "NO_OBJECT"; @@ -425,6 +427,10 @@ const char *translateObject(object_id_t object) { return PUS_TM_FUNNEL_STRING; case 0x73000102: return CFDP_TM_FUNNEL_STRING; + case 0x73010000: + return EIVE_SYSTEM_STRING; + case 0x73010001: + return ACS_SUBSYSTEM_STRING; case 0x73500000: return CCSDS_IP_CORE_BRIDGE_STRING; case 0xFFFFFFFF: diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index c94a2cb6..788ee1c4 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -5,7 +5,7 @@ #include "mission/devices/torquer.h" AcsController::AcsController(object_id_t objectId) - : ExtendedControllerBase(objectId, objects::NO_OBJECT), mgmData(this) {} + : ExtendedControllerBase(objectId), mgmData(this) {} ReturnValue_t AcsController::handleCommandMessage(CommandMessage *message) { return returnvalue::OK; diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 174d1e9f..5beccb4e 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -14,8 +14,8 @@ #include #include -ThermalController::ThermalController(object_id_t objectId, object_id_t parentId) - : ExtendedControllerBase(objectId, parentId), +ThermalController::ThermalController(object_id_t objectId) + : ExtendedControllerBase(objectId), sensorTemperatures(this), susTemperatures(this), deviceTemperatures(this), diff --git a/mission/controller/ThermalController.h b/mission/controller/ThermalController.h index 7ca517cb..76366d0c 100644 --- a/mission/controller/ThermalController.h +++ b/mission/controller/ThermalController.h @@ -12,7 +12,7 @@ class ThermalController : public ExtendedControllerBase { public: static const uint16_t INVALID_TEMPERATURE = 999; - ThermalController(object_id_t objectId, object_id_t parentId); + ThermalController(object_id_t objectId); ReturnValue_t initialize() override; diff --git a/mission/controller/controllerdefinitions/AcsControllerDefinitions.h b/mission/controller/controllerdefinitions/AcsControllerDefinitions.h new file mode 100644 index 00000000..8122178d --- /dev/null +++ b/mission/controller/controllerdefinitions/AcsControllerDefinitions.h @@ -0,0 +1,14 @@ +#ifndef MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_ +#define MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_ + +#include + +namespace acs { + +enum CtrlModes { OFF = HasModesIF::MODE_OFF, SAFE = 1, DETUMBLE = 2, IDLE = 3, TARGET_PT = 4 }; + +static constexpr Submode_t IDLE_CHARGE = 1; + +} // namespace acs + +#endif /* MISSION_CONTROLLER_CONTROLLERDEFINITIONS_ACSCONTROLLERDEFINITIONS_H_ */ diff --git a/mission/devices/PayloadPcduHandler.h b/mission/devices/PayloadPcduHandler.h index 2f89c837..137a9a0b 100644 --- a/mission/devices/PayloadPcduHandler.h +++ b/mission/devices/PayloadPcduHandler.h @@ -10,8 +10,8 @@ #include "fsfw_hal/common/gpio/GpioIF.h" #include "mission/devices/devicedefinitions/payloadPcduDefinitions.h" #include "mission/memory/SdCardMountedIF.h" -#include "mission/system/DualLanePowerStateMachine.h" -#include "mission/system/definitions.h" +#include "mission/system/objects/DualLanePowerStateMachine.h" +#include "mission/system/objects/definitions.h" #ifdef FSFW_OSAL_LINUX class SpiComIF; diff --git a/mission/system/AcsSubsystem.cpp b/mission/system/AcsSubsystem.cpp deleted file mode 100644 index 37da0123..00000000 --- a/mission/system/AcsSubsystem.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "AcsSubsystem.h" - -AcsSubsystem::AcsSubsystem(object_id_t setObjectId, object_id_t parent, - uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables) - : Subsystem(setObjectId, parent, maxNumberOfSequences, maxNumberOfTables) {} diff --git a/mission/system/CMakeLists.txt b/mission/system/CMakeLists.txt index 21a2fd72..617e2765 100644 --- a/mission/system/CMakeLists.txt +++ b/mission/system/CMakeLists.txt @@ -1,15 +1,3 @@ -target_sources( - ${LIB_EIVE_MISSION} - PRIVATE EiveSystem.cpp - AcsSubsystem.cpp - ComSubsystem.cpp - PayloadSubsystem.cpp - AcsBoardAssembly.cpp - RwAssembly.cpp - SusAssembly.cpp - DualLanePowerStateMachine.cpp - PowerStateMachineBase.cpp - DualLaneAssemblyBase.cpp - TcsBoardAssembly.cpp) - +add_subdirectory(objects) +add_subdirectory(tree) add_subdirectory(fdir) diff --git a/mission/system/ComSubsystem.cpp b/mission/system/ComSubsystem.cpp deleted file mode 100644 index 3308de8c..00000000 --- a/mission/system/ComSubsystem.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "ComSubsystem.h" - -ComSubsystem::ComSubsystem(object_id_t setObjectId, object_id_t parent, - uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables) - : Subsystem(setObjectId, parent, maxNumberOfSequences, maxNumberOfTables) {} diff --git a/mission/system/EiveSystem.cpp b/mission/system/EiveSystem.cpp deleted file mode 100644 index 1be0152a..00000000 --- a/mission/system/EiveSystem.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "EiveSystem.h" - -EiveSystem::EiveSystem(object_id_t setObjectId, object_id_t parent, uint32_t maxNumberOfSequences, - uint32_t maxNumberOfTables) - : Subsystem(setObjectId, parent, maxNumberOfSequences, maxNumberOfTables) {} diff --git a/mission/system/PayloadSubsystem.cpp b/mission/system/PayloadSubsystem.cpp deleted file mode 100644 index 97008c2f..00000000 --- a/mission/system/PayloadSubsystem.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "PayloadSubsystem.h" - -PayloadSubsystem::PayloadSubsystem(object_id_t setObjectId, object_id_t parent, - uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables) - : Subsystem(setObjectId, parent, maxNumberOfSequences, maxNumberOfTables) {} diff --git a/mission/system/AcsBoardAssembly.cpp b/mission/system/objects/AcsBoardAssembly.cpp similarity index 89% rename from mission/system/AcsBoardAssembly.cpp rename to mission/system/objects/AcsBoardAssembly.cpp index 6a59183c..bcc2eb7a 100644 --- a/mission/system/AcsBoardAssembly.cpp +++ b/mission/system/objects/AcsBoardAssembly.cpp @@ -6,11 +6,10 @@ #include "OBSWConfig.h" -AcsBoardAssembly::AcsBoardAssembly(object_id_t objectId, object_id_t parentId, - PowerSwitchIF* switcher, AcsBoardHelper helper, GpioIF* gpioIF) - : DualLaneAssemblyBase(objectId, parentId, switcher, SWITCH_A, SWITCH_B, - POWER_STATE_MACHINE_TIMEOUT, SIDE_SWITCH_TRANSITION_NOT_ALLOWED, - TRANSITION_OTHER_SIDE_FAILED), +AcsBoardAssembly::AcsBoardAssembly(object_id_t objectId, PowerSwitchIF* switcher, + AcsBoardHelper helper, GpioIF* gpioIF) + : DualLaneAssemblyBase(objectId, switcher, SWITCH_A, SWITCH_B, POWER_STATE_MACHINE_TIMEOUT, + SIDE_SWITCH_TRANSITION_NOT_ALLOWED, TRANSITION_OTHER_SIDE_FAILED), helper(helper), gpioIF(gpioIF) { if (switcher == nullptr) { @@ -275,42 +274,4 @@ void AcsBoardAssembly::refreshHelperModes() { } } -ReturnValue_t AcsBoardAssembly::initialize() { - ReturnValue_t result = registerChild(helper.gyro0AdisIdSideA); - if (result != returnvalue::OK) { - return result; - } - result = registerChild(helper.gyro1L3gIdSideA); - if (result != returnvalue::OK) { - return result; - } - result = registerChild(helper.gyro2AdisIdSideB); - if (result != returnvalue::OK) { - return result; - } - result = registerChild(helper.gyro3L3gIdSideB); - if (result != returnvalue::OK) { - return result; - } - result = registerChild(helper.mgm0Lis3IdSideA); - if (result != returnvalue::OK) { - return result; - } - result = registerChild(helper.mgm1Rm3100IdSideA); - if (result != returnvalue::OK) { - return result; - } - result = registerChild(helper.mgm2Lis3IdSideB); - if (result != returnvalue::OK) { - return result; - } - result = registerChild(helper.mgm3Rm3100IdSideB); - if (result != returnvalue::OK) { - return result; - } - result = registerChild(helper.gpsId); - if (result != returnvalue::OK) { - return result; - } - return AssemblyBase::initialize(); -} +ReturnValue_t AcsBoardAssembly::initialize() { return AssemblyBase::initialize(); } diff --git a/mission/system/AcsBoardAssembly.h b/mission/system/objects/AcsBoardAssembly.h similarity index 96% rename from mission/system/AcsBoardAssembly.h rename to mission/system/objects/AcsBoardAssembly.h index 820060ce..1fe3336d 100644 --- a/mission/system/AcsBoardAssembly.h +++ b/mission/system/objects/AcsBoardAssembly.h @@ -94,8 +94,8 @@ class AcsBoardAssembly : public DualLaneAssemblyBase { static constexpr uint8_t NUMBER_DEVICES_MODE_TABLE = 9; - AcsBoardAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher, - AcsBoardHelper helper, GpioIF* gpioIF); + AcsBoardAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, AcsBoardHelper helper, + GpioIF* gpioIF); /** * In dual mode, the A side or the B side GPS device can be used, but not both. diff --git a/mission/system/objects/AcsSubsystem.cpp b/mission/system/objects/AcsSubsystem.cpp new file mode 100644 index 00000000..96735ae9 --- /dev/null +++ b/mission/system/objects/AcsSubsystem.cpp @@ -0,0 +1,5 @@ +#include "AcsSubsystem.h" + +AcsSubsystem::AcsSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, + uint32_t maxNumberOfTables) + : Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {} diff --git a/mission/system/AcsSubsystem.h b/mission/system/objects/AcsSubsystem.h similarity index 62% rename from mission/system/AcsSubsystem.h rename to mission/system/objects/AcsSubsystem.h index 20fffdbe..8673395a 100644 --- a/mission/system/AcsSubsystem.h +++ b/mission/system/objects/AcsSubsystem.h @@ -5,8 +5,7 @@ class AcsSubsystem : public Subsystem { public: - AcsSubsystem(object_id_t setObjectId, object_id_t parent, uint32_t maxNumberOfSequences, - uint32_t maxNumberOfTables); + AcsSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables); private: }; diff --git a/mission/system/objects/CMakeLists.txt b/mission/system/objects/CMakeLists.txt new file mode 100644 index 00000000..39d7c800 --- /dev/null +++ b/mission/system/objects/CMakeLists.txt @@ -0,0 +1,13 @@ +target_sources( + ${LIB_EIVE_MISSION} + PRIVATE EiveSystem.cpp + AcsSubsystem.cpp + ComSubsystem.cpp + PayloadSubsystem.cpp + AcsBoardAssembly.cpp + SusAssembly.cpp + RwAssembly.cpp + DualLanePowerStateMachine.cpp + PowerStateMachineBase.cpp + DualLaneAssemblyBase.cpp + TcsBoardAssembly.cpp) diff --git a/mission/system/objects/ComSubsystem.cpp b/mission/system/objects/ComSubsystem.cpp new file mode 100644 index 00000000..794eede6 --- /dev/null +++ b/mission/system/objects/ComSubsystem.cpp @@ -0,0 +1,5 @@ +#include "ComSubsystem.h" + +ComSubsystem::ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, + uint32_t maxNumberOfTables) + : Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {} diff --git a/mission/system/ComSubsystem.h b/mission/system/objects/ComSubsystem.h similarity index 62% rename from mission/system/ComSubsystem.h rename to mission/system/objects/ComSubsystem.h index fc35438c..0bdaeb15 100644 --- a/mission/system/ComSubsystem.h +++ b/mission/system/objects/ComSubsystem.h @@ -5,8 +5,7 @@ class ComSubsystem : public Subsystem { public: - ComSubsystem(object_id_t setObjectId, object_id_t parent, uint32_t maxNumberOfSequences, - uint32_t maxNumberOfTables); + ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables); private: }; diff --git a/mission/system/DualLaneAssemblyBase.cpp b/mission/system/objects/DualLaneAssemblyBase.cpp similarity index 96% rename from mission/system/DualLaneAssemblyBase.cpp rename to mission/system/objects/DualLaneAssemblyBase.cpp index f9ca44fe..a55553a0 100644 --- a/mission/system/DualLaneAssemblyBase.cpp +++ b/mission/system/objects/DualLaneAssemblyBase.cpp @@ -4,12 +4,11 @@ #include "OBSWConfig.h" -DualLaneAssemblyBase::DualLaneAssemblyBase(object_id_t objectId, object_id_t parentId, - PowerSwitchIF* pwrSwitcher, pcdu::Switches switch1, - pcdu::Switches switch2, Event pwrTimeoutEvent, - Event sideSwitchNotAllowedEvent, +DualLaneAssemblyBase::DualLaneAssemblyBase(object_id_t objectId, PowerSwitchIF* pwrSwitcher, + pcdu::Switches switch1, pcdu::Switches switch2, + Event pwrTimeoutEvent, Event sideSwitchNotAllowedEvent, Event transitionOtherSideFailedEvent) - : AssemblyBase(objectId, parentId, 20), + : AssemblyBase(objectId, 20), pwrStateMachine(switch1, switch2, pwrSwitcher), pwrTimeoutEvent(pwrTimeoutEvent), sideSwitchNotAllowedEvent(sideSwitchNotAllowedEvent), diff --git a/mission/system/DualLaneAssemblyBase.h b/mission/system/objects/DualLaneAssemblyBase.h similarity index 93% rename from mission/system/DualLaneAssemblyBase.h rename to mission/system/objects/DualLaneAssemblyBase.h index 4233d860..eadfb77f 100644 --- a/mission/system/DualLaneAssemblyBase.h +++ b/mission/system/objects/DualLaneAssemblyBase.h @@ -2,7 +2,7 @@ #define MISSION_SYSTEM_DUALLANEASSEMBLYBASE_H_ #include -#include +#include /** * @brief Encapsulates assemblies which are also responsible for dual lane power switching @@ -18,8 +18,8 @@ class DualLaneAssemblyBase : public AssemblyBase, public ConfirmsFailuresIF { static constexpr UniqueEventId_t POWER_STATE_MACHINE_TIMEOUT_ID = 2; static constexpr UniqueEventId_t SIDE_SWITCH_TRANSITION_NOT_ALLOWED_ID = 3; - DualLaneAssemblyBase(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher, - pcdu::Switches switch1, pcdu::Switches switch2, Event pwrSwitchTimeoutEvent, + DualLaneAssemblyBase(object_id_t objectId, PowerSwitchIF* pwrSwitcher, pcdu::Switches switch1, + pcdu::Switches switch2, Event pwrSwitchTimeoutEvent, Event sideSwitchNotAllowedEvent, Event transitionOtherSideFailedEvent); protected: diff --git a/mission/system/DualLanePowerStateMachine.cpp b/mission/system/objects/DualLanePowerStateMachine.cpp similarity index 100% rename from mission/system/DualLanePowerStateMachine.cpp rename to mission/system/objects/DualLanePowerStateMachine.cpp diff --git a/mission/system/DualLanePowerStateMachine.h b/mission/system/objects/DualLanePowerStateMachine.h similarity index 91% rename from mission/system/DualLanePowerStateMachine.h rename to mission/system/objects/DualLanePowerStateMachine.h index d2160c64..7a6f29b6 100644 --- a/mission/system/DualLanePowerStateMachine.h +++ b/mission/system/objects/DualLanePowerStateMachine.h @@ -3,7 +3,7 @@ #include #include -#include +#include #include "definitions.h" diff --git a/mission/system/objects/EiveSystem.cpp b/mission/system/objects/EiveSystem.cpp new file mode 100644 index 00000000..a870214d --- /dev/null +++ b/mission/system/objects/EiveSystem.cpp @@ -0,0 +1,5 @@ +#include "EiveSystem.h" + +EiveSystem::EiveSystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, + uint32_t maxNumberOfTables) + : Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {} diff --git a/mission/system/EiveSystem.h b/mission/system/objects/EiveSystem.h similarity index 62% rename from mission/system/EiveSystem.h rename to mission/system/objects/EiveSystem.h index 671d47b6..e88d2402 100644 --- a/mission/system/EiveSystem.h +++ b/mission/system/objects/EiveSystem.h @@ -5,8 +5,7 @@ class EiveSystem : public Subsystem { public: - EiveSystem(object_id_t setObjectId, object_id_t parent, uint32_t maxNumberOfSequences, - uint32_t maxNumberOfTables); + EiveSystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables); private: }; diff --git a/mission/system/objects/PayloadSubsystem.cpp b/mission/system/objects/PayloadSubsystem.cpp new file mode 100644 index 00000000..8bc98f0b --- /dev/null +++ b/mission/system/objects/PayloadSubsystem.cpp @@ -0,0 +1,5 @@ +#include "PayloadSubsystem.h" + +PayloadSubsystem::PayloadSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, + uint32_t maxNumberOfTables) + : Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables) {} diff --git a/mission/system/PayloadSubsystem.h b/mission/system/objects/PayloadSubsystem.h similarity index 75% rename from mission/system/PayloadSubsystem.h rename to mission/system/objects/PayloadSubsystem.h index b25454f7..af3c1efb 100644 --- a/mission/system/PayloadSubsystem.h +++ b/mission/system/objects/PayloadSubsystem.h @@ -5,7 +5,7 @@ class PayloadSubsystem : public Subsystem { public: - PayloadSubsystem(object_id_t setObjectId, object_id_t parent, uint32_t maxNumberOfSequences, + PayloadSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables); private: diff --git a/mission/system/PowerStateMachineBase.cpp b/mission/system/objects/PowerStateMachineBase.cpp similarity index 100% rename from mission/system/PowerStateMachineBase.cpp rename to mission/system/objects/PowerStateMachineBase.cpp diff --git a/mission/system/PowerStateMachineBase.h b/mission/system/objects/PowerStateMachineBase.h similarity index 100% rename from mission/system/PowerStateMachineBase.h rename to mission/system/objects/PowerStateMachineBase.h diff --git a/mission/system/RwAssembly.cpp b/mission/system/objects/RwAssembly.cpp similarity index 91% rename from mission/system/RwAssembly.cpp rename to mission/system/objects/RwAssembly.cpp index 6e393034..6e1c86ae 100644 --- a/mission/system/RwAssembly.cpp +++ b/mission/system/objects/RwAssembly.cpp @@ -1,8 +1,8 @@ #include "RwAssembly.h" -RwAssembly::RwAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher, - power::Switch_t switcher, RwHelper helper) - : AssemblyBase(objectId, parentId), helper(helper), switcher(pwrSwitcher, switcher) { +RwAssembly::RwAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, power::Switch_t switcher, + RwHelper helper) + : AssemblyBase(objectId), helper(helper), switcher(pwrSwitcher, switcher) { ModeListEntry entry; for (uint8_t idx = 0; idx < NUMBER_RWS; idx++) { entry.setObject(helper.rwIds[idx]); @@ -167,16 +167,7 @@ bool RwAssembly::isUseable(object_id_t object, Mode_t mode) { return false; } -ReturnValue_t RwAssembly::initialize() { - ReturnValue_t result = returnvalue::OK; - for (const auto& obj : helper.rwIds) { - result = registerChild(obj); - if (result != returnvalue::OK) { - return result; - } - } - return SubsystemBase::initialize(); -} +ReturnValue_t RwAssembly::initialize() { return SubsystemBase::initialize(); } void RwAssembly::handleModeTransitionFailed(ReturnValue_t result) { if (targetMode == MODE_OFF) { diff --git a/mission/system/RwAssembly.h b/mission/system/objects/RwAssembly.h similarity index 91% rename from mission/system/RwAssembly.h rename to mission/system/objects/RwAssembly.h index 482a18a3..0eb0b59f 100644 --- a/mission/system/RwAssembly.h +++ b/mission/system/objects/RwAssembly.h @@ -12,8 +12,8 @@ struct RwHelper { class RwAssembly : public AssemblyBase { public: - RwAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher, - power::Switch_t switcher, RwHelper helper); + RwAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, power::Switch_t switcher, + RwHelper helper); private: static constexpr uint8_t NUMBER_RWS = 4; diff --git a/mission/system/SusAssembly.cpp b/mission/system/objects/SusAssembly.cpp similarity index 90% rename from mission/system/SusAssembly.cpp rename to mission/system/objects/SusAssembly.cpp index 472a6580..3f75a369 100644 --- a/mission/system/SusAssembly.cpp +++ b/mission/system/objects/SusAssembly.cpp @@ -4,9 +4,8 @@ #include #include -SusAssembly::SusAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher, - SusAssHelper helper) - : DualLaneAssemblyBase(objectId, parentId, pwrSwitcher, SWITCH_NOM, SWITCH_RED, +SusAssembly::SusAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, SusAssHelper helper) + : DualLaneAssemblyBase(objectId, pwrSwitcher, SWITCH_NOM, SWITCH_RED, POWER_STATE_MACHINE_TIMEOUT, SIDE_SWITCH_TRANSITION_NOT_ALLOWED, TRANSITION_OTHER_SIDE_FAILED), helper(helper), @@ -121,16 +120,7 @@ ReturnValue_t SusAssembly::checkChildrenStateOn(Mode_t wantedMode, Submode_t wan return returnvalue::OK; } -ReturnValue_t SusAssembly::initialize() { - ReturnValue_t result = returnvalue::OK; - for (const auto& id : helper.susIds) { - result = registerChild(id); - if (result != returnvalue::OK) { - return result; - } - } - return AssemblyBase::initialize(); -} +ReturnValue_t SusAssembly::initialize() { return AssemblyBase::initialize(); } bool SusAssembly::isUseable(object_id_t object, Mode_t mode) { if (healthHelper.healthTable->isFaulty(object)) { diff --git a/mission/system/SusAssembly.h b/mission/system/objects/SusAssembly.h similarity index 95% rename from mission/system/SusAssembly.h rename to mission/system/objects/SusAssembly.h index 3cce9d86..673e91f5 100644 --- a/mission/system/SusAssembly.h +++ b/mission/system/objects/SusAssembly.h @@ -40,8 +40,7 @@ class SusAssembly : public DualLaneAssemblyBase { static constexpr Event SIDE_SWITCH_TRANSITION_NOT_ALLOWED = event::makeEvent(SUBSYSTEM_ID, 3, severity::LOW); - SusAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher, - SusAssHelper helper); + SusAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, SusAssHelper helper); private: enum class States { IDLE, SWITCHING_POWER, MODE_COMMANDING } state = States::IDLE; diff --git a/mission/system/TcsBoardAssembly.cpp b/mission/system/objects/TcsBoardAssembly.cpp similarity index 91% rename from mission/system/TcsBoardAssembly.cpp rename to mission/system/objects/TcsBoardAssembly.cpp index c753504b..88075fdc 100644 --- a/mission/system/TcsBoardAssembly.cpp +++ b/mission/system/objects/TcsBoardAssembly.cpp @@ -3,10 +3,9 @@ #include #include -TcsBoardAssembly::TcsBoardAssembly(object_id_t objectId, object_id_t parentId, - PowerSwitchIF* pwrSwitcher, power::Switch_t theSwitch, - TcsBoardHelper helper) - : AssemblyBase(objectId, parentId, 24), switcher(pwrSwitcher, theSwitch), helper(helper) { +TcsBoardAssembly::TcsBoardAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, + power::Switch_t theSwitch, TcsBoardHelper helper) + : AssemblyBase(objectId, 24), switcher(pwrSwitcher, theSwitch), helper(helper) { eventQueue = QueueFactory::instance()->createMessageQueue(24); ModeListEntry entry; for (uint8_t idx = 0; idx < NUMBER_RTDS; idx++) { @@ -90,16 +89,7 @@ ReturnValue_t TcsBoardAssembly::isModeCombinationValid(Mode_t mode, Submode_t su return HasModesIF::INVALID_MODE; } -ReturnValue_t TcsBoardAssembly::initialize() { - ReturnValue_t result = returnvalue::OK; - for (const auto& obj : helper.rtdInfos) { - result = registerChild(obj.first); - if (result != returnvalue::OK) { - return result; - } - } - return SubsystemBase::initialize(); -} +ReturnValue_t TcsBoardAssembly::initialize() { return AssemblyBase::initialize(); } void TcsBoardAssembly::startTransition(Mode_t mode, Submode_t submode) { if (mode != MODE_OFF) { diff --git a/mission/system/TcsBoardAssembly.h b/mission/system/objects/TcsBoardAssembly.h similarity index 92% rename from mission/system/TcsBoardAssembly.h rename to mission/system/objects/TcsBoardAssembly.h index 6042abaa..fb5f7d38 100644 --- a/mission/system/TcsBoardAssembly.h +++ b/mission/system/objects/TcsBoardAssembly.h @@ -20,8 +20,8 @@ class TcsBoardAssembly : public AssemblyBase, public ConfirmsFailuresIF { static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::TCS_BOARD_ASS; static constexpr Event CHILDREN_LOST_MODE = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM); - TcsBoardAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher, - power::Switch_t switcher, TcsBoardHelper helper); + TcsBoardAssembly(object_id_t objectId, PowerSwitchIF* pwrSwitcher, power::Switch_t switcher, + TcsBoardHelper helper); ReturnValue_t initialize() override; diff --git a/mission/system/definitions.h b/mission/system/objects/definitions.h similarity index 100% rename from mission/system/definitions.h rename to mission/system/objects/definitions.h diff --git a/mission/system/tree/CMakeLists.txt b/mission/system/tree/CMakeLists.txt new file mode 100644 index 00000000..ec7e0c96 --- /dev/null +++ b/mission/system/tree/CMakeLists.txt @@ -0,0 +1 @@ +target_sources(${LIB_EIVE_MISSION} PRIVATE acsModeTree.cpp) diff --git a/mission/system/tree/acsModeTree.cpp b/mission/system/tree/acsModeTree.cpp new file mode 100644 index 00000000..0d0bd524 --- /dev/null +++ b/mission/system/tree/acsModeTree.cpp @@ -0,0 +1,397 @@ +#include "acsModeTree.h" + +#include +#include +#include +#include +#include + +#include "eive/objects.h" +#include "mission/controller/controllerdefinitions/AcsControllerDefinitions.h" + +Subsystem satsystem::ACS_SUBSYSTEM(objects::ACS_SUBSYSTEM, 12, 24); + +void checkInsert(ReturnValue_t result, const char* ctx); +void buildOffSequence(Subsystem* ss, ModeListEntry& eh); +void buildDetumbleSequence(Subsystem* ss, ModeListEntry& entryHelper); +void buildSafeSequence(Subsystem* ss, ModeListEntry& entryHelper); +void buildIdleSequence(Subsystem* ss, ModeListEntry& entryHelper); +void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& entryHelper); +void buildTargetPtSequence(Subsystem* ss, ModeListEntry& entryHelper); + +// Alias for checker function +const auto check = checkInsert; +static const auto OFF = HasModesIF::MODE_OFF; +static const auto NML = DeviceHandlerIF::MODE_NORMAL; + +auto ACS_SEQUENCE_OFF = + std::make_pair(acs::CtrlModes::OFF << 24, FixedArrayList()); +auto ACS_TABLE_OFF_TGT = + std::make_pair((acs::CtrlModes::OFF << 24) | 1, FixedArrayList()); +auto ACS_TABLE_OFF_TRANS = + std::make_pair((acs::CtrlModes::OFF << 24) | 2, FixedArrayList()); + +auto ACS_SEQUENCE_DETUMBLE = + std::make_pair(acs::CtrlModes::DETUMBLE << 24, FixedArrayList()); +auto ACS_TABLE_DETUMBLE_TGT = + std::make_pair((acs::CtrlModes::DETUMBLE << 24) | 1, FixedArrayList()); +auto ACS_TABLE_DETUMBLE_TRANS_0 = + std::make_pair((acs::CtrlModes::DETUMBLE << 24) | 2, FixedArrayList()); +auto ACS_TABLE_DETUMBLE_TRANS_1 = + std::make_pair((acs::CtrlModes::DETUMBLE << 24) | 3, FixedArrayList()); + +auto ACS_SEQUENCE_SAFE = + std::make_pair(acs::CtrlModes::SAFE << 24, FixedArrayList()); +auto ACS_TABLE_SAFE_TGT = + std::make_pair((acs::CtrlModes::SAFE << 24) | 1, FixedArrayList()); +auto ACS_TABLE_SAFE_TRANS_0 = + std::make_pair((acs::CtrlModes::SAFE << 24) | 2, FixedArrayList()); +auto ACS_TABLE_SAFE_TRANS_1 = + std::make_pair((acs::CtrlModes::SAFE << 24) | 3, FixedArrayList()); + +auto ACS_SEQUENCE_IDLE = + std::make_pair(acs::CtrlModes::IDLE << 24, FixedArrayList()); +auto ACS_TABLE_IDLE_TGT = + std::make_pair((acs::CtrlModes::IDLE << 24) | 1, FixedArrayList()); +auto ACS_TABLE_IDLE_TRANS_0 = + std::make_pair((acs::CtrlModes::IDLE << 24) | 2, FixedArrayList()); +auto ACS_TABLE_IDLE_TRANS_1 = + std::make_pair((acs::CtrlModes::IDLE << 24) | 3, FixedArrayList()); + +auto ACS_SEQUENCE_IDLE_CHRG = std::make_pair(acs::CtrlModes::IDLE << 24 | (acs::IDLE_CHARGE << 8), + FixedArrayList()); +auto ACS_TABLE_IDLE_CHRG_TGT = std::make_pair( + (acs::CtrlModes::IDLE << 24) | (acs::IDLE_CHARGE << 8) | 1, FixedArrayList()); +auto ACS_TABLE_IDLE_CHRG_TRANS_0 = std::make_pair( + (acs::CtrlModes::IDLE << 24) | (acs::IDLE_CHARGE << 8) | 2, FixedArrayList()); +auto ACS_TABLE_IDLE_CHRG_TRANS_1 = std::make_pair( + (acs::CtrlModes::IDLE << 24) | (acs::IDLE_CHARGE << 8) | 3, FixedArrayList()); + +auto ACS_SEQUENCE_TARGET_PT = + std::make_pair(acs::CtrlModes::TARGET_PT, FixedArrayList()); +auto ACS_TABLE_TARGET_PT_TGT = + std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 1, FixedArrayList()); +auto ACS_TABLE_TARGET_PT_TRANS_0 = + std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 2, FixedArrayList()); +auto ACS_TABLE_TARGET_PT_TRANS_1 = + std::make_pair((acs::CtrlModes::TARGET_PT << 24) | 3, FixedArrayList()); + +void satsystem::initAcsSubsystem(object_id_t satSystemObjId) { + ModeListEntry entry; + buildOffSequence(&ACS_SUBSYSTEM, entry); + buildSafeSequence(&ACS_SUBSYSTEM, entry); + buildDetumbleSequence(&ACS_SUBSYSTEM, entry); + buildIdleSequence(&ACS_SUBSYSTEM, entry); + buildIdleChargeSequence(&ACS_SUBSYSTEM, entry); + buildTargetPtSequence(&ACS_SUBSYSTEM, entry); + ACS_SUBSYSTEM.setInitialMode(HasModesIF::MODE_OFF); +} + +void buildOffSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::buildOffSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, ArrayList& table) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + check(table.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + check(sequence.insert(eh), ctxc); + }; + + // OFF Target table is empty + check(ss->addTable(&ACS_TABLE_OFF_TGT.second, ACS_TABLE_OFF_TGT.first, false, true), ctxc); + + // Build OFF transition + iht(objects::ACS_CONTROLLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); + iht(objects::IMTQ_HANDLER, OFF, 0, ACS_TABLE_OFF_TRANS.second); + iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_OFF_TRANS.second); + iht(objects::ACS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); + iht(objects::SUS_BOARD_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); + iht(objects::RW_ASS, OFF, 0, ACS_TABLE_OFF_TRANS.second); + check(ss->addTable(&ACS_TABLE_OFF_TRANS.second, ACS_TABLE_OFF_TRANS.first, false, true), ctxc); + + // Build OFF sequence + ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TGT.first, 0, false); + ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TRANS.first, 0, false); + check(ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first, + false, true), + ctxc); +} + +void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::buildSafeSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + check(sequence.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + check(sequence.insert(eh), ctxc); + }; + // Build SAFE target + iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TGT.second); + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TGT.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TGT.second); + check(ss->addTable(&ACS_TABLE_SAFE_TGT.second, ACS_TABLE_SAFE_TGT.first, false, true), ctxc); + + // Build SAFE transition 0 + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_SAFE_TRANS_0.second); + iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); + iht(objects::RW_ASS, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second); + check(ss->addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true), + ctxc); + + // Build SAFE transition 1 + iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TRANS_1.second); + check(ss->addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true), + ctxc); + + // Build SAFE sequence + ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TGT.first, 0, true); + ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_0.first, 0, false); + ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_1.first, 0, false); + check(ss->addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_SAFE.first, + false, true), + ctxc); +} + +void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::buildDetumbleSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + check(sequence.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + check(sequence.insert(eh), ctxc); + }; + // Build DETUMBLE target + iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TGT.second); + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second); + check(ss->addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, false, true), + ctxc); + + // Build DETUMBLE transition 0 + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + iht(objects::RW_ASS, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second); + check(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false, + true), + ctxc); + + // Build DETUMBLE transition 1 + iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second); + check(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false, + true), + ctxc); + + // Build DETUMBLE sequence + ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TGT.first, 0, true); + ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_0.first, 0, false); + ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_1.first, 0, false); + check(ss->addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first, + ACS_SEQUENCE_SAFE.first, false, true), + ctxc); +} + +void buildIdleSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::buildIdleSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + check(sequence.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + check(sequence.insert(eh), ctxc); + }; + // Build IDLE target + iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, 0, ACS_TABLE_IDLE_TGT.second); + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_TGT.second); + iht(objects::RW_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TGT.second); + ss->addTable(&ACS_TABLE_IDLE_TGT.second, ACS_TABLE_IDLE_TGT.first, false, true); + + // Build IDLE transition 0 + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); + iht(objects::RW_ASS, NML, 0, ACS_TABLE_IDLE_TRANS_0.second); + iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_IDLE_TRANS_0.second); + ss->addTable(&ACS_TABLE_IDLE_TRANS_0.second, ACS_TABLE_IDLE_TRANS_0.first, false, true); + + // Build IDLE transition 1 + iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, 0, ACS_TABLE_IDLE_TRANS_1.second); + ss->addTable(&ACS_TABLE_IDLE_TRANS_1.second, ACS_TABLE_IDLE_TRANS_1.first, false, true); + + // Build IDLE sequence + ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TGT.first, 0, true); + ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TRANS_0.first, 0, true); + ihs(ACS_SEQUENCE_IDLE.second, ACS_TABLE_IDLE_TRANS_1.first, 0, false); + ss->addSequence(&ACS_SEQUENCE_IDLE.second, ACS_SEQUENCE_IDLE.first, ACS_SEQUENCE_SAFE.first, + false, true); +} + +void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::buildIdleChargeSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + check(sequence.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + check(sequence.insert(eh), ctxc); + }; + // Build IDLE target + iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE, + ACS_TABLE_IDLE_CHRG_TGT.second); + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second); + check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TGT.second, ACS_TABLE_IDLE_CHRG_TGT.first, false, true), + ctxc); + + // Build IDLE transition 0 + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); + iht(objects::RW_ASS, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); + iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second); + check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_0.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, false, + true), + ctxc); + + // Build IDLE transition 1 + iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE, + ACS_TABLE_IDLE_CHRG_TRANS_1.second); + check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_1.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, false, + true), + ctxc); + + // Build IDLE sequence + ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TGT.first, 0, true); + ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, 0, true); + ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, 0, false); + check(ss->addSequence(&ACS_SEQUENCE_IDLE_CHRG.second, ACS_SEQUENCE_IDLE_CHRG.first, + ACS_SEQUENCE_SAFE.first, false, true), + ctxc); +} + +void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) { + std::string context = "satsystem::buildTargetPtSequence"; + auto ctxc = context.c_str(); + // Insert Helper Table + auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, + ArrayList& sequence) { + eh.setObject(obj); + eh.setMode(mode); + eh.setSubmode(submode); + check(sequence.insert(eh), ctxc); + }; + // Insert Helper Sequence + auto ihs = [&](ArrayList& sequence, Mode_t tableId, uint32_t waitSeconds, + bool checkSuccess) { + eh.setTableId(tableId); + eh.setWaitSeconds(waitSeconds); + eh.setCheckSuccess(checkSuccess); + check(sequence.insert(eh), ctxc); + }; + + // Build TARGET PT table + iht(objects::ACS_CONTROLLER, acs::CtrlModes::TARGET_PT, 0, ACS_TABLE_TARGET_PT_TGT.second); + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); + iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); + iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TGT.second); + check(ss->addTable(&ACS_TABLE_TARGET_PT_TGT.second, ACS_TABLE_TARGET_PT_TGT.first, false, true), + ctxc); + + // Build TARGET PT transition 0 + iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); + iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); + iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); + iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); + iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second); + check(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_0.second, ACS_TABLE_TARGET_PT_TRANS_0.first, false, + true), + ctxc); + + // Build TARGET PT transition 1 + iht(objects::ACS_CONTROLLER, acs::CtrlModes::TARGET_PT, 0, ACS_TABLE_TARGET_PT_TRANS_1.second); + check(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_1.second, ACS_TABLE_TARGET_PT_TRANS_1.first, false, + true), + ctxc); + + // Build IDLE sequence + ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TGT.first, 0, true); + ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_0.first, 0, true); + ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_1.first, 0, false); + check(ss->addSequence(&ACS_SEQUENCE_TARGET_PT.second, ACS_SEQUENCE_TARGET_PT.first, + ACS_SEQUENCE_IDLE.first, false, true), + ctxc); +} + +void checkInsert(ReturnValue_t result, const char* ctx) { + if (result != returnvalue::OK) { + sif::warning << "satsystem::checkInsert: Insertion failed at " << ctx; + if (result == mapdefs::KEY_ALREADY_EXISTS) { + sif::warning << ": Key already exists" << std::endl; + } else if (result == mapdefs::MAP_FULL) { + sif::warning << ": Map full" << std::endl; + } else { + sif::warning << std::endl; + } + } +} diff --git a/mission/system/tree/acsModeTree.h b/mission/system/tree/acsModeTree.h new file mode 100644 index 00000000..37469707 --- /dev/null +++ b/mission/system/tree/acsModeTree.h @@ -0,0 +1,11 @@ +#include + +class Subsystem; + +namespace satsystem { + +extern Subsystem ACS_SUBSYSTEM; + +void initAcsSubsystem(object_id_t satSystemObjId); + +} // namespace satsystem diff --git a/tmtc b/tmtc index 044c600b..f3609b81 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 044c600b1ce13d58781a8d06125619c8cc0080f9 +Subproject commit f3609b81799790578c095262f33c11add3c0b078 diff --git a/unittest/controller/testThermalController.cpp b/unittest/controller/testThermalController.cpp index d8cd2a1d..3fac0f4e 100644 --- a/unittest/controller/testThermalController.cpp +++ b/unittest/controller/testThermalController.cpp @@ -17,7 +17,7 @@ TEST_CASE("Thermal Controller", "[ThermalController]") { // testEnvironment::initialize(); - ThermalController controller(THERMAL_CONTROLLER_ID, objects::NO_OBJECT); + ThermalController controller(THERMAL_CONTROLLER_ID); ReturnValue_t result = controller.initialize(); REQUIRE(result == returnvalue::OK);