]> AND Private Git Repository - blast.git/blobdiff - MainWindow.cpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
added clk/rst link when creating a block
[blast.git] / MainWindow.cpp
index 683ba3d03c2e4d0154eb489634d9aee4ed084451..c7ff634194becd6261e230c5d2c859a47adc18eb 100644 (file)
@@ -24,6 +24,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
   try {    
     params->loadBlastConfiguration("blastconfig.xml");
 
+    // first load external sources
+    params->loadSources();
+
     if (!QFileInfo::exists(params->refLib)) {
       params->loadReferencesFromXml();
       int ret = QMessageBox::question(this,tr("Building references library"),tr("The reference block library does not exists.\n References have been read directly from the xml descriptions of blocks.\n It can be saved into a library in order to start application faster. "), QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Ok);
@@ -316,10 +319,10 @@ void MainWindow::slotLoadProject(){
     GroupWidget* topGroup = dispatcher->loadProject(params->projectFile);
     if (topGroup != NULL) {
       addTopGroup(topGroup);
-      library->updateComboScene();
+      library->updateComboScene();      
       params->isCurrentProject = true;
       enableProjectActions(true, PROJECT_CLOSE | PROJECT_SAVE | PROJECT_SAVEAS | PROJECT_LIB, OP_RAZ);
-      enableAnalysisActions(true, ANALYSIS_ANALYZE, OP_RAZ);
+      enableAnalysisActions(true, ANALYSIS_ANALYZE | ANALYSIS_GENERATE, OP_RAZ);
     }
     else {
       QMessageBox msgBox;
@@ -341,9 +344,9 @@ 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->updateComboScene();    
     library->show();
     params->isCurrentProject = true;
   }
@@ -440,15 +443,16 @@ 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);
       }
     }
   }
 }
 
 void MainWindow::slotGenerateVHDL() {
+
   try {
-    params->getGraph()->generateVHDL(params->projectPath);
+    dispatcher->generateVHDL(Dispatcher::Design);
   }
   catch(Exception e) {
     cerr << qPrintable(e.getMessage()) << endl;
@@ -482,7 +486,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);
 }