Ejemplo n.º 1
0
void ParameterEditor::updateControls(SourceImplPtr p)
{
    controlWidget->hide();
    controlLayout->removeWidget(controlWidget);
    controlWidget->deleteLater();
    if (p) {
        FrameGui *fg = p->controls(this);
        controlWidget = fg;
        assert (controlWidget);
        connect (fg,SIGNAL(graphicsChanged()),this,SLOT(updateDisplay()));
        ShowTreeWidgetItem *st = root;
        st = st->locateData(p);
        if (st){
             connect (fg,SIGNAL(graphicsChanged()),st,SLOT(setIcon()));
        }
        controlLayout->addWidget(controlWidget,2,0,1,2);
	playback = boost::make_shared<Playback>(p);
        if (p->numChildren()){
            playbutton->setEnabled(true);
            stopbutton->setEnabled(true);
        } else {
            playbutton->setDisabled(true);
            stopbutton->setDisabled(true);
            stopButtonData(true);
        }
    } else {
      playbutton->setDisabled(true);
      stopbutton->setDisabled(true);
      stopButtonData(true);
      playback =  PlaybackPtr();
    }
    updateDisplay();
    controlWidget->show();
    update();
}
Ejemplo n.º 2
0
//-----------------------------------------------------------------------------
// Function: AddressSpaceEditor::AddressSpaceEditor()
//-----------------------------------------------------------------------------
AddressSpaceEditor::AddressSpaceEditor(QSharedPointer<Component> component, 
    LibraryInterface* handler,
    QSharedPointer<AddressSpace> addrSpace,
    QSharedPointer <ParameterFinder> parameterFinder,
    QSharedPointer <ExpressionFormatter> expressionFormatter,
    QSharedPointer<ExpressionParser> expressionParser,
    QWidget* parent):
ItemEditor(component, handler, parent),
    addrSpace_(addrSpace),
    nameEditor_(addrSpace->getNameGroup(), this),
    generalEditor_(addrSpace, component->getMasterInterfaces(addrSpace_->getName()), parameterFinder,
                   expressionParser, this),
    segmentsEditor_(addrSpace, component, handler->getDirectoryPath(*component->getVlnv()), parameterFinder,
                    expressionParser, expressionFormatter, this),
    localMemMapEditor_(addrSpace->getLocalMemoryMap(), component, handler, parameterFinder, expressionFormatter, 
                       this)
{
	Q_ASSERT(addrSpace_);

    nameEditor_.setTitle(tr("Address space name and description"));

    connect(&nameEditor_, SIGNAL(contentChanged()),	this, SIGNAL(contentChanged()), Qt::UniqueConnection);

    connect(&generalEditor_, SIGNAL(contentChanged()), this, SIGNAL(contentChanged()), Qt::UniqueConnection);
    connect(&generalEditor_, SIGNAL(graphicsChanged()), this, SIGNAL(graphicsChanged()), Qt::UniqueConnection);

    connect(&generalEditor_, SIGNAL(increaseReferences(QString)),
        this, SIGNAL(increaseReferences(QString)), Qt::UniqueConnection);
    connect(&generalEditor_, SIGNAL(decreaseReferences(QString)),
        this, SIGNAL(decreaseReferences(QString)), Qt::UniqueConnection);

    connect(&segmentsEditor_, SIGNAL(contentChanged()), this, SIGNAL(contentChanged()), Qt::UniqueConnection);
    connect(&segmentsEditor_, SIGNAL(contentChanged()), this, SIGNAL(graphicsChanged()), Qt::UniqueConnection);

    connect(&segmentsEditor_, SIGNAL(errorMessage(const QString&)),
        this, SIGNAL(errorMessage(const QString&)), Qt::UniqueConnection);
    connect(&segmentsEditor_, SIGNAL(noticeMessage(const QString&)),
        this, SIGNAL(noticeMessage(const QString&)), Qt::UniqueConnection);

	connect(&localMemMapEditor_, SIGNAL(contentChanged()), this, SIGNAL(contentChanged()), Qt::UniqueConnection);
    connect(&localMemMapEditor_, SIGNAL(graphicsChanged()), this, SIGNAL(graphicsChanged()), Qt::UniqueConnection);
    connect(&localMemMapEditor_, SIGNAL(errorMessage(const QString&)),
        this, SIGNAL(errorMessage(const QString&)), Qt::UniqueConnection);
	connect(&localMemMapEditor_, SIGNAL(itemAdded(int)),
		this, SIGNAL(childAdded(int)), Qt::UniqueConnection);
	connect(&localMemMapEditor_, SIGNAL(itemRemoved(int)),
		this, SIGNAL(childRemoved(int)), Qt::UniqueConnection);

    connect(&localMemMapEditor_, SIGNAL(increaseReferences(QString)),
        this, SIGNAL(increaseReferences(QString)), Qt::UniqueConnection);
    connect(&localMemMapEditor_, SIGNAL(decreaseReferences(QString)),
        this, SIGNAL(decreaseReferences(QString)), Qt::UniqueConnection);

    setupLayout();

	refresh();
}
Ejemplo n.º 3
0
void StaticFrameGui::set (StaticFrame * p)
{
    fp = p;
    assert (fp);

    dewellSwitch->setChecked(fp->useDewell);
    repeatSwitch->setChecked(!fp->useDewell);
    dewellEntry->setDisabled(!fp->useDewell);
    repeatEntry->setDisabled(fp->useDewell);
    pointsDisplay->setNum((int)fp->data.size());
    dewellEntry->setValue(fp->dewell);
    repeatEntry->setValue (fp->repeats);
    size->setValue(100.0 * log10 (fp->scale));

    connect (group,SIGNAL(buttonClicked(int)),this,SLOT(buttonChangedData(int)));
    connect (dewellEntry,SIGNAL(valueChanged(int)),this,SLOT(dewellChangedData(int)));
    connect (repeatEntry,SIGNAL(valueChanged(int)),this,SLOT(repeatChangedData(int)));
    connect (size,SIGNAL(valueChanged(int)),this,SLOT(scaleChanged(int)));
    emit graphicsChanged();
}
Ejemplo n.º 4
0
void StaticFrameGui::scaleChanged(int v)
{
    fp->scale = pow (10.0,v/100.0);
    emit graphicsChanged(); // update the thumbnail
}
Ejemplo n.º 5
0
void StaticFrameGui::angleChangedData(QQuaternion q)
{
    fp->geometry = arcball->rotate();
    emit graphicsChanged(); //Update the thumbnail
}
Ejemplo n.º 6
0
//-----------------------------------------------------------------------------
// Function: LocalMemoryMapEditor::LocalMemoryMapEditor()
//-----------------------------------------------------------------------------
LocalMemoryMapEditor::LocalMemoryMapEditor(QSharedPointer<MemoryMap> memoryMap,
                                           QSharedPointer<Component> component,
                                           LibraryInterface* handler,
                                           QSharedPointer<ParameterFinder> parameterFinder,
                                           QSharedPointer<ExpressionFormatter> expressionFormatter,
                                           QWidget *parent)
    : QGroupBox(tr("Local memory map"), parent),
      localMemoryMap_(memoryMap),
      nameEditor_(new NameGroupEditor(memoryMap->getNameGroup(), this)),
      view_(new EditableTableView(this)),
      model_(0),
      component_(component),
      handler_(handler)
{
    setCheckable(true);
    setChecked(!localMemoryMap_->isEmpty());

    nameEditor_->setTitle(tr("Memory map name and description"));

    QSharedPointer<IPXactSystemVerilogParser> expressionParser(new IPXactSystemVerilogParser(parameterFinder));

    model_ = new MemoryMapModel(memoryMap, component->getChoices(), expressionParser, parameterFinder,
        expressionFormatter, this);

    ComponentParameterModel* componentParameterModel = new ComponentParameterModel(parameterFinder, this);
    componentParameterModel->setExpressionParser(expressionParser);

    ParameterCompleter* parameterCompleter = new ParameterCompleter(this);
    parameterCompleter->setModel(componentParameterModel);

    ExpressionProxyModel* proxy = new ExpressionProxyModel(expressionParser, this);
    proxy->setColumnToAcceptExpressions(MemoryMapColumns::BASE_COLUMN);
    proxy->setColumnToAcceptExpressions(MemoryMapColumns::RANGE_COLUMN);

	proxy->setSourceModel(model_);
	view_->setModel(proxy);

	// display a label on top the table
	SummaryLabel* summaryLabel = new SummaryLabel(tr("Address blocks"), this);

	proxy->setSourceModel(model_);
	view_->setModel(proxy);

	const QString compPath = handler_->getDirectoryPath(*component_->getVlnv());
	QString defPath = QString("%1/localAddrBlockList.csv").arg(compPath);
	view_->setDefaultImportExportPath(defPath);
	view_->setAllowImportExport(true);

	// items can not be dragged
	view_->setItemsDraggable(false);
    view_->setItemDelegate(new MemoryMapDelegate(parameterCompleter, parameterFinder, this));
	view_->setSortingEnabled(true);

	view_->sortByColumn(MemoryMapColumns::BASE_COLUMN, Qt::AscendingOrder);

    connect(this, SIGNAL(toggled(bool)), this, SLOT(onCheckStateChanged()), Qt::UniqueConnection);

	connect(nameEditor_, SIGNAL(contentChanged()), this, SIGNAL(contentChanged()), Qt::UniqueConnection);
    
	connect(model_, SIGNAL(contentChanged()), this, SIGNAL(contentChanged()), Qt::UniqueConnection);
	connect(model_, SIGNAL(itemAdded(int)), this, SIGNAL(itemAdded(int)), Qt::UniqueConnection);
	connect(model_, SIGNAL(itemRemoved(int)), this, SIGNAL(itemRemoved(int)), Qt::UniqueConnection);
    
    connect(model_, SIGNAL(graphicsChanged()), this, SIGNAL(graphicsChanged()), Qt::UniqueConnection);
    connect(model_, SIGNAL(itemAdded(int)), this, SIGNAL(graphicsChanged()), Qt::UniqueConnection);
    connect(model_, SIGNAL(itemRemoved(int)), this, SIGNAL(graphicsChanged()), Qt::UniqueConnection);

	// connect view to model
	connect(view_, SIGNAL(addItem(const QModelIndex&)),
        model_, SLOT(onAddItem(const QModelIndex&)), Qt::UniqueConnection);
	connect(view_, SIGNAL(removeItem(const QModelIndex&)),
		model_, SLOT(onRemoveItem(const QModelIndex&)), Qt::UniqueConnection);

    connect(view_->itemDelegate(), SIGNAL(increaseReferences(QString)),
        this, SIGNAL(increaseReferences(QString)), Qt::UniqueConnection);
    connect(view_->itemDelegate(), SIGNAL(decreaseReferences(QString)),
        this, SIGNAL(decreaseReferences(QString)), Qt::UniqueConnection);

    connect(model_, SIGNAL(decreaseReferences(QString)),
        this, SIGNAL(decreaseReferences(QString)), Qt::UniqueConnection);

	QVBoxLayout* layout = new QVBoxLayout(this);
	layout->addWidget(nameEditor_);
	layout->addWidget(summaryLabel, 0, Qt::AlignCenter);
	layout->addWidget(view_);
}