Module: sys_model_task¶
-
struct
ModelPriorityPair¶ - #include <sys_model_task.h>
Structure used to pair a model and its requested priority.
-
class
SysModelTask¶ - #include <sys_model_task.h>
Class used to group a set of models into one “Task” of execution.
Public Functions
-
SysModelTask()¶ The task constructor.
-
SysModelTask(uint64_t InputPeriod, uint64_t InputDelay = 0, uint64_t FirstStartTime = 0)¶ A construction option that allows the user to set some task parameters. Note that the only required argument is InputPeriod.
- Parameters
uint64_t: InputPeriod The amount of nanoseconds between calls to this Task.uint64_t: InputDelay How long to delay the input by in nanosecondsuint64_t: FirstStartTime The offset in nanoseconds in a given frame to start the Task with.
-
~SysModelTask()¶ The destructor.
-
void
AddNewObject(SysModel *NewModel, int32_t Priority = -1)¶ This method adds a new model into the Task list. Note that the Priority parameter is option as it defaults to -1 (lowest, latest)
- Return
void
- Parameters
SysModel*: NewModel The new model that we are adding to the Taskint32_t: Priority The selected priority of the model being added (highest goes first)
-
void
SelfInitTaskList()¶ This method self-initializes all of the models that have been added to the Task.
- Return
void
-
void
CrossInitTaskList()¶ This method cross-initializes all of the models that have been added to the Task.
- Return
void
-
void
ExecuteTaskList(uint64_t CurrentSimTime)¶ This method executes all of the models on the Task during runtime. Then, it sets its NextStartTime appropriately.
- Return
void
- Parameters
CurrentSimNanos: The current simulation time in [ns]
-
void
ResetTaskList(uint64_t CurrentSimTime)¶ This method resets all of the models that have been added to the Task at the CurrentSimTime. See sys_model_task.h for related method ResetTask()
- Return
void
- Parameters
uint64_t: CurrentSimTime The time to start at after reset
-
void
ResetTask()¶
-
void
enableTask()¶
-
void
disableTask()¶
-
void
updatePeriod(uint64_t newPeriod)¶ This method changes the period of a given task over to the requested period. It attempts to keep the same offset relative to the original offset that was specified at task creation.
- Return
void
- Parameters
uint64_t: newPeriod The period that the task should run at going forward
Public Members
-
std::vector<ModelPriorityPair>
TaskModels¶ Array that has pointers to all task sysModels
-
std::string
TaskName¶ Identifier for Task
-
uint64_t
NextStartTime¶ [ns] Next time to start task
-
uint64_t
NextPickupTime¶ [ns] Next time read Task outputs
-
uint64_t
TaskPeriod¶ [ns] Cycle rate for Task
-
uint64_t
PickupDelay¶ [ns] Time between dispatches
-
uint64_t
FirstTaskTime¶ [ns] Time to start Task for first time
-
bool
taskActive¶ Flag indicating whether the Task has been disabled
-