+
+void BlockLibraryWidget::updateBoxConn() {
+ if (params->autoConnMainClk) {
+ radAutoClk->setChecked(true);
+ //enableAvailableClocks(false);
+ }
+ else {
+ radChooseClk->setChecked(true);
+ //enableAvailableClocks(true);
+ }
+ QString msg = "Auto-connect to main clk/rst (ext_clk_0 at ";
+ msg += QString::number(params->clocks.at(0));
+ msg += " MHz)";
+ radAutoClk->setText(msg);
+}
+
+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) {
+ delete [] comboClkGen;
+ nbClock = 0;
+ }
+ if (nbRst != 0) {
+ delete [] comboRstGen;
+ nbRst = 0;
+ }
+
+ if ((idCat == -1) || (idBlock == -1)) return;
+
+ QList<AbstractInterface*> lstClocks = currentRefBlock->getInterfaces(AbstractInterface::Input, AbstractInterface::Clock);
+ nbClock = lstClocks.size();
+ QList<AbstractInterface*> lstRst = currentRefBlock->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++;
+ }
+}
+
+void BlockLibraryWidget::enableAvailableClocks(bool state) {
+
+ if (state == false) {
+ stack->setCurrentIndex(0);
+ }
+ else {
+ stack->setCurrentIndex(1);
+ }
+}
+