X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/015e6979cd7d336f6bbebfbdb7916af3ba23c096..60c13e8b4c7ea3d595969c1e7c0a28b068a17ca6:/MainWindow.cpp?ds=sidebyside diff --git a/MainWindow.cpp b/MainWindow.cpp index 212e54d..8169dd0 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -320,6 +320,7 @@ void MainWindow::slotLoadProject(){ if (topGroup != NULL) { addTopGroup(topGroup); library->updateComboScene(); + library->updateBoxConn(); params->isCurrentProject = true; enableProjectActions(true, PROJECT_CLOSE | PROJECT_SAVE | PROJECT_SAVEAS | PROJECT_LIB, OP_RAZ); enableAnalysisActions(true, ANALYSIS_ANALYZE | ANALYSIS_GENERATE, OP_RAZ); @@ -344,9 +345,10 @@ void MainWindow::slotNewProject(){ if (ret == 1) { enableProjectActions(true, PROJECT_CLOSE | PROJECT_SAVE | PROJECT_SAVEAS | PROJECT_LIB, OP_RAZ); enableAnalysisActions(true, ANALYSIS_ANALYZE | ANALYSIS_GENERATE, OP_RAZ); - GroupWidget* topGroup = dispatcher->createTopScene(); + GroupWidget* topGroup = dispatcher->createTopScene(Dispatcher::Design); addTopGroup(topGroup); library->updateComboScene(); + library->updateBoxConn(); library->show(); params->isCurrentProject = true; } @@ -443,7 +445,7 @@ void MainWindow::slotGraphAnalysis() { msg += " is not compatible with its input pattern.\nDo you want to launch automatic modification process to ensure the compatibility ?"; int ret = QMessageBox::question(this,tr("Building references library"),msg, QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Ok); if (ret == QMessageBox::Ok) { - dispatcher->findGraphModifications(toBlock); + dispatcher->findGraphModifications(Dispatcher::Design, toBlock); } } } @@ -451,28 +453,8 @@ void MainWindow::slotGraphAnalysis() { void MainWindow::slotGenerateVHDL() { - QDir baseDir(params->projectPath); - if (!baseDir.exists()) { - cerr << "Project path " << qPrintable(params->projectPath) << " no longer exists. First, recreate it and put the project file within. Then retry to generate." << endl; - return; - } - if (! baseDir.exists("src")) { - baseDir.mkdir("src"); - } - if (! baseDir.exists("testbench")) { - baseDir.mkdir("testbench"); - } - if (! baseDir.exists("Makefile")) { - QFile make("/home/sdomas/Projet/Blast/code/blast/Makefile-isim"); - QString dest = params->projectPath; - dest += "/Makefile"; - make.copy(dest); - } - - QString dest = params->projectPath; - dest += "/src/"; try { - params->getGraph()->generateVHDL(dest); + dispatcher->generateVHDL(Dispatcher::Design); } catch(Exception e) { cerr << qPrintable(e.getMessage()) << endl; @@ -506,7 +488,7 @@ void MainWindow::closeEvent(QCloseEvent *event) { void MainWindow::mousePressEvent(QMouseEvent *e) { if (dispatcher->getCurrentGroup() != NULL) { - dispatcher->setCurrentGroupWidget(dispatcher->getCurrentGroup()); + dispatcher->setCurrentGroupWidget(Dispatcher::Design, dispatcher->getCurrentGroup()); } QMainWindow::mousePressEvent(e); }