|
wiRedPanda
Logic Circuit Simulator
|
Generic undo command for any DolphinEdits mutation (Set 0/1, Invert, Clear, clock/combinational fill, and the value-filling half of a length increase). More...
#include <DolphinCommands.h>
Public Member Functions | |
| void | redo () override |
| SetCellsCommand (SignalModel *model, const QList< QPair< int, int > > &cells, const QList< int > &oldValues, std::function< void()> onApplied, QUndoCommand *parent=nullptr) | |
| void | undo () override |
Generic undo command for any DolphinEdits mutation (Set 0/1, Invert, Clear, clock/combinational fill, and the value-filling half of a length increase).
Mirrors the main Scene's UpdateCommand: the caller applies the edit before constructing this command, so the constructor captures the post-edit ("new") values directly from the model, while the pre-edit ("old") values must be snapshotted by the caller beforehand and passed in. cells and both value lists must be the same size and in the same (row, col) order. onApplied is invoked after both redo() and undo() so the caller can re-run the simulation and refresh its edited-flag – this command only owns cell values, not BewavedDolphin's wider state.
Definition at line 31 of file DolphinCommands.h.
| SetCellsCommand::SetCellsCommand | ( | SignalModel * | model, |
| const QList< QPair< int, int > > & | cells, | ||
| const QList< int > & | oldValues, | ||
| std::function< void()> | onApplied, | ||
| QUndoCommand * | parent = nullptr ) |
Definition at line 8 of file DolphinCommands.cpp.
|
override |
Definition at line 27 of file DolphinCommands.cpp.
|
override |
Definition at line 32 of file DolphinCommands.cpp.