ModelSpace
All Classes Namespaces Functions Variables Enumerations Pages
modelspace::ModelSpacePyConfigWriter Class Reference

Write out ModelSpace Python file from node information. More...

#include <ModelSpacePyConfigWriter.h>

Inheritance diagram for modelspace::ModelSpacePyConfigWriter:
Collaboration diagram for modelspace::ModelSpacePyConfigWriter:

Public Member Functions

void file (const std::string &filename)
 Set the file for write and redirect output to that file.
 
std::string file ()
 
void watchNode (ImNode *target)
 Add a node to the ConfigurationWriter for tracking.
 
void unwatchNode (ImNode *target)
 Remove a node from the ConfigurationWriter for tracking.
 
void write ()
 Write watched node data to file.
 

Protected Member Functions

virtual void _setNodeConnectionSequence () override
 Set the sequence of nodes for creation and write paired connections.
 
virtual void _decomposeNodeInformation () override
 Decompose all relevant strings from the provided node and connection information.
 
virtual void _writeOutputStart () override
 Write the start of the file.
 
virtual void _writeDataValue (ImNode *node) override
 Write the creation of a single node, given by node.
 
virtual void _writeDataConnection (Connection *upstream, Connection *downstream) override
 Write the connection of one "Connection" to another.
 
virtual void _writeLogData () override
 Write all logged data to file.
 
virtual void _writeOutputEnd () override
 Write the end of the file output.
 
std::string _getSignalName (Connection *signal)
 Get the full modelspace name of a signal from Connection object.
 
ImNode_getNodeByUid (int uid)
 Get pointer to a node by uid.
 
Connection_getConnectionByUid (int uid)
 Get pointer to connection by uid.
 
std::vector< Connection * > _getConnectionsByName (ImNode *node, const std::string &name)
 Return all connections matching set criteria in a node.
 
std::vector< Connection * > _getConnectionsByType (ImNode *node, int type)
 Return all connections matching set criteria in a node.
 

Protected Attributes

AutoDoc_autodoc_ptr
 
std::vector< ImNode * > _watched_nodes
 
std::vector< ImNode * > _sequenced_nodes
 
std::vector< std::pair< Connection *, Connection * > > _paired_connections
 
std::string _filename = "gui_config_file.py"
 

Detailed Description

Write out ModelSpace Python file from node information.

Member Function Documentation

◆ _decomposeNodeInformation()

void modelspace::ModelSpacePyConfigWriter::_decomposeNodeInformation ( )
overrideprotectedvirtual

Decompose all relevant strings from the provided node and connection information.

Reimplemented from modelspace::ConfigurationWriter.

◆ _getConnectionByUid()

Connection * modelspace::ModelSpacePyConfigWriter::_getConnectionByUid ( int  uid)
protected

Get pointer to connection by uid.

Parameters
uidThe uid to search
Returns
Pointer to connection associated with uid. Nullptr if not found

◆ _getConnectionsByName()

std::vector< Connection * > modelspace::ModelSpacePyConfigWriter::_getConnectionsByName ( ImNode node,
const std::string &  name 
)
protected

Return all connections matching set criteria in a node.

Parameters
nodeThe node to search
nameThe name to search for
Returns
A vector of all connections matching the criteria

◆ _getConnectionsByType()

std::vector< Connection * > modelspace::ModelSpacePyConfigWriter::_getConnectionsByType ( ImNode node,
int  type 
)
protected

Return all connections matching set criteria in a node.

Parameters
typeThe connection type to search for
nameThe name to search for
Returns
A vector of all connections matching the criteria

◆ _getNodeByUid()

ImNode * modelspace::ModelSpacePyConfigWriter::_getNodeByUid ( int  uid)
protected

Get pointer to a node by uid.

Parameters
uidThe uid to search
Returns
Pointer to node associated with uid. Nullptr if not found

◆ _getSignalName()

std::string modelspace::ModelSpacePyConfigWriter::_getSignalName ( Connection signal)
protected

Get the full modelspace name of a signal from Connection object.

Parameters
signalThe signal to resolve name of
Returns
String with signal name

◆ _setNodeConnectionSequence()

void modelspace::ModelSpacePyConfigWriter::_setNodeConnectionSequence ( )
overrideprotectedvirtual

Set the sequence of nodes for creation and write paired connections.

Reimplemented from modelspace::ConfigurationWriter.

◆ _writeDataConnection()

void modelspace::ModelSpacePyConfigWriter::_writeDataConnection ( Connection upstream,
Connection downstream 
)
overrideprotectedvirtual

Write the connection of one "Connection" to another.

Parameters
upstreamThe data output connection (typically, but not always an output) to connect
downstreamThe data input connection (typically, but not always an input) to connect

Reimplemented from modelspace::ConfigurationWriter.

◆ _writeDataValue()

void modelspace::ModelSpacePyConfigWriter::_writeDataValue ( ImNode node)
overrideprotectedvirtual

Write the creation of a single node, given by node.

Parameters
nodeThe node to write to file

Reimplemented from modelspace::ConfigurationWriter.

◆ _writeLogData()

void modelspace::ModelSpacePyConfigWriter::_writeLogData ( )
overrideprotectedvirtual

Write all logged data to file.

Reimplemented from modelspace::ConfigurationWriter.

◆ _writeOutputEnd()

void modelspace::ModelSpacePyConfigWriter::_writeOutputEnd ( )
overrideprotectedvirtual

Write the end of the file output.

Reimplemented from modelspace::ConfigurationWriter.

◆ _writeOutputStart()

void modelspace::ModelSpacePyConfigWriter::_writeOutputStart ( )
overrideprotectedvirtual

Write the start of the file.

Reimplemented from modelspace::ConfigurationWriter.

◆ file()

void modelspace::ConfigurationWriter::file ( const std::string &  filename)
inlineinherited

Set the file for write and redirect output to that file.

Parameters
filenameThe filename to write to
Returns
0 on success, 1 on failure
Note
Calling this function will cause the ConfigurationWriter class to begin writing its data to the provided file

◆ unwatchNode()

void modelspace::ConfigurationWriter::unwatchNode ( ImNode target)
inherited

Remove a node from the ConfigurationWriter for tracking.

Parameters
targetThe node to remove from tracking
Note
Will ignore node if its unique ID is not tracked

◆ watchNode()

void modelspace::ConfigurationWriter::watchNode ( ImNode target)
inherited

Add a node to the ConfigurationWriter for tracking.

Parameters
targetThe node to add to tracking
Note
Will ignore node if its unique ID is already tracked

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