36#define TEMPORAL_FILENAME std::string()
83 auto staticTooltipMenu =
myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
134 if (currentDistribution) {
136 undoList->begin(currentDistribution->getTagProperty()->getGUIIcon(),
"delete " + currentDistribution->getTagProperty()->getTagStr() +
" distribution");
152 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
154 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
216 }
else if (distributions.size() > 0) {
236 const auto& distributions = viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(
myDistributionEditor->getDistributionTag());
238 for (
const auto& distribution : distributions) {
248 viewNet->updateViewNet();
260 viewNet->updateViewNet();
267 const auto& demandElements =
myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements();
269 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
271 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
276std::map<std::string, GNEDemandElement*>
279 const auto& ACs =
myFrameParent->getViewNet()->getNet()->getAttributeCarriers();
283 std::map<std::string, GNEDemandElement*> distributions;
284 for (
const auto& distribution : ACs->getDemandElements().at(
myDistributionEditor->getDistributionTag())) {
285 distributions[distribution.second->getID()] = distribution.second;
287 for (
const auto& distribution : distributions) {
291 return distributions;
303 auto staticTooltipMenu = attributeEditorParent->
getFrameParent()->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
319 FXHorizontalFrame::create();
338 if (getParent()->
id()) {
339 FXHorizontalFrame::destroy();
398 auto staticTooltipMenu = frameParent->
getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
431 if (row !=
nullptr) {
441 for (
const auto& distributionRef :
myDistributionSelector->getCurrentDistribution()->getChildDemandElements()) {
442 if (distributionRef->getTagProperty()->isDistributionReference()) {
443 if (distributionRef->getTagProperty()->isDistributionReference() && (distributionRef->getParentDemandElements().front() ==
myDistributionSelector->getCurrentDistribution())) {
451 distributionRef->updateGeometry();
489 if (row->getDeleteRowButton() == obj) {
490 myFrameParent->getViewNet()->getNet()->deleteDemandElement(row->getDistributionReference(),
myFrameParent->getViewNet()->getUndoList());
501 double sumProbability = 0;
503 for (
const auto& distributionRef :
myDistributionSelector->getCurrentDistribution()->getChildDemandElements()) {
504 if (distributionRef->getTagProperty()->isDistributionReference()) {
505 sumProbability += distributionRef->getAttributeDouble(
SUMO_ATTR_PROB);
FXDEFMAP(GNEDistributionFrame::DistributionEditor) DistributionEditorMap[]
#define TEMPORAL_FILENAME
@ MID_GNE_DELETE
delete element
@ MID_GNE_SET_ATTRIBUTE
attribute edited
@ MID_GNE_BUTTON_REMOVE
remove button
@ MID_GNE_BUTTON_ADD
add button
@ MID_GNE_CREATE
create element
@ MID_GNE_SET_TYPE
used to select a type of element in a combo box
#define GUIDesignTextFieldFixed(width)
text field with fixed width
#define GUIDesignTextColorRed
red color (for invalid text)
#define GUIDesignLabelFixed(width)
label, icon before text, text centered and custom width
#define GUIDesignButtonIcon
button only with icon
#define GUIDesignComboBox
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignComboBoxVisibleItems
#define GUIDesignTextColorBlack
black color (for correct text)
#define GUIDesignTextFieldRestricted(type)
text field extended over Frame with thick frame (int)
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
#define GUIDesignLabelIconThick
label squared over frame with thick and with text justify to center
GUIIcon
An enumeration of icons used by the gui applications.
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_VTYPE
description of a vehicle/person/container type
@ SUMO_TAG_ROUTE_DISTRIBUTION
distribution of a route
@ SUMO_TAG_ROUTE
description of a route
@ SUMO_TAG_VTYPE_DISTRIBUTION
distribution of a vehicle type
int GUIDesignHeight
the default height for GUI elements
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
Result getResult() const
get result to indicate if this dialog was closed accepting or rejecting changes
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.
DistributionEditor(GNEFrame *frameParent, SumoXMLTag distributionTag, GUIIcon icon)
constructor
~DistributionEditor()
destructor
GNEFrame * myFrameParent
FOX needs this.
DistributionSelector * myDistributionSelector
distribution selector
void destroy()
destroy DistributionRow (but don't delete)
GNEDemandElement * getDistributionReference() const
get pointer to distributionReference
MFXTextFieldIcon * myProbabilityTextField
textField to modify the probability attribute
GNEDemandElement * myDistributionReference
pointer to distributionReference
long onCmdSetProbability(FXObject *, FXSelector, void *)
try to set new probability
DistributionRow(DistributionValuesEditor *attributeEditorParent, GNEDemandElement *distributionReference)
FOX-declaration.
FXLabel * myIconLabel
label
MFXButtonTooltip * getDeleteRowButton() const
get delete row button
MFXTextFieldIcon * myIDTextField
comboBox with ID
DistributionValuesEditor * myDistributionValuesEditorParent
FOX need this.
MFXButtonTooltip * myDeleteRowButton
delete row button
GNEDemandElement * getCurrentDistribution() const
current distribution
void refreshDistributionSelector()
refresh modul
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
GNEDemandElement * myCurrentDistribution
current distribution element
~DistributionSelector()
destructor
void setDistribution(GNEDemandElement *distribution)
refresh modul
DistributionSelector(GNEFrame *frameParent)
constructor
GNEFrame * myFrameParent
pointer to Frame Parent
GNEFrame * myFrameParent
pointer to frame parent
GNEAttributesEditor * myAttributesEditor
attributes editor
void hideDistributionValuesEditor()
hide attribute editor
void refreshRows()
refresh rows
DistributionValuesEditor(GNEFrame *frameParent, DistributionEditor *distributionEditor, DistributionSelector *distributionSelector, GNEAttributesEditor *attributesEditor)
constructor
friend class DistributionRow
FOX-declaration.
std::vector< DistributionRow * > myDistributionRows
list of Attribute editor rows
GNEFrame * getFrameParent() const
pointer to GNEFrame parent
DistributionEditor * myDistributionEditor
distribution editor
long onCmdRemoveRow(FXObject *obj, FXSelector, void *)
Called when user press the add button.
MFXButtonTooltip * myAddButton
add buton
void updateSumLabel()
FOX need this.
long onCmdAddRow(FXObject *, FXSelector, void *)
Called when user press the add button.
FXLabel * mySumLabel
sum label
DistributionSelector * myDistributionSelector
distribution selector
FXHorizontalFrame * myBotFrame
bot frame
void showDistributionValuesEditor()
show attributes of multiple ACs
GNEViewNet * getViewNet() const
get view net
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)
MFXGroupBoxModule(GNEFrame *frame, const std::string &text, const int options=Options::COLLAPSIBLE)
constructor for frames
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
static const RGBColor BLUE
static const RGBColor BLACK
static const RGBColor RED
named colors