X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/d43174d0eb3d293b3bb5fbe76662241134e74d0d..c85843afb9bd492b46d6fe87a8287157097483f5:/Dispatcher.h?ds=inline diff --git a/Dispatcher.h b/Dispatcher.h index e79ad60..538ee66 100644 --- a/Dispatcher.h +++ b/Dispatcher.h @@ -15,14 +15,22 @@ class GroupScene; class AbstractBoxItem; class GroupItem; class BoxItem; +class SourceItem; class ConnectionItem; class InterfaceItem; +class GroupBlock; +class FunctionalBlock; using namespace std; using namespace Qt; +/*! + * \brief The Dispatcher class + * The Dispatcher class represents the control part (in MVC) of the application. It relays + * user's interactions with the GUI into model's modifications and feeds back them onto the view. + */ class Dispatcher { public: @@ -32,8 +40,7 @@ public: GroupWidget* loadProject(const QString& filename); inline int getNumberOfScenes() { return groupList.length(); } - bool connect(InterfaceItem *iface1, InterfaceItem *iface2); - void checkSelection(); + void unselectAllItems(int direction=0); void setCurrentGroupWidget(GroupWidget *win); void changeConnectionMode(int mode = -1); @@ -43,7 +50,8 @@ public: GroupWidget* createChildScene(GroupWidget* parentWidget, BoxItem* upperItemOfGroupItem = NULL); void destroyScene(GroupScene* scene); void showRaiseWindow(BoxItem *item); - void showRstClkInter(AbstractBoxItem *item); + void showRstClkIface(AbstractBoxItem *item); + void showWishboneIface(AbstractBoxItem *item); GroupWidget *addNewEmptyGroup(GroupScene *scene, bool show = true); void addNewFullGroup(); @@ -55,17 +63,24 @@ public: public slots: QMap getAllGroupNames(); - GroupScene* searchSceneById(int id); - GroupScene* searchSceneByName(QString name); - BoxItem* searchBlockItemById(int id); - GroupItem* searchGroupItemById(int id); - InterfaceItem* searchInterfaceItemById(int id); + GroupScene* getSceneById(int id); + GroupScene* getSceneByName(QString name); + BoxItem* getBoxItemById(int id); + GroupItem* getGroupItemById(int id); + InterfaceItem* getInterfaceItemById(int id); + // block ops - void addBlock(int idCategory, int idBlock, int idScene); - void removeBlock(BoxItem* item); - void duplicateBlock(BoxItem* item); - void renameBlockOrGroup(AbstractBoxItem* item); + BoxItem* addBlock(int idCategory, int idBlock, int idScene); + void removeBoxItem(BoxItem* item); + void duplicateBoxItem(BoxItem* item); + void renameFunctionalBlock(BoxItem* item); + void generateBlockVHDL(BoxItem* item); + void renameGroupBlock(GroupItem* item); + void renameSourceBlock(SourceItem* item); + void removeSourceItem(SourceItem* item); + void duplicateSourceItem(SourceItem* item); + // interface ops /*! @@ -77,26 +92,16 @@ public slots: * connect to group in the contextual menu. * Thus, parameter item is always owned by a BoxItem */ - void connectInterToGroup(InterfaceItem* item); + void connectInterToGroup(InterfaceItem* item); /*! - * \brief disconnectInterFromGroup + * \brief removeFunctionalInterface * \param item item is always owned by a BoxItem * * This method is called only when the user right clicks on an InterfaceItem (that belongs - * to a BoxItem and if it IS connected to an InterfaceItem of the GroupItem) and chooses - * disconnect from group in the contextual menu. + * to a BoxItem that represents a functional block and has a multiplicity > 1) and chooses remove in the contextual menu. * Thus, parameter item is always owned by a BoxItem */ - void disconnectInterFromGroup(InterfaceItem* item); - /*! - * \brief removeBlockInterface - * \param item item is always owned by a BoxItem - * - * This method is called only when the user right clicks on an InterfaceItem (that belongs - * to a BoxItem and has a multiplicity > 1) and chooses remove in the contextual menu. - * Thus, parameter item is always owned by a BoxItem - */ - void removeBlockInterface(InterfaceItem* item); + void removeFunctionalInterface(InterfaceItem* item); /*! * \brief removeGroupInterface * \param item item is always owned by a GroupItem @@ -106,16 +111,22 @@ public slots: * Thus, parameter item is always owned by a GroupItem */ void removeGroupInterface(InterfaceItem* item); - void duplicateInterface(InterfaceItem* item); + void duplicateInterfaceItem(InterfaceItem* item); void showProperties(InterfaceItem *inter); void renameInterface(InterfaceItem* item); + void showPatterns(InterfaceItem* item); + void showModifier(InterfaceItem* item); + void removeModifier(InterfaceItem* item); // connection ops - ConnectionItem *addConnection(InterfaceItem *input, InterfaceItem *output); - void removeAllBlockConnections(BoxItem *item); + bool createConnection(InterfaceItem *iface1, InterfaceItem *iface2, bool visible = true); + void removeAllBlockConnections(AbstractBoxItem *item); void removeConnection(ConnectionItem *conn); + // analysis ops + void findGraphModifications(FunctionalBlock* block); // find modif so that block has compatible inputs + // others void showBlocksLibrary();