HAL  v4.5.0-232-g8053ac4b3
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
hal::ActionSetParameterValue Class Reference

Sets the value of an existing typed parameter on a gate. More...

#include </home/runner/work/hal/hal/plugins/gui/include/gui/user_action/action_set_parameter_value.h>

Inheritance diagram for hal::ActionSetParameterValue:
Inheritance graph
Collaboration diagram for hal::ActionSetParameterValue:
Collaboration graph

Public Member Functions

 ActionSetParameterValue (const QString &parameterName=QString(), const QString &value=QString())
 
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
 
UserAction * undoAction () const
 
QString debugDump () const
 
void setObjectLock (bool lock)
 
void setParentObjectLock (bool lock)
 
bool hasProjectModified () const
 

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< u32 > setFromText (const QString &s)
 
static QString gridToText (const QHash< hal::Node, QPoint > &grid)
 
static QHash< hal::Node, QPoint > gridFromText (const QString &txt)
 
- Protected Attributes inherited from hal::UserAction
UserActionObject mObject
 
UserActionObject mParentObject
 
int mCompoundOrder
 
UserAction * mUndoAction
 
qint64 mTimeStamp
 
bool mObjectLock
 
bool mParentObjectLock
 
bool mProjectModified
 

Detailed Description

Sets the value of an existing typed parameter on a gate.

Unlike ActionSetObjectData, a gate's parameters are fixed by its type: they can only be modified, never created, deleted or moved. This action therefore only carries the parameter name and the new value; the target gate is identified by the inherited mObject.

The inverse of "set parameter <name> to <value>" is another ActionSetParameterValue that restores the previous value, so exec() builds its own undo action of the same type.

Definition at line 42 of file action_set_parameter_value.h.

Constructor & Destructor Documentation

◆ ActionSetParameterValue()

hal::ActionSetParameterValue::ActionSetParameterValue ( const QString &  parameterName = QString(),
const QString &  value = QString() 
)

Constructor.

Parameters
parameterName- The name of the parameter to modify.
value- The new value, formatted as the core expects it for the parameter's type. If the gate has no instance value yet, the declaration of its gate type is used. An empty value removes the instance value from the gate.

Definition at line 19 of file action_set_parameter_value.cpp.

Referenced by exec().

Member Function Documentation

◆ addToHash()

void hal::ActionSetParameterValue::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 105 of file action_set_parameter_value.cpp.

References QCryptographicHash::addData(), and QString::toUtf8().

◆ exec()

◆ readFromXml()

void hal::ActionSetParameterValue::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 90 of file action_set_parameter_value.cpp.

References QXmlStreamReader::name(), QXmlStreamReader::readElementText(), and QXmlStreamReader::readNextStartElement().

◆ tagname()

QString hal::ActionSetParameterValue::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 79 of file action_set_parameter_value.cpp.

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

◆ writeToXml()

void hal::ActionSetParameterValue::writeToXml ( QXmlStreamWriter &  xmlOut) const
overridevirtual

Persist user interaction in xml macro file.

Parameters
xmlOut- The xml writer.

Reimplemented from hal::UserAction.

Definition at line 84 of file action_set_parameter_value.cpp.

References QXmlStreamWriter::writeTextElement().


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