Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEDistributionFrame.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// The Widget for edit distribution elements
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
25
26// ===========================================================================
27// class definitions
28// ===========================================================================
29
32class MFXComboBoxIcon;
34
35// ===========================================================================
36// class definitions
37// ===========================================================================
38
40
41public:
42 // ===========================================================================
43 // class declaration
44 // ===========================================================================
45
48
49 // ===========================================================================
50 // class DistributionEditor
51 // ===========================================================================
52
56
57
59
60 public:
62 DistributionEditor(GNEFrame* frameParent, SumoXMLTag distributionTag, GUIIcon icon);
63
66
69
72
74 long onCmdCreateDistribution(FXObject*, FXSelector, void*);
75
77 long onCmdDeleteDistribution(FXObject*, FXSelector, void*);
78
80 long onUpdDeleteDistribution(FXObject* sender, FXSelector, void*);
81
83
84 protected:
86 FOX_CONSTRUCTOR(DistributionEditor)
87
88 private:
91
94
97
100
103
106
108 DistributionEditor& operator=(const DistributionEditor& src) = delete;
109 };
110
111 // ===========================================================================
112 // class DistributionSelector
113 // ===========================================================================
114
118
119
121
122 public:
124 DistributionSelector(GNEFrame* frameParent);
125
128
130 void setDistribution(GNEDemandElement* distribution);
131
133 GNEDemandElement* getCurrentDistribution() const;
134
136 void refreshDistributionIDs();
137
139 void refreshDistributionSelector();
140
143
145 long onCmdSelectDistribution(FXObject*, FXSelector, void*);
146
148 long onCmdUpdateDistribution(FXObject* sender, FXSelector, void*);
149
151
152 protected:
154 FOX_CONSTRUCTOR(DistributionSelector)
155
157 std::map<std::string, GNEDemandElement*> fillDistributionComboBox();
158
159 private:
162
164 DistributionEditor* myDistributionEditor = nullptr;
165
167 GNEAttributesEditor* myAttributesEditor = nullptr;
168
170 DistributionValuesEditor* myDistributionValuesEditor = nullptr;
171
173 MFXComboBoxIcon* myDistributionsComboBox = nullptr;
174
176 GNEDemandElement* myCurrentDistribution = nullptr;
177
180
182 DistributionSelector& operator=(const DistributionSelector& src) = delete;
183 };
184
185 // ===========================================================================
186 // class DistributionRow
187 // ===========================================================================
188
189 class DistributionRow : protected FXHorizontalFrame {
192
193 public:
196
198 void destroy();
199
201 void refreshRow();
202
205
207 long onCmdSetProbability(FXObject*, FXSelector, void*);
208
210 long onCmdRemoveRow(FXObject*, FXSelector, void*);
211
213
214 protected:
216 FOX_CONSTRUCTOR(DistributionRow)
217
218 private:
221
223 GNEAttributeCarrier* myAC = nullptr;
224
226 MFXButtonTooltip* myDeleteRowButton = nullptr;
227
229 FXLabel* myIconLabel = nullptr;
230
232 MFXTextFieldIcon* myIDTextField = nullptr;
233
235 MFXTextFieldIcon* myProbabilityTextField = nullptr;
236
239
242 };
243
244 // ===========================================================================
245 // class DistributionValuesEditor
246 // ===========================================================================
247
251
252
254
255 public:
257 DistributionValuesEditor(GNEFrame* frameParent, DistributionEditor* distributionEditor,
258 DistributionSelector* distributionSelector,
259 GNEAttributesEditor* attributesEditor);
260
262 void showDistributionValuesEditor();
263
265 void hideDistributionValuesEditor();
266
268 void refreshRows();
269
271 GNEFrame* getFrameParent() const;
272
274 void updateSumLabel();
275
278
280 long onCmdAddRow(FXObject*, FXSelector, void*);
281
283
284 protected:
286 FOX_CONSTRUCTOR(DistributionValuesEditor)
287
288 private:
291
293 DistributionEditor* myDistributionEditor;
294
297
299 GNEAttributesEditor* myAttributesEditor;
300
302 std::vector<DistributionRow*> myDistributionRows;
303
305 FXHorizontalFrame* myBotFrame = nullptr;
306
308 MFXButtonTooltip* myAddButton = nullptr;
309
311 FXLabel* mySumLabel = nullptr;
312
315
317 DistributionValuesEditor& operator=(const DistributionValuesEditor& src) = delete;
318 };
319};
GUIIcon
An enumeration of icons used by the gui applications.
Definition GUIIcons.h:33
SumoXMLTag
Numbers representing SUMO-XML - element names.
long onCmdDeleteDistribution(FXObject *, FXSelector, void *)
Called when "Delete distribution" button is clicked.
SumoXMLTag getDistributionTag() const
get distribution tag
MFXButtonTooltip * myCreateDistributionButton
"create Distribution" button
MFXButtonTooltip * myDeleteDistributionButton
"delete Distribution" button
SumoXMLTag myDistributionTag
@briuef distribution tag
long onUpdDeleteDistribution(FXObject *sender, FXSelector, void *)
Called when "Delete distribution" button is updated.
long onCmdCreateDistribution(FXObject *, FXSelector, void *)
Called when "create distribution" button is clicked.
DistributionSelector * myDistributionSelector
distribution selector
DistributionRow & operator=(const DistributionRow &src)=delete
Invalidated assignment operator.
DistributionRow(const DistributionRow &)=delete
Invalidated copy constructor.
DistributionValuesEditor * myDistributionValuesEditorParent
FOX need this.
MFXGroupBoxModule (based on FXGroupBox)
Definition json.hpp:4471
every row value