fixed namespace for gui section
This commit is contained in:
parent
0448bed859
commit
7f36828270
@ -10,10 +10,14 @@
|
||||
#include "mainwindow.h"
|
||||
#include "pythontab.h"
|
||||
|
||||
static void initBasenameResource() { Q_INIT_RESOURCE(base); }
|
||||
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
|
||||
BaseMainWindow::BaseMainWindow(Context *_ctx, QWidget *parent)
|
||||
: QMainWindow(parent), ctx(_ctx)
|
||||
{
|
||||
Q_INIT_RESOURCE(base);
|
||||
initBasenameResource();
|
||||
qRegisterMetaType<std::string>();
|
||||
|
||||
log_files.clear();
|
||||
@ -114,3 +118,5 @@ void BaseMainWindow::createMenusAndBars()
|
||||
mainToolBar->addAction(actionOpen);
|
||||
mainToolBar->addAction(actionSave);
|
||||
}
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
@ -11,11 +11,10 @@
|
||||
#include <QTabWidget>
|
||||
#include <QToolBar>
|
||||
|
||||
// FIXME
|
||||
USING_NEXTPNR_NAMESPACE
|
||||
|
||||
Q_DECLARE_METATYPE(std::string)
|
||||
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
|
||||
class BaseMainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -45,4 +44,6 @@ class BaseMainWindow : public QMainWindow
|
||||
QStatusBar *statusBar;
|
||||
};
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
||||
#endif // BASEMAINWINDOW_H
|
||||
|
@ -7,6 +7,8 @@
|
||||
#include "fpgaviewwidget.h"
|
||||
#include "pybindings.h"
|
||||
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
|
||||
enum class ElementType
|
||||
{
|
||||
BEL,
|
||||
@ -234,3 +236,5 @@ void DesignWidget::selectObject()
|
||||
{
|
||||
Q_EMIT info("selected " + itemContextMenu->text(0).toStdString() + "\n");
|
||||
}
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
@ -7,8 +7,7 @@
|
||||
#include "qttreepropertybrowser.h"
|
||||
#include "qtvariantproperty.h"
|
||||
|
||||
// FIXME
|
||||
USING_NEXTPNR_NAMESPACE
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
|
||||
class DesignWidget : public QWidget
|
||||
{
|
||||
@ -45,4 +44,6 @@ class DesignWidget : public QWidget
|
||||
QMap<QString, QtVariantProperty *> idToProperty;
|
||||
};
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
||||
#endif // DESIGNWIDGET_H
|
||||
|
@ -1,8 +1,14 @@
|
||||
#include "mainwindow.h"
|
||||
|
||||
static void initMainResource() { Q_INIT_RESOURCE(nextpnr); }
|
||||
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
|
||||
MainWindow::MainWindow(Context *_ctx, QWidget *parent)
|
||||
: BaseMainWindow(_ctx, parent)
|
||||
{
|
||||
initMainResource();
|
||||
|
||||
std::string title = "nextpnr-dummy - " + ctx->getChipName();
|
||||
setWindowTitle(title.c_str());
|
||||
|
||||
@ -19,4 +25,6 @@ void MainWindow::createMenu()
|
||||
|
||||
void MainWindow::open() {}
|
||||
|
||||
bool MainWindow::save() { return false; }
|
||||
bool MainWindow::save() { return false; }
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
@ -3,8 +3,7 @@
|
||||
|
||||
#include "../basewindow.h"
|
||||
|
||||
// FIXME
|
||||
USING_NEXTPNR_NAMESPACE
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
|
||||
class MainWindow : public BaseMainWindow
|
||||
{
|
||||
@ -22,4 +21,6 @@ class MainWindow : public BaseMainWindow
|
||||
virtual bool save();
|
||||
};
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
@ -6,6 +6,8 @@
|
||||
#include <math.h>
|
||||
#include "mainwindow.h"
|
||||
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
|
||||
FPGAViewWidget::FPGAViewWidget(QWidget *parent)
|
||||
: QOpenGLWidget(parent), m_xMove(0), m_yMove(0), m_zDistance(1.0)
|
||||
{
|
||||
@ -173,3 +175,5 @@ void FPGAViewWidget::wheelEvent(QWheelEvent *event)
|
||||
setZoom(step.y() * -0.1f);
|
||||
}
|
||||
}
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
@ -7,8 +7,7 @@
|
||||
#include <QPainter>
|
||||
#include "nextpnr.h"
|
||||
|
||||
// FIXME
|
||||
USING_NEXTPNR_NAMESPACE
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
|
||||
class FPGAViewWidget : public QOpenGLWidget, protected QOpenGLFunctions
|
||||
{
|
||||
@ -49,4 +48,6 @@ class FPGAViewWidget : public QOpenGLWidget, protected QOpenGLFunctions
|
||||
Context *ctx;
|
||||
};
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
@ -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; }
|
||||
|
||||
bool MainWindow::save() { return false; }
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
@ -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
|
||||
|
@ -1,6 +1,8 @@
|
||||
#include "infotab.h"
|
||||
#include <QGridLayout>
|
||||
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
|
||||
InfoTab::InfoTab(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
plainTextEdit = new QPlainTextEdit();
|
||||
@ -37,3 +39,5 @@ void InfoTab::showContextMenu(const QPoint &pt)
|
||||
}
|
||||
|
||||
void InfoTab::clearBuffer() { plainTextEdit->clear(); }
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
@ -5,8 +5,7 @@
|
||||
#include <QPlainTextEdit>
|
||||
#include "nextpnr.h"
|
||||
|
||||
// FIXME
|
||||
USING_NEXTPNR_NAMESPACE
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
|
||||
class InfoTab : public QWidget
|
||||
{
|
||||
@ -24,4 +23,6 @@ class InfoTab : public QWidget
|
||||
QMenu *contextMenu;
|
||||
};
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
||||
#endif // INFOTAB_H
|
||||
|
@ -1,7 +1,8 @@
|
||||
#include "line_editor.h"
|
||||
|
||||
#include <QKeyEvent>
|
||||
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
|
||||
LineEditor::LineEditor(QWidget *parent) : QLineEdit(parent), index(0)
|
||||
{
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
@ -64,4 +65,6 @@ void LineEditor::clearHistory()
|
||||
lines.clear();
|
||||
index = 0;
|
||||
clear();
|
||||
}
|
||||
}
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
@ -3,6 +3,9 @@
|
||||
|
||||
#include <QLineEdit>
|
||||
#include <QMenu>
|
||||
#include "nextpnr.h"
|
||||
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
|
||||
class LineEditor : public QLineEdit
|
||||
{
|
||||
@ -28,4 +31,6 @@ class LineEditor : public QLineEdit
|
||||
QMenu *contextMenu;
|
||||
};
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
||||
#endif // LINE_EDITOR_H
|
||||
|
@ -3,6 +3,8 @@
|
||||
#include "emb.h"
|
||||
#include "pybindings.h"
|
||||
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
|
||||
PythonTab::PythonTab(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
PyImport_ImportModule("emb");
|
||||
@ -114,4 +116,6 @@ void PythonTab::showContextMenu(const QPoint &pt)
|
||||
contextMenu->exec(mapToGlobal(pt));
|
||||
}
|
||||
|
||||
void PythonTab::clearBuffer() { plainTextEdit->clear(); }
|
||||
void PythonTab::clearBuffer() { plainTextEdit->clear(); }
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
@ -8,8 +8,7 @@
|
||||
#include "line_editor.h"
|
||||
#include "nextpnr.h"
|
||||
|
||||
// FIXME
|
||||
USING_NEXTPNR_NAMESPACE
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
|
||||
class PythonTab : public QWidget
|
||||
{
|
||||
@ -33,4 +32,6 @@ class PythonTab : public QWidget
|
||||
emb::stdout_write_type write;
|
||||
};
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
||||
#endif // PYTHONTAB_H
|
||||
|
@ -38,6 +38,8 @@
|
||||
#include "timing.h"
|
||||
#include "version.h"
|
||||
|
||||
USING_NEXTPNR_NAMESPACE
|
||||
|
||||
void svg_dump_el(const GraphicElement &el)
|
||||
{
|
||||
float scale = 10.0, offset = 10.0;
|
||||
|
Loading…
Reference in New Issue
Block a user