Eclipse SUMO - Simulation of Urban MObility
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) More...
 
const std::string getDefaultValue (const std::string &name) const
 get default value of the given parameter More...
 
GNEApplicationWindowgetGNEApp () const
 get to GNEApplicationWindow More...
 
FXMenuCommand * getMenuCommand () const
 get menu command More...
 
const std::string & getToolName () const
 get tool name More...
 
OptionsContgetToolsOptions ()
 get tools options More...
 
 GNEPythonTool (GNEApplicationWindow *GNEApp, const std::string &toolPath, const std::string &templateStr, FXMenuPane *menu)
 Constructor. More...
 
bool loadConfiguration (const std::string &file)
 load configuration More...
 
virtual void postProcessing ()
 execute post processing More...
 
void saveConfiguration (const std::string &file) const
 save configuration More...
 
virtual void setCurrentValues ()
 set current values (used for set values like current folder and similar) More...
 
virtual ~GNEPythonTool ()
 destructor More...
 

Protected Member Functions

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

Protected Attributes

GNEApplicationWindowmyGNEApp
 pointer to GNEApplicationWindow More...
 
FXMenuCommand * myMenuCommand
 menu command associated with this tool More...
 
const std::string myPythonToolName
 tool name More...
 
OptionsCont myPythonToolsOptions
 tools options More...
 
OptionsCont myPythonToolsOptionsOriginal
 original tools options More...
 
const std::string myToolPath
 python tool path relative to SUMO_HOME More...
 

Private Member Functions

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

Detailed Description

Definition at line 36 of file GNEPythonTool.h.

Constructor & Destructor Documentation

◆ GNEPythonTool() [1/2]

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

◆ ~GNEPythonTool()

GNEPythonTool::~GNEPythonTool ( )
virtual

destructor

Definition at line 58 of file GNEPythonTool.cpp.

◆ GNEPythonTool() [2/2]

GNEPythonTool::GNEPythonTool ( const GNEPythonTool )
privatedelete

Invalidated copy constructor.

Member Function Documentation

◆ getCommand()

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

get command (python + script + arguments)

Reimplemented in GNENetDiffTool.

Definition at line 126 of file GNEPythonTool.cpp.

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

Referenced by GNERunPythonTool::run().

Here is the caller graph for this function:

◆ getCommandPath()

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

get command (python + script)

Definition at line 98 of file GNEPythonTool.cpp.

References myToolPath.

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

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 163 of file GNEPythonTool.cpp.

References OptionsCont::getValueString(), and myPythonToolsOptionsOriginal.

◆ getGNEApp()

GNEApplicationWindow * GNEPythonTool::getGNEApp ( ) const

get to GNEApplicationWindow

Definition at line 62 of file GNEPythonTool.cpp.

References myGNEApp.

◆ getMenuCommand()

FXMenuCommand * GNEPythonTool::getMenuCommand ( ) const

get menu command

Definition at line 80 of file GNEPythonTool.cpp.

References myMenuCommand.

Referenced by GNERunPythonToolDialog::onCmdBack(), GNERunPythonToolDialog::onCmdClose(), and GNEPythonToolDialog::onCmdRun().

Here is the caller graph for this function:

◆ getToolName()

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

get tool name

Definition at line 68 of file GNEPythonTool.cpp.

References myPythonToolName.

Referenced by GNEPythonToolDialog::openDialog(), and GNERunPythonToolDialog::runTool().

Here is the caller graph for this function:

◆ getToolsOptions()

OptionsCont & GNEPythonTool::getToolsOptions ( )

get tools options

Definition at line 74 of file GNEPythonTool.cpp.

References myPythonToolsOptions.

Referenced by GNEPythonToolDialog::buildArguments().

Here is the caller graph for this function:

◆ loadConfiguration()

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

load configuration

Definition at line 175 of file GNEPythonTool.cpp.

References OptionsLoader::errorOccurred(), myPythonToolName, myPythonToolsOptions, OptionsCont::resetWritable(), TL, TLF, StringUtils::transcode(), StringUtils::transcodeToLocal(), WRITE_ERROR, and WRITE_MESSAGE.

Referenced by GNEPythonToolDialog::onCmdLoad().

Here is the caller graph for this function:

◆ operator=()

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

Invalidated assignment operator.

◆ postProcessing()

void GNEPythonTool::postProcessing ( )
virtual

execute post processing

Reimplemented in GNENetDiffTool.

Definition at line 92 of file GNEPythonTool.cpp.

◆ saveConfiguration()

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

save configuration

Definition at line 203 of file GNEPythonTool.cpp.

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

Referenced by GNEPythonToolDialog::onCmdSave().

Here is the caller graph for this function:

◆ setCurrentValues()

void GNEPythonTool::setCurrentValues ( )
virtual

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

Reimplemented in GNENetDiffTool.

Definition at line 86 of file GNEPythonTool.cpp.

Referenced by GNEPythonToolDialog::openDialog().

Here is the caller graph for this function:

Field Documentation

◆ myGNEApp

GNEApplicationWindow* GNEPythonTool::myGNEApp
protected

◆ myMenuCommand

FXMenuCommand* GNEPythonTool::myMenuCommand
protected

menu command associated with this tool

Definition at line 85 of file GNEPythonTool.h.

Referenced by getMenuCommand(), and GNEPythonTool().

◆ myPythonToolName

const std::string GNEPythonTool::myPythonToolName
protected

tool name

Definition at line 97 of file GNEPythonTool.h.

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

◆ myPythonToolsOptions

◆ myPythonToolsOptionsOriginal

OptionsCont GNEPythonTool::myPythonToolsOptionsOriginal
protected

original tools options

Definition at line 91 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 94 of file GNEPythonTool.h.

Referenced by getCommandPath().


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