2
3
4
5
6
7
8
9
10
11
12
13
14
15
17
18
19
20
21#ifndef ARCHITECTURE_TASKS_H
22#define ARCHITECTURE_TASKS_H
24#include "architecture/EventLogger.h"
25#include "architecture/Time.h"
26#include "data_management/GraphTreeObject.h"
27#include "data_management/DataIO.hpp"
28#include "core/clockwerkerrors.h"
29#include "core/macros.h"
78 Task(
Task &pnt,
const std::string &m_name=
"Unnamed");
83 Task(
Executive &executive,
const std::string &m_name=
"Unnamed");
90 Task(
Task &pnt,
int slot,
const std::string &m_name=
"Unnamed");
97 Task(
Executive &executive,
int slot,
const std::string &m_name=
"Unnamed");
171 int rangeCheck(
float min,
float max,
DataIO<
float> signal);
172 int rangeCheck(
int min,
int max,
DataIO<
int> signal);
224 Monitor(
Task &pnt,
int schedule_slot=0,
const std::string &m_name=
"Unnamed")
225 :
Task(pnt
, schedule_slot
, m_name
) {};
232 Monitor(
Executive &executive,
int schedule_slot=0,
const std::string &m_name=
"Unnamed")
233 :
Task(executive
, schedule_slot
, m_name
) {};
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
290 Event(
Task &pnt,
int schedule_slot=0,
const std::string &m_name=
"Unnamed")
291 :
Task(pnt
, schedule_slot
, m_name
) {};
298 Event(
Executive &executive,
int schedule_slot=0,
const std::string &m_name=
"Unnamed")
299 :
Task(executive
, schedule_slot
, m_name
) {};
Class for inter-object communication.
Definition DataIO.hpp:46
DataIO(GraphTreeObject *data_parent, std::string data_name, T initial_value)
Constructor for the DataIO object.
Definition DataIO.hpp:134
int operator()(const T &new_value)
Function to set the value of the DataIO object.
Definition DataIO.hpp:115
Base event class.
Definition Tasks.h:278
DataIO< bool > trigger
Our trigger – this is the flag indicating to the event that it should step.
Definition Tasks.h:311
Event()
Default constructor for the task object for simplicity. Note: Masks some functionality and should not...
Definition Tasks.h:283
Event(Task &pnt, int schedule_slot=0, const std::string &m_name="Unnamed")
Task-based constructor for the task. Auto-assigns executive.
Definition Tasks.h:290
virtual ~Event()
Desrtuctor. Doesn't really do anything.
Definition Tasks.h:302
int step()
Function to step the Event. This will be called every step, but only call execute when triggered.
Definition Tasks.cpp:169
Event(Executive &executive, int schedule_slot=0, const std::string &m_name="Unnamed")
Executive-based constructor for the task.
Definition Tasks.h:298
Central control mechanism to run simulations and software.
Definition Executive.h:43
Base class for object organization.
Definition GraphTreeObject.h:87
Base class implementation of the monitor.
Definition Tasks.h:212
virtual ~Monitor()
Desrtuctor. Doesn't really do anything.
Definition Tasks.h:236
DataIO< bool > latch
Our latch flag – If true, the monitor will continue to return triggered even after conditions change.
Definition Tasks.h:251
void reset()
Function to reset the monitor's trigger to false.
Definition Tasks.h:243
Monitor(Executive &executive, int schedule_slot=0, const std::string &m_name="Unnamed")
Executive-based constructor for the task.
Definition Tasks.h:232
Monitor(Task &pnt, int schedule_slot=0, const std::string &m_name="Unnamed")
Task-based constructor for the task. Auto-assigns executive.
Definition Tasks.h:224
int step()
Function to step the monitor. This will be called every step.
Definition Tasks.cpp:139
DataIO< bool > trigger
Our trigger – this is the flag set and unset by the monitor as its ultimate output,...
Definition Tasks.h:247
Monitor()
Default constructor for the task object for simplicity. Note: Masks some functionality and should not...
Definition Tasks.h:217
This is the base implementation of the task class.
Definition Tasks.h:68
Task(Executive &executive, const std::string &m_name="Unnamed")
Executive-based constructor for the task.
Definition Tasks.cpp:35
int rangeCheck(double min, double max, DataIO< double > signal)
Overloaded function to check range on a parameter.
Definition Tasks.cpp:113
int startup()
Function to perform startup activities (step once at start after creation). Should not be modified in...
Definition Tasks.cpp:77
Task()
Default constructor for the task object for simplicity. Note: Masks some functionality and should not...
Definition Tasks.cpp:21
log_level_e _local_log_level
Our local log level – allows a higher log level locally than the overall system.
Definition Tasks.h:175
Task(Task &pnt, const std::string &m_name="Unnamed")
Task-based constructor for the task. Auto-assigns executive.
Definition Tasks.cpp:23
Task(Task &pnt, int slot, const std::string &m_name="Unnamed")
Task-based constructor for the task. Auto-assigns executive.
Definition Tasks.cpp:47
Executive * exc
Pointer to the executive object.
Definition Tasks.h:184
DataIO< Time > entry_time
Time of entry (per wallClockTimer) of the last step of this task.
Definition Tasks.h:143
void recordTiming()
Function to command this task to record timing information.
Definition Tasks.h:130
DataIO< int > schedule_slot
The schedule slot this task will step in – set to 0 by default.
Definition Tasks.h:140
Task(Executive &executive, int slot, const std::string &m_name="Unnamed")
Executive-based constructor for the task.
Definition Tasks.cpp:62
bool _record_timing
Variable to enable or disable timing.
Definition Tasks.h:181
int _error
Simple variable to track error in task.
Definition Tasks.h:178
DataIO< bool > active
The active flag for the task – set to true by default.
Definition Tasks.h:137
virtual int start()
Function to perform task startup activities (step once after creation)
Definition Tasks.h:153
virtual ~Task()
Desrtuctor. Doesn't really do anything.
Definition Tasks.h:100
virtual int deactivate()
Function to deactivate the task.
Definition Tasks.h:127
virtual int step()
Function to step the task. This will be called every step.
Definition Tasks.cpp:89
DataIO< Time > exit_time
Time of exit (per wallClockTimer) of the last step of this task.
Definition Tasks.h:146
virtual int execute()
Function to execute the task. All math and calculations should be here.
Definition Tasks.h:160
virtual int activate()
Function to activate the task.
Definition Tasks.h:120
void logLevel(log_level_e new_level)
Function to set the local model log level.
Definition Tasks.h:134
Wrapper to manage and convert time as timespce.
Definition Time.h:45
Time()
Default, copy constructors and default destructor.
Definition Time.h:48
#define NO_ERROR
Definition clockwerkerrors.h:31