Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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-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// The Widget for edit distribution elements
19/****************************************************************************/
20
21#include <netedit/GNENet.h>
22#include <netedit/GNEUndoList.h>
23#include <netedit/GNEViewNet.h>
30
32
33
34// ===========================================================================
35// FOX callback mapping
36// ===========================================================================
37
43
48
49
55
60
61// Object implementation
62FXIMPLEMENT(GNEDistributionFrame::DistributionEditor, MFXGroupBoxModule, DistributionEditorMap, ARRAYNUMBER(DistributionEditorMap))
63FXIMPLEMENT(GNEDistributionFrame::DistributionSelector, MFXGroupBoxModule, DistributionSelectorMap, ARRAYNUMBER(DistributionSelectorMap))
64FXIMPLEMENT(GNEDistributionFrame::DistributionRow, FXHorizontalFrame, DistributionRowMap, ARRAYNUMBER(DistributionRowMap))
65FXIMPLEMENT(GNEDistributionFrame::DistributionValuesEditor, MFXGroupBoxModule, DistributionValuesEditorMap, ARRAYNUMBER(DistributionValuesEditorMap))
66
67
68// ===========================================================================
69// method definitions
70// ===========================================================================
71
72// ---------------------------------------------------------------------------
73// GNEDistributionFrame::DistributionEditor - methods
74// ---------------------------------------------------------------------------
75
77 MFXGroupBoxModule(frameParent, TL("Distribution Editor")),
78 myFrameParent(frameParent),
79 myDistributionTag(distributionTag) {
80 // get staticTooltip menu
81 auto staticTooltipMenu = myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
82 // Create new distribution
83 myCreateDistributionButton = new MFXButtonTooltip(getCollapsableFrame(), staticTooltipMenu, TL("New"),
85 myCreateDistributionButton->setTipText(TLF("Create new %", toString(myDistributionTag)).c_str()),
86 // Delete distribution
87 myDeleteDistributionButton = new MFXButtonTooltip(getCollapsableFrame(), staticTooltipMenu, TL("Delete"),
89 myDeleteDistributionButton->setTipText(TLF("Delete current edited %", toString(myDistributionTag)).c_str()),
90 // show editor
91 show();
92}
93
94
96
97
100 return myDistributionTag;
101}
102
103
104long
106 auto undoList = myFrameParent->getViewNet()->getUndoList();
107 // obtain a new valid ID
108 const auto distributionID = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->generateDemandElementID(myDistributionTag);
109 // create new distribution
110 GNEDemandElement* distribution = nullptr;
111 if (myDistributionTag == SUMO_TAG_VTYPE_DISTRIBUTION) {
112 distribution = new GNEVTypeDistribution(myFrameParent->getViewNet()->getNet(), distributionID, -1);
113 } else if (myDistributionTag == SUMO_TAG_ROUTE_DISTRIBUTION) {
114 distribution = new GNERouteDistribution(myFrameParent->getViewNet()->getNet(), distributionID);
115 } else {
116 throw ProcessError("Invalid distribution");
117 }
118 // add it using undoList (to allow undo-redo)
119 undoList->begin(distribution->getTagProperty().getGUIIcon(), "create distribution");
120 undoList->add(new GNEChange_DemandElement(distribution, true), true);
121 undoList->end();
122 // refresh selector using created distribution
123 myDistributionSelector->setDistribution(distribution);
124 return 1;
125}
126
127
128long
130 auto undoList = myFrameParent->getViewNet()->getUndoList();
131 auto currentDistribution = myDistributionSelector->getCurrentDistribution();
132 if (currentDistribution) {
133 // begin undo list operation
134 undoList->begin(currentDistribution->getTagProperty().getGUIIcon(), "delete " + currentDistribution->getTagProperty().getTagStr() + " distribution");
135 // remove distribution
136 myFrameParent->getViewNet()->getNet()->deleteDemandElement(myDistributionSelector->getCurrentDistribution(), undoList);
137 // end undo list operation
138 undoList->end();
139 // refresh selector
140 myDistributionSelector->refreshDistributionSelector();
141 }
142 return 1;
143}
144
145
146long
148 // check if we have a selected distribution
149 if (myDistributionSelector->getCurrentDistribution()) {
150 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
151 } else {
152 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
153 }
154}
155
156// ---------------------------------------------------------------------------
157// GNETypeFrame::DistributionSelector - methods
158// ---------------------------------------------------------------------------
159
161 MFXGroupBoxModule(frameParent, TL("Distribution selector")),
162 myFrameParent(frameParent) {
163 // Create MFXComboBoxIcon
166 // DistributionSelector is always shown
167 show();
168}
169
170
172
173
174void
176 myCurrentDistribution = distribution;
177 refreshDistributionSelector();
178}
179
180
183 return myCurrentDistribution;
184
185}
186
187
188void
190 // fill distributions
191 fillDistributionComboBox();
192 // set current item
193 for (int i = 0; i < (int)myDistributionsComboBox->getNumItems(); i++) {
194 if (myDistributionsComboBox->getItemText(i) == myCurrentDistribution->getID()) {
195 myDistributionsComboBox->setCurrentItem(i);
196 }
197 }
198}
199
200
201void
203 auto& inspectedElements = myFrameParent->getViewNet()->getInspectedElements();
204 // fill distributions
205 const auto distributions = fillDistributionComboBox();
206 // update current distribution (used if myCurrentDistribution was deleted during undo-redo)
207 myCurrentDistribution = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(myCurrentDistribution, false);
208 // update comboBox
209 if (myCurrentDistribution) {
210 for (int i = 0; i < (int)myDistributionsComboBox->getNumItems(); i++) {
211 if (myDistributionsComboBox->getItemText(i) == myCurrentDistribution->getID()) {
212 myDistributionsComboBox->setCurrentItem(i);
213 }
214 }
215 } else if (distributions.size() > 0) {
216 // set first distribution
217 myCurrentDistribution = distributions.begin()->second;
218 }
219 // continue depending of myCurrentDistribution
220 if (myCurrentDistribution) {
221 // set distribtution as inspected element (needed for attribute editor)
222 inspectedElements.inspectAC(myCurrentDistribution);
223 // show modules
224 myAttributesEditor->showAttributeEditorModule(true);
225 myDistributionValuesEditor->showDistributionValuesEditor();
226 } else {
227 // remove inspected elements
228 inspectedElements.inspectACs({});
229 // hide modules
230 myAttributesEditor->hideAttributesEditorModule();
231 myDistributionValuesEditor->hideDistributionValuesEditor();
232 }
233}
234
235
236long
238 const auto viewNet = myFrameParent->getViewNet();
239 const auto& distributions = viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(myDistributionEditor->getDistributionTag());
240 // Check if value of myTypeMatchBox correspond of an allowed additional tags
241 for (const auto& distribution : distributions) {
242 if (distribution.second->getID() == myDistributionsComboBox->getText().text()) {
243 // set pointer
244 myCurrentDistribution = distribution.second;
245 // set color of myTypeMatchBox to black (valid)
246 myDistributionsComboBox->setTextColor(FXRGB(0, 0, 0));
247 // set myCurrentType as inspected element (needed for attribute editor)
248 viewNet->getInspectedElements().inspectAC(distribution.second);
249 // show modules
250 myAttributesEditor->showAttributeEditorModule(true);
251 myDistributionValuesEditor->showDistributionValuesEditor();
252 // Write Warning in console if we're in testing mode
253 WRITE_DEBUG(("Selected item '" + myDistributionsComboBox->getText() + "' in DistributionSelector").text());
254 // update viewNet
255 viewNet->updateViewNet();
256 return 1;
257 }
258 }
259 // not found, then reset myCurrentDistribution
260 myCurrentDistribution = nullptr;
261 // hide modules
262 myAttributesEditor->hideAttributesEditorModule();
263 myDistributionValuesEditor->hideDistributionValuesEditor();
264 // set color of myTypeMatchBox to red (invalid)
265 myDistributionsComboBox->setTextColor(FXRGB(255, 0, 0));
266 // Write Warning in console if we're in testing mode
267 WRITE_DEBUG("Selected invalid item in DistributionSelector");
268 // update viewNet
269 viewNet->updateViewNet();
270 return 1;
271}
272
273
274long
276 const auto& demandElements = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements();
277 if (demandElements.at(myDistributionEditor->getDistributionTag()).size() > 0) {
278 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
279 } else {
280 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
281 }
282}
283
284
285std::map<std::string, GNEDemandElement*>
287 // get ACs
288 const auto& ACs = myFrameParent->getViewNet()->getNet()->getAttributeCarriers();
289 // clear items
290 myDistributionsComboBox->clearItems();
291 // fill with distributions sorted by ID
292 std::map<std::string, GNEDemandElement*> distributions;
293 for (const auto& distribution : ACs->getDemandElements().at(myDistributionEditor->getDistributionTag())) {
294 distributions[distribution.second->getID()] = distribution.second;
295 }
296 for (const auto& distribution : distributions) {
297 myDistributionsComboBox->appendIconItem(distribution.first.c_str(), distribution.second->getACIcon());
298 }
299 // return distributions sorted by ID
300 return distributions;
301}
302
303// ---------------------------------------------------------------------------
304// GNEDistributionFrame::DistributionRow - methods
305// ---------------------------------------------------------------------------
306
307GNEDistributionFrame::DistributionRow::DistributionRow(DistributionValuesEditor* attributeEditorParent, const GNEDemandElement* key, const double probability) :
308 FXHorizontalFrame(attributeEditorParent->getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame),
309 myDistributionValuesEditorParent(attributeEditorParent),
310 myKey(key),
311 myProbability(probability) {
312 // get staticTooltip menu
313 auto staticTooltipMenu = attributeEditorParent->getFrameParent()->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
314 // create label
315 myIconLabel = new FXLabel(this, "", key->getACIcon(), GUIDesignLabelIconThick);
316 // Create and hide MFXTextFieldTooltip for string attributes
319 // Create and hide MFXTextFieldTooltip for string attributes
320 myProbabilityTextField = new MFXTextFieldTooltip(this, staticTooltipMenu,
322 // create delete buton
323 myDeleteRowButton = new MFXButtonTooltip(this, staticTooltipMenu,
325 myDeleteRowButton->setTipText(TL("Delete distribution value"));
326 // only create if parent was created
327 if (getParent()->id() && attributeEditorParent->myDistributionSelector->getCurrentDistribution()) {
328 // create DistributionRow
329 FXHorizontalFrame::create();
330 // refresh row
331 refreshRow();
332 // Show DistributionRow
333 show();
334 }
335}
336
337
338void
340 // only destroy if parent was created
341 if (getParent()->id()) {
342 FXHorizontalFrame::destroy();
343 }
344}
345
346
347void
349 // get distribution selector
350 const auto currentDistribution = myDistributionValuesEditorParent->myDistributionSelector->getCurrentDistribution();
351 // get possible keys
352 const auto possibleKeys = currentDistribution->getPossibleDistributionKeys(myDistributionValuesEditorParent->myDistributionValueTag);
353 // refill combo Box with possible values
354 myComboBoxKeys->clearItems();
355 myComboBoxKeys->appendIconItem(myKey->getID().c_str());
356 for (const auto& possibleKey : possibleKeys) {
357 myComboBoxKeys->appendIconItem(possibleKey.first.c_str());
358 }
359 myComboBoxKeys->setCurrentItem(0);
360 // adjust combo Box
361 myComboBoxKeys->setTextColor(FXRGB(0, 0, 0));
362 myComboBoxKeys->killFocus();
363 // set probability
364 myProbabilityTextField->setText(toString(myProbability).c_str());
365 myProbabilityTextField->setTextColor(FXRGB(0, 0, 0));
366 myProbabilityTextField->killFocus();
367}
368
369
370double
372 return myProbability;
373}
374
375
376long
378 // get Undo list
379 GNEUndoList* undoList = myDistributionValuesEditorParent->getFrameParent()->getViewNet()->getUndoList();
380 // get current distribution
381 auto currentDistribution = myDistributionValuesEditorParent->myDistributionSelector->getCurrentDistribution();
382 // get ACs
383 const auto& ACs = myDistributionValuesEditorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers();
384 // continue if we have a distribution to edit
385 if (currentDistribution == nullptr) {
386 return 1;
387 }
388 // check if new key is valid
389 if (isValidNewKey()) {
390 myComboBoxKeys->setTextColor(FXRGB(0, 0, 0));
391 // get new key
392 const auto newKey = ACs->retrieveDemandElement(myDistributionValuesEditorParent->myDistributionValueTag, myComboBoxKeys->getText().text());
393 // only change if is different of current key
394 if (myKey != newKey) {
395 // begin undo list
396 undoList->begin(myKey, "edit distribution key");
397 // remove distribution key
398 currentDistribution->removeDistributionKey(myKey, undoList);
399 // sert key and icon
400 myKey = ACs->retrieveDemandElement(myDistributionValuesEditorParent->myDistributionValueTag, myComboBoxKeys->getText().text());
401 myIconLabel->setIcon(myKey->getACIcon());
402 // add distribution key (and probability)
403 currentDistribution->addDistributionKey(myKey, myProbability, undoList);
404 // end undo list
405 undoList->end();
406 // refresh all rows
407 myDistributionValuesEditorParent->refreshRows();
408 }
409 } else {
410 myComboBoxKeys->setTextColor(FXRGB(255, 0, 0));
411 myComboBoxKeys->killFocus();
412 }
413 return 1;
414}
415
416
417long
419 // get current distribution
420 auto currentDistribution = myDistributionValuesEditorParent->myDistributionSelector->getCurrentDistribution();
421 // continue if we have a distribution to edit
422 if (currentDistribution == nullptr) {
423 return 1;
424 }
425 // get probability
426 const std::string probabilityStr = myProbabilityTextField->getText().text();
427 const double probability = GNEAttributeCarrier::canParse<double>(probabilityStr) ? GNEAttributeCarrier::parse<double>(probabilityStr) : -1;
428 // Check if set new probability
429 if (probability >= 0) {
430 // set new probability
431 myProbability = probability;
432 // edit distribution value
433 currentDistribution->editDistributionValue(myKey, probability, myDistributionValuesEditorParent->getFrameParent()->getViewNet()->getUndoList());
434 // reset color
435 myProbabilityTextField->setTextColor(FXRGB(0, 0, 0));
436 // update sum label
437 myDistributionValuesEditorParent->updateSumLabel();
438 } else {
439 myProbabilityTextField->setTextColor(FXRGB(255, 0, 0));
440 myProbabilityTextField->killFocus();
441 }
442 return 1;
443}
444
445
446long
448 // get current distribution
449 auto currentDistribution = myDistributionValuesEditorParent->myDistributionSelector->getCurrentDistribution();
450 // continue if we have a distribution to edit
451 if (currentDistribution == nullptr) {
452 return 1;
453 }
454 // remove distribution key
455 currentDistribution->removeDistributionKey(myKey, myDistributionValuesEditorParent->getFrameParent()->getViewNet()->getUndoList());
456 // remake rows
457 myDistributionValuesEditorParent->remakeRows();
458 return 1;
459}
460
461
462bool
464 const auto ACs = myDistributionValuesEditorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers();
465 // get element associated with key
466 const auto element = ACs->retrieveDemandElement(myDistributionValuesEditorParent->myDistributionValueTag, myComboBoxKeys->getText().text(), false);
467 // first check if element exists
468 if (element) {
469 // avoid duplicated keys
470 return !myKey->keyExists(element);
471 } else {
472 return false;
473 }
474}
475
476// ---------------------------------------------------------------------------
477// GNEDistributionFrame::DistributionValuesEditor - methods
478// ---------------------------------------------------------------------------
479
481 DistributionSelector* distributionSelector, GNEFrameAttributeModules::AttributesEditor* attributesEditor, SumoXMLTag distributionValueTag) :
482 MFXGroupBoxModule(frameParent, TL("Distribution values")),
483 myFrameParent(frameParent),
484 myDistributionEditor(distributionEditor),
485 myDistributionSelector(distributionSelector),
486 myAttributesEditor(attributesEditor),
487 myDistributionValueTag(distributionValueTag) {
488 // set relations
493 // get staticTooltip menu
494 auto staticTooltipMenu = frameParent->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
495 // Create bot frame elements
497 auto addButton = new MFXButtonTooltip(myBotFrame, staticTooltipMenu, "", GUIIconSubSys::getIcon(GUIIcon::ADD), this, MID_GNE_BUTTON_ADD, GUIDesignButtonIcon);
498 addButton->setTipText(TL("Add new distribution value"));
499 new FXHorizontalFrame(myBotFrame, GUIDesignAuxiliarHorizontalFrame);
501 mySumLabel = new FXLabel(myBotFrame, "", nullptr, GUIDesignLabelThickedFixed(50));
503}
504
505
506void
508 // remake rows
509 remakeRows();
510 // show DistributionValuesEditor
511 show();
512}
513
514
515void
517 // hide also DistributionValuesEditor
518 hide();
519}
520
521
522void
524 // first remove all rows
525 for (auto& row : myDistributionRows) {
526 // destroy and delete all rows
527 if (row != nullptr) {
528 row->destroy();
529 delete row;
530 row = nullptr;
531 }
532 }
533 myDistributionRows.clear();
534 // continue if we have a distribution to edit
535 if (myDistributionSelector->getCurrentDistribution()) {
536 // Iterate over distribution key-values
537 for (const auto& keyValue : myDistributionSelector->getCurrentDistribution()->getDistributionKeyValues()) {
538 // create distribution row
539 auto distributionRow = new DistributionRow(this, keyValue.first, keyValue.second);
540 // add into distribution rows
541 myDistributionRows.push_back(distributionRow);
542 }
543 }
544 // reparent bot frame button (to place it at bottom)
545 myBotFrame->reparent(getCollapsableFrame());
546}
547
548
549void
551 // refresh rows
552 for (const auto& row : myDistributionRows) {
553 row->refreshRow();
554 }
555}
556
557
562
563
564void
566 // update probability
567 double sumProbability = 0;
568 for (const auto& row : myDistributionRows) {
569 sumProbability += row->getProbability();
570 }
571 mySumLabel->setText(toString(sumProbability).c_str());
572}
573
574
575long
577 if (myDistributionSelector->getCurrentDistribution() == nullptr) {
578 return 1;
579 }
580 // get next free key
581 const auto possibleKeys = myDistributionSelector->getCurrentDistribution()->getPossibleDistributionKeys(myDistributionValueTag);
582 if (possibleKeys.empty()) {
583 return 1;
584 }
585 // add first possible key
586 myDistributionSelector->getCurrentDistribution()->addDistributionKey(possibleKeys.begin()->second, 0.5, myFrameParent->getViewNet()->getUndoList());
587 // remake rows
588 remakeRows();
589 return 1;
590}
591
592
593long
595 if (myDistributionSelector->getCurrentDistribution() == nullptr) {
596 mySumLabel->setText("");
597 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
598 } else {
599 // update sum label
600 updateSumLabel();
601 // enable or disable add button depending of existents distributions
602 if (myDistributionSelector->getCurrentDistribution()->getPossibleDistributionKeys(myDistributionValueTag).size() > 0) {
603 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
604 } else {
605 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
606 }
607 }
608}
609
610/****************************************************************************/
FXDEFMAP(GNEDistributionFrame::DistributionEditor) DistributionEditorMap[]
@ 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:252
#define GUIDesignButtonIcon
button only with icon
Definition GUIDesigns.h:97
#define GUIDesignButton
Definition GUIDesigns.h:88
#define GUIDesignComboBox
Definition GUIDesigns.h:299
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition GUIDesigns.h:317
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:405
#define GUIDesignComboBoxVisibleItemsMedium
combo box medium small
Definition GUIDesigns.h:53
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition GUIDesigns.h:80
#define GUIDesignTextFieldFixedRestricted(width, type)
text field with fixed width
Definition GUIDesigns.h:74
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
Definition GUIDesigns.h:258
#define GUIDesignLabelIconThick
label squared over frame with thick and with text justify to center
Definition GUIDesigns.h:261
GUIIcon
An enumeration of icons used by the gui applications.
Definition GUIIcons.h:33
#define WRITE_DEBUG(msg)
Definition MsgHandler.h:306
#define TL(string)
Definition MsgHandler.h:315
#define TLF(string,...)
Definition MsgHandler.h:317
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
long onCmdUpdateDistribution(FXObject *sender, FXSelector, void *)
update distribution comboBox
GNEFrameAttributeModules::AttributesEditor * myAttributesEditor
attributes editor
void setDistribution(GNEDemandElement *distribution)
refresh modul
DistributionSelector(GNEFrame *frameParent)
constructor
long onUpdAddRow(FXObject *sender, FXSelector, void *)
Called when sum button button is updated.
GNEFrame * getFrameParent() const
pointer to GNEFrame parent
DistributionEditor * myDistributionEditor
distribution editor
DistributionValuesEditor(GNEFrame *frameParent, DistributionEditor *distributionEditor, DistributionSelector *distributionSelector, GNEFrameAttributeModules::AttributesEditor *attributesEditor, SumoXMLTag distributionValueTag)
constructor
long onCmdAddRow(FXObject *, FXSelector, void *)
Called when user press the add button.
DistributionSelector * myDistributionSelector
distribution selector
GNEFrameAttributeModules::AttributesEditor * myAttributesEditor
attributes editor
void showDistributionValuesEditor()
show attributes of multiple ACs
GNEViewNet * getViewNet() const
get view net
Definition GNEFrame.cpp:150
GUIIcon getGUIIcon() const
get GUI icon associated to this Tag
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
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
ComboBox with icon.
MFXGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)