Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNETypeDistributionFrame.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-2023 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// The Widget for edit type distribution elements
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
24
25// ===========================================================================
26// class definitions
27// ===========================================================================
32
33public:
34 // ===========================================================================
35 // class declaration
36 // ===========================================================================
37
39
40 // ===========================================================================
41 // class TypeDistributionEditor
42 // ===========================================================================
43
47
48 public:
50 TypeDistributionEditor(GNETypeDistributionFrame* typeDistributionFrameParent);
51
54
57
59 long onCmdCreateType(FXObject*, FXSelector, void*);
60
62 long onCmdDeleteType(FXObject*, FXSelector, void*);
63
65 long onUpdDeleteType(FXObject* sender, FXSelector, void*);
66
68
69 protected:
71 FOX_CONSTRUCTOR(TypeDistributionEditor)
72
73 private:
76
78 FXButton* myCreateTypeButton = nullptr;
79
81 FXButton* myDeleteTypeButton = nullptr;
82 };
83
84 // ===========================================================================
85 // class TypeDistributionSelector
86 // ===========================================================================
87
91
92 public:
95
98
101
103 void setCurrentTypeDistribution(const GNEDemandElement* vTypeDistribution);
104
107
110
112 long onCmdSelectTypeDistribution(FXObject*, FXSelector, void*);
113
115 long onCmdUpdateTypeDistribution(FXObject* sender, FXSelector, void*);
116
118
119 protected:
120 FOX_CONSTRUCTOR(TypeDistributionSelector)
121
122 private:
125
127 FXComboBox* myTypeComboBox = nullptr;
128
131 };
132
133 // ===========================================================================
134 // class TypeAttributesEditorRow
135 // ===========================================================================
136
137 class TypeAttributesEditorRow : protected FXHorizontalFrame {
140
141 public:
143 TypeAttributesEditorRow(TypeAttributesEditor* attributeEditorParent, const GNEAttributeProperties& ACAttr, const std::string& value);
144
146 void destroy();
147
149 void refreshTypeAttributesEditorRow(const std::string& value);
150
153
156
158 long onCmdSetAttribute(FXObject*, FXSelector, void*);
159
161
162 protected:
165
166 private:
169
172
175
178 };
179
180 // ===========================================================================
181 // class TypeAttributesEditor
182 // ===========================================================================
183
187
188 public:
190 TypeAttributesEditor(GNETypeDistributionFrame* typeDistributionFrameParent);
191
194
197
200
203
206
208 long onCmdTypeAttributesEditorHelp(FXObject*, FXSelector, void*);
209
211
212 protected:
214 FOX_CONSTRUCTOR(TypeAttributesEditor)
215
216 private:
219
221 std::vector<TypeAttributesEditorRow*> myTypeAttributesEditorRows;
222
224 FXButton* myHelpButton = nullptr;
225 };
226
232
235
237 void show();
238
241
242protected:
244 void attributeUpdated(SumoXMLAttr attribute);
245
246private:
249
252
255};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
An Element which don't belong to GNENet but has influence in the simulation.
void showAttributeEditorModule()
show attributes of multiple ACs
long onCmdTypeAttributesEditorHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
GNETypeDistributionFrame * myTypeDistributionFrameParent
fox need this
void refreshAttributeEditor()
refresh attribute editor (only the valid values will be refresh)
GNETypeDistributionFrame * getTypeDistributionFrameParent() const
pointer to GNEFrame parent
std::vector< TypeAttributesEditorRow * > myTypeAttributesEditorRows
list of Attribute editor rows
const GNEAttributeProperties myACAttr
current AC Attribute
void refreshTypeAttributesEditorRow(const std::string &value)
refresh current row
long onCmdSetAttribute(FXObject *, FXSelector, void *)
try to set new attribute value
void destroy()
destroy GNEAttributesCreatorRow (but don't delete)
MFXLabelTooltip * myAttributeLabel
pointer to attribute label
MFXTextFieldTooltip * myValueTextField
textField to modify the value of string attributes
TypeAttributesEditor * myTypeAttributesEditorParent
pointer to TypeAttributesEditor parent
bool isTypeAttributesEditorRowValid() const
check if current attribute of TextField/ComboBox is valid
long onCmdCreateType(FXObject *, FXSelector, void *)
Called when "create type distribution" button is clicked.
long onUpdDeleteType(FXObject *sender, FXSelector, void *)
Called when "Delete type distribution" button is updated.
long onCmdDeleteType(FXObject *, FXSelector, void *)
Called when "Delete type distribution" button is clicked.
FXButton * myCreateTypeButton
"create vehicle type" button
FXButton * myDeleteTypeButton
"delete vehicle type" button
GNETypeDistributionFrame * myTypeDistributionFrameParent
FOX needs this.
std::string myCurrentTypeDistribution
current type distribution
FXComboBox * myTypeComboBox
comboBox with the list of type distributions
GNETypeDistributionFrame * myTypeDistributionFrameParent
pointer to Frame Parent
void setCurrentTypeDistribution(const GNEDemandElement *vTypeDistribution)
set current vehicle type distribution
long onCmdUpdateTypeDistribution(FXObject *sender, FXSelector, void *)
update type distribution comboBox
GNEDemandElement * getCurrentTypeDistribution() const
get current Vehicle Type distribution
long onCmdSelectTypeDistribution(FXObject *, FXSelector, void *)
Called when the user select type distribution in ComboBox.
TypeDistributionSelector * getTypeDistributionSelector() const
get type distribution selector
TypeDistributionSelector * myTypeDistributionSelector
type distribution selector
void attributeUpdated(SumoXMLAttr attribute)
function called after set a valid attribute in AttributeCreator/AttributeEditor/ParametersEditor/....
TypeDistributionEditor * myTypeDistributionEditor
type editor
TypeAttributesEditor * myTypeTypeAttributesEditor
editor for vehicle type attributes
A single child window which contains a view of the simulation area.
MFXGroupBoxModule (based on FXGroupBox)