Skip to content

Commit

Permalink
[ADDITIVE] Add toggle for filtering memory overlap items in memory de…
Browse files Browse the repository at this point in the history
…signer.
  • Loading branch information
hagantsa committed Dec 4, 2024
1 parent 8dab67b commit 0caf0ba
Show file tree
Hide file tree
Showing 13 changed files with 181 additions and 24 deletions.
Binary file added common/graphics/memOverlap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions editors/MemoryDesigner/MemoryDesignConstructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,22 @@ bool MemoryDesignConstructor::unconnectedMemoryItemsAreFiltered() const
return itemHandler_->unconnectedMemoryItemsAreFiltered();
}

//-----------------------------------------------------------------------------
// Function: MemoryDesignConstructor::filterMemoryOverlapItems()
//-----------------------------------------------------------------------------
void MemoryDesignConstructor::filterMemoryOverlapItems(bool filterOverlap)
{
itemHandler_->filterMemoryOverlapItems(filterOverlap);
}

//-----------------------------------------------------------------------------
// Function: MemoryDesignConstructor::memoryOverlapItemsAreFiltered()
//-----------------------------------------------------------------------------
bool MemoryDesignConstructor::memoryOverlapItemsAreFiltered() const
{
return itemHandler_->memoryOverlapItemsAreFiltered();
}

//-----------------------------------------------------------------------------
// Function: MemoryDesignConstructor::constructMemoryDesignItems()
//-----------------------------------------------------------------------------
Expand Down
14 changes: 14 additions & 0 deletions editors/MemoryDesigner/MemoryDesignConstructor.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,20 @@ class MemoryDesignConstructor : public QObject
*/
bool unconnectedMemoryItemsAreFiltered() const;

/*!
* Set a new value for filtering the memory overlap items.
*
* @param [in] filterOverlap Value for filtering memory overlap.
*/
void filterMemoryOverlapItems(bool filterOverlap);

/*!
* Check if the memory overlap items are filtered.
*
* @return True, if the memory overlap items are filtered, false otherwise.
*/
bool memoryOverlapItemsAreFiltered() const;

/*!
* Construct memory design items from the selected connection graph.
*
Expand Down
16 changes: 16 additions & 0 deletions editors/MemoryDesigner/MemoryDesignDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,22 @@ void MemoryDesignDocument::filterUnconnectedMemoryItems(bool filterUnconnected)
diagram_->filterUnconnectedMemoryItems(filterUnconnected);
}

//-----------------------------------------------------------------------------
// Function: MemoryDesignDocument::filterMemoryOverlapItems()
//-----------------------------------------------------------------------------
void MemoryDesignDocument::filterMemoryOverlapItems(bool filterOverlap)
{
diagram_->filterMemoryOverlapItems(filterOverlap);
}

//-----------------------------------------------------------------------------
// Function: MemoryDesignDocument::memoryOverlapItemsAreFiltered()
//-----------------------------------------------------------------------------
bool MemoryDesignDocument::memoryOverlapItemsAreFiltered() const
{
return diagram_->memoryOverlapItemsAreFiltered();
}

//-----------------------------------------------------------------------------
// Function: MemoryDesignDocument::exportImage()
//-----------------------------------------------------------------------------
Expand Down
14 changes: 14 additions & 0 deletions editors/MemoryDesigner/MemoryDesignDocument.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,20 @@ class MemoryDesignDocument : public TabDocument
*/
void filterUnconnectedMemoryItems(bool filterUnconnected);

/*!
* Filter the memory overlap items.
*
* @param [in] filterOverlap Value for filtering.
*/
void filterMemoryOverlapItems(bool filterOverlap);

/*!
* Check if the memory overlap items are filtered.
*
* @return True, if the memory overlap items are filtered, false otherwise.
*/
bool memoryOverlapItemsAreFiltered() const;

public slots:

/*!
Expand Down
16 changes: 16 additions & 0 deletions editors/MemoryDesigner/MemoryDesignerDiagram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,22 @@ bool MemoryDesignerDiagram::unconnectedMemoryItemsAreFiltered() const
return memoryConstructor_->unconnectedMemoryItemsAreFiltered();
}

//-----------------------------------------------------------------------------
// Function: MemoryDesignerDiagram::filterMemoryOverlapItems()
//-----------------------------------------------------------------------------
void MemoryDesignerDiagram::filterMemoryOverlapItems(bool filterOverlap)
{
memoryConstructor_->filterMemoryOverlapItems(filterOverlap);
}

//-----------------------------------------------------------------------------
// Function: MemoryDesignerDiagram::memoryOverlapItemsAreFiltered()
//-----------------------------------------------------------------------------
bool MemoryDesignerDiagram::memoryOverlapItemsAreFiltered() const
{
return memoryConstructor_->memoryOverlapItemsAreFiltered();
}

//-----------------------------------------------------------------------------
// Function: MemoryDesignerDiagram::loadDesign()
//-----------------------------------------------------------------------------
Expand Down
14 changes: 14 additions & 0 deletions editors/MemoryDesigner/MemoryDesignerDiagram.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,20 @@ class MemoryDesignerDiagram : public QGraphicsScene
* @return True, if the unconnected memory items are filtered, false otherwise.
*/
bool unconnectedMemoryItemsAreFiltered() const;

/*!
* Set a new value for filtering the memory overlap items.
*
* @param [in] filterOverlap Value for filtering memory overlap.
*/
void filterMemoryOverlapItems(bool filterOverlap);

/*!
* Check if the memory overlap items are filtered.
*
* @return True, if the memory overlap items are filtered, false otherwise.
*/
bool memoryOverlapItemsAreFiltered() const;

/*!
* Load a design using the selected view.
Expand Down
40 changes: 29 additions & 11 deletions editors/MemoryDesigner/MemoryGraphicsItemHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,13 @@
#include <editors/MemoryDesigner/AddressSpaceGraphicsItem.h>
#include <editors/MemoryDesigner/MemoryMapGraphicsItem.h>
#include <editors/MemoryDesigner/MemoryColumn.h>
#include <editors/MemoryDesigner/MemoryCollisionItem.h>

//-----------------------------------------------------------------------------
// Function: MemoryGraphicsItemHandler::MemoryGraphicsItemHandler()
//-----------------------------------------------------------------------------
MemoryGraphicsItemHandler::MemoryGraphicsItemHandler():
QObject(),
filterAddressSpaceSegments_(true),
filterAddressBlocks_(true),
filterRegisters_(true),
filterFields_(true),
filterUnconnectedMemoryItems_(true),
memoryMapItems_(),
spaceItems_()
QObject()
{

}
Expand Down Expand Up @@ -115,12 +109,12 @@ void MemoryGraphicsItemHandler::filterUnconnectedMemoryItems(bool filterUnconnec
{
filterUnconnectedMemoryItems_ = filterUnconnected;

foreach (AddressSpaceGraphicsItem* spaceItem, spaceItems_)
for (AddressSpaceGraphicsItem* spaceItem : spaceItems_)
{
filterUnconnectedMemoryItem(spaceItem);
}

foreach (MemoryMapGraphicsItem* mapItem, memoryMapItems_)
for (MemoryMapGraphicsItem* mapItem : memoryMapItems_)
{
filterUnconnectedMemoryItem(mapItem);
}
Expand All @@ -145,6 +139,30 @@ bool MemoryGraphicsItemHandler::unconnectedMemoryItemsAreFiltered() const
return filterUnconnectedMemoryItems_;
}

//-----------------------------------------------------------------------------
// Function: MemoryGraphicsItemHandler::filterMemoryOverlapItems()
//-----------------------------------------------------------------------------
void MemoryGraphicsItemHandler::filterMemoryOverlapItems(bool filterOverlap)
{
filterMemoryOverlapItems_ = filterOverlap;

for (auto addrSpace : spaceItems_)
{
for (auto overlapItem : addrSpace->getMemoryCollisions())
{
overlapItem->setVisible(!filterOverlap);
}
}
}

//-----------------------------------------------------------------------------
// Function: MemoryGraphicsItemHandler::memoryOverlapItemsAreFiltered()
//-----------------------------------------------------------------------------
bool MemoryGraphicsItemHandler::memoryOverlapItemsAreFiltered() const
{
return filterMemoryOverlapItems_;
}

//-----------------------------------------------------------------------------
// Function: MemoryGraphicsItemHandler::createMemoryItems()
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -241,7 +259,7 @@ void MemoryGraphicsItemHandler::connectGraphicsItemSignals(MainMemoryGraphicsIte
//-----------------------------------------------------------------------------
void MemoryGraphicsItemHandler::createFieldOverlapItems()
{
foreach (MemoryMapGraphicsItem* mapItem, memoryMapItems_)
for (MemoryMapGraphicsItem* mapItem : memoryMapItems_)
{
mapItem->createFieldOverlapItems();
}
Expand Down
27 changes: 22 additions & 5 deletions editors/MemoryDesigner/MemoryGraphicsItemHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,20 @@ class MemoryGraphicsItemHandler : public QObject
*/
bool unconnectedMemoryItemsAreFiltered() const;

/*!
* Set a new value for filtering the memory overlap items.
*
* @param [in] filterOverlap Value for filtering memory overlap.
*/
void filterMemoryOverlapItems(bool filterOverlap);

/*!
* Check if the memory overlap items are filtered.
*
* @return True, if the memory overlap items are filtered, false otherwise.
*/
bool memoryOverlapItemsAreFiltered() const;

/*!
* Create the memory items found in the design.
*
Expand Down Expand Up @@ -188,19 +202,22 @@ class MemoryGraphicsItemHandler : public QObject
//-----------------------------------------------------------------------------

//! Value for filtering address space segments.
bool filterAddressSpaceSegments_;
bool filterAddressSpaceSegments_ = true;

//! Value for filtering memory map address blocks.
bool filterAddressBlocks_;
bool filterAddressBlocks_ = true;

//! Value for filtering address block registers.
bool filterRegisters_;
bool filterRegisters_ = true;

//! Value for filtering register fields.
bool filterFields_;
bool filterFields_ = true;

//! Value for filtering unconnected memory items.
bool filterUnconnectedMemoryItems_;
bool filterUnconnectedMemoryItems_ = true;

//! Value for filtering memory overlap items.
bool filterMemoryOverlapItems_ = false;

//! List of all the created memory map graphics items.
QVector<MemoryMapGraphicsItem*> memoryMapItems_;
Expand Down
1 change: 1 addition & 0 deletions kactus.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
<file>common/graphics/search.png</file>
<file>common/graphics/fail.png</file>
<file>common/graphics/pass.png</file>
<file>common/graphics/filterMemoryOverlap.png</file>
</qresource>
<qresource prefix="/">
<file>common/graphics/splash.png</file>
Expand Down
21 changes: 21 additions & 0 deletions mainwindow/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,13 @@ void MainWindow::setupActions()
connect(actionFilterUnconnectedMemoryItems_, SIGNAL(triggered(bool)),
this, SLOT(onFilterUnconnectedMemoryItems(bool)), Qt::UniqueConnection);

//! Initialize the action to filter memory overlap items.
actionFilterMemoryOverlap_ = new QAction(QIcon(":icons/common/graphics/filterMemoryOverlap.png"),
tr("Filter memory overlap markers"), this);
actionFilterMemoryOverlap_->setCheckable(true);
connect(actionFilterMemoryOverlap_, SIGNAL(triggered(bool)),
this, SLOT(onFilterMemoryOverlapItems(bool)), Qt::UniqueConnection);

// Initialize the action to zoom in.
actZoomIn_ = new QAction(QIcon(":/icons/common/graphics/view-zoom_in.png"), tr("Zoom In"), this);
actZoomIn_->setEnabled(false);
Expand Down Expand Up @@ -704,6 +711,7 @@ void MainWindow::setupMenus()
filteringGroup_->addAction(actionCondenseMemoryItems_);
filteringGroup_->addAction(actionCondenseFieldItems_);
filteringGroup_->addAction(actionExtendFieldItems_);
filteringGroup_->addAction(actionFilterMemoryOverlap_);

filteringAction_ = ribbon_->addGroup(filteringGroup_);
filteringAction_->setVisible(false);
Expand Down Expand Up @@ -1028,6 +1036,7 @@ void MainWindow::updateMenuStrip()
actionFilterRegisters_->setChecked(memoryDocument->addressBlockRegistersAreFiltered());
actionFilterFields_->setChecked(memoryDocument->fieldsAreFiltered());
actionFilterUnconnectedMemoryItems_->setChecked(memoryDocument->unconnectedMemoryItemsAreFiltered());
actionFilterMemoryOverlap_->setChecked(memoryDocument->memoryOverlapItemsAreFiltered());
}

filteringAction_->setVisible(isMemoryDesign);
Expand Down Expand Up @@ -3849,3 +3858,15 @@ void MainWindow::onFilterUnconnectedMemoryItems(bool filterUnconnected)
memoryDocument->filterUnconnectedMemoryItems(filterUnconnected);
}
}

//-----------------------------------------------------------------------------
// Function: MainWindow::onFilterMemoryOverlapItems()
//-----------------------------------------------------------------------------
void MainWindow::onFilterMemoryOverlapItems(bool filterOverlap)
{
MemoryDesignDocument* memoryDocument = dynamic_cast<MemoryDesignDocument*>(designTabs_->currentWidget());
if (memoryDocument && !memoryDocument->isProtected())
{
memoryDocument->filterMemoryOverlapItems(filterOverlap);
}
}
10 changes: 10 additions & 0 deletions mainwindow/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,13 @@ private slots:
*/
void onFilterUnconnectedMemoryItems(bool filterUnconnected);

/*!
* Set the filtering of the memory overlap items within a memory design.
*
* @param [in] filterOverlap Value for the filter.
*/
void onFilterMemoryOverlapItems(bool filterOverlap);

/*!
* Open the document containing the selected component and select the identified component item editor.
*
Expand Down Expand Up @@ -874,6 +881,9 @@ private slots:
//! The action to filter unconnected memory items in a memory design.
QAction* actionFilterUnconnectedMemoryItems_;

//! Action to toggle visibility of memory overlap items in memory designer.
QAction* actionFilterMemoryOverlap_ = nullptr;

QMenu* generationMenu_ = nullptr;

//! The menu containing the actions to select which windows to display.
Expand Down
16 changes: 8 additions & 8 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.13.218.0
#define VERSION_FULL 3.13.228.0

#define VERSION_BASEYEAR 0
#define VERSION_DATE "2024-12-03"
#define VERSION_TIME "14:02:16"
#define VERSION_DATE "2024-12-04"
#define VERSION_TIME "14:34:15"

#define VERSION_MAJOR 3
#define VERSION_MINOR 13
#define VERSION_BUILDNO 218
#define VERSION_BUILDNO 228
#define VERSION_EXTEND 0

#define VERSION_FILE 3,13,218,0
#define VERSION_PRODUCT 3,13,218,0
#define VERSION_FILESTR "3,13,218,0"
#define VERSION_PRODUCTSTR "3,13,218,0"
#define VERSION_FILE 3,13,228,0
#define VERSION_PRODUCT 3,13,228,0
#define VERSION_FILESTR "3,13,228,0"
#define VERSION_PRODUCTSTR "3,13,228,0"

#endif

0 comments on commit 0caf0ba

Please sign in to comment.