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

Private GIT Repository
corrected some warnings
authorstephane Domas <stephane.domas@univ-fcomte.fr>
Tue, 23 May 2017 15:27:17 +0000 (17:27 +0200)
committerstephane Domas <stephane.domas@univ-fcomte.fr>
Tue, 23 May 2017 15:27:17 +0000 (17:27 +0200)
AbstractInterface.cpp
BoxItem.cpp
Dispatcher.cpp
FunctionalBlock.cpp
Graph.cpp
Graph.h
GroupBlock.cpp
MainWindow.cpp
blast.creator.user

index 49a937cc9b09f1424a0e15567acee9e52444a3a6..bdf342d0af7c487ee792fada86dccb33e446aec1 100644 (file)
@@ -169,7 +169,7 @@ QString AbstractInterface::getTypeString() {
 
 int AbstractInterface::typeFromString(const QString &_type) {
 
 
 int AbstractInterface::typeFromString(const QString &_type) {
 
-  int ret;
+  int ret = Expression; // default type
   if (_type == "expression") {
     ret = Expression;
   }
   if (_type == "expression") {
     ret = Expression;
   }
index c473e6f70060a91d81ad889bde201e6552c1dc29..53d56ec46f1601accdda63d3f8139e84694dd146 100644 (file)
@@ -280,6 +280,15 @@ void BoxItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
       }
       break;
     }
       }
       break;
     }
+    case Title:
+      cout << "abnormal case while resizing block" << endl;
+      break;
+    case BorderWest:
+      cout << "abnormal case while resizing block" << endl;
+      break;
+    case BorderNorth:
+      cout << "abnormal case while resizing block" << endl;
+      break;
     case NoBorder:
       cout << "abnormal case while resizing block" << endl;
       break;
     case NoBorder:
       cout << "abnormal case while resizing block" << endl;
       break;
index ee727438160c6c28a33e93798c825b19a808c673..1df7ded886818894ff2e439f91ba701ae8853515 100644 (file)
@@ -84,9 +84,7 @@ void Dispatcher::closeCurrentProject() {
 bool Dispatcher::createConnection(InterfaceItem *iface1, InterfaceItem *iface2) {
     
   ConnectedInterface* ref1 = iface1->refInter;
 bool Dispatcher::createConnection(InterfaceItem *iface1, InterfaceItem *iface2) {
     
   ConnectedInterface* ref1 = iface1->refInter;
-  ConnectedInterface* ref2 = iface2->refInter;
-  ConnectedInterface* asso1 = (ConnectedInterface*)(iface1->refInter->getAssociatedIface());
-  ConnectedInterface* asso2 = (ConnectedInterface*)(iface2->refInter->getAssociatedIface());
+  ConnectedInterface* ref2 = iface2->refInter;  
   // connect both interface
 
   bool ok1 = false;
   // connect both interface
 
   bool ok1 = false;
@@ -833,8 +831,7 @@ void Dispatcher::removeBoxItem(BoxItem *item) {
   removeAllBlockConnections(item);
 
   if (item->getRefBlock()->isFunctionalBlock()) {
   removeAllBlockConnections(item);
 
   if (item->getRefBlock()->isFunctionalBlock()) {
-    FunctionalBlock* block = AB_TO_FUN(item->getRefBlock());
-    GroupBlock* group = AB_TO_GRP(block->getParent());
+    FunctionalBlock* block = AB_TO_FUN(item->getRefBlock());    
     item->getScene()->removeBoxItem(item);
     params->getGraph()->removeFunctionalBlock(block);
   }
     item->getScene()->removeBoxItem(item);
     params->getGraph()->removeFunctionalBlock(block);
   }
index e7239e09c01e8bf999f1665e96ae78d3488ae476..534625d06bd0d65cab0e7344c0bf6a6fbb6170a5 100644 (file)
@@ -127,7 +127,6 @@ void FunctionalBlock::createPatterns() throw(Exception) {
   \r
   cout << "create patterns for block " << qPrintable(name) << endl;\r
   if (evaluator == NULL) evaluator = new ArithmeticEvaluator();\r
   \r
   cout << "create patterns for block " << qPrintable(name) << endl;\r
   if (evaluator == NULL) evaluator = new ArithmeticEvaluator();\r
-  bool ok = true;  \r
   if (! isGeneratorBlock()) {\r
     try {\r
       createDelta();\r
   if (! isGeneratorBlock()) {\r
     try {\r
       createDelta();\r
@@ -159,8 +158,7 @@ void FunctionalBlock::createDelta() throw(Exception) {
     return;\r
   }\r
   \r
     return;\r
   }\r
   \r
-  // look for parameter names\r
-  bool ok = true;\r
+  // look for parameter names  \r
   double result = 0;\r
   try {\r
     result = evaluateExpression(deltaStr);\r
   double result = 0;\r
   try {\r
     result = evaluateExpression(deltaStr);\r
@@ -178,8 +176,7 @@ void FunctionalBlock::createConsumptionPattern()  throw(Exception) {
   cout << "call to " << qPrintable(fctName) << endl;\r
 #endif\r
   \r
   cout << "call to " << qPrintable(fctName) << endl;\r
 #endif\r
   \r
-  lengthCP = -1;\r
-  bool ok = true; \r
+  lengthCP = -1;  \r
   QHash<QString,QString> consPattern = implementation->getConsumptionPattern();  \r
   \r
   foreach(AbstractInterface* iface, getControlInputs()) {       \r
   QHash<QString,QString> consPattern = implementation->getConsumptionPattern();  \r
   \r
   foreach(AbstractInterface* iface, getControlInputs()) {       \r
@@ -476,8 +473,7 @@ void FunctionalBlock::createAdmittance(int nbExec) throw(Exception) {
   static QString fctName = "FunctionalBlock::createAdmittance()";\r
 #ifdef DEBUG_FCTNAME\r
   cout << "call to " << qPrintable(fctName) << endl;\r
   static QString fctName = "FunctionalBlock::createAdmittance()";\r
 #ifdef DEBUG_FCTNAME\r
   cout << "call to " << qPrintable(fctName) << endl;\r
-#endif\r
-  bool ok = true;\r
+#endif  \r
   // firstly, copy CP in AP\r
   QMapIterator<AbstractInterface*,QList<char>* > iterC(consumptionPattern);\r
   while (iterC.hasNext()) {\r
   // firstly, copy CP in AP\r
   QMapIterator<AbstractInterface*,QList<char>* > iterC(consumptionPattern);\r
   while (iterC.hasNext()) {\r
@@ -553,8 +549,7 @@ void FunctionalBlock::checkInputPatternCompatibility() throw(Exception) {
 #ifdef DEBUG_FCTNAME\r
   cout << "call to " << qPrintable(fctName) << endl;\r
 #endif\r
 #ifdef DEBUG_FCTNAME\r
   cout << "call to " << qPrintable(fctName) << endl;\r
 #endif\r
-  \r
-  bool ok = true;\r
+    \r
   // firstly, create input pattern\r
   try {\r
     createInputPattern();\r
   // firstly, create input pattern\r
   try {\r
     createInputPattern();\r
index 0fb4fcb612933fff65265619655d45601adaacf5..4b24181bbf023f8a0a318eaaf36b3ac824bab28f 100644 (file)
--- a/Graph.cpp
+++ b/Graph.cpp
@@ -2,7 +2,6 @@
 #include "GroupBlock.h"
 #include "ReferenceBlock.h"
 #include "FunctionalBlock.h"
 #include "GroupBlock.h"
 #include "ReferenceBlock.h"
 #include "FunctionalBlock.h"
-#include "Exception.h"
 
 Graph::Graph() {
   topGroup = new GroupBlock(NULL);
 
 Graph::Graph() {
   topGroup = new GroupBlock(NULL);
@@ -25,7 +24,7 @@ GroupBlock* Graph::createChildGroupBlock(GroupBlock* parent) {
   return b;
 }
 
   return b;
 }
 
-bool Graph::removeGroupBlock(GroupBlock *group) {
+void Graph::removeGroupBlock(GroupBlock *group) {
   group->removeAllBlocks();
   GroupBlock* parent = AB_TO_GRP(group->getParent());
   parent->removeBlock(group);
   group->removeAllBlocks();
   GroupBlock* parent = AB_TO_GRP(group->getParent());
   parent->removeBlock(group);
@@ -89,8 +88,7 @@ FunctionalBlock* Graph::createSourceBlock(ReferenceBlock* ref) {
 
 FunctionalBlock* Graph::duplicateSourceBlock(FunctionalBlock *block) {
 
 
 FunctionalBlock* Graph::duplicateSourceBlock(FunctionalBlock *block) {
 
-  ReferenceBlock* ref = block->getReference();
-  GroupBlock* group = AB_TO_GRP(block->getParent());
+  ReferenceBlock* ref = block->getReference();  
 
   // adding to the graph
   FunctionalBlock* newBlock = createSourceBlock(ref);
 
   // adding to the graph
   FunctionalBlock* newBlock = createSourceBlock(ref);
@@ -110,7 +108,7 @@ bool Graph::removeSourceBlock(FunctionalBlock *block) {
 }
 
 void Graph::createPatterns() throw(Exception) {
 }
 
 void Graph::createPatterns() throw(Exception) {
-  bool ok = true;
+  
   foreach(AbstractBlock* block, sources) {
     FunctionalBlock* funBlock = AB_TO_FUN(block);
     try {
   foreach(AbstractBlock* block, sources) {
     FunctionalBlock* funBlock = AB_TO_FUN(block);
     try {
@@ -150,14 +148,13 @@ void Graph::resetPatternComputed() {
   }
 }
 
   }
 }
 
-bool Graph::computeOutputPatterns(int nbExec) {
+void Graph::computeOutputPatterns(int nbExec) throw(Exception) {
   
   try {
     createPatterns();
   }
   catch(Exception e) {
   
   try {
     createPatterns();
   }
   catch(Exception e) {
-    cerr << qPrintable(e.getMessage()) << endl;
-    return false;
+    throw(e);    
   }
 
   resetPatternComputed();  
   }
 
   resetPatternComputed();  
@@ -189,7 +186,6 @@ bool Graph::computeOutputPatterns(int nbExec) {
     topGroup->computeOutputPattern();
   }
   catch(Exception e) {
     topGroup->computeOutputPattern();
   }
   catch(Exception e) {
-    cerr << qPrintable(e.getMessage()) << endl;
-    return false;
+    throw(e);
   }
 }
   }
 }
diff --git a/Graph.h b/Graph.h
index 03d188265d04efd771bcb56f2479a72bc8e3e8a6..b9c598ae3c294d0dbe613552f5b69facb863184d 100644 (file)
--- a/Graph.h
+++ b/Graph.h
@@ -10,6 +10,7 @@ class GroupBlock;
 class ReferenceBlock;
 class FunctionalBlock;
 class AbstractInterface;
 class ReferenceBlock;
 class FunctionalBlock;
 class AbstractInterface;
+#include "Exception.h"
 class Exception;
 using namespace std;
 using namespace Qt;
 class Exception;
 using namespace std;
 using namespace Qt;
@@ -27,7 +28,7 @@ public:
   
   // methods for group blocks
   GroupBlock* createChildGroupBlock(GroupBlock* parent);
   
   // methods for group blocks
   GroupBlock* createChildGroupBlock(GroupBlock* parent);
-  bool removeGroupBlock(GroupBlock *group);
+  void removeGroupBlock(GroupBlock *group);
   GroupBlock* getGroupBlockByName(QString name);
   
   // methods for functional blocks
   GroupBlock* getGroupBlockByName(QString name);
   
   // methods for functional blocks
@@ -52,7 +53,7 @@ public:
    */
   void createPatterns() throw(Exception);
   void resetPatternComputed();
    */
   void createPatterns() throw(Exception);
   void resetPatternComputed();
-  bool computeOutputPatterns(int nbExec);
+  void computeOutputPatterns(int nbExec) throw(Exception);
   
   
 private:  
   
   
 private:  
index b6fc702d0f317701290434843331da6545b1eb22..62fd6ec8c813599c568d8c928b901f7ffc6e5aba 100644 (file)
@@ -125,8 +125,7 @@ void GroupBlock::computeOutputPattern(int nbExec) throw(Exception) {
 
   cout << "computing output pattern of group " << qPrintable(name) << endl;
   
 
   cout << "computing output pattern of group " << qPrintable(name) << endl;
   
-  bool canCompute = false;
-  bool compatible = false;
+  bool canCompute = false;  
   // get the input pattern on each inputs
   createInputPattern();
   
   // get the input pattern on each inputs
   createInputPattern();
   
@@ -170,8 +169,7 @@ void GroupBlock::computeOutputPattern(int nbExec) throw(Exception) {
     catch(Exception e) {
       cout << qPrintable(block->getName()) << " is not compatible with his input pattern" << endl;
       throw(e);
     catch(Exception e) {
       cout << qPrintable(block->getName()) << " is not compatible with his input pattern" << endl;
       throw(e);
-    }
-    compatible = true;
+    }    
     
     try {
       block->computeOutputPattern();
     
     try {
       block->computeOutputPattern();
index 877e9ac1a10f390ce21d3025f98b7276de5aa944..e7724255ddb2be2854b9a063a2e3df2dd385b736 100644 (file)
@@ -280,7 +280,7 @@ void MainWindow::slotLoadProject(){
       msgBox.setStandardButtons(QMessageBox::Cancel);
       msgBox.setDefaultButton(QMessageBox::Cancel);
 
       msgBox.setStandardButtons(QMessageBox::Cancel);
       msgBox.setDefaultButton(QMessageBox::Cancel);
 
-      int ret = msgBox.exec();
+      msgBox.exec();
     }
   }
 }
     }
   }
 }
@@ -373,8 +373,12 @@ void MainWindow::slotOpenBlockLibrary() {
 
 
 void MainWindow::slotGraphValidation() {
 
 
 void MainWindow::slotGraphValidation() {
-  params->getGraph()->computeOutputPatterns(5);
-  //params->parametersValidation();
+  try {
+    params->getGraph()->computeOutputPatterns(5); 
+  }
+  catch(Exception e) {
+    cerr << qPrintable(e.getMessage()) << endl;    
+  }
 }
 
 void MainWindow::addTopGroup(GroupWidget *_topGroup) {
 }
 
 void MainWindow::addTopGroup(GroupWidget *_topGroup) {
index aea89f7f4be503ca892602614ce0102ab757f8f6..0f7c2537e670768969cdf156b48d1ce665c0039b 100755 (executable)
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE QtCreatorProject>
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 3.2.1, 2017-05-22T16:26:54. -->
+<!-- Written by QtCreator 3.2.1, 2017-05-23T17:26:50. -->
 <qtcreator>
  <data>
   <variable>EnvironmentId</variable>
 <qtcreator>
  <data>
   <variable>EnvironmentId</variable>
-  <value type="QByteArray">{eddbf04f-e5ee-4f36-bc65-6ab7f2b6d4ec}</value>
+  <value type="QByteArray">{3701e197-5b6c-48ea-9e98-a6cf6de18672}</value>
  </data>
  <data>
   <variable>ProjectExplorer.Project.ActiveTarget</variable>
  </data>
  <data>
   <variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -60,7 +60,7 @@
   <valuemap type="QVariantMap">
    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
   <valuemap type="QVariantMap">
    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{72d0832a-d73b-473a-b29c-d1c0737451fe}</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{ed04208c-8774-456b-99b9-4a02094ca7a4}</value>
    <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
    <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
    <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
    <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
    <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
    <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>