Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEFrameAttributeModules.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-2024 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// Auxiliar class for GNEFrame Modules (only for attributes edition)
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
31
32// ===========================================================================
33// class declaration
34// ===========================================================================
35
36class GNEFrame;
37class GNEViewParent;
38class GNEFlowEditor;
40class GNETypeFrame;
41
42// ===========================================================================
43// class definitions
44// ===========================================================================
45
47
48public:
49 // ===========================================================================
50 // class declaration
51 // ===========================================================================
52
53 class AttributesEditor;
54
55 // ===========================================================================
56 // class GenericDataAttributes
57 // ===========================================================================
58
62
63 public:
65 GenericDataAttributes(GNEFrame* frameParent);
66
69
72
75
78
81
83 std::string getParametersStr() const;
84
86 std::vector<std::pair<std::string, std::string> > getParameters() const;
87
89 void setParameters(const std::vector<std::pair<std::string, std::string> >& parameters);
90
92 GNEFrame* getFrameParent() const;
93
95 bool areAttributesValid() const;
96
100 long onCmdEditParameters(FXObject*, FXSelector, void*);
101
103 long onCmdSetParameters(FXObject*, FXSelector, void*);
105
106 protected:
107 FOX_CONSTRUCTOR(GenericDataAttributes)
108
109 private:
112
115
117 FXTextField* myTextFieldParameters = nullptr;
118
120 FXButton* myButtonEditParameters = nullptr;
121 };
122
123 // ===========================================================================
124 // class ParametersEditor
125 // ===========================================================================
126
130
131 public:
133 ParametersEditor(GNEInspectorFrame* inspectorFrameParent);
134
136 ParametersEditor(GNETypeFrame* typeFrameParent);
137
140
142 GNEViewNet* getViewNet() const;
143
146
149
152
155
158
162 long onCmdEditParameters(FXObject*, FXSelector, void*);
163
165 long onCmdSetParameters(FXObject*, FXSelector, void*);
167
168 protected:
170 FOX_CONSTRUCTOR(ParametersEditor)
171
172 private:
175
178
180 FXTextField* myTextFieldParameters = nullptr;
181
183 FXButton* myButtonEditParameters = nullptr;
184 };
185
187 static bool isSupermodeValid(const GNEViewNet* viewNet, const GNEAttributeCarrier* AC);
188
190 static bool isSupermodeValid(const GNEViewNet* viewNet, const GNEAttributeProperties& ACAttr);
191};
long onCmdSetParameters(FXObject *, FXSelector, void *)
Called when user udpate the parameter text field.
bool areAttributesValid() const
check if current attributes are valid
const Parameterised::Map & getParametersMap() const
get parameters as map
FXButton * myButtonEditParameters
button for edit parameters using specific dialog
void refreshGenericDataAttributes()
refresh netedit attributes
FXTextField * myTextFieldParameters
text field for write parameters
void showGenericDataAttributes()
show netedit attributes EditorCreator
long onCmdEditParameters(FXObject *, FXSelector, void *)
GNEFrame * getFrameParent() const
pointer to frame parent
std::vector< std::pair< std::string, std::string > > getParameters() const
get parameters as vector of strings
std::string getParametersStr() const
get parameters as string
Parameterised::Map myParameters
pointer to current map of parameters
void hideGenericDataAttributes()
hide netedit attributes EditorCreator
void setParameters(const std::vector< std::pair< std::string, std::string > > &parameters)
set parameters
void refreshParametersEditor()
refresh netedit attributes
long onCmdSetParameters(FXObject *, FXSelector, void *)
Called when user udpate the parameter text field.
GNEInspectorFrame * myInspectorFrameParent
FOX need this.
long onCmdEditParameters(FXObject *, FXSelector, void *)
void hideParametersEditor()
hide netedit attributes EditorInspector
GNEInspectorFrame * getInspectorFrameParent() const
get inspector frame parent
FXButton * myButtonEditParameters
button for edit parameters using specific dialog
FXTextField * myTextFieldParameters
text field for write parameters
GNETypeFrame * getTypeFrameParent() const
get type frame parent
void showParametersEditor()
show netedit attributes EditorInspector
static bool isSupermodeValid(const GNEViewNet *viewNet, const GNEAttributeCarrier *AC)
return true if AC can be edited in the current supermode
A single child window which contains a view of the simulation area.
MFXGroupBoxModule (based on FXGroupBox)
std::map< std::string, std::string > Map
parameters map