Learn Environment
Loading...
Searching...
No Matches
task_executor.hpp
Go to the documentation of this file.
1#ifndef TASK_EXECUTOR_HPP
2#define TASK_EXECUTOR_HPP
3
4#include "task.hpp"
5
6#include <QObject>
7#include <QString>
8#include <QSharedPointer>
9
10class ScriptWorker;
11
19class TaskExecutor : public QObject {
20 Q_OBJECT
21
22public:
27 explicit TaskExecutor(QObject *parent = nullptr);
28
33 void executeTask(const Subtask &subtask, bool startSolution = false);
34
38 void forceStop();
39
43 void resetRobot();
44
45Q_SIGNALS:
50
55
60 void taskExecutionFailed(const QString &error);
61
66
71
76 void resetRobotFailed(const QString &error);
77
78private:
88 bool constructPath(const QString &basePath, const QString &addition, QString &result, const QString &errorMsg, bool checkExists = true);
89
90 QList<ScriptWorker*> scriptWorkers;
91};
92
93#endif // TASK_EXECUTOR_HPP
Manages the execution of scripts for tasks.
Definition script_worker.hpp:21
Executes tasks and manages their execution state.
Definition task_executor.hpp:19
void forceStop()
Forces the stop of all currently running tasks.
Definition task_executor.cpp:62
void taskExecutionStarted()
Signal emitted when task execution starts.
void resetRobotFailed(const QString &error)
Signal emitted when robot reset fails.
void resetRobotFinished()
Signal emitted when robot reset finishes.
void resetRobotStarted()
Signal emitted when robot reset starts.
TaskExecutor(QObject *parent=nullptr)
Constructs a TaskExecutor object.
Definition task_executor.cpp:8
void executeTask(const Subtask &subtask, bool startSolution=false)
Executes a given subtask.
Definition task_executor.cpp:10
void resetRobot()
Triggers python script to reset the robot to its initial state and removes all objects from the scene...
Definition task_executor.cpp:68
void taskExecutionFinished()
Signal emitted when task execution finishes.
void taskExecutionFailed(const QString &error)
Signal emitted when task execution fails.
Represents a subtask within a task.
Definition task.hpp:31