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 | |
GNEApplicationWindow * | getGNEApp () const |
get to GNEApplicationWindow | |
FXMenuCommand * | getMenuCommand () const |
get menu command | |
const std::string & | getToolName () const |
get tool name | |
OptionsCont & | getToolsOptions () |
get tools options | |
GNEPythonTool (GNEApplicationWindow *GNEApp, 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 * | myGNEApp |
pointer to GNEApplicationWindow | |
FXMenuCommand * | myMenuCommand |
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 * | GNEApp, |
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 126 of file GNEPythonTool.cpp.
References StringUtils::escapeShell(), getCommandPath(), StringTokenizer::getVector(), and myPythonToolsOptions.
Referenced by GNERunPythonTool::run().
|
protected |
get command (python + script)
Definition at line 98 of file GNEPythonTool.cpp.
References myToolPath.
Referenced by GNENetDiffTool::getCommand(), getCommand(), and saveConfiguration().
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.
GNEApplicationWindow * GNEPythonTool::getGNEApp | ( | ) | const |
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().
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().
OptionsCont & GNEPythonTool::getToolsOptions | ( | ) |
get tools options
Definition at line 74 of file GNEPythonTool.cpp.
References myPythonToolsOptions.
Referenced by GNEPythonToolDialog::buildArguments().
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().
|
privatedelete |
Invalidated assignment operator.
|
virtual |
execute post processing
Reimplemented in GNENetDiffTool.
Definition at line 92 of file GNEPythonTool.cpp.
void GNEPythonTool::saveConfiguration | ( | const std::string & | file | ) | const |
save configuration
Definition at line 203 of file GNEPythonTool.cpp.
References StringUtils::escapeShell(), getCommandPath(), myPythonToolName, myPythonToolsOptions, 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 86 of file GNEPythonTool.cpp.
Referenced by GNEPythonToolDialog::openDialog().
|
protected |
pointer to GNEApplicationWindow
Definition at line 82 of file GNEPythonTool.h.
Referenced by getGNEApp(), GNENetDiffTool::loadShapes(), and GNENetDiffTool::postProcessing().
|
protected |
menu command associated with this tool
Definition at line 85 of file GNEPythonTool.h.
Referenced by getMenuCommand(), and GNEPythonTool().
|
protected |
tool name
Definition at line 97 of file GNEPythonTool.h.
Referenced by getToolName(), GNEPythonTool(), loadConfiguration(), and saveConfiguration().
|
protected |
tools options
Definition at line 88 of file GNEPythonTool.h.
Referenced by GNENetDiffTool::getCommand(), getCommand(), getToolsOptions(), GNENetDiffTool::GNENetDiffTool(), GNEPythonTool(), loadConfiguration(), GNENetDiffTool::postProcessing(), saveConfiguration(), and GNENetDiffTool::setCurrentValues().
|
protected |
original tools options
Definition at line 91 of file GNEPythonTool.h.
Referenced by getDefaultValue(), GNENetDiffTool::GNENetDiffTool(), and GNEPythonTool().
|
protected |
python tool path relative to SUMO_HOME
Definition at line 94 of file GNEPythonTool.h.
Referenced by getCommandPath().