![]() |
Eclipse SUMO - Simulation of Urban MObility
|
#include <GNEPythonTool.h>
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 | |
OptionsCont & | getToolsOptions () |
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 | |
GNEApplicationWindow * | myApplicationWindow = 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. | |
GNEPythonTool & | operator= (const GNEPythonTool &)=delete |
Invalidated assignment operator. | |
Definition at line 36 of file GNEPythonTool.h.
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, myMenuCommand, myPythonToolName, myPythonToolsOptions, myPythonToolsOptionsOriginal, TemplateHandler::parseTemplate(), TL, TOOL_PYTHON, and WRITE_ERROR.
|
virtual |
destructor
Definition at line 58 of file GNEPythonTool.cpp.
|
privatedelete |
Invalidated copy constructor.
|
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 GNERunPythonToolDialog::getRunCommand(), and saveConfiguration().
|
protected |
get command (python + script)
Definition at line 92 of file GNEPythonTool.cpp.
References myToolPath.
Referenced by GNENetDiffTool::getCommand(), and getCommand().
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 OptionsCont::getValueString(), and myPythonToolsOptionsOriginal.
FXMenuCommand * GNEPythonTool::getMenuCommand | ( | ) | const |
get menu command
Definition at line 74 of file GNEPythonTool.cpp.
References myMenuCommand.
Referenced by GNERunPythonToolDialog::onCmdAccept(), GNERunPythonToolDialog::onCmdBack(), and GNEPythonToolDialog::onCmdRun().
const std::string & GNEPythonTool::getToolName | ( | ) | const |
OptionsCont & GNEPythonTool::getToolsOptions | ( | ) |
get tools options
Definition at line 68 of file GNEPythonTool.cpp.
References myPythonToolsOptions.
Referenced by GNEPythonToolDialog::buildArguments().
bool GNEPythonTool::loadConfiguration | ( | const std::string & | file | ) |
load configuration
Definition at line 169 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().
|
privatedelete |
Invalidated assignment operator.
|
virtual |
execute post processing
Reimplemented in GNENetDiffTool.
Definition at line 86 of file GNEPythonTool.cpp.
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.
Referenced by GNEPythonToolDialog::onCmdSave().
|
virtual |
set current values (used for set values like current folder and similar)
Reimplemented in GNENetDiffTool.
Definition at line 80 of file GNEPythonTool.cpp.
|
protected |
application window
Definition at line 75 of file GNEPythonTool.h.
Referenced by GNENetDiffTool::loadShapes(), and GNENetDiffTool::postProcessing().
|
protected |
menu command associated with this tool
Definition at line 78 of file GNEPythonTool.h.
Referenced by getMenuCommand(), and GNEPythonTool().
|
protected |
tool name
Definition at line 90 of file GNEPythonTool.h.
Referenced by getToolName(), GNEPythonTool(), loadConfiguration(), and saveConfiguration().
|
protected |
tools options
Definition at line 81 of file GNEPythonTool.h.
Referenced by GNENetDiffTool::getCommand(), getCommand(), getToolsOptions(), GNENetDiffTool::GNENetDiffTool(), GNEPythonTool(), loadConfiguration(), GNENetDiffTool::postProcessing(), and GNENetDiffTool::setCurrentValues().
|
protected |
original tools options
Definition at line 84 of file GNEPythonTool.h.
Referenced by getDefaultValue(), GNENetDiffTool::GNENetDiffTool(), and GNEPythonTool().
|
protected |
python tool path relative to SUMO_HOME
Definition at line 87 of file GNEPythonTool.h.
Referenced by getCommandPath().