Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEPythonToolDialog.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// Dialog for tools
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
25
27
28// ===========================================================================
29// class declarations
30// ===========================================================================
31
32class GNEPythonTool;
34
35// ===========================================================================
36// class definitions
37// ===========================================================================
38
39class GNEPythonToolDialog : protected GNEDialog {
41 FXDECLARE(GNEPythonToolDialog)
42
43
45
46public:
49
52
54 void runInternalTest(const InternalTestStep::DialogArgument* dialogArgument);
55
57 const GNEPythonTool* getPythonTool() const;
58
61
63 long onCmdShowToolTipsMenu(FXObject*, FXSelector, void*);
64
66 long onCmdSave(FXObject*, FXSelector, void*);
67
69 long onCmdLoad(FXObject*, FXSelector, void*);
70
72 long onCmdSetVisualization(FXObject*, FXSelector, void*);
73
75 long onCmdRun(FXObject*, FXSelector, void*);
76
78 long onCmdReset(FXObject*, FXSelector, void*);
79
81 long onUpdRequiredAttributes(FXObject* sender, FXSelector, void*);
82
84
85protected:
87 class CategoryOptions : public std::string {
88
89 public:
91 CategoryOptions(const std::string& category);
92
94 void addOption(const std::string& name, Option* option);
95
97 const std::vector<std::pair<std::string, Option*> >& getOptions() const;
98
100 void sortByName();
101
102 private:
104 std::vector<std::pair<std::string, Option*> > myOptions;
105
108 };
109
112
114 void buildArguments(bool sortByName, bool groupedByCategories);
115
118
121
123 std::vector<GNEPythonToolDialog::CategoryOptions> getOptions(OptionsCont& optionsCont) const;
124
126 std::vector<CategoryOptions> getOptionsByCategories(OptionsCont& optionsCont) const;
127
129 int getNumRowColums() const;
130
132 FXVerticalFrame* getArgumentFrameLeft() const;
133
135 FXVerticalFrame* getArgumentFrameRight() const;
136
138 std::vector<GNEPythonToolDialogElements::Argument*> myArguments;
139
141 std::vector<GNEPythonToolDialogElements::Category*> myCategories;
142
143private:
146
148 FXCheckButton* mySortedCheckButton = nullptr;
149
151 FXCheckButton* myGroupedCheckButton = nullptr;
152
154 FXVerticalFrame* myArgumentFrameLeft = nullptr;
155
157 FXVerticalFrame* myArgumentFrameRight = nullptr;
158
161
164
167};
The main window of Netedit.
internal class used for sorting options by categories
std::vector< std::pair< std::string, Option * > > myOptions
options for this category
elements used in Tool Dialogs
std::vector< CategoryOptions > getOptionsByCategories(OptionsCont &optionsCont) const
get options sorted by category
FXVerticalFrame * myArgumentFrameRight
argument frame right
GNEPythonTool * myPythonTool
python tool
GNEPythonToolDialog & operator=(const GNEPythonToolDialog &)=delete
Invalidated assignment operator.
void adjustParameterColumn()
adjust parameter column
int getNumRowColums() const
get number of row colums
long onCmdLoad(FXObject *, FXSelector, void *)
load options
std::vector< GNEPythonToolDialogElements::Argument * > myArguments
list of arguments sorted by categories
std::vector< GNEPythonToolDialogElements::Category * > myCategories
list of categories
OptionsCont myCustomToolsOptions
custom tools options
long onCmdShowToolTipsMenu(FXObject *, FXSelector, void *)
enable/disable show toolTip
long onCmdRun(FXObject *, FXSelector, void *)
event after press run button
MFXCheckableButton * myShowToolTipsMenu
menu for tooltips menu
std::vector< GNEPythonToolDialog::CategoryOptions > getOptions(OptionsCont &optionsCont) const
get options
FOX_CONSTRUCTOR(GNEPythonToolDialog)
FOX needs this.
FXVerticalFrame * getArgumentFrameLeft() const
get argument frame left
long onUpdRequiredAttributes(FXObject *sender, FXSelector, void *)
event for check if required attributes was set
FXCheckButton * mySortedCheckButton
check button to enable/diasble sorting
long onCmdSetVisualization(FXObject *, FXSelector, void *)
set visualization (sorting and grouping)
FXVerticalFrame * getArgumentFrameRight() const
get argument frame right
long onCmdReset(FXObject *, FXSelector, void *)
event after press reset button
FXVerticalFrame * myArgumentFrameLeft
argument frame left
const GNEPythonTool * getPythonTool() const
get python tool
long onCmdSave(FXObject *, FXSelector, void *)
save options
GNEPythonToolDialog(const GNEPythonToolDialog &)=delete
Invalidated copy constructor.
void runInternalTest(const InternalTestStep::DialogArgument *dialogArgument)
run internal test
void buildArguments(bool sortByName, bool groupedByCategories)
build arguments
FXCheckButton * myGroupedCheckButton
check button to enable/diasble grouping
A class representing a single program option.
Definition Option.h:74
A storage for options typed value containers)
Definition OptionsCont.h:89
Definition json.hpp:4471
every row value