|
HAL
v4.5.0-232-g8053ac4b3
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
|
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>


Public Member Functions | |
| ActionSetParameterValue (const QString ¶meterName=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 |
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.
| hal::ActionSetParameterValue::ActionSetParameterValue | ( | const QString & | parameterName = QString(), |
| const QString & | value = QString() |
||
| ) |
Constructor.
| 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().
|
overridevirtual |
Hook for derived classes to add parameter to cryptographic hash.
| 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().
|
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.
true on success, false otherwise. Reimplemented from hal::UserAction.
Definition at line 23 of file action_set_parameter_value.cpp.
References ActionSetParameterValue(), hal::DataContainer::delete_parameter(), hal::UserAction::exec(), QString::fromStdString(), hal::UserActionObjectType::Gate, hal::NetlistRelay::gateBooleanFunctionChanged(), hal::Result< T >::get(), hal::Netlist::get_gate_by_id(), hal::GateType::get_parameter(), hal::DataContainer::get_parameter_declaration(), hal::DataContainer::get_parameter_value(), hal::Gate::get_type(), hal::gNetlist, hal::gNetlistRelay, hal::DataContainer::has_parameter(), hal::UserActionObject::id(), hal::Result< T >::is_error(), QString::isEmpty(), hal::UserAction::mObject, hal::UserAction::mUndoAction, name, hal::DataContainer::set_parameter(), QString::toStdString(), and hal::UserActionObject::type().
|
overridevirtual |
Reads user interaction as well as arguments from xml macro file.
| 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().
|
overridevirtual |
The xml tagname for the action is purely virtual and needs to be implemented in derived class.
Implements hal::UserAction.
Definition at line 79 of file action_set_parameter_value.cpp.
References hal::ActionSetParameterValueFactory::sFactory, and hal::UserActionFactory::tagname().
|
overridevirtual |
Persist user interaction in xml macro file.
| xmlOut | - The xml writer. |
Reimplemented from hal::UserAction.
Definition at line 84 of file action_set_parameter_value.cpp.
References QXmlStreamWriter::writeTextElement().