diff options
author | David Shah <davey1576@gmail.com> | 2018-06-22 13:22:19 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-06-22 13:22:19 +0200 |
commit | ab88bfdae137f38df0cc575405a05112b2ce4be1 (patch) | |
tree | 53171f08c9a45d3fa1ad3eec15fc37c05797bb1f /gui/ice40 | |
parent | 6633441e32c99d09133e4a62c122a377a4af4ad1 (diff) | |
parent | 7f368282700172925428e45f23b8b61e0bf39f94 (diff) | |
download | nextpnr-ab88bfdae137f38df0cc575405a05112b2ce4be1.tar.gz nextpnr-ab88bfdae137f38df0cc575405a05112b2ce4be1.tar.bz2 nextpnr-ab88bfdae137f38df0cc575405a05112b2ce4be1.zip |
Merge branch 'master' of gitlab.com:SymbioticEDA/nextpnr
Diffstat (limited to 'gui/ice40')
-rw-r--r-- | gui/ice40/mainwindow.cc | 22 | ||||
-rw-r--r-- | gui/ice40/mainwindow.h | 5 | ||||
-rw-r--r-- | gui/ice40/worker.cc | 10 | ||||
-rw-r--r-- | gui/ice40/worker.h | 5 |
4 files changed, 26 insertions, 16 deletions
diff --git a/gui/ice40/mainwindow.cc b/gui/ice40/mainwindow.cc index 9ce7f41e..4c7bc18f 100644 --- a/gui/ice40/mainwindow.cc +++ b/gui/ice40/mainwindow.cc @@ -11,11 +11,15 @@ #include "place_sa.h"
#include "route.h"
+static void initMainResource() { Q_INIT_RESOURCE(nextpnr); }
+
+NEXTPNR_NAMESPACE_BEGIN
+
MainWindow::MainWindow(Context *_ctx, QWidget *parent)
: BaseMainWindow(_ctx, parent)
{
- Q_INIT_RESOURCE(nextpnr);
-
+ initMainResource();
+
std::string title = "nextpnr-ice40 - " + ctx->getChipName();
setWindowTitle(title.c_str());
@@ -37,24 +41,21 @@ void MainWindow::createMenu() icon1.addFile(QStringLiteral(":/icons/resources/control_play.png"));
actionPlay->setIcon(icon1);
actionPlay->setStatusTip("Continue running task");
- connect(actionPlay, SIGNAL(triggered()), task,
- SLOT(continue_thread()));
+ connect(actionPlay, SIGNAL(triggered()), task, SLOT(continue_thread()));
QAction *actionPause = new QAction("Pause", this);
QIcon icon2;
icon2.addFile(QStringLiteral(":/icons/resources/control_pause.png"));
actionPause->setIcon(icon2);
actionPause->setStatusTip("Pause running task");
- connect(actionPause, SIGNAL(triggered()), task,
- SLOT(pause_thread()));
+ connect(actionPause, SIGNAL(triggered()), task, SLOT(pause_thread()));
QAction *actionStop = new QAction("Stop", this);
QIcon icon3;
icon3.addFile(QStringLiteral(":/icons/resources/control_stop.png"));
actionStop->setIcon(icon3);
actionStop->setStatusTip("Stop running task");
- connect(actionStop, SIGNAL(triggered()), task,
- SLOT(terminate_thread()));
+ connect(actionStop, SIGNAL(triggered()), task, SLOT(terminate_thread()));
QToolBar *taskToolBar = new QToolBar();
addToolBar(Qt::TopToolBarArea, taskToolBar);
@@ -75,4 +76,7 @@ void MainWindow::open() Q_EMIT task->parsejson(fn);
}
}
-bool MainWindow::save() { return false; }
\ No newline at end of file +
+bool MainWindow::save() { return false; }
+
+NEXTPNR_NAMESPACE_END
\ No newline at end of file diff --git a/gui/ice40/mainwindow.h b/gui/ice40/mainwindow.h index fd65f9ae..712f341a 100644 --- a/gui/ice40/mainwindow.h +++ b/gui/ice40/mainwindow.h @@ -4,8 +4,7 @@ #include "../basewindow.h"
#include "worker.h"
-// FIXME
-USING_NEXTPNR_NAMESPACE
+NEXTPNR_NAMESPACE_BEGIN
class MainWindow : public BaseMainWindow
{
@@ -26,4 +25,6 @@ class MainWindow : public BaseMainWindow TaskManager *task;
};
+NEXTPNR_NAMESPACE_END
+
#endif // MAINWINDOW_H
diff --git a/gui/ice40/worker.cc b/gui/ice40/worker.cc index 3854c67f..9549f659 100644 --- a/gui/ice40/worker.cc +++ b/gui/ice40/worker.cc @@ -10,6 +10,8 @@ #include "route.h" #include "timing.h" +NEXTPNR_NAMESPACE_BEGIN + struct WorkerInterruptionRequested { }; @@ -22,7 +24,7 @@ Worker::Worker(Context *_ctx, TaskManager *parent) : ctx(_ctx) parent->clearTerminate(); throw WorkerInterruptionRequested(); } - while (parent->isPaused()){ + while (parent->isPaused()) { QThread::sleep(1); } }; @@ -64,7 +66,7 @@ TaskManager::TaskManager(Context *ctx) : toTerminate(false), toPause(false) TaskManager::~TaskManager() { - if (workerThread.isRunning()) + if (workerThread.isRunning()) terminate_thread(); workerThread.quit(); workerThread.wait(); @@ -105,4 +107,6 @@ bool TaskManager::isPaused() { QMutexLocker locker(&mutex); return toPause; -}
\ No newline at end of file +} + +NEXTPNR_NAMESPACE_END diff --git a/gui/ice40/worker.h b/gui/ice40/worker.h index 49d1df4d..181fafa3 100644 --- a/gui/ice40/worker.h +++ b/gui/ice40/worker.h @@ -5,8 +5,7 @@ #include <QThread> #include "nextpnr.h" -// FIXME -USING_NEXTPNR_NAMESPACE +NEXTPNR_NAMESPACE_BEGIN class TaskManager; @@ -51,4 +50,6 @@ class TaskManager : public QObject bool toPause; }; +NEXTPNR_NAMESPACE_END + #endif // WORKER_H |