Skip to content

Commit

Permalink
Merge branch 'std-update' of github.com:kactus2/kactus2dev into std-u…
Browse files Browse the repository at this point in the history
…pdate
  • Loading branch information
epekkar committed Dec 8, 2023
2 parents 03caf9c + cf9c726 commit c9144f4
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 41 deletions.
2 changes: 1 addition & 1 deletion IPXACTmodels/Component/validators/ComponentValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ bool ComponentValidator::hasValidDesignConfigurationInstantiations(QSharedPointe
*component->getDesignConfigurationInstantiations())
{
if (instantiationNames.contains(instantiation->name()) ||
!instantiationsValidator_->validateDesignConfigurationInstantiation(instantiation, component->getRevision()))
!instantiationsValidator_->validateDesignConfigurationInstantiation(instantiation))
{
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void InstantiationsValidator::findErrorsInDesignInstantiation(QVector<QString>&
// Function: InstantiationsValidator::validateDesignConfigurationInstantiation()
//-----------------------------------------------------------------------------
bool InstantiationsValidator::validateDesignConfigurationInstantiation(
QSharedPointer<DesignConfigurationInstantiation> instantiation, Document::Revision docRevision) const
QSharedPointer<DesignConfigurationInstantiation> instantiation) const
{
return hasValidName(instantiation->name()) && hasValidDesignConfigurationReference(instantiation) &&
hasValidParameters(instantiation->getParameters());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class IPXACTMODELS_EXPORT InstantiationsValidator
*
* @return True, if the design configuration instantiation is valid IP-XACT, otherwise false.
*/
bool validateDesignConfigurationInstantiation(QSharedPointer<DesignConfigurationInstantiation> instantiation, Document::Revision docRevision) const;
bool validateDesignConfigurationInstantiation(QSharedPointer<DesignConfigurationInstantiation> instantiation) const;

/*!
* Check if the design configuration reference is valid.
Expand Down
10 changes: 8 additions & 2 deletions editors/ComponentEditor/memoryMaps/FieldAccessPoliciesModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,15 @@ QStringList FieldAccessPoliciesModel::mimeTypes() const
//-----------------------------------------------------------------------------
void FieldAccessPoliciesModel::onAddRow(QModelIndex const& index)
{
int lastRow = fieldInterface_->getAccessPolicyCount(fieldName_);
int row = fieldInterface_->getAccessPolicyCount(fieldName_);

beginInsertRows(QModelIndex(), lastRow, lastRow);
// if the index is valid then add the item to the correct position
if (index.isValid())
{
row = index.row();
}

beginInsertRows(QModelIndex(), row, row);
fieldInterface_->addFieldAccessPolicy(fieldName_);
endInsertRows();

Expand Down
2 changes: 0 additions & 2 deletions editors/ComponentEditor/modes/PortSliceDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

#include <editors/ComponentEditor/common/ReferenceSelector/ReferenceSelector.h>

#include <editors/ComponentEditor/remapStates/ValueOrIndexedValueEditor.h>

#include <IPXACTmodels/common/Choice.h>

#include <QCompleter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ arrayView_(new ArrayView(this)),
expressionParser_(parser),
parameterFinder_(finder),
expressionFormatter_(formatter),
parameterModel_(new ComponentParameterModel(finder, this))
parameterModel_(new ComponentParameterModel(finder, this)),
docRevision_(docRevision)
{
parameterModel_->setExpressionParser(parser);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ QString SingleDesignConfigurationInstantiationItem::text() const
//-----------------------------------------------------------------------------
bool SingleDesignConfigurationInstantiationItem::isValid() const
{
return validator_->validateDesignConfigurationInstantiation(instantiation_, component_->getRevision());
return validator_->validateDesignConfigurationInstantiation(instantiation_);
}

//-----------------------------------------------------------------------------
Expand Down
51 changes: 27 additions & 24 deletions editors/ComponentEditor/visualization/memoryvisualizationitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,36 +240,39 @@ void MemoryVisualizationItem::fillGapsBetweenChildren()
// Function: MemoryVisualizationItem::markConflictingChildren()
//-----------------------------------------------------------------------------
void MemoryVisualizationItem::markConflictingChildren()
{
const auto offset = getOffset();
const auto lastAddress = getLastAddress();

quint64 highestAddressInUse = offset;

{
for (auto child = childItems_.begin(); child != childItems_.end(); ++child)
{
if (auto& current = child.value(); current->isPresent())
{
auto const& currentOffset = child.key();
markChildIfConflicting(child.value());
}
}

//-----------------------------------------------------------------------------
// Function: MemoryVisualizationItem::markChildIfConflicting()
//-----------------------------------------------------------------------------
void MemoryVisualizationItem::markChildIfConflicting(MemoryVisualizationItem* child)
{
if (!child || !child->isPresent())
{
return;
}

bool overlaps = currentOffset > offset && currentOffset <= highestAddressInUse;
bool isOutsideBounds = currentOffset < offset || current->getLastAddress() > lastAddress;
auto parentOffset = getOffset();
auto lastAddress = getLastAddress();

current->setConflicted(overlaps || isOutsideBounds);
auto const& currentChildOffset = child->getOffset();

if (overlaps)
{
// Mark any overlapping items conflicted.
for (auto preceding = childItems_.begin(); preceding != child; ++preceding)
{
if ((*preceding)->getLastAddress() >= currentOffset)
{
(*preceding)->setConflicted(true);
}
}
}
bool isOutsideBounds = currentChildOffset < parentOffset || child->getLastAddress() > lastAddress;

child->setConflicted(isOutsideBounds);

highestAddressInUse = qMax(current->getLastAddress(), highestAddressInUse);
// Check overlap with preceding children. Mark any overlapping items conflicted.
for (auto precedingChild = childItems_.begin(); precedingChild.value() != child; ++precedingChild)
{
if ((*precedingChild)->getLastAddress() >= currentChildOffset)
{
(*precedingChild)->setConflicted(true);
child->setConflicted(true);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ protected slots:

//! Mark all invalid children outside item boundaries.
virtual void markConflictingChildren();

//! Handler for mouse press events
virtual void mousePressEvent(QGraphicsSceneMouseEvent* event);

Expand All @@ -182,6 +182,13 @@ protected slots:
*/
bool emptySpaceBeforeChild(MemoryVisualizationItem const* current, quint64 lastAddressInUse) const;

/*!
* Mark child and its preceding children conflicting, if overlapping.
*
* @param [in] child The child to check.
*/
void markChildIfConflicting(MemoryVisualizationItem* child);

/*!
* Creates a new child for representing a free memory slot.
*
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.1140.0
#define VERSION_FULL 3.12.1142.0

#define VERSION_BASEYEAR 0
#define VERSION_DATE "2023-12-07"
#define VERSION_TIME "08:39:20"
#define VERSION_TIME "13:01:29"

#define VERSION_MAJOR 3
#define VERSION_MINOR 12
#define VERSION_BUILDNO 1140
#define VERSION_BUILDNO 1142
#define VERSION_EXTEND 0

#define VERSION_FILE 3,12,1140,0
#define VERSION_PRODUCT 3,12,1140,0
#define VERSION_FILESTR "3,12,1140,0"
#define VERSION_PRODUCTSTR "3,12,1140,0"
#define VERSION_FILE 3,12,1142,0
#define VERSION_PRODUCT 3,12,1142,0
#define VERSION_FILESTR "3,12,1142,0"
#define VERSION_PRODUCTSTR "3,12,1142,0"

#endif

0 comments on commit c9144f4

Please sign in to comment.