diff --git a/IPXACTmodels/Component/validators/ComponentValidator.cpp b/IPXACTmodels/Component/validators/ComponentValidator.cpp index dc0cf2c94..6c708d41c 100644 --- a/IPXACTmodels/Component/validators/ComponentValidator.cpp +++ b/IPXACTmodels/Component/validators/ComponentValidator.cpp @@ -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; } diff --git a/IPXACTmodels/Component/validators/InstantiationsValidator.cpp b/IPXACTmodels/Component/validators/InstantiationsValidator.cpp index 4a1dc648d..34fc635e5 100644 --- a/IPXACTmodels/Component/validators/InstantiationsValidator.cpp +++ b/IPXACTmodels/Component/validators/InstantiationsValidator.cpp @@ -123,7 +123,7 @@ void InstantiationsValidator::findErrorsInDesignInstantiation(QVector& // Function: InstantiationsValidator::validateDesignConfigurationInstantiation() //----------------------------------------------------------------------------- bool InstantiationsValidator::validateDesignConfigurationInstantiation( - QSharedPointer instantiation, Document::Revision docRevision) const + QSharedPointer instantiation) const { return hasValidName(instantiation->name()) && hasValidDesignConfigurationReference(instantiation) && hasValidParameters(instantiation->getParameters()); diff --git a/IPXACTmodels/Component/validators/InstantiationsValidator.h b/IPXACTmodels/Component/validators/InstantiationsValidator.h index 3098afe47..c8459968e 100644 --- a/IPXACTmodels/Component/validators/InstantiationsValidator.h +++ b/IPXACTmodels/Component/validators/InstantiationsValidator.h @@ -105,7 +105,7 @@ class IPXACTMODELS_EXPORT InstantiationsValidator * * @return True, if the design configuration instantiation is valid IP-XACT, otherwise false. */ - bool validateDesignConfigurationInstantiation(QSharedPointer instantiation, Document::Revision docRevision) const; + bool validateDesignConfigurationInstantiation(QSharedPointer instantiation) const; /*! * Check if the design configuration reference is valid. diff --git a/editors/ComponentEditor/memoryMaps/FieldAccessPoliciesModel.cpp b/editors/ComponentEditor/memoryMaps/FieldAccessPoliciesModel.cpp index 4c3b7b860..666b6cbeb 100644 --- a/editors/ComponentEditor/memoryMaps/FieldAccessPoliciesModel.cpp +++ b/editors/ComponentEditor/memoryMaps/FieldAccessPoliciesModel.cpp @@ -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(); diff --git a/editors/ComponentEditor/modes/PortSliceDelegate.cpp b/editors/ComponentEditor/modes/PortSliceDelegate.cpp index 41680691d..0869f9b61 100644 --- a/editors/ComponentEditor/modes/PortSliceDelegate.cpp +++ b/editors/ComponentEditor/modes/PortSliceDelegate.cpp @@ -18,8 +18,6 @@ #include -#include - #include #include diff --git a/editors/ComponentEditor/remapStates/ValueOrIndexedValueEditor.cpp b/editors/ComponentEditor/remapStates/ValueOrIndexedValueEditor.cpp index 53269e27d..de41c8077 100644 --- a/editors/ComponentEditor/remapStates/ValueOrIndexedValueEditor.cpp +++ b/editors/ComponentEditor/remapStates/ValueOrIndexedValueEditor.cpp @@ -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); diff --git a/editors/ComponentEditor/treeStructure/SingleDesignConfigurationInstantiationItem.cpp b/editors/ComponentEditor/treeStructure/SingleDesignConfigurationInstantiationItem.cpp index 1f10abddc..62285e7ae 100644 --- a/editors/ComponentEditor/treeStructure/SingleDesignConfigurationInstantiationItem.cpp +++ b/editors/ComponentEditor/treeStructure/SingleDesignConfigurationInstantiationItem.cpp @@ -56,7 +56,7 @@ QString SingleDesignConfigurationInstantiationItem::text() const //----------------------------------------------------------------------------- bool SingleDesignConfigurationInstantiationItem::isValid() const { - return validator_->validateDesignConfigurationInstantiation(instantiation_, component_->getRevision()); + return validator_->validateDesignConfigurationInstantiation(instantiation_); } //----------------------------------------------------------------------------- diff --git a/editors/ComponentEditor/visualization/memoryvisualizationitem.cpp b/editors/ComponentEditor/visualization/memoryvisualizationitem.cpp index 6f7afff82..7b780de69 100644 --- a/editors/ComponentEditor/visualization/memoryvisualizationitem.cpp +++ b/editors/ComponentEditor/visualization/memoryvisualizationitem.cpp @@ -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); } } } diff --git a/editors/ComponentEditor/visualization/memoryvisualizationitem.h b/editors/ComponentEditor/visualization/memoryvisualizationitem.h index a3c994440..9824ab448 100644 --- a/editors/ComponentEditor/visualization/memoryvisualizationitem.h +++ b/editors/ComponentEditor/visualization/memoryvisualizationitem.h @@ -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); @@ -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. * diff --git a/version.h b/version.h index 183316b27..0b596f0b8 100644 --- a/version.h +++ b/version.h @@ -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