![]() |
HAL
|
Adds an item to a module or grouping. More...
#include <action_add_items_to_object.h>
Public Member Functions | |
ActionAddItemsToObject (const QSet< u32 > &mods=QSet< u32 >(), const QSet< u32 > &gats=QSet< u32 >(), const QSet< u32 > &nets=QSet< u32 >(), const QSet< u32 > &pins=QSet< u32 >()) | |
bool | exec () override |
void | setPlacementHint (PlacementHint hint) |
void | setUsedInCreateContext () |
QString | tagname () const override |
void | writeToXml (QXmlStreamWriter &xmlOut) const override |
void | readFromXml (QXmlStreamReader &xmlIn) override |
void | addToHash (QCryptographicHash &cryptoHash) const override |
![]() | |
virtual | ~UserAction () |
virtual UserActionObject | object () const |
virtual void | setObject (const UserActionObject &obj) |
int | compoundOrder () const |
void | setCompoundOrder (int cmpord) |
qint64 | timeStamp () const |
QString | cryptographicHash (int recordNo) const |
UserAction * | undoAction () const |
QString | debugDump () const |
void | setObjectLock (bool lock) |
void | setParentObjectLock (bool lock) |
bool | hasProjectModified () const |
Additional Inherited Members | |
![]() | |
UserAction () | |
void | writeParentObjectToXml (QXmlStreamWriter &xmlOut) const |
void | readParentObjectFromXml (QXmlStreamReader &xmlIn) |
![]() | |
static QString | setToText (const QSet< u32 > &set) |
static QSet< u32 > | setFromText (const QString &s) |
static QString | gridToText (const QHash< hal::Node, QPoint > &grid) |
static QHash< hal::Node, QPoint > | gridFromText (const QString &txt) |
![]() | |
UserActionObject | mObject |
UserActionObject | mParentObject |
int | mCompoundOrder |
UserAction * | mUndoAction |
qint64 | mTimeStamp |
bool | mObjectLock |
bool | mParentObjectLock |
bool | mProjectModified |
Adds an item to a module or grouping.
Adds Modules, Gates, or Nets to the UserActionObject which must exist and must be of type Module or Grouping.
Undo Action: ActionDeleteObject
Definition at line 41 of file action_add_items_to_object.h.
|
inline |
Action constructor.
mods | - The ids of the modules to add |
gats | - The ids of the gates to add |
nets | - The ids of the nets to add |
pins | - The ids of the pins to add |
Definition at line 61 of file action_add_items_to_object.h.
Referenced by exec().
|
overridevirtual |
Hook for derived classes to add parameter to cryptographic hash.
cryptoHash | - Additional hash data. |
Reimplemented from hal::UserAction.
Definition at line 32 of file action_add_items_to_object.cpp.
References QCryptographicHash::addData(), and hal::UserAction::setToText().
|
overridevirtual |
Executes user interaction and returns true on success. Note: Each implementation of exec() must include a call to the exec() method of base class to store the UserAction object in history and to transfer its ownership.
Reimplemented from hal::UserAction.
Definition at line 103 of file action_add_items_to_object.cpp.
References ActionAddItemsToObject(), hal::GraphContext::add(), hal::UserActionCompound::addAction(), hal::Grouping::assign_gate_by_id(), hal::Module::assign_gates(), hal::Grouping::assign_module_by_id(), hal::Grouping::assign_net_by_id(), QHash::begin(), hal::GraphContext::beginChange(), hal::UserActionObjectType::ContextView, QHash::end(), hal::GraphContext::endChange(), hal::UserAction::exec(), test_plugin::g, hal::gContentManager, hal::Netlist::get_gate_by_id(), hal::Netlist::get_grouping_by_id(), hal::Module::get_id(), hal::Netlist::get_module_by_id(), hal::Module::get_parent_module(), hal::GraphContextManager::getContextById(), hal::ContentManager::getContextManagerWidget(), hal::ContextManagerWidget::getCurrentContext(), hal::GraphContext::getLayouter(), hal::gGraphContextManager, hal::gNetlist, hal::GraphLayouter::gridPlacementFactory(), hal::UserActionObjectType::Grouping, hal::GraphContext::id(), hal::UserActionObject::id(), QHash::insert(), QHash::isEmpty(), hal::UserAction::mObject, hal::UserActionObjectType::Module, hal::UserAction::mUndoAction, hal::Module::set_parent_module(), hal::UserAction::setObject(), and hal::UserActionObject::type().
Referenced by hal::AddToModuleReceiver::handleModulesPicked().
|
overridevirtual |
Reads user interaction as well as arguments from xml macro file.
xmlIn | - The xml reader. |
Reimplemented from hal::UserAction.
Definition at line 75 of file action_add_items_to_object.cpp.
References QXmlStreamReader::attributes(), hal::UserAction::gridFromText(), QXmlStreamReader::name(), hal::PlacementHint::PreferLeft, hal::PlacementHint::PreferRight, QXmlStreamReader::readElementText(), QXmlStreamReader::readNextStartElement(), hal::UserAction::setFromText(), QXmlStreamReader::skipCurrentElement(), QStringRef::toInt(), hal::UserActionObjectType::toNodeType(), QStringRef::toString(), and QXmlStreamAttributes::value().
|
inline |
Sets the placement hints that are used to layout the added items.
hint | - The new placement hint |
Definition at line 76 of file action_add_items_to_object.h.
Referenced by hal::ActionDeleteObject::exec(), hal::ActionFoldModule::exec(), hal::ActionRemoveItemsFromObject::exec(), and hal::GraphContextManager::openNetEndpointsInView().
|
inline |
Must be called when adding pins to a pingroup and the pingroup was created in the same compound action. Sets a flag so that the undo action does not delete the source pingroup.
Definition at line 83 of file action_add_items_to_object.h.
|
overridevirtual |
The xml tagname for the action is purely virtual and needs to be implemented in derived class.
Implements hal::UserAction.
Definition at line 27 of file action_add_items_to_object.cpp.
References hal::ActionAddItemsToObjectFactory::sFactory, and hal::UserActionFactory::tagname().
|
overridevirtual |
Persist user interaction in xml macro file.
xmlOut | - The xml writer. |
Reimplemented from hal::UserAction.
Definition at line 44 of file action_add_items_to_object.cpp.
References hal::UserActionObjectType::fromNodeType(), hal::PlacementHint::GridPosition, hal::PlacementHint::gridPosition(), hal::UserAction::gridToText(), hal::Node::id(), QSet::isEmpty(), hal::PlacementHint::mode(), QString::number(), hal::PlacementHint::PreferLeft, hal::PlacementHint::preferredOrigin(), hal::PlacementHint::PreferRight, hal::UserAction::setToText(), hal::PlacementHint::Standard, hal::UserActionObjectType::toString(), hal::Node::type(), QXmlStreamWriter::writeAttribute(), QXmlStreamWriter::writeEndElement(), hal::UserAction::writeParentObjectToXml(), QXmlStreamWriter::writeStartElement(), and QXmlStreamWriter::writeTextElement().