Skip to content

Commit

Permalink
Fixed #14347
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Feb 18, 2024
1 parent 0983900 commit bd05a57
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/netedit/elements/GNEAttributeCarrier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2739,6 +2739,12 @@ GNEAttributeCarrier::fillAdditionalElements() {
TL("Whether the router should be inactive initially (and switched on in the gui)"),
"0");
myTagProperties[currentTag].addAttribute(attrProperty);

attrProperty = GNEAttributeProperties(SUMO_ATTR_OPTIONAL,
GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE,
TL("If rerouter is optional"),
"0");
myTagProperties[currentTag].addAttribute(attrProperty);
}
currentTag = GNE_TAG_REROUTER_SYMBOL;
{
Expand Down
8 changes: 8 additions & 0 deletions src/netedit/elements/additional/GNERerouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ GNERerouter::getAttribute(SumoXMLAttr key) const {
return toString(myVTypes);
case SUMO_ATTR_OFF:
return toString(myOff);
case SUMO_ATTR_OPTIONAL:
return toString(myOptional);
case GNE_ATTR_SELECTED:
return toString(isAttributeCarrierSelected());
case GNE_ATTR_PARAMETERS:
Expand Down Expand Up @@ -309,6 +311,7 @@ GNERerouter::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList
case SUMO_ATTR_HALTING_TIME_THRESHOLD:
case SUMO_ATTR_VTYPES:
case SUMO_ATTR_OFF:
case SUMO_ATTR_OPTIONAL:
case GNE_ATTR_SELECTED:
case GNE_ATTR_PARAMETERS:
GNEChange_Attribute::changeAttribute(this, key, value, undoList);
Expand Down Expand Up @@ -342,6 +345,8 @@ GNERerouter::isValid(SumoXMLAttr key, const std::string& value) {
}
case SUMO_ATTR_OFF:
return canParse<bool>(value);
case SUMO_ATTR_OPTIONAL:
return canParse<bool>(value);
case GNE_ATTR_SELECTED:
return canParse<bool>(value);
case GNE_ATTR_PARAMETERS:
Expand Down Expand Up @@ -398,6 +403,9 @@ GNERerouter::setAttribute(SumoXMLAttr key, const std::string& value) {
case SUMO_ATTR_OFF:
myOff = parse<bool>(value);
break;
case SUMO_ATTR_OPTIONAL:
myOptional = parse<bool>(value);
break;
case GNE_ATTR_SELECTED:
if (parse<bool>(value)) {
selectAttributeCarrier();
Expand Down

0 comments on commit bd05a57

Please sign in to comment.