Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEPythonTool Class Reference

#include <GNEPythonTool.h>

Inheritance diagram for GNEPythonTool:
[legend]
Collaboration diagram for GNEPythonTool:
[legend]

Public Member Functions

virtual std::string getCommand () const
 get command (python + script + arguments)
const std::string getDefaultValue (const std::string &name) const
 get default value of the given parameter
FXMenuCommand * getMenuCommand () const
 get menu command
const std::string & getToolName () const
 get tool name
OptionsContgetToolsOptions ()
 get tools options
 GNEPythonTool (GNEApplicationWindow *applicationWindow, const std::string &toolPath, const std::string &templateStr, FXMenuPane *menu)
 Constructor.
bool loadConfiguration (const std::string &file)
 load configuration
virtual void postProcessing ()
 execute post processing
void saveConfiguration (const std::string &file) const
 save configuration
virtual void setCurrentValues ()
 set current values (used for set values like current folder and similar)
virtual ~GNEPythonTool ()
 destructor

Protected Member Functions

std::string getCommandPath () const
 get command (python + script)

Protected Attributes

GNEApplicationWindowmyApplicationWindow = nullptr
 application window
FXMenuCommand * myMenuCommand = nullptr
 menu command associated with this tool
const std::string myPythonToolName
 tool name
OptionsCont myPythonToolsOptions
 tools options
OptionsCont myPythonToolsOptionsOriginal
 original tools options
const std::string myToolPath
 python tool path relative to SUMO_HOME

Private Member Functions

 GNEPythonTool (const GNEPythonTool &)=delete
 Invalidated copy constructor.
GNEPythonTooloperator= (const GNEPythonTool &)=delete
 Invalidated assignment operator.

Detailed Description

Definition at line 36 of file GNEPythonTool.h.

Constructor & Destructor Documentation

◆ GNEPythonTool() [1/2]

GNEPythonTool::GNEPythonTool ( GNEApplicationWindow * applicationWindow,
const std::string & toolPath,
const std::string & templateStr,
FXMenuPane * menu )

Constructor.

Definition at line 37 of file GNEPythonTool.cpp.

References GUIDesigns::buildFXMenuCommandShortcut(), GUIIconSubSys::getIcon(), MID_GNE_OPENPYTHONTOOLDIALOG, myApplicationWindow, myMenuCommand, myPythonToolName, myPythonToolsOptions, myPythonToolsOptionsOriginal, myToolPath, TemplateHandler::parseTemplate(), TL, TOOL_PYTHON, and WRITE_ERROR.

Referenced by GNENetDiffTool::GNENetDiffTool(), GNEPythonTool(), and operator=().

Here is the caller graph for this function:

◆ ~GNEPythonTool()

GNEPythonTool::~GNEPythonTool ( )
virtual

destructor

Definition at line 58 of file GNEPythonTool.cpp.

◆ GNEPythonTool() [2/2]

GNEPythonTool::GNEPythonTool ( const GNEPythonTool & )
privatedelete

Invalidated copy constructor.

References GNEPythonTool().

Member Function Documentation

◆ getCommand()

std::string GNEPythonTool::getCommand ( ) const
virtual

get command (python + script + arguments)

Reimplemented in GNENetDiffTool.

Definition at line 120 of file GNEPythonTool.cpp.

References StringUtils::escapeShell(), getCommandPath(), StringTokenizer::getVector(), and myPythonToolsOptions.

Referenced by saveConfiguration().

Here is the caller graph for this function:

◆ getCommandPath()

std::string GNEPythonTool::getCommandPath ( ) const
protected

get command (python + script)

Definition at line 92 of file GNEPythonTool.cpp.

References myToolPath.

Referenced by GNENetDiffTool::getCommand(), and getCommand().

Here is the caller graph for this function:

◆ getDefaultValue()

const std::string GNEPythonTool::getDefaultValue ( const std::string & name) const

get default value of the given parameter

Definition at line 157 of file GNEPythonTool.cpp.

References invalid_return< std::string >::value, and myPythonToolsOptionsOriginal.

◆ getMenuCommand()

FXMenuCommand * GNEPythonTool::getMenuCommand ( ) const

get menu command

Definition at line 74 of file GNEPythonTool.cpp.

References myMenuCommand.

◆ getToolName()

const std::string & GNEPythonTool::getToolName ( ) const

get tool name

Definition at line 62 of file GNEPythonTool.cpp.

References myPythonToolName.

◆ getToolsOptions()

OptionsCont & GNEPythonTool::getToolsOptions ( )

get tools options

Definition at line 68 of file GNEPythonTool.cpp.

References myPythonToolsOptions.

◆ loadConfiguration()

bool GNEPythonTool::loadConfiguration ( const std::string & file)

◆ operator=()

GNEPythonTool & GNEPythonTool::operator= ( const GNEPythonTool & )
privatedelete

Invalidated assignment operator.

References GNEPythonTool().

◆ postProcessing()

void GNEPythonTool::postProcessing ( )
virtual

execute post processing

Reimplemented in GNENetDiffTool.

Definition at line 86 of file GNEPythonTool.cpp.

◆ saveConfiguration()

void GNEPythonTool::saveConfiguration ( const std::string & file) const

save configuration

Definition at line 197 of file GNEPythonTool.cpp.

References getCommand(), myPythonToolName, SysUtils::runHiddenCommand(), TLF, and WRITE_MESSAGE.

◆ setCurrentValues()

void GNEPythonTool::setCurrentValues ( )
virtual

set current values (used for set values like current folder and similar)

Reimplemented in GNENetDiffTool.

Definition at line 80 of file GNEPythonTool.cpp.

Field Documentation

◆ myApplicationWindow

GNEApplicationWindow* GNEPythonTool::myApplicationWindow = nullptr
protected

application window

Definition at line 75 of file GNEPythonTool.h.

Referenced by GNEPythonTool(), GNENetDiffTool::loadShapes(), and GNENetDiffTool::postProcessing().

◆ myMenuCommand

FXMenuCommand* GNEPythonTool::myMenuCommand = nullptr
protected

menu command associated with this tool

Definition at line 78 of file GNEPythonTool.h.

Referenced by getMenuCommand(), and GNEPythonTool().

◆ myPythonToolName

const std::string GNEPythonTool::myPythonToolName
protected

tool name

Definition at line 90 of file GNEPythonTool.h.

Referenced by getToolName(), GNEPythonTool(), loadConfiguration(), and saveConfiguration().

◆ myPythonToolsOptions

◆ myPythonToolsOptionsOriginal

OptionsCont GNEPythonTool::myPythonToolsOptionsOriginal
protected

original tools options

Definition at line 84 of file GNEPythonTool.h.

Referenced by getDefaultValue(), GNENetDiffTool::GNENetDiffTool(), and GNEPythonTool().

◆ myToolPath

const std::string GNEPythonTool::myToolPath
protected

python tool path relative to SUMO_HOME

Definition at line 87 of file GNEPythonTool.h.

Referenced by getCommandPath(), and GNEPythonTool().


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