Learn Environment
Loading...
Searching...
No Matches
task.hpp
Go to the documentation of this file.
1#ifndef TASK_HPP
2#define TASK_HPP
3
4#include <QString>
5#include <QVector>
6#include <QSharedPointer>
7#include <QWeakPointer>
8
9// Forward declaration of Task struct
10struct Task;
11
16enum class SubtaskStatus {
17 Inactive,
18 Ready,
19 Queued,
20 Running
21};
22
31struct Subtask {
32 QString title;
33 QString description;
34 QString file;
35 QString filePath;
38
39 // optional field
40 int timeoutSeconds = 60;
43
44 // internal fields
45 QWeakPointer<Task> parentTask;
47
48 bool hasBeenExecuted = false;
49 bool lastExecutionFailed = false;
51};
52
61struct Task {
62 QString title;
63 QString folder;
64 QString difficulty;
65 QString topic;
66 QVector<Subtask> subtasks;
67
68 // optional field
70
71 // internal fields
73};
74
75#endif // TASK_HPP
Represents a subtask within a task.
Definition task.hpp:31
bool hasBeenExecuted
Whether the subtask has been executed at least once.
Definition task.hpp:48
SubtaskStatus status
The status of the subtask.
Definition task.hpp:46
QString lastExecutionError
The error message from the last execution of the subtask.
Definition task.hpp:50
QWeakPointer< Task > parentTask
Weak pointer to the parent task.
Definition task.hpp:45
QString title
The title of the subtask.
Definition task.hpp:32
int timeoutSeconds
The timeout for the subtask execution in seconds.
Definition task.hpp:40
QString file
The file name of the subtask.
Definition task.hpp:34
QString description
The description of the subtask.
Definition task.hpp:33
bool lastExecutionFailed
Whether the subtask has been executed at least once.
Definition task.hpp:49
QString solutionFilePath
The file path to the solution of the subtask.
Definition task.hpp:36
QString filePath
The file path of the subtask.
Definition task.hpp:35
bool parallelizedEvaluationRequired
Whether parallelized evaluation is required.
Definition task.hpp:41
QString evaluationFilePath
The file path to the evaluation script of the subtask.
Definition task.hpp:37
bool reset_robot_before_executing
Whether to reset the robot before executing the subtask.
Definition task.hpp:42
Represents a task containing multiple subtasks.
Definition task.hpp:61
QString title
The title of the task.
Definition task.hpp:62
QString folder
The folder path of the task.
Definition task.hpp:63
QString difficultyHexColor
The hex color associated with the difficulty level.
Definition task.hpp:72
QVector< Subtask > subtasks
The list of subtasks within the task.
Definition task.hpp:66
QString topic
The topic of the task.
Definition task.hpp:65
QString difficulty
The difficulty level of the task.
Definition task.hpp:64
bool previousSubtasksRequired
Whether previous subtasks are required.
Definition task.hpp:69
SubtaskStatus
Represents the status of a subtask.
Definition task.hpp:16
@ Inactive
The subtask is inactive (state where it can't be executed).
@ Running
The subtask is currently being executed.
@ Queued
The subtask is queued for execution.
@ Ready
The subtask is ready to be executed.