From c4fb1f49d813a97113099d4c6e257d5606955182 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Wed, 30 Dec 2020 22:56:46 +0100 Subject: [PATCH] updated defaultcfg --- defaultcfg/fsfwconfig/CMakeLists.txt | 21 +++++++------- .../fsfwconfig/devices/logicalAddresses.cpp | 5 ---- .../fsfwconfig/devices/logicalAddresses.h | 2 +- .../fsfwconfig/devices/powerSwitcherList.cpp | 4 --- .../objects/{Factory.cpp => FsfwFactory.cpp} | 29 +++++++++---------- .../objects/{Factory.h => FsfwFactory.h} | 2 +- 6 files changed, 26 insertions(+), 37 deletions(-) delete mode 100644 defaultcfg/fsfwconfig/devices/logicalAddresses.cpp delete mode 100644 defaultcfg/fsfwconfig/devices/powerSwitcherList.cpp rename defaultcfg/fsfwconfig/objects/{Factory.cpp => FsfwFactory.cpp} (60%) rename defaultcfg/fsfwconfig/objects/{Factory.h => FsfwFactory.h} (91%) diff --git a/defaultcfg/fsfwconfig/CMakeLists.txt b/defaultcfg/fsfwconfig/CMakeLists.txt index b8b41c93..4b8f4474 100644 --- a/defaultcfg/fsfwconfig/CMakeLists.txt +++ b/defaultcfg/fsfwconfig/CMakeLists.txt @@ -1,15 +1,14 @@ -target_sources(${TARGET_NAME} - PRIVATE +target_sources(${LIB_FSFW_NAME} PRIVATE + ipc/missionMessageTypes.cpp + objects/FsfwFactory.cpp + pollingsequence/PollingSequenceFactory.cpp ) -# Add include paths for the executable -target_include_directories(${TARGET_NAME} - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} +# Should be added to include path +target_include_directories(${TARGET_NAME} PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} ) -# Add include paths for the FSFW library -target_include_directories(${LIB_FSFW_NAME} - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} -) \ No newline at end of file +if(NOT FSFW_CONFIG_PATH) + set(FSFW_CONFIG_PATH ${CMAKE_CURRENT_SOURCE_DIR}) +endif() diff --git a/defaultcfg/fsfwconfig/devices/logicalAddresses.cpp b/defaultcfg/fsfwconfig/devices/logicalAddresses.cpp deleted file mode 100644 index c7ce314d..00000000 --- a/defaultcfg/fsfwconfig/devices/logicalAddresses.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "logicalAddresses.h" - - - - diff --git a/defaultcfg/fsfwconfig/devices/logicalAddresses.h b/defaultcfg/fsfwconfig/devices/logicalAddresses.h index e0827ba3..53edcd54 100644 --- a/defaultcfg/fsfwconfig/devices/logicalAddresses.h +++ b/defaultcfg/fsfwconfig/devices/logicalAddresses.h @@ -2,7 +2,7 @@ #define CONFIG_DEVICES_LOGICALADDRESSES_H_ #include -#include "../objects/systemObjectList.h" +#include #include /** diff --git a/defaultcfg/fsfwconfig/devices/powerSwitcherList.cpp b/defaultcfg/fsfwconfig/devices/powerSwitcherList.cpp deleted file mode 100644 index 343f78d0..00000000 --- a/defaultcfg/fsfwconfig/devices/powerSwitcherList.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include "powerSwitcherList.h" - - - diff --git a/defaultcfg/fsfwconfig/objects/Factory.cpp b/defaultcfg/fsfwconfig/objects/FsfwFactory.cpp similarity index 60% rename from defaultcfg/fsfwconfig/objects/Factory.cpp rename to defaultcfg/fsfwconfig/objects/FsfwFactory.cpp index 41333b1c..428adf1d 100644 --- a/defaultcfg/fsfwconfig/objects/Factory.cpp +++ b/defaultcfg/fsfwconfig/objects/FsfwFactory.cpp @@ -1,9 +1,5 @@ -#include "Factory.h" -#include "../tmtc/apid.h" -#include "../tmtc/pusIds.h" -#include "../objects/systemObjectList.h" -#include "../devices/logicalAddresses.h" -#include "../devices/powerSwitcherList.h" +#include "FsfwFactory.h" +#include #include #include @@ -11,24 +7,27 @@ #include #include #include -#include +#include #include /** - * This class should be used to create all system objects required for - * the on-board software, using the object ID list from the configuration - * folder. + * This function builds all system objects required for using + * the FSFW. It is recommended to build all other required objects + * in a function with an identical prototype, call this function in it and + * then pass the function to the object manager so it builds all system + * objects on software startup. * - * The objects are registered in the internal object manager automatically. - * This is used later to add objects to tasks. + * All system objects are registered in the internal object manager + * automatically. The objects should be added to tasks at a later stage, using + * their objects IDs. * - * This file also sets static framework IDs. + * This function also sets static framework IDs. * - * Framework objects are created first. + * Framework should be created first before creating mission system objects. * @ingroup init */ -void Factory::produce(void) { +void Factory::produceFsfwObjects(void) { setStaticFrameworkObjectIds(); new EventManager(objects::EVENT_MANAGER); new HealthTable(objects::HEALTH_TABLE); diff --git a/defaultcfg/fsfwconfig/objects/Factory.h b/defaultcfg/fsfwconfig/objects/FsfwFactory.h similarity index 91% rename from defaultcfg/fsfwconfig/objects/Factory.h rename to defaultcfg/fsfwconfig/objects/FsfwFactory.h index fe55deff..2724d2e3 100644 --- a/defaultcfg/fsfwconfig/objects/Factory.h +++ b/defaultcfg/fsfwconfig/objects/FsfwFactory.h @@ -9,7 +9,7 @@ namespace Factory { * @brief Creates all SystemObject elements which are persistent * during execution. */ - void produce(); + void produceFsfwObjects(); void setStaticFrameworkObjectIds(); }