made fixed sequence slot doc generic

This commit is contained in:
Robin Müller 2020-09-04 14:11:59 +02:00
parent 92c7369276
commit b8754fbc16
4 changed files with 51 additions and 41 deletions

View File

@ -1,5 +1,5 @@
#include "../objectmanager/SystemObjectIF.h" #include "FixedSequenceSlot.h"
#include "../tasks/FixedSequenceSlot.h" #include "PeriodicTaskIF.h"
#include <cstddef> #include <cstddef>
FixedSequenceSlot::FixedSequenceSlot(object_id_t handlerId, uint32_t setTime, FixedSequenceSlot::FixedSequenceSlot(object_id_t handlerId, uint32_t setTime,

View File

@ -1,8 +1,9 @@
#ifndef FRAMEWORK_TASKS_FIXEDSEQUENCESLOT_H_ #ifndef FSFW_TASKS_FIXEDSEQUENCESLOT_H_
#define FRAMEWORK_TASKS_FIXEDSEQUENCESLOT_H_ #define FSFW_TASKS_FIXEDSEQUENCESLOT_H_
#include "ExecutableObjectIF.h"
#include "../objectmanager/ObjectManagerIF.h" #include "../objectmanager/ObjectManagerIF.h"
#include "../tasks/ExecutableObjectIF.h"
class PeriodicTaskIF; class PeriodicTaskIF;
/** /**
@ -56,4 +57,4 @@ public:
}; };
#endif /* FIXEDSEQUENCESLOT_H_ */ #endif /* FSFW_TASKS_FIXEDSEQUENCESLOT_H_ */

View File

@ -1,5 +1,5 @@
#include "FixedSlotSequence.h"
#include "../serviceinterface/ServiceInterfaceStream.h" #include "../serviceinterface/ServiceInterfaceStream.h"
#include "../tasks/FixedSlotSequence.h"
#include <cstdlib> #include <cstdlib>
FixedSlotSequence::FixedSlotSequence(uint32_t setLengthMs) : FixedSlotSequence::FixedSlotSequence(uint32_t setLengthMs) :

View File

@ -1,26 +1,30 @@
#ifndef FRAMEWORK_TASKS_FIXEDSLOTSEQUENCE_H_ #ifndef FSFW_TASKS_FIXEDSLOTSEQUENCE_H_
#define FRAMEWORK_TASKS_FIXEDSLOTSEQUENCE_H_ #define FSFW_TASKS_FIXEDSLOTSEQUENCE_H_
#include "FixedSequenceSlot.h"
#include "../objectmanager/SystemObject.h" #include "../objectmanager/SystemObject.h"
#include "../tasks/FixedSequenceSlot.h"
#include <set> #include <set>
/** /**
* @brief This class is the representation of a Polling Sequence Table in software. * @brief This class is the representation of a
* Polling Sequence Table in software.
* @details * @details
* The FixedSlotSequence object maintains the dynamic execution of * The FixedSlotSequence object maintains the dynamic execution of
* device handler objects. * objects with stricter timing requirements for the FixedTimeslotTask.
* *
* The main idea is to create a list of device handlers, to announce all * The main idea is to create a list of executable objects (for example
* handlers to thepolling sequence and to maintain a list of * device handlers), to announce all handlers to the polling sequence and to
* polling slot objects. This slot list represents the Polling Sequence Table * maintain a list of polling slot objects.
* in software. * This slot list represents the Polling Sequence Table in software.
* *
* Each polling slot contains information to indicate when and * Each polling slot contains information to indicate when and
* which device handler shall be executed within a given polling period. * which executable object shall be executed within a given polling period.
* The sequence is then executed by iterating through this slot list. * When adding a slot, a pointer to the executing task, a pointer to the
* Handlers are invoking by calling a certain function stored in the handler list. * executable object and a step number can be passed. The step number will be
* passed to the periodic handler.
* The sequence is executed by iterating through the slot sequence and
* executing the executable object in the correct timeslot.
*/ */
class FixedSlotSequence { class FixedSlotSequence {
public: public:
@ -29,41 +33,44 @@ public:
/** /**
* @brief The constructor of the FixedSlotSequence object. * @brief The constructor of the FixedSlotSequence object.
*
* @details The constructor takes two arguments, the period length and the init function.
*
* @param setLength The period length, expressed in ms. * @param setLength The period length, expressed in ms.
*/ */
FixedSlotSequence(uint32_t setLengthMs); FixedSlotSequence(uint32_t setLengthMs);
/** /**
* @brief The destructor of the FixedSlotSequence object. * @brief The destructor of the FixedSlotSequence object.
* * @details
* @details The destructor frees all allocated memory by iterating through the slotList * The destructor frees all allocated memory by iterating through the
* and deleting all allocated resources. * slotList and deleting all allocated resources.
*/ */
virtual ~FixedSlotSequence(); virtual ~FixedSlotSequence();
/** /**
* @brief This is a method to add an PollingSlot object to slotList. * @brief This is a method to add an PollingSlot object to slotList.
* *
* @details Here, a polling slot object is added to the slot list. It is appended * @details
* to the end of the list. The list is currently NOT reordered. * Here, a polling slot object is added to the slot list. It is appended
* Afterwards, the iterator current is set to the beginning of the list. * to the end of the list. The list is currently NOT reordered.
* @param Object ID of the object to add * Afterwards, the iterator current is set to the beginning of the list.
* @param setTime Value between (0 to 1) * slotLengthMs, when a FixedTimeslotTask * @param handlerId ID of the object to add
* will be called inside the slot period. * @param setTime
* @param setSequenceId ID which can be used to distinguish * Value between (0 to 1) * slotLengthMs, when a FixedTimeslotTask
* different task operations * will be called inside the slot period.
* @param setSequenceId
* ID which can be used to distinguish different task operations. This
* value will be passed to the executable function.
* @param * @param
* @param * @param
*/ */
void addSlot(object_id_t handlerId, uint32_t setTime, int8_t setSequenceId, void addSlot(object_id_t handlerId, uint32_t setTime, int8_t setSequenceId,
ExecutableObjectIF* executableObject, PeriodicTaskIF* executingTask); ExecutableObjectIF* executableObject,
PeriodicTaskIF* executingTask);
/** /**
* Checks if the current slot shall be executed immediately after the one before. * @brief Checks if the current slot shall be executed immediately
* This allows to distinguish between grouped and not grouped handlers. * after the one before.
* @details
* This allows to distinguish between grouped and separated handlers.
* @return - @c true if the slot has the same polling time as the previous * @return - @c true if the slot has the same polling time as the previous
* - @c false else * - @c false else
*/ */
@ -128,12 +135,16 @@ public:
* @brief Check and initialize slot list. * @brief Check and initialize slot list.
* @details * @details
* Checks if timing is ok (must be ascending) and if all handlers were found. * Checks if timing is ok (must be ascending) and if all handlers were found.
* Also calls any initialization steps which are required after task
* creation.
* @return * @return
*/ */
ReturnValue_t checkSequence() const; ReturnValue_t checkSequence() const;
/**
* @brief Perform any initialization steps required after the executing
* task has been created. This function should be called from the
* executing task!
* @return
*/
ReturnValue_t intializeSequenceAfterTaskCreation() const; ReturnValue_t intializeSequenceAfterTaskCreation() const;
protected: protected:
@ -152,8 +163,6 @@ protected:
SlotList slotList; SlotList slotList;
uint32_t lengthMs; uint32_t lengthMs;
bool isEmpty = false;
}; };
#endif /* FIXEDSLOTSEQUENCE_H_ */ #endif /* FSFW_TASKS_FIXEDSLOTSEQUENCE_H_ */