Module: sys_process

struct ModelScheduleEntry
#include <sys_process.h>

Structure that contains the information needed to call a Task.

Public Members

uint64_t NextTaskStart

Time to call Task next

uint64_t TaskUpdatePeriod

Period of update for Task

int32_t taskPriority

[-] Priority level for the task

SysModelTask *TaskPtr

Handle to the Task that needs to be called

class SysProcess
#include <sys_process.h>

Class used to group a set of tasks into one process (task group) of execution.

Public Functions

SysProcess()

The task constructor.

SysProcess(std::string messageContainer)

Make a process AND attach a storage bucket with the provided name. Give the process the same name.

Return

void

Parameters
  • std::string: messagecontainer The amount of nanoseconds between calls to this Task.

~SysProcess()

The destructor does nothing.

Return

void

void addNewTask(SysModelTask *newTask, int32_t taskPriority = -1)

This method adds a new task into the T\task list. Note that taskPriority parameter is option as it defaults to -1 (lowest)

Return

void

Parameters
  • SysModelTask*: newTask The new task that we are adding to the list

  • int32_t: taskPriority The selected priority of the task being added

void selfInitProcess()

This method sets the nextTaskTime = 0 and calls SelfInitTaskList() for all process tasks.

Return

void

void crossInitProcess()

This method asks all process tasks to CrossInitTaskLists.

Return

void

void resetProcess(uint64_t currentTime)

This method resets each task and associated model-set inside the process ensuring that all parameters go back to their default state.

Return

void

Parameters
  • uint64_t: currentTime Current simulation time in ns that reset is occurring at

void reInitProcess()

This method does two things: 1) resets the next task time for all process tasks to the first task time. 2) clears the process list and then adds everything back into the process with the correct priority.

Return

void

void enableProcess()
void disableProcess()
void scheduleTask(ModelScheduleEntry &taskCall)

This method is used to place the task from the caller into the correct place in the simulation schedule. The transaction for this model is that the caller will set the correct parameters in the calling argument and that the simulation will faithfully schedule it.

Return

void

Parameters
  • ModelScheduleEntry&: taskCall Pointer to a struct that contains start time and task handle.

void selectProcess()
void setProcessName(std::string newName)
std::string getProcessName()
uint64_t getNextTime()
void singleStepNextTask(uint64_t currentNanos)

This method steps the next task up to currentNanos unless it isn’t supposed to run yet.

Return

void

bool processEnabled()
void addInterfaceRef(SysInterface *newInt)
void changeTaskPeriod(std::string taskName, uint64_t newPeriod)

This method updates a specified task’s period once it locates that task in the list. It will warn the user if a task is not found.

Return

void

Parameters
  • std::string: taskName The name of the task you want to change period of

  • uint64_t: newPeriod the new number of nanoseconds you want between calls

void setPriority(int64_t newPriority)
void routeInterfaces()

This method is used to ensure that all necessary input messages are routed from their source buffer to this process’ message buffer. It needs to be executed prior to dispatching the process’ models

Return

void

void disableAllTasks()

The name kind of says it all right? It is a shotgun used to disable all of a process’ tasks. It is handy for a FSW scheme where you have tons of tasks and you are really only turning one on at a time.

Return

void

void enableAllTasks()

The name kind of says it all right? It is a shotgun used to enable all of a processes tasks. It is handy for a process that starts out almost entirely inhibited but you want to turn it all on at once.

Return

void

Public Members

std::vector<SysInterface*> intRefs

Interface references to move data to process

std::vector<ModelScheduleEntry> processTasks

Array that has pointers to all process tasks

int64_t messageBuffer

Message buffer for this process

uint64_t nextTaskTime

[ns] time for the next Task

uint64_t prevRouteTime

[ns] Time that interfaces were previously routed

std::string processName

Identifier for process

bool processActive

Flag indicating whether the Process is active

int64_t processPriority

[-] Priority level for process (higher first)

BSKLogger bskLogger

BSK Logging