\r
AbstractBlock::~AbstractBlock() {\r
\r
- foreach(AbstractInterface* iface, inputs) {\r
- delete iface;\r
- }\r
- foreach(AbstractInterface* iface, outputs) {\r
- delete iface;\r
- }\r
- foreach(AbstractInterface* iface, bidirs) {\r
- delete iface;\r
- }\r
- inputs.clear();\r
- outputs.clear();\r
- bidirs.clear();\r
+ removeAllInterfaces();\r
+\r
foreach(BlockParameter* p, params) {\r
delete p;\r
}\r
delete inter;\r
}\r
\r
+void AbstractBlock::removeAllInterfaces() {\r
+\r
+ foreach(AbstractInterface* iface, inputs) {\r
+ delete iface;\r
+ }\r
+ foreach(AbstractInterface* iface, outputs) {\r
+ delete iface;\r
+ }\r
+ foreach(AbstractInterface* iface, bidirs) {\r
+ delete iface;\r
+ }\r
+ inputs.clear();\r
+ outputs.clear();\r
+ bidirs.clear();\r
+\r
+}\r
+\r
void AbstractBlock::defineBlockParam(BlockParameter *param)\r
{\r
cout << "definition of param : " << param->getName().toStdString() << endl;\r
void addParameter(BlockParameter *param);\r
void addInterface(AbstractInterface *inter);\r
void removeInterface(AbstractInterface *inter);\r
+ void removeAllInterfaces();\r
void defineBlockParam(BlockParameter *param);\r
\r
QList<AbstractInterface *> getInterfaces();\r
AbstractBoxItem:: AbstractBoxItem(AbstractBlock *_refBlock, Dispatcher *_dispatcher, Parameters *_params, QGraphicsItem *parent) : QGraphicsItem(parent) {
dispatcher = _dispatcher;
params = _params;
- refBlock = _refBlock;
- QFont fontId("Arial",10);
- QFontMetrics fmId(fontId);
+ refBlock = _refBlock;
+ QFontMetrics fmId(params->defaultBlockFont);
nameWidth = fmId.width(refBlock->getName());
nameHeight = fmId.height();
nameMargin = 10;
// NOTE : initInterfaces() is only called in subclasses
}
+AbstractBoxItem::AbstractBoxItem(Dispatcher *_dispatcher, Parameters *_params, QGraphicsItem* parent) : QGraphicsItem(parent) {
+ dispatcher = _dispatcher;
+ params = _params;
+ refBlock = NULL;
+ nameWidth = 0;
+ nameHeight = 0;
+ nameMargin = 10;
+ ifaceMargin = 10;
+
+ // the six following values will be override in subclass constructors
+ minimumBoxWidth = 0;
+ minimumBoxHeight = 0;
+ boxWidth = 0;
+ boxHeight = 0;
+ totalWidth = 0;
+ totalHeight = 0;
+
+ originPoint = QPointF(0.0,0.0);
+
+ selected = false;
+ currentInterface = NULL;
+ rstClkVisible = false;
+
+ setAcceptHoverEvents(true);
+
+ // NOTE : initInterfaces() is only called in subclasses
+}
+
AbstractBoxItem::~AbstractBoxItem() {
foreach(InterfaceItem* inter, interfaces) {
delete inter;
return false;
}
-void AbstractBoxItem::initInterfaces()
-{
+void AbstractBoxItem::setRefBlock(AbstractBlock* _refBlock) {
+ refBlock = _refBlock;
+ QFontMetrics fmId(params->defaultBlockFont);
+ nameWidth = fmId.width(refBlock->getName());
+ nameHeight = fmId.height();
+}
+
+void AbstractBoxItem::initInterfaces() {
/* TO DO : creating all needed InterfaceItem, with by default, input at west and output at east */
int orientation = Parameters::West;
enum ChangeType { Resize = 0, InterfaceMove };
AbstractBoxItem(AbstractBlock *_refBlock, Dispatcher *_dispatcher, Parameters *_params, QGraphicsItem* parent = Q_NULLPTR);
+ AbstractBoxItem(Dispatcher *_dispatcher, Parameters *_params, QGraphicsItem* parent = Q_NULLPTR);
virtual ~AbstractBoxItem();
inline QPointF getOriginPoint() { return originPoint; }
// setters
- inline void setId(int id){ this->id = id; }
+ void setRefBlock(AbstractBlock* _refBlock);
+ inline void setId(int _id){ id = _id; }
inline void setSelected(bool _selected) { selected = _selected; }
inline void setRstClkVisible(bool b){ rstClkVisible = b;}
void setDimension(int x, int y);
#include "ReferenceBlock.h"
#include "ParametersWindow.h"
#include "BlockParameter.h"
+#include "Graph.h"
BoxItem::BoxItem(AbstractBlock *_refBlock,
//cout << "pos in group: " << x() << "," << y() << endl;
}
+BoxItem::BoxItem(Dispatcher *_dispatcher, Parameters *_params, GroupItem *parent) throw(Exception) : AbstractBoxItem(_dispatcher, _params, parent) {
+
+ refBlock = NULL;
+ childGroupItem = NULL;
+ currentBorder = NoBorder;
+ selected = false;
+
+ setZValue(100);
+ setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemSendsGeometryChanges);
+
+ boxWidth = params->defaultBlockWidth;
+ boxHeight = params->defaultBlockHeight;
+ //initInterfaces();
+ //updateGeometry(InterfaceMove);
+ //resetInterfacesPosition();
+ //QPointF initPos = QPointF(0.0,0.0) - originPoint;
+ //setPos(initPos);
+ //cout << "total size of block: " << totalWidth << "," << totalHeight << endl;
+ //cout << "pos in group: " << x() << "," << y() << endl;
+}
BoxItem::~BoxItem() {
}
bool boxSizeChanged = false;
- // whatever the change, the minimum size may ahve changed
+ // whatever the change, the minimum size may have changed
updateMinimumSize();
if (type == Resize) {
new ParametersWindow(refBlock, params, NULL);
}
}
+void BoxItem::loadFunctional(QDomElement funcElement) throw(Exception) {
+
+ bool ok = false;
+
+ int id = funcElement.attribute("id","none").toInt(&ok);
+ if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
+
+ QString refXml = funcElement.attribute("ref_xml","none");
+ if(refXml == "none") throw(Exception(PROJECTFILE_CORRUPTED));
+
+ QString refMd5 = funcElement.attribute("ref_md5","none");
+ if(refMd5 == "none") throw(Exception(PROJECTFILE_CORRUPTED));
+
+ cout << "ref md5 : " << refMd5.toStdString() << "\nref xml : " << refXml.toStdString() << endl;
+
+ QString name = funcElement.attribute("name","none");
+ if(name == "none") throw(Exception(PROJECTFILE_CORRUPTED));
+
+ QStringList positionStr = funcElement.attribute("position","none").split(",");
+ if(positionStr.length() != 2) throw(Exception(PROJECTFILE_CORRUPTED));
+ int posX = positionStr.at(0).toInt(&ok);
+ if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
+ int posY = positionStr.at(1).toInt(&ok);
+ if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
+
+ QStringList dimensionStr = funcElement.attribute("dimension","none").split(",");
+ if(dimensionStr.length() != 2) throw(Exception(PROJECTFILE_CORRUPTED));
+ int dimX = dimensionStr.at(0).toInt(&ok);
+ if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
+ int dimY = dimensionStr.at(1).toInt(&ok);
+ if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
+
+ ReferenceBlock *referenceMd5 = NULL;
+ ReferenceBlock *referenceXml = NULL;
+ ReferenceBlock *reference = NULL;
+ if(refMd5 != "none") {
+ referenceMd5 = params->searchBlockByMd5(refMd5);
+ }
+ if(refXml != "none"){
+ referenceXml = params->searchBlockByXml(refXml);
+ }
+ if ((referenceMd5 == NULL) && (referenceXml == NULL)) {
+ throw(Exception(PROJECTFILE_CORRUPTED));
+ }
+ if (referenceMd5 != referenceXml) {
+ throw(Exception(PROJECTFILE_CORRUPTED));
+ }
+ else {
+ reference = referenceMd5;
+ }
+ GroupBlock* parentGroupBlock = AB_TO_GRP(((GroupItem *)parentItem())->getRefBlock());
+ FunctionalBlock* functionalBlock = params->getGraph()->addFunctionalBlock(parentGroupBlock, reference);
+ /* NB: addFunctionalBlock creates all interfaces from the reference, which is annoying when
+ reading bif_iface tags. Thus interface are all removed.
+ */
+ functionalBlock->setName(name);
+ setRefBlock(functionalBlock);
+
+ setPos(posX,posY);
+ setDimension(dimX,dimY);
+ setId(id);
+
+
+ QDomNodeList blockParamNodes = funcElement.elementsByTagName("bif_parameter");
+ // setting parameters value
+ for(int i=0; i<blockParamNodes.length(); i++){
+ QDomElement currentBlockParamNode = blockParamNodes.at(i).toElement();
+
+ QString name = currentBlockParamNode.attribute("name","none");
+ if(name == "none") throw(Exception(PROJECTFILE_CORRUPTED));
+
+ QString value = currentBlockParamNode.attribute("value","none");
+ if(value == "none") throw(Exception(PROJECTFILE_CORRUPTED));
+
+ BlockParameter *blockParam = NULL;
+ blockParam = functionalBlock->getParameterFromName(name);
+ if (blockParam == NULL) throw(Exception(PROJECTFILE_CORRUPTED));
+ blockParam->setValue(value);
+ }
+
+ // recreate all interface because of some may have a multiplicity>1 with several examplars
+ functionalBlock->removeAllInterfaces();
+ QDomNodeList interfaceNodes = funcElement.elementsByTagName("bif_iface");
+ // setting interfaces (user name, and for multiplicity>1 may be create some new ones)
+ for(int i=0; i<interfaceNodes.length(); i++) {
+
+ QDomElement currentInterfaceNode = interfaceNodes.at(i).toElement();
+
+ QString name = currentInterfaceNode.attribute("name","none");
+ if(name == "none") throw(Exception(PROJECTFILE_CORRUPTED));
+
+ QString refName = currentInterfaceNode.attribute("ref_name","none");
+ if(refName == "none") throw(Exception(PROJECTFILE_CORRUPTED));
+
+ ReferenceInterface* refInter = AI_TO_REF(reference->getIfaceFromName(refName));
+ FunctionalInterface *functionalInterface = new FunctionalInterface(functionalBlock,refInter);
+ functionalInterface->setName(name);
+ functionalBlock->addInterface(functionalInterface);
+ }
+ // creating InterfaceItem
+ initInterfaces();
+ // setting them with saved values
+ for(int i=0; i<interfaceNodes.length(); i++){
+
+ QDomElement currentInterfaceNode = interfaceNodes.at(i).toElement();
+
+ int id = currentInterfaceNode.attribute("id","none").toInt(&ok);
+ if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
+
+ QString name = currentInterfaceNode.attribute("name","none");
+ if(name == "none") throw(Exception(PROJECTFILE_CORRUPTED));
+
+ QString orientationStr = currentInterfaceNode.attribute("orientation","none");
+ int orientation = InterfaceItem::getIntOrientation(orientationStr);
+ if(orientation == -1) throw(Exception(PROJECTFILE_CORRUPTED));
+
+ double position = currentInterfaceNode.attribute("position","none").toDouble(&ok);
+ if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
+
+ InterfaceItem *interfaceItem = searchInterfaceByName(name);
+ interfaceItem->setId(id);
+ interfaceItem->setOrientation(orientation);
+ interfaceItem->setPositionRatio(position);
+ }
+ updateGeometry(Resize);
+}
void BoxItem::save(QXmlStreamWriter &writer) {
if (refBlock->isFunctionalBlock()) {
for(int i=0; i<b.getInterfaces().length(); i++){
InterfaceItem *inter = b.getInterfaces().at(i);
toWrite << inter->getId();
- toWrite << inter->getName();
+ //toWrite << inter->getName();
toWrite << inter->getPositionRatio();
toWrite << inter->getOrientation();
}
return out;
}
-QDataStream &operator >>(QDataStream &in, BoxItem &b)
-{
+QDataStream &operator >>(QDataStream &in, BoxItem &b) {
in.setVersion(QDataStream::Qt_4_8);
in >> positionRatio;
in >> orientation;
- inter->setId(id);
- inter->setName(name);
+ inter->setId(id);
inter->setPositionRatio(positionRatio);
inter->setOrientation(orientation);
inter->updatePosition();
#include <QtCore>
#include <QtGui>
+#include <QtXml>
+#include <QtXmlPatterns>
#include "AbstractBoxItem.h"
public:
BoxItem(AbstractBlock *_refBlock, Dispatcher *_dispatcher, Parameters *_params, GroupItem* parent) throw(Exception);
+ BoxItem(Dispatcher *_dispatcher, Parameters *_params, GroupItem* parent) throw(Exception);
~BoxItem();
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
// others
void moveTo(QPointF dest);
+ void loadFunctional(QDomElement funcElement) throw(Exception);
void save(QXmlStreamWriter& writer);
protected:
return NULL;
}
+ /*
// creating the top widget/scene
topGroup = new GroupWidget(NULL,this,params);
currentGroup = topGroup;
params->setTopScene(scene);
params->setCurrentScene(scene);
-
+*/
try {
- params->loadProject(root);
+ topGroup = params->loadProject(root);
}
catch(Exception e){
cerr << qPrintable(e.getDefaultMessage()) << endl;
foreach(GroupWidget* win, groupList) {
win->deleteLater();
}
+ groupList.clear();
params->destroyGraph();
+ topGroup = NULL;
+ currentGroup = NULL;
+ sceneCounter = 0;
}
bool Dispatcher::connect(InterfaceItem *iface1, InterfaceItem *iface2) {
if (item->refInter->getOwner()->isGroupBlock()) {
item->refInter->setName(text);
}
- item->setName(text);
-
}
else {
QMessageBox::warning(NULL,"Error in given name",
return topGroup;
}
-void Dispatcher::addNewEmptyGroup(GroupScene* scene) {
+GroupWidget* Dispatcher::addNewEmptyGroup(GroupScene* scene, bool show) {
static QString fctName = "Dispatcher::addNewEmptyGroup();";
#ifdef DEBUG_FCTNAME
cout << "call to " << qPrintable(fctName) << endl;
params->unsaveModif = true;
GroupWidget* child = createChildScene(scene->getGroupWidget(),newItem);
- child->show();
+ if (show) child->show();
+ return child;
}
cout << "call to " << qPrintable(fctName) << endl;
#endif
- // getting back the goup block already created
- GroupBlock* groupBlock = NULL;
- if (upperItemOfGroupItem != NULL) {
- groupBlock = AB_TO_GRP(upperItemOfGroupItem->getRefBlock());
- }
- // creating the view part of the group
- GroupItem *groupItem = new GroupItem(upperItemOfGroupItem,groupBlock,this,params);
- // creating the group widget
- GroupWidget* group = new GroupWidget(parentWidget, this, params);
- // getting the newly created scene
- GroupScene *scene = group->getScene();
- scene->setId(sceneCounter++);
- // affecting group item to the scene
- scene->setGroupItem(groupItem);
- groupList.append(group);
-
- mainWindow->getLibrary()->updateComboScene();
+ GroupWidget* group = NULL;
+ /* NB: this method may be called during design process or when loading
+ a project. In this case, upperItemOfGroupItem is NULL, thus a lot of things
+ cannot be initialized yet. This is why there are 2 cases below
+ */
+ if (upperItemOfGroupItem != NULL) {
+ // getting back the goup block already created
+ GroupBlock* groupBlock = AB_TO_GRP(upperItemOfGroupItem->getRefBlock());
+ // creating the view part of the group
+ GroupItem *groupItem = new GroupItem(upperItemOfGroupItem,groupBlock,this,params);
+ // creating the group widget
+ group = new GroupWidget(parentWidget, this, params);
+ // getting the newly created scene
+ GroupScene *scene = group->getScene();
+ scene->setId(sceneCounter++);
+ // affecting group item to the scene
+ scene->setGroupItem(groupItem);
+ groupList.append(group);
+
+ mainWindow->getLibrary()->updateComboScene();
+ }
+ else {
+ GroupItem *groupItem = new GroupItem(this,params);
+ // creating the group widget
+ group = new GroupWidget(parentWidget, this, params);
+ // getting the newly created scene
+ GroupScene *scene = group->getScene();
+ // affecting group item to the scene
+ scene->setGroupItem(groupItem);
+ groupList.append(group);
+ }
return group;
}
void destroyScene(GroupScene* scene);
void showRaiseWindow(BoxItem *item);
void showRstClkInter(AbstractBoxItem *item);
- void addNewEmptyGroup(GroupScene *scene);
+ GroupWidget *addNewEmptyGroup(GroupScene *scene, bool show = true);
void addNewFullGroup();
inline GroupWidget* getCurrentGroup() { return currentGroup; }
+ inline void setSceneCounter(int value) { sceneCounter = value;}
+
bool isCurrentProject;
public slots:
#include "ConnectedInterface.h"
#include "GroupScene.h"
#include "ParametersWindow.h"
+#include "GroupBlock.h"
+#include "GroupInterface.h"
GroupItem::GroupItem(BoxItem *_parentItem,
cout << "pos in scene: " << x() << "," << y() << endl;
}
+GroupItem::GroupItem(Dispatcher *_dispatcher,Parameters *_params) throw(Exception) :AbstractBoxItem(_dispatcher, _params) {
+
+ parentItem = NULL;
+ rectTitle = QRectF(0,-(nameHeight+2*nameMargin),nameWidth+2*nameMargin,nameHeight+2*nameMargin);
+ selected = false;
+ setZValue(-100);
+ setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemSendsGeometryChanges);
+
+ updateGeometry(InterfaceMove);
+ QPointF initPos = QPointF(0.0,0.0) - originPoint;
+ setPos(initPos);
+ cout << "total size of group: " << totalWidth << "," << totalHeight << endl;
+ cout << "pos in scene: " << x() << "," << y() << endl;
+}
+
GroupItem::~GroupItem() {
// since the reference block is nowhere referenced except in this class, it must be deleted here
delete refBlock;
return parentItem;
}
+void GroupItem::setParentItem(BoxItem *_parentItem) {
+ parentItem = _parentItem;
+ if (parentItem != NULL) {
+ parentItem->setChildGroupItem(this);
+ }
+}
+
void GroupItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
if(boxWidth > 0 && boxHeight > 0){
if(selected)
return NULL;
}
+void GroupItem::load(QDomElement groupElement) throw(Exception) {
+
+ GroupBlock* groupBlock = AB_TO_GRP(refBlock);
+
+ bool ok = false;
+
+ int id = groupElement.attribute("id","none").toInt(&ok);
+ if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
+
+ QString nameStr = groupElement.attribute("name","none");
+ if(nameStr == "none") throw(Exception(PROJECTFILE_CORRUPTED));
+
+ QStringList positionStr = groupElement.attribute("position","none").split(",");
+ if(positionStr.length() != 2) throw(Exception(PROJECTFILE_CORRUPTED));
+ int posX = positionStr.at(0).toInt(&ok);
+ if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
+ int posY = positionStr.at(1).toInt(&ok);
+ if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
+
+ QStringList dimensionStr = groupElement.attribute("dimension","none").split(",");
+ if(dimensionStr.length() != 2) throw(Exception(PROJECTFILE_CORRUPTED));
+ int dimX = dimensionStr.at(0).toInt(&ok);
+ if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
+ int dimY = dimensionStr.at(1).toInt(&ok);
+ if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
+
+ setId(id);
+ setPos(posX,posY);
+ setDimension(dimX,dimY);
+ groupBlock->setName(nameStr);
+
+ cout << "group info : \n-id : " << id << "\n-pos : " << posX << ", " << posY << "\n-dim : " << dimX << ", " << dimY << "\n-name : " << nameStr.toStdString() << endl;
+
+ QDomNodeList interfaces = groupElement.elementsByTagName("group_iface");
+ for(int j=0; j<interfaces.length(); j++){
+ QDomElement currentInterfaceNode = interfaces.at(j).toElement();
+
+ int id = currentInterfaceNode.attribute("id","none").toInt(&ok);
+ if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
+
+ QString name = currentInterfaceNode.attribute("name","none");
+ if(name == "none") throw(Exception(PROJECTFILE_CORRUPTED));
+
+ QString levelStr = currentInterfaceNode.attribute("level","none");
+ int level = AbstractInterface::getIntLevel(levelStr);
+ if(level == -1) throw(Exception(PROJECTFILE_CORRUPTED));
+
+ QString directionStr = currentInterfaceNode.attribute("direction","none");
+ int direction = AbstractInterface::getIntDirection(directionStr);
+ if(direction == -1) throw(Exception(PROJECTFILE_CORRUPTED));
+
+ QString orientationStr = currentInterfaceNode.attribute("orientation","none");
+ int orientation = InterfaceItem::getIntOrientation(orientationStr);
+ if(orientation == -1) throw(Exception(PROJECTFILE_CORRUPTED));
+
+ double position = currentInterfaceNode.attribute("position","none").toDouble(&ok);
+ if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
+
+ GroupInterface *groupInterface = new GroupInterface(groupBlock,name,direction,level);
+
+ InterfaceItem *interfaceItem = new InterfaceItem(position,orientation,groupInterface,this,params);
+ interfaceItem->setId(id);
+
+ groupBlock->addInterface(groupInterface);
+ addInterface(interfaceItem, false);
+ cout << "interface add to " << groupBlock->getName().toStdString() << endl;
+ }
+
+}
+
void GroupItem::save(QXmlStreamWriter &writer) {
writer.writeStartElement("group_item");
#include <QtCore>
#include <QtGui>
+#include <QtXml>
+#include <QtXmlPatterns>
+
#include "AbstractBoxItem.h"
class AbstractBoxItem;
*/
GroupItem(BoxItem* _parentItem, AbstractBlock *_refBlock, Dispatcher *_dispatcher, Parameters *_params) throw(Exception);
+ GroupItem(Dispatcher *_dispatcher, Parameters *_params) throw(Exception); //! uses only when loading a project file
~GroupItem();
// getters
BoxItem* getParentItem();
// setters
+ void setParentItem(BoxItem* _parentItem);
// testers
bool isGroupItem();
// others
void updateShape();
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+ void load(QDomElement groupElement) throw(Exception);
void save(QXmlStreamWriter& writer);
protected:
BoxItem *GroupScene::createBlockItem(AbstractBlock *block) {
- BoxItem* blockItem = new BoxItem(block,dispatcher,params,groupItem);
- blockItem->setZValue(1);
- addBlockItem(blockItem);
- return blockItem;
-}
-
-void GroupScene::addBlockItem(BoxItem* item) {
- // add item from the viewport
- //addItem(item);
+ BoxItem* item = new BoxItem(block,dispatcher,params,groupItem);
+ item->setZValue(1);
// add item from the QList
blockItems.append(item);
// repainting the group
// center the new block
QPointF newPos((groupItem->getWidth()-item->getTotalWidth())/2.0, (groupItem->getHeight()-item->getTotalHeight())/2.0);
newPos = newPos-item->getOriginPoint();
- item->moveTo(newPos);
+ item->moveTo(newPos);
+
+ return item;
+}
+
+void GroupScene::addBlockItem(BoxItem* item) {
+ // add item from the QList
+ blockItems.append(item);
+ // repainting the group
+ groupItem->updateShape();
}
void GroupScene::removeBlockItem(BoxItem* item) {
void GroupScene::save(QXmlStreamWriter &writer) {
writer.writeStartElement("scene");
writer.writeAttribute("id",QString::number(id));
+ if (parentScene == NULL) {
+ writer.writeAttribute("upper_scene",QString::number(-1));
+ }
+ else {
+ writer.writeAttribute("upper_scene",QString::number(parentScene->getId()));
+ }
groupItem->save(writer);
writer.writeStartElement("block_items");
// others
- BoxItem* createBlockItem(AbstractBlock* block);
- void addBlockItem(BoxItem* item);
+ BoxItem* createBlockItem(AbstractBlock* block); //! create a new BoxItem and place it at the center of the scene
+ void addBlockItem(BoxItem* item); //! add an already configured BoxItem in the scene.
void removeBlockItem(BoxItem* item);
void createConnectionItem(InterfaceItem* iface1, InterfaceItem* iface2);
ConnectionItem* searchConnectionItem(InterfaceItem* iface1, InterfaceItem* iface2);
// CAUTION : the owner must add explicitely this item to its interface, calling addInterface()
owner = _owner;
params = _params;
- selected = false;
- name = refInter->getName();
+ selected = false;
QFontMetrics fmName(params->defaultIfaceFont);
- nameWidth = fmName.width(name);
+ nameWidth = fmName.width(refInter->getName());
nameHeight = fmName.height();
// by default, only data interface are visible
if (refInter->getPurpose() == AbstractInterface::Data) {
this->id = counter++;
}
+QString InterfaceItem::getName() {
+ return refInter->getName();
+}
+
/* boundingRect() : give the bounding rect in the blockitem coord. system */
QRectF InterfaceItem::boundingRect() const {
iface->refInter->connectFrom(NULL);
}
if(iface->refInter->getConnectedTo().contains(refInter)){
- cout << "abnormal case while removing iface conn from " << qPrintable(name) << " to " << qPrintable(iface->name) << endl;
+ cout << "abnormal case while removing iface conn from " << qPrintable(refInter->getName()) << " to " << qPrintable(iface->refInter->getName()) << endl;
iface->refInter->removeConnectedTo(refInter);
}
if(refInter->getConnectedFrom() == iface->refInter) {
- cout << "abnormal case while removing iface conn from " << qPrintable(name) << " to " << qPrintable(iface->name) << endl;
+ cout << "abnormal case while removing iface conn from " << qPrintable(refInter->getName()) << " to " << qPrintable(iface->refInter->getName()) << endl;
refInter->connectFrom(NULL);
}
if(refInter->getConnectedTo().contains(iface->refInter)){
// getters
inline int getId() { return id; }
- inline QString getName() { return name; }
+ QString getName();
inline double getPositionRatio() { return positionRatio; }
inline double getPosition() { return position; }
inline int getOrientation() { return orientation; }
// setters
void setOriginPoint();
- inline void setId(int id){ this->id = id; }
- inline void setName(QString name){ this->name = name; }
+ inline void setId(int id){ this->id = id; }
inline void setPositionRatio(double ratio) { positionRatio = ratio; }
inline void setOrientation(int _orientation){ orientation = _orientation; }
private:
- int id;
- QString name;
+ int id;
double positionRatio;
int position; // position in pixels on the "orientation side" of the owner
int orientation; // north, south, east, west
if (topGroup != NULL) {
addTopGroup(topGroup);
library->updateComboScene();
+ params->isCurrentProject = true;
+ enableProjectActions(true, PROJECT_CLOSE | PROJECT_SAVE | PROJECT_SAVEAS | PROJECT_LIB, OP_RAZ);
}
else {
QMessageBox msgBox;
- msgBox.setText("Cannot open the project.");
- msgBox.setInformativeText("Do you want to save your changes?");
+ msgBox.setText("Cannot open the project.");
msgBox.setStandardButtons(QMessageBox::Cancel);
msgBox.setDefaultButton(QMessageBox::Cancel);
params->isCurrentProject = true;
}
-void MainWindow::slotCloseProject(){
+bool MainWindow::slotCloseProject(){
- // removing the GroupWidget from stack
- QWidget *widget = stackedWidget->widget(1);
- stackedWidget->removeWidget(widget);
- stackedWidget->setCurrentIndex(0);
+ bool doClose = false;
- dispatcher->closeCurrentProject();
+ if(params->isCurrentProject) {
+ if (params->unsaveModif) {
+ QMessageBox msgBox;
+ msgBox.setText("The project has been modified.");
+ msgBox.setInformativeText("Do you want to save your changes?");
+ msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
+ msgBox.setDefaultButton(QMessageBox::Save);
+ int ret = msgBox.exec();
- params->isCurrentProject = false;
- params->unsaveModif = false;
- absoluteFilename = QString();
+ switch(ret) {
+ case QMessageBox::Save :
+ slotSaveProject();
+ doClose = true;
+ break;
+ case QMessageBox::Discard :
+ doClose = true;
+ break;
+ }
+ }
+ if (doClose) {
+ // removing the GroupWidget from stack
+ QWidget *widget = stackedWidget->widget(1);
+ stackedWidget->removeWidget(widget);
+ stackedWidget->setCurrentIndex(0);
- initialize();
+ dispatcher->closeCurrentProject();
+
+ params->isCurrentProject = false;
+ params->unsaveModif = false;
+ absoluteFilename = QString();
+
+ initialize();
+ }
+ }
+ return doClose;
}
stackedWidget->setCurrentIndex(0);
}
-void MainWindow::closeEvent(QCloseEvent *event){
- if(params->isCurrentProject){
- QMessageBox msgBox;
- msgBox.setText("The project has been modified.");
- msgBox.setInformativeText("Do you want to save your changes?");
- msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
- msgBox.setDefaultButton(QMessageBox::Save);
-
- int ret = msgBox.exec();
-
- switch(ret) {
- case QMessageBox::Save :
- slotSaveProject();
- slotCloseProject();
- break;
- case QMessageBox::Discard :
- slotCloseProject();
- break;
- }
+void MainWindow::closeEvent(QCloseEvent *event) {
+
+ if (params->isCurrentProject) {
+ slotCloseProject();
event->ignore();
- } else {
- exit(0);
}
+
}
void MainWindow::mousePressEvent(QMouseEvent *e) {
void slotLoadProject();
void slotSaveProject();
void slotSaveAsProject();
- void slotCloseProject();
+ bool slotCloseProject();
void slotOpenBlockLibrary();
void slotNewBlockWidget();
return root;\r
}\r
\r
-void Parameters::loadProject(QDomElement root) {\r
-\r
-#ifdef DEBUG_INCLFUN\r
+GroupWidget *Parameters::loadProject(QDomElement root) throw(Exception) {\r
\r
bool ok = false;\r
GroupWidget* groupWidget = NULL;\r
GroupItem *groupItem = NULL;\r
GroupBlock *groupBlock = NULL;\r
\r
+ GroupWidget* topGroup = NULL;\r
/**********************************************************\r
1 : getting scene and creating associated group widgets\r
***********************************************************/\r
QDomNodeList scenesNodes = root.elementsByTagName("scene");\r
\r
+ int maxIdScene = -1;\r
for(int i=0; i<scenesNodes.length(); i++) {\r
QDomElement currentSceneNode = scenesNodes.at(i).toElement();\r
int idScene = currentSceneNode.attribute("id","none").toInt(&ok);\r
if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
+ if (idScene > maxIdScene) maxIdScene = idScene;\r
int idUpperScene = currentSceneNode.attribute("upper_scene","none").toInt(&ok);\r
if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
\r
if (idUpperScene == -1) {\r
- dispatcher->createTopScene();\r
+ topGroup = dispatcher->createTopScene();\r
topScene->setId(idScene);\r
- groupItem = topScene->getGroupItem();\r
- groupBlock = AB_TO_GRP(groupItem->getRefBlock());\r
+ groupItem = topScene->getGroupItem(); \r
cout << "top group added to scene n°" << idScene << endl;\r
}\r
else {\r
- GroupScene* scene = searchSceneById(idUpperScene, topScene);\r
- GroupWidget* parent = scene->getGroupWindow();\r
- groupWidget = dispatcher->createChildScene(parent);\r
- groupItem = groupWidget->getScene()->getGroupItem();\r
- groupBlock = AB_TO_GRP(groupItem->getRefBlock());\r
+ cout << "trying to create scene n°" << idScene << " with upper scene n°" <<idUpperScene << endl;\r
+ GroupScene* upperScene = searchSceneById(idUpperScene, topScene);\r
+ groupWidget = dispatcher->addNewEmptyGroup(upperScene,false);\r
+ groupWidget->getScene()->setId(idScene);\r
+ groupItem = groupWidget->getScene()->getGroupItem(); \r
}\r
+ groupBlock = AB_TO_GRP(groupItem->getRefBlock());\r
/**********************************************************\r
- 1.1 : getting the group item\r
+ 1.1 : getting the group item of each scene\r
***********************************************************/\r
QDomElement groupItemNode = currentSceneNode.firstChildElement("group_item");\r
-\r
- int id = groupItemNode.attribute("id","none").toInt(&ok);\r
- if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- QString name = groupItemNode.attribute("name","none");\r
- if(name == "none") throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- QStringList positionStr = groupItemNode.attribute("position","none").split(",");\r
- if(positionStr.length() != 2) throw(Exception(PROJECTFILE_CORRUPTED));\r
- int posX = positionStr.at(0).toInt(&ok);\r
- if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
- int posY = positionStr.at(1).toInt(&ok);\r
- if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- QStringList dimensionStr = groupItemNode.attribute("dimension","none").split(",");\r
- if(dimensionStr.length() != 2) throw(Exception(PROJECTFILE_CORRUPTED));\r
- int dimX = dimensionStr.at(0).toInt(&ok);\r
- if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
- int dimY = dimensionStr.at(1).toInt(&ok);\r
- if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- groupItem->setId(id);\r
- groupItem->setPos(posX,posY);\r
- groupItem->setDimension(dimX,dimY);\r
- groupBlock->setName(name);\r
+ try {\r
+ groupItem->load(groupItemNode);\r
+ }\r
+ catch(Exception err) {\r
+ throw(err);\r
+ }\r
\r
if (idUpperScene != -1) {\r
groupWidget->setWindowTitle(groupBlock->getName());\r
groupWidget->show();\r
- }\r
- cout << "group info : \n-id : " << id << "\n-pos : " << posX << ", " << posY << "\n-dim : " << dimX << ", " << dimY << "\n-name : " << name.toStdString() << endl;\r
-\r
- QDomNodeList interfaces = groupItemNode.elementsByTagName("group_iface");\r
- for(int j=0; j<interfaces.length(); j++){\r
- QDomElement currentInterfaceNode = interfaces.at(j).toElement();\r
-\r
- int id = currentInterfaceNode.attribute("id","none").toInt(&ok);\r
- if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- QString name = currentInterfaceNode.attribute("name","none");\r
- if(name == "none") throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- QString levelStr = currentInterfaceNode.attribute("level","none");\r
- int level = AbstractInterface::getIntLevel(levelStr);\r
- if(level == -1) throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- QString directionStr = currentInterfaceNode.attribute("direction","none");\r
- int direction = AbstractInterface::getIntDirection(directionStr);\r
- if(direction == -1) throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- QString orientationStr = currentInterfaceNode.attribute("orientation","none");\r
- int orientation = InterfaceItem::getIntOrientation(orientationStr);\r
- if(orientation == -1) throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- double position = currentInterfaceNode.attribute("position","none").toDouble(&ok);\r
- if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- GroupInterface *groupInterface = new GroupInterface(groupBlock,name,direction,level);\r
-\r
- InterfaceItem *interfaceItem = new InterfaceItem(position,orientation,groupInterface,groupItem,this);\r
- interfaceItem->setId(id);\r
-\r
- groupBlock->addInterface(groupInterface);\r
- groupItem->addInterface(interfaceItem);\r
- cout << "interface add to " << groupBlock->getName().toStdString() << endl;\r
- }\r
+ } \r
}\r
-\r
+ dispatcher->setSceneCounter(maxIdScene+1);\r
cout << "groupItems loaded and windows created succefully!" << endl;\r
\r
+ /**********************************************************\r
+ 2 : getting the functional blocks of each scene\r
+ ***********************************************************/\r
\r
for(int i=0; i<scenesNodes.length(); i++){\r
QDomElement currentSceneNode = scenesNodes.at(i).toElement();\r
\r
QDomNodeList functionalBlockNodes = currentSceneNode.elementsByTagName("bi_functional");\r
\r
- for(int j=0; j<functionalBlockNodes.length(); j++){\r
- QDomElement currentFBNode = functionalBlockNodes.at(j).toElement();\r
-\r
- int id = currentFBNode.attribute("id","none").toInt(&ok);\r
- if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- QString refXml = currentFBNode.attribute("ref_xml","none");\r
- if(refXml == "none") throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- QString refMd5 = currentFBNode.attribute("ref_md5","none");\r
- if(refMd5 == "none") throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- cout << "ref md5 : " << refMd5.toStdString() << "\nref xml : " << refXml.toStdString() << endl;\r
-\r
- QString name = currentFBNode.attribute("name","none");\r
- if(name == "none") throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- QStringList positionStr = currentFBNode.attribute("position","none").split(",");\r
- if(positionStr.length() != 2) throw(Exception(PROJECTFILE_CORRUPTED));\r
- int posX = positionStr.at(0).toInt(&ok);\r
- if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
- int posY = positionStr.at(1).toInt(&ok);\r
- if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- QStringList dimensionStr = currentFBNode.attribute("dimension","none").split(",");\r
- if(dimensionStr.length() != 2) throw(Exception(PROJECTFILE_CORRUPTED));\r
- int dimX = dimensionStr.at(0).toInt(&ok);\r
- if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
- int dimY = dimensionStr.at(1).toInt(&ok);\r
- if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- AbstractBlock *reference;\r
- /*if(refMd5 != "none"){\r
- cout << "md5" << endl;\r
- reference = searchBlockByMd5(refMd5);\r
- }\r
- else */if(refXml != "none"){\r
- cout << "xml" << endl;\r
- reference = searchBlockByXml(refXml);\r
- }\r
- else {\r
- throw(Exception(PROJECTFILE_CORRUPTED));\r
- }\r
-\r
- FunctionalBlock *functionalBlock = new FunctionalBlock(currentScene->getGroupItem()->getRefBlock(),reference);\r
- functionalBlock->setName(name);\r
-\r
- ((GroupBlock*)currentScene->getGroupItem()->getRefBlock())->addBlock(functionalBlock);\r
-\r
-\r
- BlockItem *blockItem = new BlockItem(currentScene->getGroupItem(),functionalBlock,dispatcher,this);\r
- blockItem->setPos(posX,posY);\r
- blockItem->setDimension(dimX,dimY);\r
- blockItem->setId(id);\r
- ((GroupItem*)currentScene->getGroupItem())->addBlockItem(blockItem);\r
- currentScene->addItem(blockItem);\r
- currentScene->addBlockItem(blockItem);\r
-\r
- QDomNodeList blockParamNodes = currentFBNode.elementsByTagName("bif_parameter");\r
-\r
- for(int i=0; i<blockParamNodes.length(); i++){\r
- QDomElement currentBlockParamNode = blockParamNodes.at(i).toElement();\r
-\r
- QString name = currentBlockParamNode.attribute("name","none");\r
- if(name == "none") throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- QString value = currentBlockParamNode.attribute("value","none");\r
- if(value == "none") throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- QString context = currentBlockParamNode.attribute("context","none");\r
- if(context == "none") throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- QString type = currentBlockParamNode.attribute("type","none");\r
- if(type == "none") throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
-\r
- BlockParameter *blockParam = new BlockParameter;\r
- blockParam->setName(name);\r
- blockParam->setValue(value);\r
- blockParam->setType(type);\r
- if(context == "constant") blockParam->setContext(BlockParameter::Constant);\r
- if(context == "user") blockParam->setContext(BlockParameter::User);\r
- if(context == "generic") blockParam->setContext(BlockParameter::Generic);\r
- if(context == "wb") blockParam->setContext(BlockParameter::Wishbone);\r
- if(context == "port") blockParam->setContext(BlockParameter::Port);\r
-\r
- functionalBlock->addParameter(blockParam);\r
+ for(int j=0; j<functionalBlockNodes.length(); j++) {\r
+ QDomElement currentFBNode = functionalBlockNodes.at(j).toElement(); \r
+ BoxItem* funcItem = new BoxItem(dispatcher,this, currentScene->getGroupItem());\r
+ try {\r
+ funcItem->loadFunctional(currentFBNode);\r
}\r
-\r
-\r
- QDomNodeList interfaceNodes = currentFBNode.elementsByTagName("bif_iface");\r
-\r
- for(int i=0; i<interfaceNodes.length(); i++){\r
-\r
- QDomElement currentInterfaceNode = interfaceNodes.at(i).toElement();\r
-\r
- int id = currentInterfaceNode.attribute("id","none").toInt(&ok);\r
- if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- QString name = currentInterfaceNode.attribute("name","none");\r
- if(name == "none") throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- QString refName = currentInterfaceNode.attribute("ref_name","none");\r
- if(refName == "none") throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- QString orientationStr = currentInterfaceNode.attribute("orientation","none");\r
- int orientation = InterfaceItem::getIntOrientation(orientationStr);\r
- if(orientation == -1) throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- double position = currentInterfaceNode.attribute("position","none").toDouble(&ok);\r
- if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- ReferenceInterface *refInter = (ReferenceInterface*)reference->getIfaceFromName(refName);\r
- FunctionalInterface *functionalInterface = new FunctionalInterface(functionalBlock,refInter);\r
- functionalBlock->addInterface(functionalInterface);\r
- functionalInterface->setName(refName);\r
-\r
- InterfaceItem *interfaceItem = new InterfaceItem(position,orientation,functionalInterface,blockItem,this);\r
- interfaceItem->setId(id);\r
- interfaceItem->setName(name);\r
-\r
- blockItem->addInterface(interfaceItem);\r
-\r
+ catch(Exception err) {\r
+ throw(err);\r
}\r
+ // add the block to the GroupScene\r
+ currentScene->addBlockItem(funcItem);\r
}\r
}\r
- cout << "functionalBlocks loaded and created succefully!" << endl;\r
+ cout << "functional blocks loaded and created succefully!" << endl;\r
\r
+ /**********************************************************\r
+ 3 : set the BoxItem that represents a GroupItem in a child scene\r
+ ***********************************************************/\r
\r
for(int i=0; i<scenesNodes.length(); i++){\r
QDomElement currentSceneNode = scenesNodes.at(i).toElement();\r
int dimY = dimensionStr.at(1).toInt(&ok);\r
if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
\r
-\r
+ // get the GroupItem already created and set at phase 1\r
GroupItem *insideGroup = searchGroupItemById(idGroup, topScene);\r
+ BoxItem* upperItem = NULL;\r
if(insideGroup == NULL) cout << "group null" << endl;\r
- BlockItem *blockItem = new BlockItem(insideGroup->getRefBlock(), dispatcher, this);\r
- blockItem->setChildGroupItem(insideGroup);\r
- blockItem->setId(id);\r
- blockItem->setPos(posX,posY);\r
- blockItem->setDimension(dimX,dimY);\r
+ // now search within the scene which BoxItem has a childItem that is = to insideGroup\r
+ QList<BoxItem *> lst = currentScene->getBlockItems();\r
+ foreach(BoxItem* item, lst) {\r
+ if (item->getChildGroupItem() == insideGroup) {\r
+ upperItem = item;\r
+ break;\r
+ }\r
+ }\r
+ if (upperItem == NULL) {\r
+ throw(Exception(PROJECTFILE_CORRUPTED));\r
+ }\r
\r
- ((GroupItem*)currentScene->getGroupItem())->addBlockItem(blockItem);\r
- currentScene->addItem(blockItem);\r
- currentScene->addBlockItem(blockItem);\r
+ upperItem->setId(id);\r
+ upperItem->setPos(posX,posY);\r
+ upperItem->setDimension(dimX,dimY);\r
\r
+ // set interfaces of this BoxItem\r
QDomNodeList interfaceNodes = currentBiGroup.elementsByTagName("big_iface");\r
\r
for(int k=0; k<interfaceNodes.length(); k++){\r
double position = currentInterfaceNode.attribute("position","none").toDouble(&ok);\r
if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
\r
- GroupInterface *refInter = (GroupInterface*)insideGroup->searchInterfaceByName(refName)->refInter;\r
- InterfaceItem *ifaceItem = new InterfaceItem(position, orientation, refInter, blockItem, this);\r
+ ConnectedInterface *refInter = insideGroup->searchInterfaceByName(refName)->refInter;\r
+ InterfaceItem *ifaceItem = new InterfaceItem(position, orientation, refInter, upperItem, this);\r
ifaceItem->setId(id);\r
- blockItem->addInterface(ifaceItem);\r
+ upperItem->addInterface(ifaceItem);\r
}\r
}\r
}\r
cout << "blockItems \"group\" loaded and created succefully!" << endl;\r
\r
-\r
- for(int i=0; i<scenesNodes.length(); i++){\r
- QDomElement currentSceneNode = scenesNodes.at(i).toElement();\r
-\r
- QDomElement groupItemNode = currentSceneNode.firstChildElement("group_item");\r
-\r
- int id = groupItemNode.attribute("id","none").toInt(&ok);\r
- if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
- int idUpperItem = groupItemNode.attribute("upper_item","none").toInt(&ok);\r
- if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
-\r
- BlockItem *currentItem = searchBlockItemById(id,topScene);\r
- GroupItem *upperItem = searchGroupItemById(idUpperItem, topScene);\r
-\r
- if(currentItem != NULL && upperItem != NULL){\r
- currentItem->setUpperItem(upperItem);\r
- }\r
- }\r
-\r
QDomNodeList connectionNodes = root.elementsByTagName("connection");\r
\r
for(int i=0; i<connectionNodes.length(); i++){\r
cout << "interfaces not found, connect canceled!" << endl;\r
}\r
}\r
+ cout << "connections loaded and created succefully!" << endl;\r
\r
-#endif\r
+ return topGroup;\r
}\r
\r
void Parameters::loadBlastConfiguration(QString confFile) throw(Exception) {\r
class BoxItem;\r
class InterfaceItem;\r
class Graph;\r
+class GroupWidget;\r
\r
#include "BlockImplementation.h"\r
\r
void clear();\r
\r
QDomElement openProjectFile(const QString& projectFileName) throw(Exception);\r
- void loadProject(QDomElement root);\r
+ GroupWidget *loadProject(QDomElement root) throw(Exception);\r
\r
void loadBlastConfiguration(QString confFile) throw(Exception);\r
void loadReferencesFromXml() throw(Exception);\r
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 3.2.1, 2017-04-27T20:11:44. -->
+<!-- Written by QtCreator 3.2.1, 2017-05-03T08:26:25. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
</xs:simpleType>
</xs:attribute>
+ <xs:attribute name="upper_scene">
+ <xs:simpleType>
+ <xs:restriction base="xs:integer">
+ <xs:minInclusive value="-1"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+
<xs:attribute name="upper_group">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:complexType>
<xs:group ref="sceneElmtGroup"/>
<xs:attribute ref="id"/>
+ <xs:attribute ref="upper_scene"/>
</xs:complexType>
</xs:element>