cout << "adding block to scene " << v.toInt() << endl;
QHash<QString, int> clkRstToGen;
- for(int i=0;i<layClkRst->rowCount();i++) {
+ for(int i=1;i<nbClock+nbRst;i++) {
QLayoutItem* item = layClkRst->itemAtPosition(i,0);
QLabel* lab = (QLabel *)(item->widget());
item = layClkRst->itemAtPosition(i,1);
QComboBox* combo = (QComboBox *)(item->widget());
clkRstToGen.insert(lab->text(),combo->currentIndex());
+ cout << "addblock: have to connect " << qPrintable(lab->text()) << " to clk/rst n° " << combo->currentIndex() << endl;
}
QWidget* widget = layClkRst->itemAt(0)->widget();
layClkRst->removeWidget(widget);
delete widget;
- }
+ }
if (nbClock != 0) {
delete [] comboClkGen;
nbClock = lstClocks.size();
QList<AbstractInterface*> lstRst = currentRefBlock->getInterfaces(AbstractInterface::Input, AbstractInterface::Reset);
nbRst = lstRst.size();
+ cout << "For chosen block there are " << nbClock << " clocks and " << nbRst << " resets" << endl;
comboClkGen = new QComboBox*[lstClocks.size()];
for(int i=0;i<lstClocks.size();i++) {