aboutsummaryrefslogtreecommitdiffstats
path: root/gui/ice40/worker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gui/ice40/worker.cc')
-rw-r--r--gui/ice40/worker.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/gui/ice40/worker.cc b/gui/ice40/worker.cc
index 1558bc0c..9986ff3b 100644
--- a/gui/ice40/worker.cc
+++ b/gui/ice40/worker.cc
@@ -68,6 +68,18 @@ void Worker::loadfile(const std::string &filename)
}
}
+void Worker::loadpcf(const std::string &filename)
+{
+ Q_EMIT taskStarted();
+ std::string fn = filename;
+ std::ifstream f(fn);
+ try {
+ Q_EMIT loadpcf_finished(apply_pcf(ctx, f));
+ } catch (WorkerInterruptionRequested) {
+ Q_EMIT taskCanceled();
+ }
+}
+
void Worker::pack()
{
Q_EMIT taskStarted();
@@ -119,6 +131,7 @@ TaskManager::TaskManager(Context *ctx) : toTerminate(false), toPause(false)
connect(&workerThread, &QThread::finished, worker, &QObject::deleteLater);
connect(this, &TaskManager::loadfile, worker, &Worker::loadfile);
+ connect(this, &TaskManager::loadpcf, worker, &Worker::loadpcf);
connect(this, &TaskManager::pack, worker, &Worker::pack);
connect(this, &TaskManager::budget, worker, &Worker::budget);
connect(this, &TaskManager::place, worker, &Worker::place);
@@ -126,6 +139,7 @@ TaskManager::TaskManager(Context *ctx) : toTerminate(false), toPause(false)
connect(worker, &Worker::log, this, &TaskManager::info);
connect(worker, &Worker::loadfile_finished, this, &TaskManager::loadfile_finished);
+ connect(worker, &Worker::loadpcf_finished, this, &TaskManager::loadpcf_finished);
connect(worker, &Worker::pack_finished, this, &TaskManager::pack_finished);
connect(worker, &Worker::budget_finish, this, &TaskManager::budget_finish);
connect(worker, &Worker::place_finished, this, &TaskManager::place_finished);