X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/abbc64cf04a35ab3549d5c516f44c7c5921baa63..4cf57e6db08da791233d75237f62e74bc88dd427:/Parameters.h diff --git a/Parameters.h b/Parameters.h index 8393a79..8a71cfb 100644 --- a/Parameters.h +++ b/Parameters.h @@ -16,10 +16,12 @@ class ReferenceBlock; class GroupBlock; class FunctionalBlock; class GroupScene; +class AbstractBoxItem; class GroupItem; class BoxItem; class InterfaceItem; class Graph; +class GroupWidget; #include "BlockImplementation.h" @@ -35,6 +37,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 : @@ -77,7 +86,8 @@ public : QList implPathes; QList availableBlocks; QList availableImplementations; - + ReferenceBlock* delayRef; + BlockImplementation* delayImpl; QString refLib; QString implLib; @@ -85,6 +95,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; @@ -104,29 +116,31 @@ public : /*************************************************** attributes that are specific for the current project ****************************************************/ + bool isCurrentProject; // true if a projet is currently open int sceneMode; // takes values from MODE_XXX CursorState cursorState; EditState editState; // takes values from EDIT_STATE_XXX bool unsaveModif; bool isRstClkShown; + QMap blockToItem; // allow to retrieve a box item from a functionnal block Graph* createGraph(); 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 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); @@ -143,6 +157,8 @@ public : ReferenceBlock* searchBlockByXml(QString xmlName); ReferenceBlock* searchBlockByMd5(QString sumMd5); + BoxItem* searchFunctionalBlock(AbstractBlock* block); + void save(QString confFile); @@ -159,6 +175,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);