parentItem = _parentItem;
if (parentItem != NULL) {
- parentItem->setChildGroupItem(this);
+ parentItem->setChildGroupItem(this);
}
/*
if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
QString nameStr = groupElement.attribute("name","none");
- if(nameStr == "none") throw(Exception(PROJECTFILE_CORRUPTED));
+ if(nameStr == "none") throw(Exception(PROJECTFILE_CORRUPTED));
QStringList positionStr = groupElement.attribute("position","none").split(",");
if(positionStr.length() != 2) throw(Exception(PROJECTFILE_CORRUPTED));
QString name = currentInterfaceNode.attribute("name","none");
if(name == "none") throw(Exception(PROJECTFILE_CORRUPTED));
+ QString purposeStr = currentInterfaceNode.attribute("purpose","none");
+ int purpose = AbstractInterface::getIntPurpose(purposeStr);
+ if(purpose == -1) throw(Exception(PROJECTFILE_CORRUPTED));
+
QString directionStr = currentInterfaceNode.attribute("direction","none");
int direction = AbstractInterface::getIntDirection(directionStr);
if(direction == -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,AbstractInterface::Data);
-
- InterfaceItem *interfaceItem = new InterfaceItem(position,orientation,groupInterface,this,params);
+
+ GroupInterface *groupIface = new GroupInterface(groupBlock,name,direction,purpose);
+ GroupInterface *groupCtlIface = new GroupInterface(groupBlock,name+"_enb",direction,AbstractInterface::Control);
+ groupCtlIface->setAssociatedIface(groupIface);
+
+ InterfaceItem *interfaceItem = new InterfaceItem(position,orientation,groupIface,this,params);
interfaceItem->setId(id);
- groupBlock->addInterface(groupInterface);
+ groupBlock->addInterface(groupIface);
+ groupBlock->addInterface(groupCtlIface);
addInterfaceItem(interfaceItem, false);
cout << "interface add to " << groupBlock->getName().toStdString() << endl;
}
writer.writeAttribute("id",QString::number(item->getId()));
writer.writeAttribute("name",item->getName());
+ writer.writeAttribute("purpose",QString(item->refInter->getPurposeString()));
writer.writeAttribute("direction",QString(item->refInter->getDirectionString()));
writer.writeAttribute("orientation",item->getStrOrientation());
writer.writeAttribute("position",QString::number(item->getPositionRatio()));