HAL
hal::ActionPingroup Class Reference

Pingroup user actions. More...

#include <action_pingroup.h>

Inheritance diagram for hal::ActionPingroup:
Inheritance graph
Collaboration diagram for hal::ActionPingroup:
Collaboration graph

Public Member Functions

 ActionPingroup (PinActionType::Type tp=PinActionType::None, int id=0, const QString &name=QString(), int value=0)
 
 ActionPingroup (const QList< AtomicAction > &aaList)
 
bool exec () override
 
QString tagname () const override
 
void writeToXml (QXmlStreamWriter &xmlOut) const override
 
void readFromXml (QXmlStreamReader &xmlIn) override
 
void addToHash (QCryptographicHash &cryptoHash) const override
 
- Public Member Functions inherited from hal::UserAction
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
 
UserActionundoAction () const
 
QString debugDump () const
 
void setObjectLock (bool lock)
 
void setParentObjectLock (bool lock)
 
bool hasProjectModified () const
 

Static Public Member Functions

static ActionPingroupaddPinsToExistingGroup (const Module *m, u32 grpId, QList< u32 > pinIds, int pinRow=-1)
 
static ActionPingroupaddPinToExistingGroup (const Module *m, u32 grpId, u32 pinId, int pinRow=-1)
 
static ActionPingroupaddPinsToNewGroup (const Module *m, const QString &name, QList< u32 > pinIds, int grpRow=-1)
 
static ActionPingroupaddPinToNewGroup (const Module *m, const QString &name, u32 pinId, int grpRow=-1)
 
static ActionPingroupremovePinsFromGroup (const Module *m, QList< u32 > pinIds)
 
static ActionPingroupdeletePinGroup (const Module *m, u32 grpId)
 

Additional Inherited Members

- Protected Member Functions inherited from hal::UserAction
 UserAction ()
 
void writeParentObjectToXml (QXmlStreamWriter &xmlOut) const
 
void readParentObjectFromXml (QXmlStreamReader &xmlIn)
 
- Static Protected Member Functions inherited from hal::UserAction
static QString setToText (const QSet< u32 > &set)
 
static QSet< u32setFromText (const QString &s)
 
static QString gridToText (const QHash< hal::Node, QPoint > &grid)
 
static QHash< hal::Node, QPointgridFromText (const QString &txt)
 
- Protected Attributes inherited from hal::UserAction
UserActionObject mObject
 
UserActionObject mParentObject
 
int mCompoundOrder
 
UserActionmUndoAction
 
qint64 mTimeStamp
 
bool mObjectLock
 
bool mParentObjectLock
 
bool mProjectModified
 

Detailed Description

Pingroup user actions.

Arguments depends on PinActionType::Type:

GroupCreate: ID : ID of group to create negative ID: call constructor without ID, however, ID will be used internally for subsequent commands related to crated group name : name of group value : start index, assume ascending negative value: descending order starting with (-value-1)

GroupDelete ID : ID of group to delete

GroupMoveToRow ID : ID of group to move value : row to which group get moved within vector of pin groups

GroupRename ID : ID of group to rename name : new name

GroupTypeChange ID : ID of group to modifiy value : (int) PinType as of hal_core/netlist/gate_library/enums/pin_type.h

GroupDirChange ID : ID of group to modifiy value : (int) PinDirection as of hal_core/netlist/gate_library/enums/pin_direction.h

PinAsignToGroup ID : ID of pin value : ID of group, might be negative if group recently created

PinRename ID : ID of pin to rename name : new name

PinTypeChange ID : ID of pin to modify value : (int) PinType

PinDirChange ID : ID of pin to modify value : (int) PinDirection

PinMoveToRow ID : ID of pin value : row to which pin gets moved in pingroup

Definition at line 111 of file action_pingroup.h.

Constructor & Destructor Documentation

◆ ActionPingroup() [1/2]

hal::ActionPingroup::ActionPingroup ( PinActionType::Type  tp = PinActionType::None,
int  id = 0,
const QString name = QString(),
int  value = 0 
)

◆ ActionPingroup() [2/2]

hal::ActionPingroup::ActionPingroup ( const QList< AtomicAction > &  aaList)

Definition at line 123 of file action_pingroup.cpp.

Member Function Documentation

◆ addPinsToExistingGroup()

◆ addPinsToNewGroup()

◆ addPinToExistingGroup()

ActionPingroup * hal::ActionPingroup::addPinToExistingGroup ( const Module m,
u32  grpId,
u32  pinId,
int  pinRow = -1 
)
static

Definition at line 451 of file action_pingroup.cpp.

References addPinsToExistingGroup().

◆ addPinToNewGroup()

ActionPingroup * hal::ActionPingroup::addPinToNewGroup ( const Module m,
const QString name,
u32  pinId,
int  grpRow = -1 
)
static

Definition at line 480 of file action_pingroup.cpp.

References addPinsToNewGroup(), and name.

◆ addToHash()

void hal::ActionPingroup::addToHash ( QCryptographicHash cryptoHash) const
overridevirtual

Hook for derived classes to add parameter to cryptographic hash.

Parameters
cryptoHash- Additional hash data.

Reimplemented from hal::UserAction.

Definition at line 127 of file action_pingroup.cpp.

References QCryptographicHash::addData().

◆ deletePinGroup()

◆ exec()

bool hal::ActionPingroup::exec ( )
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.

Returns
True on success, False otherwise.

Reimplemented from hal::UserAction.

Definition at line 281 of file action_pingroup.cpp.

References ascending, hal::Module::assign_pin_to_group(), QSet::clear(), QMap::clear(), QSet::contains(), hal::Module::create_pin_group(), hal::Module::delete_pin_group(), hal::UserAction::exec(), QString::fromStdString(), hal::PinGroup< T >::get_direction(), hal::BasePin< T >::get_group(), hal::PinGroup< T >::get_id(), hal::Netlist::get_module_by_id(), hal::BasePin< T >::get_name(), hal::PinGroup< T >::get_name(), hal::Module::get_pin_by_id(), hal::Module::get_pin_group_by_id(), hal::PinGroup< T >::get_start_index(), hal::BasePin< T >::get_type(), hal::PinGroup< T >::get_type(), hal::gNetlist, hal::PinActionType::GroupCreate, hal::PinActionType::GroupDelete, hal::PinActionType::GroupDirChange, hal::PinActionType::GroupMoveToRow, hal::PinActionType::GroupRename, hal::PinActionType::GroupTypeChange, hal::UserActionObject::id(), QSet::insert(), hal::PinGroup< T >::is_ascending(), hal::UserAction::mObject, hal::UserActionObjectType::Module, hal::Module::move_pin_group(), hal::Module::move_pin_within_group(), name, hal::none, hal::PinActionType::PinAsignToGroup, hal::pinIndex2Row(), hal::PinActionType::PinMoveToRow, hal::PinActionType::PinRename, hal::pinRow2Index(), hal::PinActionType::PinTypeChange, hal::Module::set_pin_group_direction(), hal::Module::set_pin_group_name(), hal::Module::set_pin_group_type(), hal::Module::set_pin_name(), hal::Module::set_pin_type(), hal::UserActionObject::type(), hal::PinActionType::useExistingGroup(), and hal::PinActionType::useExistingPin().

Referenced by hal::ModulePinsTree::handleContextMenuRequested().

◆ readFromXml()

void hal::ActionPingroup::readFromXml ( QXmlStreamReader xmlIn)
overridevirtual

Reads user interaction as well as arguments from xml macro file.

Parameters
xmlIn- The xml reader.

Reimplemented from hal::UserAction.

Definition at line 154 of file action_pingroup.cpp.

References QList::append(), hal::PinActionType::fromString(), QXmlStreamReader::name(), name, hal::PinActionType::None, QXmlStreamReader::readElementText(), QXmlStreamReader::readNextStartElement(), and QString::toInt().

◆ removePinsFromGroup()

◆ tagname()

QString hal::ActionPingroup::tagname ( ) const
overridevirtual

The xml tagname for the action is purely virtual and needs to be implemented in derived class.

Returns
The tagname.

Implements hal::UserAction.

Definition at line 113 of file action_pingroup.cpp.

References hal::ActionPingroupFactory::sFactory, and hal::UserActionFactory::tagname().

◆ writeToXml()

void hal::ActionPingroup::writeToXml ( QXmlStreamWriter xmlOut) const
overridevirtual

Persist user interaction in xml macro file.

Parameters
xmlOut- The xml writer.

Reimplemented from hal::UserAction.

Definition at line 138 of file action_pingroup.cpp.

References hal::PinActionType::None, QString::number(), hal::PinActionType::toString(), and QXmlStreamWriter::writeTextElement().


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