diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-06-22 15:38:17 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-06-22 15:38:17 +0200 |
commit | 001c6ceb5661976eb3f0146c1b819a7f2ad8ea7d (patch) | |
tree | 06846f1268806265eaaa4d1ec97410e8c0045621 /gui/ice40/worker.h | |
parent | 9b98a7175be440a6a59ddcc022615e04b8538bda (diff) | |
parent | 56c09fc5e5f7fb5c299f7a0b52e839556146615d (diff) | |
download | nextpnr-001c6ceb5661976eb3f0146c1b819a7f2ad8ea7d.tar.gz nextpnr-001c6ceb5661976eb3f0146c1b819a7f2ad8ea7d.tar.bz2 nextpnr-001c6ceb5661976eb3f0146c1b819a7f2ad8ea7d.zip |
Merge branch 'master' of gitlab.com:SymbioticEDA/nextpnr
Diffstat (limited to 'gui/ice40/worker.h')
-rw-r--r-- | gui/ice40/worker.h | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/gui/ice40/worker.h b/gui/ice40/worker.h index 12d740dd..320dc94c 100644 --- a/gui/ice40/worker.h +++ b/gui/ice40/worker.h @@ -1,21 +1,33 @@ #ifndef WORKER_H #define WORKER_H +#include <QMutex> #include <QThread> #include "nextpnr.h" -// FIXME -USING_NEXTPNR_NAMESPACE +NEXTPNR_NAMESPACE_BEGIN + +class TaskManager; class Worker : public QObject { Q_OBJECT public: - Worker(Context *ctx); + Worker(Context *ctx, TaskManager *parent); public Q_SLOTS: - void parsejson(const std::string &filename); + void loadfile(const std::string &); + void pack(); + void place(); + void route(); Q_SIGNALS: void log(const std::string &text); + void loadfile_finished(bool status); + void pack_finished(bool status); + void place_finished(bool status); + void route_finished(bool status); + void taskCanceled(); + void taskStarted(); + void taskPaused(); private: Context *ctx; @@ -29,11 +41,37 @@ class TaskManager : public QObject public: TaskManager(Context *ctx); ~TaskManager(); + bool shouldTerminate(); + void clearTerminate(); + bool isPaused(); public Q_SLOTS: void info(const std::string &text); + void terminate_thread(); + void pause_thread(); + void continue_thread(); Q_SIGNALS: - void parsejson(const std::string &); + void terminate(); + void loadfile(const std::string &); + void pack(); + void place(); + void route(); + + // redirected signals void log(const std::string &text); + void loadfile_finished(bool status); + void pack_finished(bool status); + void place_finished(bool status); + void route_finished(bool status); + void taskCanceled(); + void taskStarted(); + void taskPaused(); + + private: + QMutex mutex; + bool toTerminate; + bool toPause; }; +NEXTPNR_NAMESPACE_END + #endif // WORKER_H |