+
+void BlockLibraryWidget::updateComboScene() {
+ comboScenes->clear();
+ QMap<int,QString> list = dispatcher->getAllGroupNames();
+ QMapIterator<int,QString> iter(list);
+ while (iter.hasNext()) {
+ iter.next();
+ comboScenes->addItem(iter.value(),QVariant(iter.key()));
+ }
+}
+
+void BlockLibraryWidget::updateClkRst(int idCat, int idBlock) {
+
+ while (layClkRst->count() > 0) {
+ QWidget* widget = layClkRst->itemAt(0)->widget();
+ layClkRst->removeWidget(widget);
+ delete widget;
+ }
+
+ if (nbClock != 0) {
+ for(int i=0;i<nbClock;i++) {
+ comboClkGen[i]->deleteLater();
+ }
+ delete [] comboClkGen;
+ }
+ if (nbRst != 0) {
+ for(int i=0;i<nbRst;i++) {
+ comboRstGen[i]->deleteLater();
+ }
+ delete [] comboRstGen;
+ }
+
+ ReferenceBlock* ref = params->getReferenceBlock(idCat,idBlock);
+ QList<AbstractInterface*> lstClocks = ref->getInterfaces(AbstractInterface::Input, AbstractInterface::Clock);
+ nbClock = lstClocks.size();
+ QList<AbstractInterface*> lstRst = ref->getInterfaces(AbstractInterface::Input, AbstractInterface::Reset);
+ nbRst = lstRst.size();
+
+ comboClkGen = new QComboBox*[lstClocks.size()];
+ for(int i=0;i<lstClocks.size();i++) {
+ comboClkGen[i] = new QComboBox();
+ QString name = "";
+ int id = 0;
+ foreach(double d, params->clocks) {
+ name = "ext_clk_"+QString::number(id)+" (";
+ name += QString::number(d) + " MHz)";
+ comboClkGen[i]->addItem(name);
+ id++;
+ }
+ }
+
+ comboRstGen = new QComboBox*[lstRst.size()];
+ for(int i=0;i<lstRst.size();i++) {
+ comboRstGen[i] = new QComboBox();
+ QString name = "";
+ for(int j=0;j<params->clocks.size();j++) {
+ name = "ext_rst_"+QString::number(j);
+ comboRstGen[i]->addItem(name);
+ }
+ }
+ layClkRst->addWidget(new QLabel("Clock/Reset name"), 0, 0);
+ layClkRst->addWidget(new QLabel("connect to"), 0, 1);
+ int row = 1;
+ foreach(AbstractInterface* iface, lstClocks) {
+ layClkRst->addWidget(new QLabel(iface->getName()), row,0);
+ layClkRst->addWidget(comboClkGen[row-1],row, 1);
+ row++;
+ }
+ foreach(AbstractInterface* iface, lstRst) {
+ layClkRst->addWidget(new QLabel(iface->getName()), row,0);
+ layClkRst->addWidget(comboRstGen[row-1-nbClock],row, 1);
+ row++;
+ }
+
+}