diff options
author | Sergiusz Bazanski <q3k@q3k.org> | 2018-06-22 14:29:28 +0100 |
---|---|---|
committer | Sergiusz Bazanski <q3k@q3k.org> | 2018-06-22 14:29:28 +0100 |
commit | 858acc5c1c0ee4bbdfb8d2012b80cda656ca39db (patch) | |
tree | 7cc94b94e40c05c5a7baae61c9d0db4f23a31b60 /gui/ice40/worker.h | |
parent | 98b1f0c041b01d07f64e8e04503f8eccb05a93de (diff) | |
parent | f86a0d6c8c8792c36c87cf345665ce7c9fbcc60f (diff) | |
download | nextpnr-858acc5c1c0ee4bbdfb8d2012b80cda656ca39db.tar.gz nextpnr-858acc5c1c0ee4bbdfb8d2012b80cda656ca39db.tar.bz2 nextpnr-858acc5c1c0ee4bbdfb8d2012b80cda656ca39db.zip |
Merge branch 'master' of gitlab.com:SymbioticEDA/nextpnr into q3k/gl
Diffstat (limited to 'gui/ice40/worker.h')
-rw-r--r-- | gui/ice40/worker.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/gui/ice40/worker.h b/gui/ice40/worker.h new file mode 100644 index 00000000..181fafa3 --- /dev/null +++ b/gui/ice40/worker.h @@ -0,0 +1,55 @@ +#ifndef WORKER_H +#define WORKER_H + +#include <QMutex> +#include <QThread> +#include "nextpnr.h" + +NEXTPNR_NAMESPACE_BEGIN + +class TaskManager; + +class Worker : public QObject +{ + Q_OBJECT + public: + Worker(Context *ctx, TaskManager *parent); + public Q_SLOTS: + void parsejson(const std::string &filename); + Q_SIGNALS: + void log(const std::string &text); + + private: + Context *ctx; +}; + +class TaskManager : public QObject +{ + Q_OBJECT + QThread workerThread; + + 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 terminate(); + void parsejson(const std::string &); + void log(const std::string &text); + + private: + QMutex mutex; + bool toTerminate; + bool toPause; +}; + +NEXTPNR_NAMESPACE_END + +#endif // WORKER_H |