Skip to content

Commit

Permalink
[CORRECTIVE] Fix initiator/master interface binding label alignment i…
Browse files Browse the repository at this point in the history
…n address space editor
  • Loading branch information
hagantsa committed Nov 23, 2023
1 parent d65d425 commit 53894d9
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 34 deletions.
49 changes: 31 additions & 18 deletions editors/ComponentEditor/addressSpaces/addressspacegeneraleditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ addrUnitEditor_(this),
rangeEditor_(new ExpressionEditor(parameterFinder, this)),
widthEditor_(new ExpressionEditor(parameterFinder, this)),
isPresentEditor_(new ExpressionEditor(parameterFinder, this)),
masterInterfaceBindingLabel_(new QLabel(this))
initiatorInterfaceBindingLabel_(new QLabel(this))
{
Q_ASSERT(addrSpace_);

Expand Down Expand Up @@ -74,21 +74,7 @@ masterInterfaceBindingLabel_(new QLabel(this))
widthEditor_->setAppendingCompleter(widthEditorCompleter);
isPresentEditor_->setAppendingCompleter(isPresentEditorCompleter);

QFormLayout* layout = new QFormLayout(this);
layout->addRow(tr("Addressable unit bits (AUB):"),&addrUnitEditor_);
layout->addRow(tr("Range (=size) [AUB], f(x):"), rangeEditor_);
layout->addRow(tr("Width [bits], f(x):"), widthEditor_);

if (docRevision == Document::Revision::Std22)
{
layout->addRow(tr("Initiator interface binding(s):"), masterInterfaceBindingLabel_);
isPresentEditor_->setVisible(false);
}
else
{
layout->addRow(tr("Is present, f(x):"), isPresentEditor_);
layout->addRow(tr("Master interface binding(s):"), masterInterfaceBindingLabel_);
}
setupLayout(docRevision);

refresh(busInterfaceNames);

Expand Down Expand Up @@ -160,11 +146,11 @@ void AddressSpaceGeneralEditor::refresh(QStringList masterInterfaceNames)

if (masterInterfaceNames.isEmpty())
{
masterInterfaceBindingLabel_->setText(tr("No binding"));
initiatorInterfaceBindingLabel_->setText(tr("No binding"));
}
else
{
masterInterfaceBindingLabel_->setText(masterInterfaceNames.join(", "));
initiatorInterfaceBindingLabel_->setText(masterInterfaceNames.join(", "));
}
}

Expand Down Expand Up @@ -219,6 +205,33 @@ void AddressSpaceGeneralEditor::onIsPresentChanged()
emit contentChanged();
}

//-----------------------------------------------------------------------------
// Function: AddressSpaceGeneralEditor::setupLayout()
//-----------------------------------------------------------------------------
void AddressSpaceGeneralEditor::setupLayout(Document::Revision docRevision)
{
QVBoxLayout* topLayout = new QVBoxLayout(this);

QFormLayout* layout = new QFormLayout();
layout->addRow(tr("Addressable unit bits (AUB):"), &addrUnitEditor_);
layout->addRow(tr("Range (=size) [AUB], f(x):"), rangeEditor_);
layout->addRow(tr("Width [bits], f(x):"), widthEditor_);

if (docRevision == Document::Revision::Std22)
{
layout->addRow(tr("Initiator interface binding(s):"), initiatorInterfaceBindingLabel_);
isPresentEditor_->setVisible(false);
}
else
{
layout->addRow(tr("Is present, f(x):"), isPresentEditor_);
layout->addRow(tr("Master interface binding(s):"), initiatorInterfaceBindingLabel_);
}

topLayout->addLayout(layout);
topLayout->addStretch(1); // For initiator/master interface binding label alignment
}

//-----------------------------------------------------------------------------
// Function: AddressSpaceGeneralEditor::format()
//-----------------------------------------------------------------------------
Expand Down
16 changes: 11 additions & 5 deletions editors/ComponentEditor/addressSpaces/addressspacegeneraleditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ class AddressSpaceGeneralEditor : public QGroupBox
//! The destructor.
virtual ~AddressSpaceGeneralEditor();

//! No copying. No assignment.
AddressSpaceGeneralEditor(const AddressSpaceGeneralEditor& other) = delete;
AddressSpaceGeneralEditor& operator=(const AddressSpaceGeneralEditor& other) = delete;

/*!
* Check if the editor is in valid state and can be saved.
*
Expand Down Expand Up @@ -129,10 +133,12 @@ private slots:
void onIsPresentChanged();

private:
//! No copying. No assignment.
AddressSpaceGeneralEditor(const AddressSpaceGeneralEditor& other);
AddressSpaceGeneralEditor& operator=(const AddressSpaceGeneralEditor& other);

/*!
* Set up the layout for the editor.
*/
void setupLayout(Document::Revision docRevision);

/*!
* Formats a given expression to human-readable format.
*
Expand Down Expand Up @@ -164,8 +170,8 @@ private slots:
//! Editor to set the is presence property of address space.
ExpressionEditor* isPresentEditor_;

//! Label for the master interface binding(s).
QLabel* masterInterfaceBindingLabel_;
//! Label for the initiator/master interface binding(s).
QLabel* initiatorInterfaceBindingLabel_;
};

#endif // ADDRESSSPACEGENERALEDITOR_H
4 changes: 0 additions & 4 deletions editors/ComponentEditor/memoryMaps/SingleMemoryMapEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,6 @@ void SingleMemoryMapEditor::setupLayout()
topOfPageLayout = layout;
}

//QHBoxLayout* topOfPageLayout = new QHBoxLayout();
//topOfPageLayout->addWidget(&nameEditor_, 0);
//topOfPageLayout->addWidget(memoryMapDefinitionGroup, 0);

QWidget* topOfPageWidget = new QWidget();
topOfPageWidget->setSizeIncrement(QSizePolicy::Expanding, QSizePolicy::Maximum);
topOfPageWidget->setLayout(topOfPageLayout);
Expand Down
14 changes: 7 additions & 7 deletions version.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
#ifndef VERSIONNO__H
#define VERSIONNO__H

#define VERSION_FULL 3.12.1051.0
#define VERSION_FULL 3.12.1066.0

#define VERSION_BASEYEAR 0
#define VERSION_DATE "2023-11-23"
#define VERSION_TIME "10:00:36"
#define VERSION_TIME "12:31:39"

#define VERSION_MAJOR 3
#define VERSION_MINOR 12
#define VERSION_BUILDNO 1051
#define VERSION_BUILDNO 1066
#define VERSION_EXTEND 0

#define VERSION_FILE 3,12,1051,0
#define VERSION_PRODUCT 3,12,1051,0
#define VERSION_FILESTR "3,12,1051,0"
#define VERSION_PRODUCTSTR "3,12,1051,0"
#define VERSION_FILE 3,12,1066,0
#define VERSION_PRODUCT 3,12,1066,0
#define VERSION_FILESTR "3,12,1066,0"
#define VERSION_PRODUCTSTR "3,12,1066,0"

#endif

0 comments on commit 53894d9

Please sign in to comment.