Eclipse SUMO - Simulation of Urban MObility
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GNEDistributionFrame.cpp
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
22#include <netedit/GNENet.h>
24#include <netedit/GNEUndoList.h>
32
34
35#define TEMPORAL_FILENAME std::string()
36
37// ===========================================================================
38// FOX callback mapping
39// ===========================================================================
40
46
51
52
58
63
64// Object implementation
65FXIMPLEMENT(GNEDistributionFrame::DistributionEditor, MFXGroupBoxModule, DistributionEditorMap, ARRAYNUMBER(DistributionEditorMap))
66FXIMPLEMENT(GNEDistributionFrame::DistributionSelector, MFXGroupBoxModule, DistributionSelectorMap, ARRAYNUMBER(DistributionSelectorMap))
67FXIMPLEMENT(GNEDistributionFrame::DistributionRow, FXHorizontalFrame, DistributionRowMap, ARRAYNUMBER(DistributionRowMap))
68FXIMPLEMENT(GNEDistributionFrame::DistributionValuesEditor, MFXGroupBoxModule, DistributionValuesEditorMap, ARRAYNUMBER(DistributionValuesEditorMap))
69
70
71// ===========================================================================
72// method definitions
73// ===========================================================================
74
75// ---------------------------------------------------------------------------
76// GNEDistributionFrame::DistributionEditor - methods
77// ---------------------------------------------------------------------------
78
80 MFXGroupBoxModule(frameParent, TL("Distribution Editor")),
81 myFrameParent(frameParent),
82 myDistributionTag(distributionTag) {
83 // get staticTooltip menu
84 auto staticTooltipMenu = myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
85 // Create new distribution
86 myCreateDistributionButton = new MFXButtonTooltip(getCollapsableFrame(), staticTooltipMenu, TL("New"),
88 myCreateDistributionButton->setTipText(TLF("Create new %", toString(myDistributionTag)).c_str()),
89 // Delete distribution
90 myDeleteDistributionButton = new MFXButtonTooltip(getCollapsableFrame(), staticTooltipMenu, TL("Delete"),
92 myDeleteDistributionButton->setTipText(TLF("Delete current edited %", toString(myDistributionTag)).c_str()),
93 // show editor
94 show();
95}
96
97
99
100
103 return myDistributionTag;
104}
105
106
107long
109 auto undoList = myFrameParent->getViewNet()->getUndoList();
110 // obtain a new valid ID
111 const auto distributionID = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->generateDemandElementID(myDistributionTag);
112 // create new distribution
113 GNEDemandElement* distribution = nullptr;
114 if (myDistributionTag == SUMO_TAG_VTYPE_DISTRIBUTION) {
115 distribution = new GNEVTypeDistribution(distributionID, myFrameParent->getViewNet()->getNet(), TEMPORAL_FILENAME, -1);
116 } else if (myDistributionTag == SUMO_TAG_ROUTE_DISTRIBUTION) {
117 distribution = new GNERouteDistribution(distributionID, myFrameParent->getViewNet()->getNet(), TEMPORAL_FILENAME);
118 } else {
119 throw ProcessError("Invalid distribution");
120 }
121 // add it using undoList (to allow undo-redo)
122 undoList->begin(distribution->getTagProperty()->getGUIIcon(), "create distribution");
123 undoList->add(new GNEChange_DemandElement(distribution, true), true);
124 undoList->end();
125 // refresh selector using created distribution
126 myDistributionSelector->setDistribution(distribution);
127 return 1;
128}
129
130
131long
133 auto undoList = myFrameParent->getViewNet()->getUndoList();
134 auto currentDistribution = myDistributionSelector->getCurrentDistribution();
135 if (currentDistribution) {
136 // begin undo list operation
137 undoList->begin(currentDistribution->getTagProperty()->getGUIIcon(), "delete " + currentDistribution->getTagProperty()->getTagStr() + " distribution");
138 // remove distribution
139 myFrameParent->getViewNet()->getNet()->deleteDemandElement(myDistributionSelector->getCurrentDistribution(), undoList);
140 // end undo list operation
141 undoList->end();
142 // refresh selector
143 myDistributionSelector->refreshDistributionSelector();
144 }
145 return 1;
146}
147
148
149long
151 // check if we have a selected distribution
152 if (myDistributionSelector->getCurrentDistribution()) {
153 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
154 } else {
155 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
156 }
157}
158
159// ---------------------------------------------------------------------------
160// GNETypeFrame::DistributionSelector - methods
161// ---------------------------------------------------------------------------
162
164 MFXGroupBoxModule(frameParent, TL("Distribution selector")),
165 myFrameParent(frameParent) {
166 // Create MFXComboBoxIcon
169 // DistributionSelector is always shown
170 show();
171}
172
173
175
176
177void
179 myCurrentDistribution = distribution;
180 refreshDistributionSelector();
181}
182
183
186 return myCurrentDistribution;
187
188}
189
190
191void
193 // fill distributions
194 fillDistributionComboBox();
195 // set current item
196 for (int i = 0; i < (int)myDistributionsComboBox->getNumItems(); i++) {
197 if (myDistributionsComboBox->getItemText(i) == myCurrentDistribution->getID()) {
198 myDistributionsComboBox->setCurrentItem(i);
199 }
200 }
201}
202
203
204void
206 // fill distributions
207 const auto distributions = fillDistributionComboBox();
208 // update current distribution (used if myCurrentDistribution was deleted during undo-redo)
209 myCurrentDistribution = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(myCurrentDistribution, false);
210 // update comboBox
211 if (myCurrentDistribution) {
212 for (int i = 0; i < (int)myDistributionsComboBox->getNumItems(); i++) {
213 if (myDistributionsComboBox->getItemText(i) == myCurrentDistribution->getID()) {
214 myDistributionsComboBox->setCurrentItem(i);
215 }
216 }
217 } else if (distributions.size() > 0) {
218 // set first distribution
219 myCurrentDistribution = distributions.begin()->second;
220 }
221 // continue depending of myCurrentDistribution
222 if (myCurrentDistribution) {
223 // show modules
224 myAttributesEditor->showAttributesEditor(myCurrentDistribution, true);
225 myDistributionValuesEditor->showDistributionValuesEditor();
226 } else {
227 // hide modules
228 myAttributesEditor->hideAttributesEditor();
229 myDistributionValuesEditor->hideDistributionValuesEditor();
230 }
231}
232
233
234long
236 const auto viewNet = myFrameParent->getViewNet();
237 const auto& distributions = viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(myDistributionEditor->getDistributionTag());
238 // Check if value of myTypeMatchBox correspond of an allowed additional tags
239 for (const auto& distribution : distributions) {
240 if (distribution.second->getID() == myDistributionsComboBox->getText().text()) {
241 // set pointer
242 myCurrentDistribution = distribution.second;
243 // set color of myTypeMatchBox to black (valid)
244 myDistributionsComboBox->setTextColor(FXRGB(0, 0, 0));
245 // show modules
246 myAttributesEditor->showAttributesEditor(distribution.second, true);
247 myDistributionValuesEditor->showDistributionValuesEditor();
248 // update viewNet
249 viewNet->updateViewNet();
250 return 1;
251 }
252 }
253 // not found, then reset myCurrentDistribution
254 myCurrentDistribution = nullptr;
255 // hide modules
256 myAttributesEditor->hideAttributesEditor();
257 myDistributionValuesEditor->hideDistributionValuesEditor();
258 // set color of myTypeMatchBox to red (invalid)
259 myDistributionsComboBox->setTextColor(FXRGB(255, 0, 0));
260 // update viewNet
261 viewNet->updateViewNet();
262 return 1;
263}
264
265
266long
268 const auto& demandElements = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements();
269 if (demandElements.at(myDistributionEditor->getDistributionTag()).size() > 0) {
270 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
271 } else {
272 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
273 }
274}
275
276
277std::map<std::string, GNEDemandElement*>
279 // get ACs
280 const auto& ACs = myFrameParent->getViewNet()->getNet()->getAttributeCarriers();
281 // clear items
282 myDistributionsComboBox->clearItems();
283 // fill with distributions sorted by ID
284 std::map<std::string, GNEDemandElement*> distributions;
285 for (const auto& distribution : ACs->getDemandElements().at(myDistributionEditor->getDistributionTag())) {
286 distributions[distribution.second->getID()] = distribution.second;
287 }
288 for (const auto& distribution : distributions) {
289 myDistributionsComboBox->appendIconItem(distribution.first.c_str(), distribution.second->getACIcon());
290 }
291 // return distributions sorted by ID
292 return distributions;
293}
294
295// ---------------------------------------------------------------------------
296// GNEDistributionFrame::DistributionRow - methods
297// ---------------------------------------------------------------------------
298
299GNEDistributionFrame::DistributionRow::DistributionRow(DistributionValuesEditor* attributeEditorParent, const GNEDemandElement* key, const double probability) :
300 FXHorizontalFrame(attributeEditorParent->getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame),
301 myDistributionValuesEditorParent(attributeEditorParent),
302 myKey(key),
303 myProbability(probability) {
304 // get staticTooltip menu
305 auto staticTooltipMenu = attributeEditorParent->getFrameParent()->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
306 // create label
307 myIconLabel = new FXLabel(this, "", key->getACIcon(), GUIDesignLabelIconThick);
308 // Create and hide MFXTextFieldTooltip for string attributes
311 // Create and hide MFXTextFieldTooltip for string attributes
312 myProbabilityTextField = new MFXTextFieldTooltip(this, staticTooltipMenu,
314 // create delete buton
315 myDeleteRowButton = new MFXButtonTooltip(this, staticTooltipMenu,
317 myDeleteRowButton->setTipText(TL("Delete distribution value"));
318 // only create if parent was created
319 if (getParent()->id() && attributeEditorParent->myDistributionSelector->getCurrentDistribution()) {
320 // create DistributionRow
321 FXHorizontalFrame::create();
322 // refresh row
323 refreshRow();
324 // Show DistributionRow
325 show();
326 }
327}
328
329
330void
332 // only destroy if parent was created
333 if (getParent()->id()) {
334 FXHorizontalFrame::destroy();
335 }
336}
337
338
339void
341 /*
342 // get distribution selector
343 const auto currentDistribution = myDistributionValuesEditorParent->myDistributionSelector->getCurrentDistribution();
344 // get possible keys
345 const auto possibleKeys = currentDistribution->getPossibleDistributionKeys(myDistributionValuesEditorParent->myDistributionValueTag);
346 // refill combo Box with possible values
347 myComboBoxKeys->clearItems();
348 myComboBoxKeys->appendIconItem(myKey->getID().c_str());
349 for (const auto& possibleKey : possibleKeys) {
350 myComboBoxKeys->appendIconItem(possibleKey.first.c_str());
351 }
352 myComboBoxKeys->setCurrentItem(0);
353 // adjust combo Box
354 myComboBoxKeys->setTextColor(FXRGB(0, 0, 0));
355 myComboBoxKeys->killFocus();
356 // set probability
357 myProbabilityTextField->setText(toString(myProbability).c_str());
358 myProbabilityTextField->setTextColor(FXRGB(0, 0, 0));
359 myProbabilityTextField->killFocus();
360 */
361}
362
363
364double
366 return myProbability;
367}
368
369
370long
372 // get Undo list
373 //GNEUndoList* undoList = myDistributionValuesEditorParent->getFrameParent()->getViewNet()->getUndoList();
374 // get current distribution
375 auto currentDistribution = myDistributionValuesEditorParent->myDistributionSelector->getCurrentDistribution();
376 // get ACs
377 //const auto& ACs = myDistributionValuesEditorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers();
378 // continue if we have a distribution to edit
379 if (currentDistribution == nullptr) {
380 return 1;
381 }
382 /*
383 // check if new key is valid
384 if (isValidNewKey()) {
385 myComboBoxKeys->setTextColor(FXRGB(0, 0, 0));
386 // get new key
387 const auto newKey = ACs->retrieveDemandElement(myDistributionValuesEditorParent->myDistributionValueTag, myComboBoxKeys->getText().text());
388 // only change if is different of current key
389 if (myKey != newKey) {
390 // begin undo list
391 undoList->begin(myKey, "edit distribution key");
392 // remove distribution key
393 currentDistribution->removeDistributionKey(myKey, undoList);
394 // sert key and icon
395 myKey = ACs->retrieveDemandElement(myDistributionValuesEditorParent->myDistributionValueTag, myComboBoxKeys->getText().text());
396 myIconLabel->setIcon(myKey->getACIcon());
397 // add distribution key (and probability)
398 currentDistribution->addDistributionKey(myKey, myProbability, undoList);
399 // end undo list
400 undoList->end();
401 // refresh all rows
402 myDistributionValuesEditorParent->refreshRows();
403 }
404 } else {
405 myComboBoxKeys->setTextColor(FXRGB(255, 0, 0));
406 myComboBoxKeys->killFocus();
407 }
408 */
409 return 1;
410}
411
412
413long
415 // get current distribution
416 auto currentDistribution = myDistributionValuesEditorParent->myDistributionSelector->getCurrentDistribution();
417 // continue if we have a distribution to edit
418 if (currentDistribution == nullptr) {
419 return 1;
420 }
421 // get probability
422 const std::string probabilityStr = myProbabilityTextField->getText().text();
423 //const double probability = GNEAttributeCarrier::canParse<double>(probabilityStr) ? GNEAttributeCarrier::parse<double>(probabilityStr) : -1;
424 // Check if set new probability
425 /*
426 if (probability >= 0) {
427 // set new probability
428 myProbability = probability;
429 // edit distribution value
430 currentDistribution->editDistributionValue(myKey, probability, myDistributionValuesEditorParent->getFrameParent()->getViewNet()->getUndoList());
431 // reset color
432 myProbabilityTextField->setTextColor(FXRGB(0, 0, 0));
433 // update sum label
434 myDistributionValuesEditorParent->updateSumLabel();
435 } else {
436 myProbabilityTextField->setTextColor(FXRGB(255, 0, 0));
437 myProbabilityTextField->killFocus();
438 }
439 */
440 return 1;
441}
442
443
444long
446 // get current distribution
447 auto currentDistribution = myDistributionValuesEditorParent->myDistributionSelector->getCurrentDistribution();
448 // continue if we have a distribution to edit
449 if (currentDistribution == nullptr) {
450 return 1;
451 }
452 // remove distribution key
453 //currentDistribution->removeDistributionKey(myKey, myDistributionValuesEditorParent->getFrameParent()->getViewNet()->getUndoList());
454 // remake rows
455 myDistributionValuesEditorParent->remakeRows();
456 return 1;
457}
458
459
460bool
462 /*
463 const auto ACs = myDistributionValuesEditorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers();
464 // get element associated with key
465 //const auto element = ACs->retrieveDemandElement(myDistributionValuesEditorParent->myDistributionValueTag, myComboBoxKeys->getText().text(), false);
466 // first check if element exists
467 if (element) {
468 // avoid duplicated keys
469 return !myKey->keyExists(element);
470 } else {
471 return false;
472 }
473 */
474 return false;
475}
476
477// ---------------------------------------------------------------------------
478// GNEDistributionFrame::DistributionValuesEditor - methods
479// ---------------------------------------------------------------------------
480
482 DistributionSelector* distributionSelector, GNEAttributesEditor* attributesEditor, SumoXMLTag distributionValueTag) :
483 MFXGroupBoxModule(frameParent, TL("Distribution values")),
484 myFrameParent(frameParent),
485 myDistributionEditor(distributionEditor),
486 myDistributionSelector(distributionSelector),
487 myAttributesEditor(attributesEditor),
488 myDistributionValueTag(distributionValueTag) {
489 // set relations
494 // get staticTooltip menu
495 auto staticTooltipMenu = frameParent->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
496 // Create bot frame elements
498 auto addButton = new MFXButtonTooltip(myBotFrame, staticTooltipMenu, "", GUIIconSubSys::getIcon(GUIIcon::ADD), this, MID_GNE_BUTTON_ADD, GUIDesignButtonIcon);
499 addButton->setTipText(TL("Add new distribution value"));
500 new FXHorizontalFrame(myBotFrame, GUIDesignAuxiliarHorizontalFrame);
502 mySumLabel = new FXLabel(myBotFrame, "", nullptr, GUIDesignLabelThickedFixed(50));
504}
505
506
507void
509 // remake rows
510 remakeRows();
511 // show DistributionValuesEditor
512 show();
513}
514
515
516void
518 // hide also DistributionValuesEditor
519 hide();
520}
521
522
523void
525 // first remove all rows
526 for (auto& row : myDistributionRows) {
527 // destroy and delete all rows
528 if (row != nullptr) {
529 row->destroy();
530 delete row;
531 row = nullptr;
532 }
533 }
534 myDistributionRows.clear();
535 /*
536 // continue if we have a distribution to edit
537 if (myDistributionSelector->getCurrentDistribution()) {
538 // Iterate over distribution key-values
539 for (const auto& keyValue : myDistributionSelector->getCurrentDistribution()->getDistributionKeyValues()) {
540 // create distribution row
541 auto distributionRow = new DistributionRow(this, keyValue.first, keyValue.second);
542 // add into distribution rows
543 myDistributionRows.push_back(distributionRow);
544 }
545 }
546 */
547 // reparent bot frame button (to place it at bottom)
548 myBotFrame->reparent(getCollapsableFrame());
549}
550
551
552void
554 // refresh rows
555 for (const auto& row : myDistributionRows) {
556 row->refreshRow();
557 }
558}
559
560
565
566
567void
569 // update probability
570 double sumProbability = 0;
571 for (const auto& row : myDistributionRows) {
572 sumProbability += row->getProbability();
573 }
574 mySumLabel->setText(toString(sumProbability).c_str());
575}
576
577
578long
580 if (myDistributionSelector->getCurrentDistribution() == nullptr) {
581 return 1;
582 }
583 /*
584 // get next free key
585 const auto possibleKeys = myDistributionSelector->getCurrentDistribution()->getPossibleDistributionKeys(myDistributionValueTag);
586 if (possibleKeys.empty()) {
587 return 1;
588 }
589 // add first possible key
590 myDistributionSelector->getCurrentDistribution()->addDistributionKey(possibleKeys.begin()->second, 0.5, myFrameParent->getViewNet()->getUndoList());
591 // remake rows
592 remakeRows();
593 */
594 return 1;
595}
596
597
598long
600 if (myDistributionSelector->getCurrentDistribution() == nullptr) {
601 mySumLabel->setText("");
602 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
603 } else {
604 // update sum label
605 updateSumLabel();
606 /*
607 // enable or disable add button depending of existents distributions
608 if (myDistributionSelector->getCurrentDistribution()->getPossibleDistributionKeys(myDistributionValueTag).size() > 0) {
609 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
610 } else {
611 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
612 }
613 */
614 }
615 return 1;
616}
617
618/****************************************************************************/
FXDEFMAP(GNEDistributionFrame::DistributionEditor) DistributionEditorMap[]
#define TEMPORAL_FILENAME
@ MID_GNE_DELETE
delete element
Definition GUIAppEnum.h:943
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition GUIAppEnum.h:939
@ MID_GNE_BUTTON_REMOVE
remove button
@ MID_GNE_BUTTON_ADD
add button
@ MID_GNE_CREATE
create element
Definition GUIAppEnum.h:941
@ MID_GNE_SET_TYPE
used to select a type of element in a combo box
Definition GUIAppEnum.h:959
#define GUIDesignLabelFixed(width)
label, icon before text, text centered and custom width
Definition GUIDesigns.h:246
#define GUIDesignButtonIcon
button only with icon
Definition GUIDesigns.h:91
#define GUIDesignButton
Definition GUIDesigns.h:82
#define GUIDesignComboBox
Definition GUIDesigns.h:293
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition GUIDesigns.h:311
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:399
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition GUIDesigns.h:74
#define GUIDesignComboBoxVisibleItems
Definition GUIDesigns.h:49
#define GUIDesignTextFieldFixedRestricted(width, type)
text field with fixed width
Definition GUIDesigns.h:68
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
Definition GUIDesigns.h:252
#define GUIDesignLabelIconThick
label squared over frame with thick and with text justify to center
Definition GUIDesigns.h:255
GUIIcon
An enumeration of icons used by the gui applications.
Definition GUIIcons.h:33
#define TL(string)
Definition MsgHandler.h:305
#define TLF(string,...)
Definition MsgHandler.h:307
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_ROUTE_DISTRIBUTION
distribution of a route
@ SUMO_TAG_VTYPE_DISTRIBUTION
distribution of a vehicle type
int GUIDesignHeight
the default size for GUI elements
Definition StdDefs.cpp:35
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
long onCmdDeleteDistribution(FXObject *, FXSelector, void *)
Called when "Delete distribution" button is clicked.
SumoXMLTag getDistributionTag() const
get 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
void destroy()
destroy DistributionRow (but don't delete)
long onCmdSetProbability(FXObject *, FXSelector, void *)
try to set new probability
MFXComboBoxIcon * myComboBoxKeys
comboBox with keys
long onCmdRemoveRow(FXObject *, FXSelector, void *)
remove row
long onCmdSetKey(FXObject *, FXSelector, void *)
try to set new key
DistributionRow(DistributionValuesEditor *attributeEditorParent, const GNEDemandElement *key, const double probability)
FOX-declaration.
double getProbability() const
get current probability
MFXTextFieldTooltip * myProbabilityTextField
textField to modify the probability attribute
MFXButtonTooltip * myDeleteRowButton
delete row button
GNEDemandElement * getCurrentDistribution() const
current distribution
DistributionValuesEditor * myDistributionValuesEditor
distribution values editor
std::map< std::string, GNEDemandElement * > fillDistributionComboBox()
FOX need this.
long onCmdSelectDistribution(FXObject *, FXSelector, void *)
Called when the user select distribution in ComboBox.
void refreshDistributionIDs()
refresh distribution IDs (only call when user change ID in internal attributes)
MFXComboBoxIcon * myDistributionsComboBox
comboBox with the list of distributions
DistributionEditor * myDistributionEditor
pointer to distribution editor
GNEAttributesEditor * myAttributesEditor
attributes editor
long onCmdUpdateDistribution(FXObject *sender, FXSelector, void *)
update distribution comboBox
void setDistribution(GNEDemandElement *distribution)
refresh modul
DistributionSelector(GNEFrame *frameParent)
constructor
long onUpdAddRow(FXObject *sender, FXSelector, void *)
Called when sum button button is updated.
GNEAttributesEditor * myAttributesEditor
attributes editor
GNEFrame * getFrameParent() const
pointer to GNEFrame parent
DistributionEditor * myDistributionEditor
distribution editor
long onCmdAddRow(FXObject *, FXSelector, void *)
Called when user press the add button.
DistributionSelector * myDistributionSelector
distribution selector
DistributionValuesEditor(GNEFrame *frameParent, DistributionEditor *distributionEditor, DistributionSelector *distributionSelector, GNEAttributesEditor *attributesEditor, SumoXMLTag distributionValueTag)
constructor
void showDistributionValuesEditor()
show attributes of multiple ACs
GNEViewNet * getViewNet() const
get view net
Definition GNEFrame.cpp:154
GUIIcon getGUIIcon() const
get GUI icon associated to this tag property
GNEViewParent * getViewParent() const
get the net object
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
MFXStaticToolTip * getStaticTooltipMenu() const
get static toolTip for menus
MFXGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)