//cout << "block abs. pos: " << absPos.x() << "," << absPos.y() << " | ";
//cout << "block current. pos: " << currentPosition.x() << "," << currentPosition.y() << " | ";
- if ((gapX < 0) && (absPos.x() == marginConn)) {
+ if ((position == Left) || (position == Right)) {
+ gapX = 0;
+ }
+ else if ((gapX < 0) && (absPos.x() == marginConn)) {
gapX = 0;
}
else if (absPos.x()+gapX < marginConn) {
gapX = marginConn-absPos.x();
}
- if ((gapY < 0) && (absPos.y() == marginConn)) {
+ if ((position == Top) || (position == Bottom)) {
+ gapY = 0;
+ }
+ else if ((gapY < 0) && (absPos.y() == marginConn)) {
gapY = 0;
}
else if (absPos.y()+gapY < marginConn) {
if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
int dimY = dimensionStr.at(1).toInt(&ok);
if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
+
+ QString visStr = funcElement.attribute("visible","none");
+ bool showItem = true;
+ if (visStr == "false") {
+ showItem = false;
+ }
ReferenceBlock *referenceMd5 = NULL;
ReferenceBlock *referenceXml = NULL;
}
GroupBlock* parentGroupBlock = AB_TO_GRP(((GroupItem *)parentItem())->getRefBlock());
- FunctionalBlock* functionalBlock = params->getGraph()->createFunctionalBlock(parentGroupBlock, reference);
+ FunctionalBlock* functionalBlock = params->getGraph()->createFunctionalBlock(parentGroupBlock, reference, false);
/* NB: addFunctionalBlock creates all interfaces from the reference, which is annoying when
reading bif_iface tags. Thus interface are all removed.
*/
}
// recreate all (non-control) interfaces because of some may have a multiplicity>1 with several examplars
- functionalBlock->removeAllInterfaces();
+ //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++) {
functionalBlock->addInterface(ctlIface);
}
}
- // connect clk and rst to group clk/rst or to clkrstgen
- if ((name != "clkrstgen") && (parentGroupBlock != NULL)) {
- try {
- functionalBlock->connectClkReset();
- }
- catch(Exception e) {
- AbstractBlock* source = (AbstractBlock *)(e.getSource());
- cerr << qPrintable(source->getName()) << ":" << qPrintable(e.getMessage()) << endl;
- throw(e);
- }
- }
// creating InterfaceItem
createInterfaceItems();
interfaceItem->setOrientation(orientation);
interfaceItem->setPositionRatio(position);
}
+ setVisible(showItem);
updateGeometry(Resize);
}
writer.writeAttribute("position",attrPos);
QString attrDim = QString::number(getWidth()).append(",").append(QString::number(getHeight()));
writer.writeAttribute("dimension",attrDim);
+ if (!isVisible()) {
+ writer.writeAttribute("visible","false");
+ }
writer.writeStartElement("bif_parameters");
foreach(BlockParameter *param,refBlock->getParameters()){