optional module handling complete

This commit is contained in:
Robin Müller 2021-07-19 18:26:54 +02:00
parent d47906e833
commit d4f5c31881
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
55 changed files with 207 additions and 54 deletions

View File

@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.13)
option(FSFW_GENERATE_SECTIONS
"Generate function and data sections. Required to remove unused code" ON
)
if(FSFW_GENERATE_SECTIONS)
option(FSFW_REMOVE_UNUSED_CODE "Remove unused code" ON)
endif()
@ -11,9 +10,18 @@ endif()
option(FSFW_WARNING_SHADOW_LOCAL_GCC "Enable -Wshadow=local warning in GCC" ON)
# Options to exclude parts of the FSFW from compilation.
option(FSFW_ADD_INTERNAL_TESTS "Add internal unit tests" ON)
option(FSFW_USE_RMAP "Compile with RMAP" ON)
option(FSFW_USE_DATALINKLAYER "Compile with Data Link Layer" ON)
option(FSFW_ADD_SPG4_PROPAGATOR "Add SPG4 propagator code" ON)
# Optional sources
option(FSFW_ADD_PUS "Compile with PUS sources" ON)
option(FSFW_ADD_MONITORING "Compile with monitoring components" ON)
option(FSFW_ADD_RMAP "Compile with RMAP" OFF)
option(FSFW_ADD_DATALINKLAYER "Compile with Data Link Layer" OFF)
option(FSFW_ADD_COORDINATES "Compile with coordinate components" OFF)
option(FSFW_ADD_TMSTORAGE "Compile with tm storage components" OFF)
# Contrib sources
option(FSFW_ADD_SPG4_PROPAGATOR "Add SPG4 propagator code" OFF)
set(LIB_FSFW_NAME fsfw)
add_library(${LIB_FSFW_NAME})

View File

@ -6,4 +6,15 @@ target_include_directories(${LIB_FSFW_NAME} INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}
)
add_subdirectory(fsfw)
add_subdirectory(fsfw)
# Configure File
target_include_directories(${LIB_FSFW_NAME} PRIVATE
${CMAKE_CURRENT_BINARY_DIR}
)
target_include_directories(${LIB_FSFW_NAME} INTERFACE
${CMAKE_CURRENT_BINARY_DIR}
)
configure_file(fsfw/FSFW.h.in fsfw/FSFW.h)

View File

@ -31,12 +31,24 @@ add_subdirectory(tmtcservices)
# Optional
add_subdirectory(coordinates)
add_subdirectory(datalinklayer)
if(FSFW_ADD_MONITORING)
add_subdirectory(monitoring)
add_subdirectory(pus)
add_subdirectory(rmap)
add_subdirectory(tmstorage)
endif()
if(FSFW_ADD_PUS)
add_subdirectory(pus)
endif()
if(FSFW_ADD_TMSTORAGE)
add_subdirectory(tmstorage)
endif()
if(FSFW_ADD_COORDINATES)
add_subdirectory(coordinates)
endif()
if(FSFW_ADD_RMAP)
add_subdirectory(rmap)
endif()
if(FSFW_ADD_DATALINKLAYER)
add_subdirectory(datalinklayer)
endif()
# OSAL

View File

@ -1,7 +0,0 @@
#ifndef FSFW_FSFW_H_
#define FSFW_FSFW_H_
#include "FSFWConfig.h"
#endif /* FSFW_FSFW_H_ */

12
src/fsfw/FSFW.h.in Normal file
View File

@ -0,0 +1,12 @@
#ifndef FSFW_FSFW_H_
#define FSFW_FSFW_H_
#include "FSFWConfig.h"
#cmakedefine FSFW_ADD_RMAP
#cmakedefine FSFW_ADD_DATALINKLAYER
#cmakedefine FSFW_ADD_TMSTORAGE
#cmakedefine FSFW_ADD_COORDINATES
#cmakedefine FSFW_ADD_PUS
#endif /* FSFW_FSFW_H_ */

View File

@ -1,6 +1,7 @@
#ifndef COORDINATETRANSFORMATIONS_H_
#define COORDINATETRANSFORMATIONS_H_
#include "coordinatesConf.h"
#include "fsfw/timemanager/Clock.h"
#include <cstring>

View File

@ -1,13 +1,14 @@
#ifndef FRAMEWORK_COORDINATES_JGM3MODEL_H_
#define FRAMEWORK_COORDINATES_JGM3MODEL_H_
#include <stdint.h>
#include "coordinatesConf.h"
#include "CoordinateTransformations.h"
#include "../globalfunctions/math/VectorOperations.h"
#include "../globalfunctions/timevalOperations.h"
#include "../globalfunctions/constants.h"
#include <memory.h>
#include "fsfw/globalfunctions/math/VectorOperations.h"
#include "fsfw/globalfunctions/timevalOperations.h"
#include "fsfw/globalfunctions/constants.h"
#include <memory.h>
#include <cstdint>
template<uint8_t DEGREE,uint8_t ORDER>
class Jgm3Model {

View File

@ -1,7 +1,9 @@
#ifndef SGP4PROPAGATOR_H_
#define SGP4PROPAGATOR_H_
#include "coordinatesConf.h"
#include "fsfw/platform.h"
#ifndef PLATFORM_WIN
#include <sys/time.h>
#endif

View File

@ -0,0 +1,11 @@
#ifndef FSFW_SRC_FSFW_COORDINATES_COORDINATESCONF_H_
#define FSFW_SRC_FSFW_COORDINATES_COORDINATESCONF_H_
#include "fsfw/FSFW.h"
#ifndef FSFW_ADD_COORDINATES
#warning Coordinates files were included but compilation was \
not enabled with FSFW_ADD_COORDINATES
#endif
#endif /* FSFW_SRC_FSFW_COORDINATES_COORDINATESCONF_H_ */

View File

@ -8,6 +8,7 @@
#ifndef BCFRAME_H_
#define BCFRAME_H_
#include "dllConf.h"
#include "CCSDSReturnValuesIF.h"
/**

View File

@ -8,7 +8,8 @@
#ifndef CCSDSRETURNVALUESIF_H_
#define CCSDSRETURNVALUESIF_H_
#include "../returnvalues/HasReturnvaluesIF.h"
#include "dllConf.h"
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
/**
* This is a helper class to collect special return values that come up during CCSDS Handling.
* @ingroup ccsds_handling

View File

@ -1,7 +1,9 @@
#ifndef CLCW_H_
#define CLCW_H_
#include "dllConf.h"
#include "ClcwIF.h"
/**
* Small helper method to handle the Clcw values.
* It has a content struct that manages the register and can be set externally.

View File

@ -1,11 +1,13 @@
#ifndef DATALINKLAYER_H_
#define DATALINKLAYER_H_
#include "dllConf.h"
#include "CCSDSReturnValuesIF.h"
#include "ClcwIF.h"
#include "TcTransferFrame.h"
#include "VirtualChannelReceptionIF.h"
#include "../events/Event.h"
#include "fsfw/events/Event.h"
#include <map>

View File

@ -8,7 +8,9 @@
#ifndef FARM1STATEIF_H_
#define FARM1STATEIF_H_
#include "dllConf.h"
#include "CCSDSReturnValuesIF.h"
class VirtualChannelReception;
class TcTransferFrame;
class ClcwIF;

View File

@ -1,6 +1,7 @@
#ifndef FARM1STATELOCKOUT_H_
#define FARM1STATELOCKOUT_H_
#include "dllConf.h"
#include "Farm1StateIF.h"
/**

View File

@ -8,6 +8,7 @@
#ifndef FARM1STATEOPEN_H_
#define FARM1STATEOPEN_H_
#include "dllConf.h"
#include "Farm1StateIF.h"
/**

View File

@ -8,6 +8,7 @@
#ifndef FARM1STATEWAIT_H_
#define FARM1STATEWAIT_H_
#include "dllConf.h"
#include "Farm1StateIF.h"
/**

View File

@ -1,6 +1,7 @@
#ifndef FSFW_DATALINKLAYER_MAPPACKETEXTRACTION_H_
#define FSFW_DATALINKLAYER_MAPPACKETEXTRACTION_H_
#include "dllConf.h"
#include "MapPacketExtractionIF.h"
#include "fsfw/objectmanager/ObjectManagerIF.h"
#include "fsfw/returnvalues/HasReturnvaluesIF.h"

View File

@ -8,6 +8,7 @@
#ifndef MAPPACKETEXTRACTIONIF_H_
#define MAPPACKETEXTRACTIONIF_H_
#include "dllConf.h"
#include "CCSDSReturnValuesIF.h"
#include "TcTransferFrame.h"

View File

@ -1,6 +1,8 @@
#ifndef TCTRANSFERFRAME_H_
#define TCTRANSFERFRAME_H_
#include "dllConf.h"
#include <cstdint>
#include <cstddef>

View File

@ -8,6 +8,7 @@
#ifndef TCTRANSFERFRAMELOCAL_H_
#define TCTRANSFERFRAMELOCAL_H_
#include "dllConf.h"
#include "TcTransferFrame.h"
/**

View File

@ -8,6 +8,7 @@
#ifndef VIRTUALCHANNELRECEPTION_H_
#define VIRTUALCHANNELRECEPTION_H_
#include "dllConf.h"
#include "CCSDSReturnValuesIF.h"
#include "Clcw.h"
#include "Farm1StateIF.h"
@ -16,6 +17,7 @@
#include "Farm1StateWait.h"
#include "MapPacketExtractionIF.h"
#include "VirtualChannelReceptionIF.h"
#include <map>
/**
* Implementation of a TC Virtual Channel.

View File

@ -8,9 +8,10 @@
#ifndef VIRTUALCHANNELRECEPTIONIF_H_
#define VIRTUALCHANNELRECEPTIONIF_H_
#include "dllConf.h"
#include "ClcwIF.h"
#include "TcTransferFrame.h"
#include "../returnvalues/HasReturnvaluesIF.h"
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
/**
* This is the interface for Virtual Channel reception classes.

View File

@ -0,0 +1,11 @@
#ifndef FSFW_SRC_FSFW_DATALINKLAYER_DLLCONF_H_
#define FSFW_SRC_FSFW_DATALINKLAYER_DLLCONF_H_
#include "fsfw/FSFW.h"
#ifndef FSFW_ADD_DATALINKLAYER
#warning Datalinklayer files were included but compilation was \
not enabled with FSFW_ADD_DATALINKLAYER
#endif
#endif /* FSFW_SRC_FSFW_DATALINKLAYER_DLLCONF_H_ */

View File

@ -1,3 +1,4 @@
#include "fsfw/FSFW.h"
#include "fsfw/ipc/CommandMessageCleaner.h"
#include "fsfw/memory/GenericFileSystemMessage.h"
@ -34,9 +35,11 @@ void CommandMessageCleaner::clearCommandMessage(CommandMessage* message) {
case messagetypes::MONITORING:
MonitoringMessage::clear(message);
break;
#ifdef FSFW_ADD_TMSTORAGE
case messagetypes::TM_STORE:
TmStoreMessage::clear(message);
break;
#endif
case messagetypes::PARAMETER:
ParameterMessage::clear(message);
break;

View File

@ -1,6 +1,7 @@
#ifndef FSFW_MONITORING_ABSLIMITMONITOR_H_
#define FSFW_MONITORING_ABSLIMITMONITOR_H_
#include "monitoringConf.h"
#include "MonitorBase.h"
#include <cmath>

View File

@ -1,6 +1,7 @@
#ifndef FSFW_MONITORING_HASMONITORSIF_H_
#define FSFW_MONITORING_HASMONITORSIF_H_
#include "monitoringConf.h"
#include "../events/EventReportingProxyIF.h"
#include "../objectmanager/ObjectManagerIF.h"
#include "../ipc/MessageQueueSenderIF.h"

View File

@ -1,6 +1,7 @@
#ifndef FRAMEWORK_MONITORING_LIMITMONITOR_H_
#define FRAMEWORK_MONITORING_LIMITMONITOR_H_
#include "monitoringConf.h"
#include "MonitorBase.h"
/**

View File

@ -7,6 +7,7 @@
#ifndef LIMITVIOLATIONREPORTER_H_
#define LIMITVIOLATIONREPORTER_H_
#include "monitoringConf.h"
#include "../returnvalues/HasReturnvaluesIF.h"
#include "../serialize/SerializeIF.h"
#include "../storagemanager/StorageManagerIF.h"

View File

@ -1,6 +1,7 @@
#ifndef FSFW_MONITORING_MONITORBASE_H_
#define FSFW_MONITORING_MONITORBASE_H_
#include "monitoringConf.h"
#include "LimitViolationReporter.h"
#include "MonitoringIF.h"
#include "MonitoringMessageContent.h"

View File

@ -1,6 +1,7 @@
#ifndef FSFW_MONITORING_MONITORREPORTER_H_
#define FSFW_MONITORING_MONITORREPORTER_H_
#include "monitoringConf.h"
#include "LimitViolationReporter.h"
#include "MonitoringIF.h"
#include "MonitoringMessageContent.h"

View File

@ -1,6 +1,7 @@
#ifndef FSFW_MONITORING_MONITORINGIF_H_
#define FSFW_MONITORING_MONITORINGIF_H_
#include "monitoringConf.h"
#include "MonitoringMessage.h"
#include "../serialize/SerializeIF.h"

View File

@ -1,8 +1,9 @@
#ifndef MONITORINGMESSAGE_H_
#define MONITORINGMESSAGE_H_
#include "../ipc/CommandMessage.h"
#include "../storagemanager/StorageManagerIF.h"
#include "monitoringConf.h"
#include "fsfw/ipc/CommandMessage.h"
#include "fsfw/storagemanager/StorageManagerIF.h"
class MonitoringMessage: public CommandMessage {
public:

View File

@ -1,6 +1,7 @@
#ifndef FSFW_MONITORING_MONITORINGMESSAGECONTENT_H_
#define FSFW_MONITORING_MONITORINGMESSAGECONTENT_H_
#include "monitoringConf.h"
#include "HasMonitorsIF.h"
#include "MonitoringIF.h"

View File

@ -1,7 +1,8 @@
#ifndef RECEIVESMONITORINGREPORTSIF_H_
#define RECEIVESMONITORINGREPORTSIF_H_
#include "../ipc/MessageQueueSenderIF.h"
#include "monitoringConf.h"
#include "fsfw/ipc/messageQueueDefinitions.h"
class ReceivesMonitoringReportsIF {
public:

View File

@ -1,6 +1,7 @@
#ifndef FRAMEWORK_MONITORING_TRIPLEXMONITOR_H_
#define FRAMEWORK_MONITORING_TRIPLEXMONITOR_H_
#include "monitoringConf.h"
#include "../datapool/DataSet.h"
#include "../datapool/PIDReaderList.h"
#include "../health/HealthTableIF.h"

View File

@ -1,6 +1,7 @@
#ifndef FRAMEWORK_MONITORING_TWOVALUELIMITMONITOR_H_
#define FRAMEWORK_MONITORING_TWOVALUELIMITMONITOR_H_
#include "monitoringConf.h"
#include "LimitMonitor.h"
template<typename T>

View File

@ -0,0 +1,11 @@
#ifndef FSFW_MONITORING_MONITORINGCONF_H_
#define FSFW_MONITORING_MONITORINGCONF_H_
#include "fsfw/FSFW.h"
#ifndef FSFW_ADD_MONITORING
#warning Monitoring files were included but compilation was \
not enabled with FSFW_ADD_MONITORING
#endif
#endif /* FSFW_MONITORING_MONITORINGCONF_H_ */

8
src/fsfw/objectmanager.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef FSFW_SRC_FSFW_OBJECTMANAGER_H_
#define FSFW_SRC_FSFW_OBJECTMANAGER_H_
#include "objectmanager/ObjectManager.h"
#include "objectmanager/SystemObject.h"
#include "objectmanager/frameworkObjects.h"
#endif /* FSFW_SRC_FSFW_OBJECTMANAGER_H_ */

View File

@ -1,6 +1,7 @@
#ifndef FSFW_RMAP_RMAP_H_
#define FSFW_RMAP_RMAP_H_
#include "rmapConf.h"
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
#include "fsfw/rmap/RMAPCookie.h"

View File

@ -1,8 +1,9 @@
#ifndef FSFW_RMAP_RMAPCHANNELIF_H_
#define FSFW_RMAP_RMAPCHANNELIF_H_
#include "rmapConf.h"
#include "RMAPCookie.h"
#include "../returnvalues/HasReturnvaluesIF.h"
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
#include <cstddef>
class RMAPChannelIF {

View File

@ -1,6 +1,7 @@
#ifndef FSFW_RMAP_RMAPCOOKIE_H_
#define FSFW_RMAP_RMAPCOOKIE_H_
#include "rmapConf.h"
#include "rmapStructs.h"
#include "fsfw/devicehandlers/CookieIF.h"
#include <cstddef>

View File

@ -1,6 +1,7 @@
#ifndef FSFW_RMAP_RMAPDEVICECOMMUNICATIONINTERFACE_H_
#define FSFW_RMAP_RMAPDEVICECOMMUNICATIONINTERFACE_H_
#include "rmapConf.h"
#include "fsfw/devicehandlers/DeviceCommunicationIF.h"
/**

10
src/fsfw/rmap/rmapConf.h Normal file
View File

@ -0,0 +1,10 @@
#ifndef FSFW_SRC_FSFW_RMAP_RAMCONF_H_
#define FSFW_SRC_FSFW_RMAP_RAMCONF_H_
#include "fsfw/FSFW.h"
#ifndef FSFW_ADD_RMAP
#warning RMAP was included but compilation was not enabled with FSFW_ADD_RMAP
#endif
#endif /* FSFW_SRC_FSFW_RMAP_RAMCONF_H_ */

View File

@ -1,6 +1,8 @@
#ifndef FSFW_RMAP_RMAPSTRUCTS_H_
#define FSFW_RMAP_RMAPSTRUCTS_H_
#include "rmapConf.h"
#include <cstdint>
//SHOULDDO: having the defines within a namespace would be nice. Problem are the defines referencing the previous define, eg RMAP_COMMAND_WRITE

View File

@ -0,0 +1,6 @@
#ifndef FSFW_SRC_FSFW_SERVICEINTERFACE_H_
#define FSFW_SRC_FSFW_SERVICEINTERFACE_H_
#include "serviceinterface/ServiceInterface.h"
#endif /* FSFW_SRC_FSFW_SERVICEINTERFACE_H_ */

View File

@ -1,9 +1,9 @@
#ifndef FSFW_TCDISTRIBUTION_TCPACKETCHECK_H_
#define FSFW_TCDISTRIBUTION_TCPACKETCHECK_H_
#include "../FSFW.h"
#include "../returnvalues/HasReturnvaluesIF.h"
#include "../tmtcservices/PusVerificationReport.h"
#include "fsfw/FSFW.h"
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
#include "fsfw/tmtcservices/PusVerificationReport.h"
class TcPacketStoredBase;

View File

@ -1,11 +1,13 @@
#ifndef FSFW_TMTCSERVICES_TMSTOREBACKENDIF_H_
#define FSFW_TMTCSERVICES_TMSTOREBACKENDIF_H_
#include "../returnvalues/HasReturnvaluesIF.h"
#include "../objectmanager/SystemObjectIF.h"
#include "../parameters/HasParametersIF.h"
#include "../storagemanager/StorageManagerIF.h"
#include "../timemanager/Clock.h"
#include "tmStorageConf.h"
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
#include "fsfw/objectmanager/SystemObjectIF.h"
#include "fsfw/parameters/HasParametersIF.h"
#include "fsfw/storagemanager/StorageManagerIF.h"
#include "fsfw/timemanager/Clock.h"
class TmPacketInformation;
class TmPacketMinimal;
class SpacePacketBase;

View File

@ -1,9 +1,10 @@
#ifndef FSFW_TMTCSERVICES_TMSTOREFRONTENDIF_H_
#define FSFW_TMTCSERVICES_TMSTOREFRONTENDIF_H_
#include "tmStorageConf.h"
#include "TmStorePackets.h"
#include "../returnvalues/HasReturnvaluesIF.h"
#include "../ipc/MessageQueueSenderIF.h"
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
#include "fsfw/ipc/MessageQueueSenderIF.h"
class TmPacketMinimal;
class SpacePacketBase;

View File

@ -1,4 +1,4 @@
#include "fsfw/tmstorage/TmStoreMessage.h"
#include "TmStoreMessage.h"
#include "fsfw/objectmanager/ObjectManager.h"
TmStoreMessage::~TmStoreMessage() {

View File

@ -1,10 +1,11 @@
#ifndef FSFW_TMSTORAGE_TMSTOREMESSAGE_H_
#define FSFW_TMSTORAGE_TMSTOREMESSAGE_H_
#include "tmStorageConf.h"
#include "TmStorePackets.h"
#include "../ipc/CommandMessage.h"
#include "../storagemanager/StorageManagerIF.h"
#include "../objectmanager/SystemObjectIF.h"
#include "fsfw/ipc/CommandMessage.h"
#include "fsfw/storagemanager/StorageManagerIF.h"
#include "fsfw/objectmanager/SystemObjectIF.h"
class TmStoreMessage {
public:

View File

@ -1,14 +1,15 @@
#ifndef FSFW_TMSTORAGE_TMSTOREPACKETS_H_
#define FSFW_TMSTORAGE_TMSTOREPACKETS_H_
#include "../serialize/SerialFixedArrayListAdapter.h"
#include "../serialize/SerializeElement.h"
#include "../serialize/SerialLinkedListAdapter.h"
#include "../serialize/SerialBufferAdapter.h"
#include "../tmtcpacket/pus/tm/TmPacketMinimal.h"
#include "../timemanager/TimeStamperIF.h"
#include "../timemanager/CCSDSTime.h"
#include "../globalfunctions/timevalOperations.h"
#include "tmStorageConf.h"
#include "fsfw/serialize/SerialFixedArrayListAdapter.h"
#include "fsfw/serialize/SerializeElement.h"
#include "fsfw/serialize/SerialLinkedListAdapter.h"
#include "fsfw/serialize/SerialBufferAdapter.h"
#include "fsfw/tmtcpacket/pus/tm/TmPacketMinimal.h"
#include "fsfw/timemanager/TimeStamperIF.h"
#include "fsfw/timemanager/CCSDSTime.h"
#include "fsfw/globalfunctions/timevalOperations.h"
class ServiceSubservice: public SerialLinkedListAdapter<SerializeIF> {
public:

View File

@ -0,0 +1,11 @@
#ifndef FSFW_TMSTORAGE_TMSTORAGECONF_H_
#define FSFW_TMSTORAGE_TMSTORAGECONF_H_
#include "fsfw/FSFW.h"
#ifndef FSFW_ADD_TMSTORAGE
#warning TM storage files were includes but compilation was \
not enabled with FSFW_ADD_TMSTORAGE
#endif
#endif /* FSFW_TMSTORAGE_TMSTORAGECONF_H_ */

View File

@ -1,8 +1,8 @@
#ifndef FSFW_TMTCPACKET_PUS_TCPACKETPUSA_H_
#define FSFW_TMTCPACKET_PUS_TCPACKETPUSA_H_
#include "../../../FSFW.h"
#include "../../ccsds_header.h"
#include "fsfw/FSFW.h"
#include "fsfw/tmtcpacket/ccsds_header.h"
#include "TcPacketBase.h"
#include <cstdint>

View File

@ -1,7 +1,7 @@
#ifndef FSFW_TMTCPACKET_PUS_TM_H_
#define FSFW_TMTCPACKET_PUS_TM_H_
#include "../../FSFW.h"
#include "fsfw/FSFW.h"
#if FSFW_USE_PUS_C_TELEMETRY == 1
#include "tm/TmPacketPusC.h"