changes and tweaks taken over

This commit is contained in:
Robin Müller 2020-12-14 11:40:26 +01:00
parent 5c6916a078
commit 89de4cc321
8 changed files with 30 additions and 11 deletions

7
subsystem/CMakeLists.txt Normal file
View File

@ -0,0 +1,7 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
Subsystem.cpp
SubsystemBase.cpp
)
add_subdirectory(modes)

View File

@ -367,7 +367,7 @@ ReturnValue_t Subsystem::addSequence(ArrayList<ModeListEntry> *sequence,
}
if (inStore) {
#ifdef USE_MODESTORE
#if FSFW_USE_MODESTORE == 1
result = modeStore->storeArray(sequence,
&(modeSequences.find(id)->entries.firstLinkedElement));
if (result != RETURN_OK) {
@ -410,7 +410,7 @@ ReturnValue_t Subsystem::addTable(ArrayList<ModeListEntry> *table, Mode_t id,
}
if (inStore) {
#ifdef USE_MODESTORE
#if FSFW_USE_MODESTORE == 1
result = modeStore->storeArray(table,
&(modeTables.find(id)->firstLinkedElement));
if (result != RETURN_OK) {
@ -440,7 +440,7 @@ ReturnValue_t Subsystem::deleteSequence(Mode_t id) {
return ACCESS_DENIED;
}
#ifdef USE_MODESTORE
#if FSFW_USE_MODESTORE == 1
modeStore->deleteList(sequenceInfo->entries.firstLinkedElement);
#endif
modeSequences.erase(id);
@ -463,7 +463,7 @@ ReturnValue_t Subsystem::deleteTable(Mode_t id) {
return ACCESS_DENIED;
}
#ifdef USE_MODESTORE
#if FSFW_USE_MODESTORE == 1
modeStore->deleteList(pointer->firstLinkedElement);
#endif
modeSequences.erase(id);
@ -482,10 +482,10 @@ ReturnValue_t Subsystem::initialize() {
return RETURN_FAILED;
}
#ifdef USE_MODESTORE
#if FSFW_USE_MODESTORE == 1
modeStore = objectManager->get<ModeStoreIF>(objects::MODE_STORE);
if (modeStore == NULL) {
if (modeStore == nullptr) {
return RETURN_FAILED;
}
#endif

View File

@ -10,6 +10,8 @@
#include "../container/SinglyLinkedList.h"
#include "../serialize/SerialArrayListAdapter.h"
#include <FSFWConfig.h>
/**
* @brief TODO: documentation missing
* @details
@ -116,7 +118,7 @@ protected:
StorageManagerIF *IPCStore = nullptr;
#ifdef USE_MODESTORE
#if FSFW_USE_MODESTORE == 1
ModeStoreIF *modeStore = nullptr;
#endif

View File

@ -0,0 +1,5 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
ModeSequenceMessage.cpp
ModeStore.cpp
)

View File

@ -2,6 +2,7 @@
#define FSFW_SUBSYSTEM_MODES_MODESEQUENCEMESSAGE_H_
#include "ModeDefinitions.h"
#include "../../ipc/CommandMessage.h"
#include "../../storagemanager/StorageManagerIF.h"

View File

@ -1,8 +1,8 @@
#include "../../subsystem/modes/ModeStore.h"
#include "ModeStore.h"
// todo: I think some parts are deprecated. If this is used, the define
// USE_MODESTORE could be part of the new FSFWConfig.h file.
#ifdef USE_MODESTORE
#if FSFW_USE_MODESTORE == 1
ModeStore::ModeStore(object_id_t objectId, uint32_t slots) :
SystemObject(objectId), store(slots), emptySlot(store.front()) {

View File

@ -1,7 +1,9 @@
#ifndef MODESTORE_H_
#define MODESTORE_H_
#ifdef USE_MODESTORE
#include <FSFWConfig.h>
#if FSFW_USE_MODESTORE == 1
#include "../../container/ArrayList.h"
#include "../../container/SinglyLinkedList.h"

View File

@ -1,7 +1,9 @@
#ifndef MODESTOREIF_H_
#define MODESTOREIF_H_
#ifdef USE_MODESTORE
#include <FSFWConfig.h>
#if FSFW_USE_MODESTORE == 1
#include "../../container/ArrayList.h"
#include "../../container/SinglyLinkedList.h"