clangformat cleanup

This commit is contained in:
Miodrag Milanovic 2018-06-28 18:06:31 +02:00
parent 1676b285ae
commit 960c650478
8 changed files with 25 additions and 37 deletions

View File

@ -75,18 +75,16 @@ int main(int argc, char *argv[])
} }
if (vm.count("help") || argc == 1) { if (vm.count("help") || argc == 1) {
std::cout << boost::filesystem::basename(argv[0]) std::cout << boost::filesystem::basename(argv[0]) << " -- Next Generation Place and Route (git "
<< " -- Next Generation Place and Route (git " "sha1 " GIT_COMMIT_HASH_STR ")\n";
"sha1 " GIT_COMMIT_HASH_STR ")\n";
std::cout << "\n"; std::cout << "\n";
std::cout << options << "\n"; std::cout << options << "\n";
return argc != 1; return argc != 1;
} }
if (vm.count("version")) { if (vm.count("version")) {
std::cout << boost::filesystem::basename(argv[0]) std::cout << boost::filesystem::basename(argv[0]) << " -- Next Generation Place and Route (git "
<< " -- Next Generation Place and Route (git " "sha1 " GIT_COMMIT_HASH_STR ")\n";
"sha1 " GIT_COMMIT_HASH_STR ")\n";
return 1; return 1;
} }

View File

@ -67,8 +67,8 @@ BaseMainWindow::BaseMainWindow(QWidget *parent) : QMainWindow(parent), ctx(nullp
designview->setMinimumWidth(300); designview->setMinimumWidth(300);
designview->setMaximumWidth(300); designview->setMaximumWidth(300);
splitter_h->addWidget(designview); splitter_h->addWidget(designview);
connect(this, SIGNAL(contextChanged(Context*)), designview, SLOT(newContext(Context*))); connect(this, SIGNAL(contextChanged(Context *)), designview, SLOT(newContext(Context *)));
connect(designview, SIGNAL(info(std::string)), this, SLOT(writeInfo(std::string))); connect(designview, SIGNAL(info(std::string)), this, SLOT(writeInfo(std::string)));
@ -76,7 +76,7 @@ BaseMainWindow::BaseMainWindow(QWidget *parent) : QMainWindow(parent), ctx(nullp
#ifndef NO_PYTHON #ifndef NO_PYTHON
PythonTab *pythontab = new PythonTab(); PythonTab *pythontab = new PythonTab();
tabWidget->addTab(pythontab, "Python"); tabWidget->addTab(pythontab, "Python");
connect(this, SIGNAL(contextChanged(Context*)), pythontab, SLOT(newContext(Context*))); connect(this, SIGNAL(contextChanged(Context *)), pythontab, SLOT(newContext(Context *)));
#endif #endif
info = new InfoTab(); info = new InfoTab();
tabWidget->addTab(info, "Info"); tabWidget->addTab(info, "Info");
@ -85,7 +85,7 @@ BaseMainWindow::BaseMainWindow(QWidget *parent) : QMainWindow(parent), ctx(nullp
FPGAViewWidget *fpgaView = new FPGAViewWidget(); FPGAViewWidget *fpgaView = new FPGAViewWidget();
centralTabWidget->addTab(fpgaView, "Graphics"); centralTabWidget->addTab(fpgaView, "Graphics");
connect(this, SIGNAL(contextChanged(Context*)), fpgaView, SLOT(newContext(Context*))); connect(this, SIGNAL(contextChanged(Context *)), fpgaView, SLOT(newContext(Context *)));
splitter_v->addWidget(centralTabWidget); splitter_v->addWidget(centralTabWidget);
splitter_v->addWidget(tabWidget); splitter_v->addWidget(tabWidget);

View File

@ -135,8 +135,7 @@ void DesignWidget::newContext(Context *ctx)
bel_root->setText(0, QString("Bels")); bel_root->setText(0, QString("Bels"));
treeWidget->insertTopLevelItem(0, bel_root); treeWidget->insertTopLevelItem(0, bel_root);
QList<QTreeWidgetItem *> bel_items; QList<QTreeWidgetItem *> bel_items;
if (ctx) if (ctx) {
{
for (auto bel : ctx->getBels()) { for (auto bel : ctx->getBels()) {
auto name = ctx->getBelName(bel); auto name = ctx->getBelName(bel);
bel_items.append(new BelTreeItem(name, ElementType::BEL, QString(name.c_str(ctx)))); bel_items.append(new BelTreeItem(name, ElementType::BEL, QString(name.c_str(ctx))));
@ -149,8 +148,7 @@ void DesignWidget::newContext(Context *ctx)
QList<QTreeWidgetItem *> wire_items; QList<QTreeWidgetItem *> wire_items;
wire_root->setText(0, QString("Wires")); wire_root->setText(0, QString("Wires"));
treeWidget->insertTopLevelItem(0, wire_root); treeWidget->insertTopLevelItem(0, wire_root);
if (ctx) if (ctx) {
{
for (auto wire : ctx->getWires()) { for (auto wire : ctx->getWires()) {
auto name = ctx->getWireName(wire); auto name = ctx->getWireName(wire);
wire_items.append(new WireTreeItem(name, ElementType::WIRE, QString(name.c_str(ctx)))); wire_items.append(new WireTreeItem(name, ElementType::WIRE, QString(name.c_str(ctx))));
@ -163,8 +161,7 @@ void DesignWidget::newContext(Context *ctx)
QList<QTreeWidgetItem *> pip_items; QList<QTreeWidgetItem *> pip_items;
pip_root->setText(0, QString("Pips")); pip_root->setText(0, QString("Pips"));
treeWidget->insertTopLevelItem(0, pip_root); treeWidget->insertTopLevelItem(0, pip_root);
if (ctx) if (ctx) {
{
for (auto pip : ctx->getPips()) { for (auto pip : ctx->getPips()) {
auto name = ctx->getPipName(pip); auto name = ctx->getPipName(pip);
pip_items.append(new PipTreeItem(name, ElementType::PIP, QString(name.c_str(ctx)))); pip_items.append(new PipTreeItem(name, ElementType::PIP, QString(name.c_str(ctx))));

View File

@ -355,8 +355,7 @@ void FPGAViewWidget::paintGL()
// Draw Bels. // Draw Bels.
auto bels = LineShaderData(0.02f, QColor("#b000ba")); auto bels = LineShaderData(0.02f, QColor("#b000ba"));
if (ctx_) if (ctx_) {
{
for (auto bel : ctx_->getBels()) { for (auto bel : ctx_->getBels()) {
for (auto &el : ctx_->getBelGraphics(bel)) for (auto &el : ctx_->getBelGraphics(bel))
drawElement(bels, el); drawElement(bels, el);
@ -366,8 +365,7 @@ void FPGAViewWidget::paintGL()
// Draw Frame Graphics. // Draw Frame Graphics.
auto frames = LineShaderData(0.02f, QColor("#0066ba")); auto frames = LineShaderData(0.02f, QColor("#0066ba"));
if (ctx_) if (ctx_) {
{
for (auto &el : ctx_->getFrameGraphics()) { for (auto &el : ctx_->getFrameGraphics()) {
drawElement(frames, el); drawElement(frames, el);
} }

View File

@ -242,6 +242,7 @@ class FPGAViewWidget : public QOpenGLWidget, protected QOpenGLFunctions
void drawElement(LineShaderData &data, const GraphicElement &el); void drawElement(LineShaderData &data, const GraphicElement &el);
public Q_SLOTS: public Q_SLOTS:
void newContext(Context *ctx); void newContext(Context *ctx);
private: private:
QPoint lastPos_; QPoint lastPos_;
float moveX_; float moveX_;

View File

@ -58,8 +58,8 @@ MainWindow::MainWindow(QWidget *parent) : BaseMainWindow(parent), timing_driven(
connect(task, SIGNAL(taskStarted()), this, SLOT(taskStarted())); connect(task, SIGNAL(taskStarted()), this, SLOT(taskStarted()));
connect(task, SIGNAL(taskPaused()), this, SLOT(taskPaused())); connect(task, SIGNAL(taskPaused()), this, SLOT(taskPaused()));
connect(this, SIGNAL(contextChanged(Context*)), this, SLOT(newContext(Context*))); connect(this, SIGNAL(contextChanged(Context *)), this, SLOT(newContext(Context *)));
connect(this, SIGNAL(contextChanged(Context*)), task, SIGNAL(contextChanged(Context*))); connect(this, SIGNAL(contextChanged(Context *)), task, SIGNAL(contextChanged(Context *)));
createMenu(); createMenu();
} }
@ -184,10 +184,10 @@ void MainWindow::new_proj()
ArchArgs chipArgs; ArchArgs chipArgs;
chipArgs.type = ArchArgs::HX1K; chipArgs.type = ArchArgs::HX1K;
chipArgs.package = "tq144"; chipArgs.package = "tq144";
if (ctx) if (ctx)
delete ctx; delete ctx;
ctx = new Context(chipArgs); ctx = new Context(chipArgs);
Q_EMIT contextChanged(ctx); Q_EMIT contextChanged(ctx);
actionLoadJSON->setEnabled(true); actionLoadJSON->setEnabled(true);
@ -352,7 +352,7 @@ void MainWindow::taskStarted()
disableActions(); disableActions();
actionPause->setEnabled(true); actionPause->setEnabled(true);
actionStop->setEnabled(true); actionStop->setEnabled(true);
actionNew->setEnabled(false); actionNew->setEnabled(false);
actionOpen->setEnabled(false); actionOpen->setEnabled(false);
} }
@ -362,7 +362,7 @@ void MainWindow::taskPaused()
disableActions(); disableActions();
actionPlay->setEnabled(true); actionPlay->setEnabled(true);
actionStop->setEnabled(true); actionStop->setEnabled(true);
actionNew->setEnabled(false); actionNew->setEnabled(false);
actionOpen->setEnabled(false); actionOpen->setEnabled(false);
} }

View File

@ -56,10 +56,7 @@ Worker::Worker(TaskManager *parent) : ctx(nullptr)
}; };
} }
void Worker::newContext(Context *ctx_) void Worker::newContext(Context *ctx_) { ctx = ctx_; }
{
ctx = ctx_;
}
void Worker::loadfile(const std::string &filename) void Worker::loadfile(const std::string &filename)
{ {
@ -156,7 +153,6 @@ TaskManager::TaskManager() : toTerminate(false), toPause(false)
connect(this, &TaskManager::place, worker, &Worker::place); connect(this, &TaskManager::place, worker, &Worker::place);
connect(this, &TaskManager::route, worker, &Worker::route); connect(this, &TaskManager::route, worker, &Worker::route);
connect(this, &TaskManager::contextChanged, worker, &Worker::newContext); connect(this, &TaskManager::contextChanged, worker, &Worker::newContext);
connect(worker, &Worker::log, this, &TaskManager::info); connect(worker, &Worker::log, this, &TaskManager::info);

View File

@ -126,18 +126,16 @@ int main(int argc, char *argv[])
if (vm.count("help") || argc == 1) { if (vm.count("help") || argc == 1) {
help: help:
std::cout << boost::filesystem::basename(argv[0]) std::cout << boost::filesystem::basename(argv[0]) << " -- Next Generation Place and Route (git "
<< " -- Next Generation Place and Route (git " "sha1 " GIT_COMMIT_HASH_STR ")\n";
"sha1 " GIT_COMMIT_HASH_STR ")\n";
std::cout << "\n"; std::cout << "\n";
std::cout << options << "\n"; std::cout << options << "\n";
return argc != 1; return argc != 1;
} }
if (vm.count("version")) { if (vm.count("version")) {
std::cout << boost::filesystem::basename(argv[0]) std::cout << boost::filesystem::basename(argv[0]) << " -- Next Generation Place and Route (git "
<< " -- Next Generation Place and Route (git " "sha1 " GIT_COMMIT_HASH_STR ")\n";
"sha1 " GIT_COMMIT_HASH_STR ")\n";
return 1; return 1;
} }