X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/d30c9cf675ad7141d1c8e31d2e72315267d45cf2..3bcfe4df6fdde086eb1b59f7a0173358170174a1:/Parameters.h

diff --git a/Parameters.h b/Parameters.h
index 69887a9..a541ee6 100644
--- a/Parameters.h
+++ b/Parameters.h
@@ -16,12 +16,15 @@ class ReferenceBlock;
 class GroupBlock;
 class FunctionalBlock;
 class GroupScene;
+class AbstractBoxItem;
 class GroupItem;
 class BoxItem;
 class InterfaceItem;
 class Graph;
+class GroupWidget;
 
 #include "BlockImplementation.h"
+#include "ExternalResource.h"
 
 #include "Exception.h"
 class Exception;
@@ -35,6 +38,13 @@ class Exception;
 using namespace std;
 using namespace Qt;
 
+/*!
+ * \brief The Parameters class
+ *
+ * Parameters class represents the Model part of blast in MVC paradigm.
+ * It contains all data necessary to create a design: the graph of blocks,
+ * the scenes, ...
+ */
 class Parameters {
 
 public :
@@ -69,15 +79,25 @@ public :
   inline void setCursorState(CursorState state) { cursorState = state; }
   inline void setDispatcher(Dispatcher* _dispatcher) { dispatcher = _dispatcher;}
 
+  // testers
+
+  // others
+  static QString normalizeName(const QString& name);
+  QList<ExternalResource*> searchResourceByName(const QString& name);
+
   /***************************************************
     attributes that are general to the application
   ***************************************************/  
   BlockLibraryTree* categoryTree;
   QList<QString> refPathes;
   QList<QString> implPathes;
+  QList<QString> sourcePathes;
   QList<ReferenceBlock*> availableBlocks;
   QList<BlockImplementation*> availableImplementations;
+  QList<ExternalResource*> availableResources;
 
+  ReferenceBlock* delayRef;
+  BlockImplementation* delayImpl;  
 
   QString refLib;
   QString implLib;
@@ -85,6 +105,8 @@ public :
   // defaults for vhdl
   int wbDataWidth;
   int wbAddressWidth;
+  QString validityExtension; //! the string to add to ports to obtain the name of the associated validity port.
+  
   // defaults for scene elements
   int defaultBlockWidth;
   int defaultBlockHeight;
@@ -98,8 +120,10 @@ public :
   QString defaultIfaceFontName;
   int defaultIfaceFontSize;
   int connGapLength;
-  QPainterPath inArrow;
-  QPainterPath outArrow;
+  QPainterPath dataArrowIn;
+  QPainterPath dataArrowOut;
+  QPainterPath clkrstArrow;
+
 
   /***************************************************
    attributes that are specific for the current project
@@ -110,29 +134,38 @@ public :
   EditState editState; // takes values from EDIT_STATE_XXX
   bool unsaveModif;
   bool isRstClkShown;
+  QMap<FunctionalBlock*, BoxItem*> blockToItem; // allow to retrieve a box item from a functionnal block
+  QString projectPath;
+  QString projectName;
+  QString projectFile; // equals to projectPath/projectName.xml
+  bool autoConnMainClk; // true if auto-connection to main clock (i.e. ext_clk)
+  QList<double> clocks; // clocks[0] is the main clock.
 
-  Graph* createGraph();
+  Graph* createGraph(bool createTopGroupIfaces = true);
   void destroyGraph();
-  inline Graph* getGraph() { return graph; }
-  GroupBlock* addGroupBlock(); // adding an empty GroupBlock to the current group
-  FunctionalBlock* addFunctionalBlock(int idCategory, int idBlock); // adding a functional block to current group
+  inline Graph* getGraph() { return graph; }  
+  ReferenceBlock* getReferenceBlock(int idCategory, int idBlock); // get the reference block from its category and index
+  ReferenceBlock* getHiddenReferenceBlock(QString blockName); // get a hidden block by name, i.e. in category 100
   FunctionalBlock* duplicateFunctionalBlock(FunctionalBlock* block); // adding a copy of a functional block to current group
 
 
   void clear();
 
   QDomElement openProjectFile(const QString& projectFileName) throw(Exception);
-  void loadProject(QDomElement root);
+  GroupWidget *loadProject(QDomElement root) throw(Exception);
 
   void loadBlastConfiguration(QString confFile) throw(Exception);
   void loadReferencesFromXml() throw(Exception);
   void loadReferencesFromLib() throw(Exception);
   void saveReferencesToLib() throw(Exception);
+  void createDelayBlock();
 
   void loadImplementationsFromXml() throw(Exception);
   void loadImplementationsFromLib() throw(Exception);
   void saveImplementationsToLib() throw(Exception);
 
+  void loadSources() throw(Exception);
+
   void addAvailableBlock(ReferenceBlock *block);  
   void parametersValidation();
   void connectionsValidation();
@@ -144,10 +177,12 @@ public :
   ReferenceBlock* searchBlockByXml(QString xmlName);
   ReferenceBlock* searchBlockByMd5(QString sumMd5);
 
+  BoxItem* searchFunctionalBlock(AbstractBlock* block);
+
   void save(QString confFile);
 
 
-  QString projectPath;
+
 
 private:
   Graph* graph; // the graph model of blocks
@@ -160,6 +195,7 @@ private:
 
   GroupScene* searchSceneById(int id, GroupScene* scene);
   BoxItem* searchBlockItemById(int id, GroupScene* scene);
+  BoxItem* searchFunctionalBlockRecur(AbstractBlock* block, GroupScene* scene);
   GroupItem* searchGroupItemById(int id, GroupScene* scene);
   InterfaceItem* searchInterfaceItemById(int id, GroupScene *scene);