![]() |
tuchulcha
0.10.1
Graphical Workflow Configuration Editor
|
This model wraps a ParameterFile instance and provides access to the data interpreted as a (directed) graph. More...
#include <GraphModel.h>
Public Slots | |
QString | addNode (QString className, bool draw=true) |
add new node of given kind More... | |
void | connectSlot (QString source, QString target, bool draw=true) |
connect slots More... | |
bool | deleteNode (QString nodename, bool draw=true) |
delete node More... | |
void | disconnectAllSlots (QString node, bool draw=true) |
disconnect all slots of given node More... | |
void | disconnectSlot (QString source, QString target=QString(), bool draw=true) |
disconnect slots More... | |
virtual void | loadMetaFile (QString fileName) |
load metaFile More... | |
void | reDraw () |
emit graph changed signal to update displays More... | |
void | renameNode (QString nodename, bool draw=true) |
rename node More... | |
void | selectNext (bool back=false) |
select next item More... | |
![]() | |
virtual bool | load (const QString &fName="") |
Load model content from parameterFile. More... | |
virtual void | loadMetaInfo (const QString &fileName) |
load metaFile More... | |
virtual void | save (const QString &fileName="") |
Save model content to a text file. More... | |
virtual void | setFileName (const QString &fileName) |
Set new value for Property _fileName. More... | |
void | setHandleDynamics (bool) |
set _handleDynamics | |
void | setMinPriority (int value) |
Set property _minPriority. More... | |
void | setOnlyParams (bool value) |
Set property _onlyparams. More... | |
virtual QString | setPrefix (const QString &prefix) |
Change prefix. More... | |
void | setUseMetaInfo (bool value) |
Set property _useMetadata. More... | |
Signals | |
void | graphChanged () |
Initiate graph rebuild and Display refresh. | |
![]() | |
void | commentChanged (QString comment) |
inform about editor comment change | |
void | dynamicUpdate () |
inform about dynamic plugin update | |
void | fileNameChanged (QString fileName) |
Property _fileName has changed. More... | |
void | metaInfoChanged (bool valid) |
New metadata have been loaded. More... | |
void | minPriorityChanged (int value) |
Property _minPriority changed. More... | |
void | modified (bool val) |
inform about modifications More... | |
void | onlyParamsChanged (bool value) |
Property _onlyParams changed. More... | |
void | prefixChanged (const QString &prefix) |
Property _prefix has changed. More... | |
void | statusMessage (const QString &msg) |
send status message More... | |
void | useMetaInfoChanged (bool value) |
Property _useMetadata changed. More... | |
Public Member Functions | |
GraphModel (QString fileName="", QObject *parent=0, QString metaFile="") | |
Constructor initializing the model with the given file. More... | |
virtual void | clear (bool draw) |
Clear ParameterFile content. More... | |
virtual void | clear () |
Clear ParameterFile content with redraw. More... | |
bool | connected (QString source, QString target) const |
Check if given connection is valid and established. More... | |
QStringList | nodes () const |
Get nodes in current graph. | |
bool | nodeValid (const QString &name) const |
Checks if the given node is a valid object in the ParameterFile. More... | |
virtual bool | removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
Remove data from the model. More... | |
virtual bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) |
Set item content. More... | |
![]() | |
ParameterFileModel (QString fileName="", QObject *parent=0, QString metaFile="") | |
Constructor initializing the model with the given file. More... | |
virtual | ~ParameterFileModel () |
Default destructor. | |
bool | active () const |
Returns the bool value of the Active Parameter. | |
void | deactivate () |
Deactivate all following plugins. | |
QString | fileName () const |
Get property _fileName. | |
int | minPriority () const |
Get property _minPriority. | |
bool | onlyParams () const |
Get property _onlyparams. | |
const QParameterFile & | parameterFile () const |
Get const pointer of ParameterFile. | |
QString | prefix () const |
Get property _prefix. | |
bool | prefixValid () const |
Check prefix. | |
void | reactivate () |
Reactivate all following plugins. | |
void | reactivatePreviousPlugins () |
Reactivates all previous plugins. | |
bool | useMetaInfo () const |
Get property _useMetadata;. | |
virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const |
Return number of table rows. More... | |
virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const |
Return number of table columns. More... | |
virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
Access to item content. More... | |
virtual Qt::ItemFlags | flags (const QModelIndex &index) const |
Item flags (editable etc). More... | |
virtual QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
Data for the table headers. More... | |
virtual bool | insertRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
Add data to the model. More... | |
virtual Qt::DropActions | supportedDropActions () const |
virtual QStringList | mimeTypes () const |
virtual bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) |
bool | metaInfoValid () const |
check for available metaInfos | |
QStringList | getClasses () const |
get classes contained in metadata file | |
QString | getClass (QString objName, bool fixCase=false) const |
get class of some given object More... | |
QString | getType (QString parName, bool applyTmplType=true) const |
Get type of some parameter or slot. More... | |
QString | getDefault (QString parName) const |
pass to metaInfo, use dynamic metadata if needed | |
QString | getDoc (QString parName) const |
pass to metaInfo, use dynamic metadata if needed | |
QStringList | getInputs (QString objName) const |
Get input slots of object. More... | |
QStringList | getInputDisplayNames (QString objName) const |
Get input slots of object. More... | |
QStringList | getOutputs (QString objName) const |
Get output slots of object. More... | |
QStringList | getOutputDisplayNames (QString objName) const |
Get output slots of object. More... | |
QStringList | getParameters (QString objName) const |
Get parameters of object. More... | |
bool | isParameter (QString name) const |
Check if some parameter/slot is a parameter. More... | |
bool | isInputSlot (QString name) const |
Check if some parameter/slot is an input slot. More... | |
bool | isOutputSlot (QString name) const |
Check if some parameter/slot is an output slot. More... | |
bool | isMultiSlot (QString name) const |
Check if some slot is a multi slot. More... | |
QString | getValue (QString parName) const |
Get a parameter from the underlying parameter file. More... | |
void | setValue (QString parName, QString value) |
Set a parameter in the underlying parameter file. More... | |
bool | isSet (QString parName) const |
pass to QParameterFile::isSet | |
void | erase (QString parName) |
Delete a parameter from the the underlying parameter file. More... | |
bool | rename (QString oldPrefix, QString newPrefix) |
rename prefix More... | |
Protected Slots | |
virtual bool | _load () |
Load data without showing OpenFile Dialog. | |
![]() | |
virtual bool | _load () |
Load data without showing OpenFile Dialog. More... | |
virtual void | _update () |
Update content (e.g. when prefix has changed) | |
virtual void | _updatePriority (const QModelIndex &topLeft, const QModelIndex &bottomRight) |
Update filter if priority changed. | |
Additional Inherited Members | |
![]() | |
QMutex * | _resetMutex |
avoid multiple reset model calls | |
![]() | |
QString | _fileName |
Store filename of the model data file. | |
int | _minPriority |
minimum priority to be listed | |
bool | _onlyParams |
only show configurable parameters | |
QString | _prefix |
Parameter prefix. | |
bool | _useMetaInfo |
toggle usage of metadata | |
Definition at line 32 of file GraphModel.h.
GraphModel::GraphModel | ( | QString | fileName = "" , |
QObject * | parent = 0 , |
||
QString | metaFile = "" |
||
) |
metaFile | ParameterFile describing classes and in-/outputs |
fileName | filename of the textfile to load. |
parent | parent QObject passed to inherited constructor. |
Definition at line 49 of file GraphModel.cpp.
References ParameterFileModel::dynamicUpdate(), graphChanged(), and ParameterFileModel::useMetaInfo().
|
slot |
className | name of the class to create a new node |
draw | emit display refresh signal if true |
Definition at line 385 of file GraphModel.cpp.
References QTextInputDialog::getText(), graphChanged(), nodeValid(), QParameterFile::prefixCheck, ParameterFileModel::setValue(), and ParameterFileModel::statusMessage().
|
virtual |
draw | emit display refresh signal if true |
Definition at line 66 of file GraphModel.cpp.
References ParameterFileModel::clear(), graphChanged(), and ParameterFileModel::setPrefix().
|
virtual |
This has to be set up separately to override the parent class method.
Reimplemented from ParameterFileModel.
Definition at line 73 of file GraphModel.cpp.
bool GraphModel::connected | ( | QString | source, |
QString | target | ||
) | const |
This can also be used, to check if a connection could be established (using an exception as hint, that something goes wrong).
source | source slot ("\<object\>.\<slot\>") |
target | target slot ("\<object\>.\<slot\>") |
runtime_error | if connection is not valid |
true | nodes are connected |
Definition at line 128 of file GraphModel.cpp.
References ParameterFileModel::getType(), ParameterFileModel::getValue(), ParameterFileModel::isInputSlot(), and ParameterFileModel::isOutputSlot().
|
slot |
source | source slot ("\<object\>.\<slot\>") |
target | target slot ("\<object\>.\<slot\>") |
draw | emit display refresh signal if true |
Definition at line 175 of file GraphModel.cpp.
References connected(), disconnectSlot(), ParameterFileModel::getValue(), graphChanged(), ParameterFileModel::isInputSlot(), ParameterFileModel::isMultiSlot(), ParameterFileModel::setValue(), and ParameterFileModel::statusMessage().
|
slot |
nodename | name of the node to delete |
draw | emit display refresh signal if true |
Definition at line 301 of file GraphModel.cpp.
References disconnectAllSlots(), ParameterFileModel::erase(), QParameterFile::getKeyList(), graphChanged(), nodeValid(), ParameterFileModel::parameterFile(), ParameterFileModel::prefix(), removeRows(), ParameterFileModel::rowCount(), selectNext(), ParameterFileModel::setOnlyParams(), ParameterFileModel::setPrefix(), and ParameterFileModel::statusMessage().
|
slot |
node | node name ("\<object\>") |
draw | emit display refresh signal if true |
Definition at line 249 of file GraphModel.cpp.
References disconnectSlot(), ParameterFileModel::getInputs(), ParameterFileModel::getOutputs(), graphChanged(), and ParameterFileModel::statusMessage().
|
slot |
source | source slot ("\<object\>.\<slot\>") |
target | target slot ("\<object\>.\<slot\>"), disconnect from all targets, if empty |
draw | emit display refresh signal if true |
Definition at line 222 of file GraphModel.cpp.
References ParameterFileModel::getValue(), graphChanged(), ParameterFileModel::setValue(), and ParameterFileModel::statusMessage().
|
virtualslot |
fileName | filename to load from |
Definition at line 169 of file GraphModel.cpp.
References ParameterFileModel::loadMetaInfo().
bool GraphModel::nodeValid | ( | const QString & | name | ) | const |
name | node name |
true | node is valid |
Definition at line 124 of file GraphModel.cpp.
References ParameterFileModel::getClass().
|
slot |
this has to be done, when the ParameterFileModel content has been changed so that the graph structure has to be redrawn
Definition at line 77 of file GraphModel.cpp.
References graphChanged().
|
virtual |
row | first row to delete |
count | number of rows to append |
parent | parent item (here unused) |
Reimplemented from ParameterFileModel.
Definition at line 476 of file GraphModel.cpp.
References ParameterFileModel::data(), ParameterFileModel::getDefault(), ParameterFileModel::prefix(), ParameterFileModel::removeRows(), and setData().
|
slot |
nodename | name of the node to rename |
draw | emit display refresh signal if true |
Definition at line 264 of file GraphModel.cpp.
References QTextInputDialog::getText(), graphChanged(), nodeValid(), QParameterFile::prefixCheck, ParameterFileModel::rename(), and ParameterFileModel::statusMessage().
|
slot |
back | select previous item, if back is true |
Definition at line 362 of file GraphModel.cpp.
References nodes(), ParameterFileModel::prefix(), ParameterFileModel::prefixValid(), and ParameterFileModel::setPrefix().
|
virtual |
Overwrite the current value with the given one.
index | item index |
value | new value to set |
role | display role |
true | data successfully set |
false | failure setting value |
Reimplemented from ParameterFileModel.
Definition at line 444 of file GraphModel.cpp.
References ParameterFileModel::data(), disconnectSlot(), ParameterFileModel::getInputs(), ParameterFileModel::getOutputs(), ParameterFileModel::getType(), graphChanged(), ParameterFileModel::prefix(), ParameterFileModel::prefixValid(), and ParameterFileModel::setData().