sys_model_task

struct ModelPriorityPair
#include <sys_model_task.h>

Structure used to pair a model and its requested priority.

Public Members

int32_t CurrentModelPriority

The current model priority. Higher goes first.

SysModel *ModelPtr

The model associated with this 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 FirstStartTime = 0)

class method

A construction option that allows the user to set some task parameters. Note that the only required argument is InputPeriod.

Parameters:
  • InputPeriod – The amount of nanoseconds between calls to this Task.

  • FirstStartTime – The amount of time in nanoseconds to hold a task dormant before starting. After this time the task is executed at integer amounts of InputPeriod again

~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)

Parameters:
  • NewModel – The new model that we are adding to the Task

  • Priority – The selected priority of the model being added (highest goes first)

Returns:

void

void SelfInitTaskList()

This method self-initializes all of the models that have been added to the Task.

Returns:

void

void ExecuteTaskList(uint64_t CurrentSimTime)

This method executes all of the models on the Task during runtime. Then, it sets its NextStartTime appropriately.

Parameters:

CurrentSimNanos – The current simulation time in [ns]

Returns:

void

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()

Parameters:

CurrentSimTime – The time to start at after reset

Returns:

void

inline void ResetTask()

Resets the task.

inline void enableTask()

Enables the task. Great comment huh?

inline void disableTask()

Disables the task. I know.

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.

Parameters:

newPeriod – The period that the task should run at going forward

Returns:

void

inline void updateParentProc(std::string parent)

Allows the system to move task to a different process.

Public Members

std::vector<ModelPriorityPair> TaskModels

&#8212; Array that has pointers to all task sysModels

std::string TaskName

&#8212; Identifier for Task

std::string parentProc

&#8212; Process that calls this 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 FirstTaskTime

[ns] Time to start Task for first time. After this time the normal periodic updates resume.

bool taskActive

&#8212; Flag indicating whether the Task has been disabled

BSKLogger bskLogger

&#8212; BSK Logging