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)
 
static ActionPingrouptoggleAscendingGroup (const Module *m, u32 grpId)
 
static ActionPingroupchangePinGroupType (const Module *m, u32 grpId, int ptype)
 
static int pinGroupIndex (const Module *mod, const PinGroup< ModulePin > *pgrp)
 
static int pinIndex2Row (const ModulePin *pin, int index)
 
static int pinRow2Index (const ModulePin *pin, int row)
 
static QString generateGroupName (const Module *mod, const ModulePin *pin)
 

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 * 2, LSB : 0=descending 1=ascending

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 102 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 
)

Definition at line 117 of file action_pingroup.cpp.

References QList::append(), and name.

◆ ActionPingroup() [2/2]

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

Definition at line 122 of file action_pingroup.cpp.

Member Function Documentation

◆ addPinsToExistingGroup()

ActionPingroup * hal::ActionPingroup::addPinsToExistingGroup ( const Module m,
u32  grpId,
QList< u32 pinIds,
int  pinRow = -1 
)
static

◆ addPinsToNewGroup()

ActionPingroup * hal::ActionPingroup::addPinsToNewGroup ( const Module m,
const QString name,
QList< u32 pinIds,
int  grpRow = -1 
)
static

◆ addPinToExistingGroup()

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

Definition at line 437 of file action_pingroup.cpp.

◆ addPinToNewGroup()

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

Definition at line 466 of file action_pingroup.cpp.

References 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 126 of file action_pingroup.cpp.

References QCryptographicHash::addData().

◆ changePinGroupType()

◆ 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 255 of file action_pingroup.cpp.

References QList::append(), ascending, hal::Module::assign_pin_to_group(), QList::clear(), QSet::clear(), QMap::clear(), QSet::contains(), hal::Module::create_pin_group(), hal::Module::delete_pin_group(), QString::fromStdString(), hal::PinGroup< T >::get_direction(), hal::BasePin< T >::get_group(), hal::PinGroup< T >::get_id(), hal::PinGroup< T >::get_lowest_index(), 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::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, pinIndex2Row(), hal::PinActionType::PinMoveToRow, hal::PinActionType::PinRename, 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().

◆ generateGroupName()

QString hal::ActionPingroup::generateGroupName ( const Module mod,
const ModulePin pin 
)
static

◆ pinGroupIndex()

int hal::ActionPingroup::pinGroupIndex ( const Module mod,
const PinGroup< ModulePin > *  pgrp 
)
static

◆ pinIndex2Row()

int hal::ActionPingroup::pinIndex2Row ( const ModulePin pin,
int  index 
)
static

◆ pinRow2Index()

int hal::ActionPingroup::pinRow2Index ( const ModulePin pin,
int  row 
)
static

Definition at line 47 of file action_pingroup.cpp.

References hal::BasePin< T >::get_group().

Referenced by exec().

◆ 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 153 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 112 of file action_pingroup.cpp.

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

◆ toggleAscendingGroup()

◆ 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 137 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: