wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
UpdateBlobCommand Class Reference

Undo command for embedded IC blob changes that may alter port counts. More...

#include <Commands.h>

Inheritance diagram for UpdateBlobCommand:
[legend]

Classes

struct  ConnectionInfo

Public Member Functions

void redo () override
void setBlobName (const QString &name)
 Overrides the blob name (needed when elements are already file-backed at construction time).
void setOldBlob (const QByteArray &blob)
 Sets the old blob data for registry swap on undo.
void undo () override
 UpdateBlobCommand (const QList< GraphicElement * > &elements, const QByteArray &oldData, const QList< ConnectionInfo > &connections, Scene *scene, QUndoCommand *parent=nullptr)

Static Public Member Functions

static QList< ConnectionInfocaptureConnections (const QList< GraphicElement * > &targets)
 Captures connection topology for all target elements before a blob operation.

Additional Inherited Members

Protected Member Functions inherited from ElementsCommand
QList< GraphicElement * > elements () const
 Returns the live element pointers for this command's targets, looked up by stored ID.
 ElementsCommand (const QList< GraphicElement * > &elements, Scene *scene, QUndoCommand *parent=nullptr)
Protected Attributes inherited from ElementsCommand
QList< int > m_ids
Scenem_scene

Detailed Description

Undo command for embedded IC blob changes that may alter port counts.

Captures connection topology before the change so connections to removed ports can be restored on undo. Swaps blob registry entries on undo/redo.

Definition at line 520 of file Commands.h.

Constructor & Destructor Documentation

◆ UpdateBlobCommand()

UpdateBlobCommand::UpdateBlobCommand ( const QList< GraphicElement * > & elements,
const QByteArray & oldData,
const QList< ConnectionInfo > & connections,
Scene * scene,
QUndoCommand * parent = nullptr )
explicit

Member Function Documentation

◆ captureConnections()

QList< UpdateBlobCommand::ConnectionInfo > UpdateBlobCommand::captureConnections ( const QList< GraphicElement * > & targets)
static

Captures connection topology for all target elements before a blob operation.

Definition at line 1092 of file Commands.cpp.

References Port::graphicElement(), ItemWithId::id(), and Port::index().

Referenced by ICRegistry::embedICsByFile(), ICRegistry::extractToFile(), and WorkSpace::onChildICBlobSaved().

◆ redo()

void UpdateBlobCommand::redo ( )
override

Definition at line 1206 of file Commands.cpp.

References ElementsCommand::m_scene, and qCDebug.

◆ setBlobName()

void UpdateBlobCommand::setBlobName ( const QString & name)
inline

Overrides the blob name (needed when elements are already file-backed at construction time).

Definition at line 544 of file Commands.h.

◆ setOldBlob()

void UpdateBlobCommand::setOldBlob ( const QByteArray & blob)
inline

Sets the old blob data for registry swap on undo.

Definition at line 541 of file Commands.h.

◆ undo()

void UpdateBlobCommand::undo ( )
override

Definition at line 1224 of file Commands.cpp.

References ElementsCommand::m_scene, and qCDebug.


The documentation for this class was generated from the following files: