2018-07-12 16:29:32 +02:00
|
|
|
#ifndef FRAMEWORK_TASKS_FIXEDTIMESLOTTASKIF_H_
|
|
|
|
#define FRAMEWORK_TASKS_FIXEDTIMESLOTTASKIF_H_
|
|
|
|
|
2020-08-13 20:53:35 +02:00
|
|
|
#include "PeriodicTaskIF.h"
|
2022-05-30 11:25:08 +02:00
|
|
|
#include "fsfw/objectmanager/ObjectManager.h"
|
2021-09-27 11:16:27 +02:00
|
|
|
#include "fsfw/objectmanager/ObjectManagerIF.h"
|
|
|
|
#include "fsfw/returnvalues/FwClassIds.h"
|
2018-07-12 16:29:32 +02:00
|
|
|
|
|
|
|
/**
|
2020-12-14 11:49:30 +01:00
|
|
|
* @brief Following the same principle as the base class IF.
|
|
|
|
* This is the interface for a Fixed timeslot task
|
2018-07-12 16:29:32 +02:00
|
|
|
*/
|
|
|
|
class FixedTimeslotTaskIF : public PeriodicTaskIF {
|
2022-02-02 10:29:30 +01:00
|
|
|
public:
|
2022-05-19 00:44:34 +02:00
|
|
|
~FixedTimeslotTaskIF() override = default;
|
2020-12-14 11:49:30 +01:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
static constexpr ReturnValue_t SLOT_LIST_EMPTY =
|
2022-08-16 01:08:26 +02:00
|
|
|
returnvalue::makeCode(CLASS_ID::FIXED_SLOT_TASK_IF, 0);
|
2022-05-30 11:25:08 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
/**
|
|
|
|
* Add an object with a slot time and the execution step to the task.
|
|
|
|
* The execution step will be passed to the object (e.g. as an operation
|
|
|
|
* code in #performOperation)
|
|
|
|
* @param componentId
|
|
|
|
* @param slotTimeMs
|
|
|
|
* @param executionStep
|
|
|
|
* @return
|
|
|
|
*/
|
2022-05-30 12:20:05 +02:00
|
|
|
virtual ReturnValue_t addSlot(object_id_t execId, ExecutableObjectIF* obj, uint32_t slotTimeMs,
|
|
|
|
int8_t executionStep) = 0;
|
|
|
|
|
2022-05-30 11:25:08 +02:00
|
|
|
/**
|
|
|
|
* Add an object with a slot time and the execution step to the task.
|
|
|
|
* The execution step will be passed to the object (e.g. as an operation
|
|
|
|
* code in #performOperation)
|
|
|
|
* @param componentId
|
|
|
|
* @param slotTimeMs
|
|
|
|
* @param executionStep
|
|
|
|
* @return
|
|
|
|
*/
|
2022-05-30 12:20:05 +02:00
|
|
|
virtual ReturnValue_t addSlot(object_id_t componentId, uint32_t slotTimeMs,
|
|
|
|
int8_t executionStep) {
|
|
|
|
auto* execObj = ObjectManager::instance()->get<ExecutableObjectIF>(componentId);
|
|
|
|
return addSlot(componentId, execObj, slotTimeMs, executionStep);
|
|
|
|
}
|
2022-05-30 11:31:07 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
/**
|
|
|
|
* Check whether the sequence is valid and perform all other required
|
|
|
|
* initialization steps which are needed after task creation
|
|
|
|
*/
|
2022-05-14 09:38:59 +02:00
|
|
|
virtual ReturnValue_t checkSequence() = 0;
|
2022-05-30 12:20:05 +02:00
|
|
|
|
2022-06-08 17:36:20 +02:00
|
|
|
ReturnValue_t addComponent(object_id_t object, uint8_t opCode) override {
|
2022-08-16 01:08:26 +02:00
|
|
|
return returnvalue::FAILED;
|
2022-05-30 12:20:05 +02:00
|
|
|
}
|
|
|
|
|
2022-06-08 17:36:20 +02:00
|
|
|
ReturnValue_t addComponent(ExecutableObjectIF* object, uint8_t opCode) override {
|
2022-08-16 01:08:26 +02:00
|
|
|
return returnvalue::FAILED;
|
2022-05-30 12:20:05 +02:00
|
|
|
}
|
2018-07-12 16:29:32 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* FRAMEWORK_TASKS_FIXEDTIMESLOTTASKIF_H_ */
|