Skip to content

Commit

Permalink
Renamed attributeProperty FLOWDEFINITION to FLOW. Refs #15776
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Nov 28, 2024
1 parent 2192362 commit 84bb898
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions src/netedit/elements/GNEAttributeCarrier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8428,41 +8428,41 @@ GNEAttributeCarrier::fillCommonFlowAttributes(SumoXMLTag currentTag, SumoXMLAttr
myTagProperties[currentTag].addAttribute(attrProperty);

attrProperty = GNEAttributeProperties(SUMO_ATTR_END,
GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::FLOWDEFINITION,
GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::FLOW,
TL("End of departure interval"),
"3600");
myTagProperties[currentTag].addAttribute(attrProperty);

attrProperty = GNEAttributeProperties(SUMO_ATTR_NUMBER,
GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::FLOWDEFINITION,
GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::FLOW,
TL("probability for emitting a flow each second") + std::string("\n") +
TL("(not together with vehsPerHour or period)"),
"1800");
myTagProperties[currentTag].addAttribute(attrProperty);

attrProperty = GNEAttributeProperties(perHour,
GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::FLOWDEFINITION,
GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::FLOW,
TL("Number of flows per hour, equally spaced") + std::string("\n") +
TL("(not together with period or probability or poisson)"),
"1800");
myTagProperties[currentTag].addAttribute(attrProperty);

attrProperty = GNEAttributeProperties(SUMO_ATTR_PERIOD,
GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::FLOWDEFINITION,
GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::FLOW,
TL("Insert equally spaced flows at that period") + std::string("\n") +
TL("(not together with vehsPerHour or probability or poisson)"),
"2");
myTagProperties[currentTag].addAttribute(attrProperty);

attrProperty = GNEAttributeProperties(SUMO_ATTR_PROB,
GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::FLOWDEFINITION,
GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::FLOW,
TL("probability for emitting a flow each second") + std::string("\n") +
TL("(not together with vehsPerHour or period or poisson)"),
"0.5");
myTagProperties[currentTag].addAttribute(attrProperty);

attrProperty = GNEAttributeProperties(GNE_ATTR_POISSON,
GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::FLOWDEFINITION,
GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::FLOW,
TL("Insert flow expected vehicles per second with poisson distributed insertion rate") + std::string("\n") +
TL("(not together with period or vehsPerHour or probability)"),
"0.5");
Expand Down
6 changes: 3 additions & 3 deletions src/netedit/elements/GNEAttributeProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ GNEAttributeProperties::GNEAttributeProperties(const SumoXMLAttr attribute, cons
throw FormatException("AttributeProperty for '" + toString(attribute) + "' doesn't support default values");
}
// Attributes cannot be flowdefinition and enabilitablet at the same time
if ((attributeProperty & FLOWDEFINITION) && (attributeProperty & ACTIVATABLE)) {
if ((attributeProperty & FLOW) && (attributeProperty & ACTIVATABLE)) {
throw FormatException("Attribute '" + toString(attribute) + "' cannot be flowdefinition and activatable at the same time");
}
}
Expand Down Expand Up @@ -466,8 +466,8 @@ GNEAttributeProperties::isActivatable() const {


bool
GNEAttributeProperties::isFlowDefinition() const {
return (myAttributeProperty & FLOWDEFINITION) != 0;
GNEAttributeProperties::isFlow() const {
return (myAttributeProperty & FLOW) != 0;
}


Expand Down
4 changes: 2 additions & 2 deletions src/netedit/elements/GNEAttributeProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class GNEAttributeProperties {
EXTENDED = 1 << 20, // Attribute is extended (in Frame will not be shown, but is editable in a Dialog, see VType attributes)
UPDATEGEOMETRY = 1 << 21, // Attribute require update geometry at the end of function setAttribute(...)
ACTIVATABLE = 1 << 22, // Attribute can be switch on/off using a checkbox in frame
FLOWDEFINITION = 1 << 23, // Attribute is part of a flow definition (Number, vehsPerHour...)
FLOW = 1 << 23, // Attribute is part of a flow definition (Number, vehsPerHour...)
AUTOMATICID = 1 << 24, // Attribute id can generate their own ID (used by additionals, vehicles, etc...)
COPYABLE = 1 << 25, // Attribute can be copied over other element with the same tagProperty (used for edge/lane templates)
ALWAYSENABLED = 1 << 26, // Attribute cannot be disabled
Expand Down Expand Up @@ -210,7 +210,7 @@ class GNEAttributeProperties {
bool isActivatable() const;

/// @brief return true if attribute is part of a flow definition
bool isFlowDefinition() const;
bool isFlow() const;

/// @brief return true if attribute ID can generate an automatic ID
bool hasAutomaticID() const;
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/frames/GNEAttributeRow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ GNEAttributeRow::showAttributeRow(const GNEAttributeProperties& attrProperty) {
if (multipleEditedACs && attrProperty.isUnique()) {
// disable editing for unique attributes in case of multi-selection
hideAttributeRow();
} else if (attrProperty.isFlowDefinition()) {
} else if (attrProperty.isFlow()) {
// disable editing of flow definition attributes, but enable flow editor
hideAttributeRow();
//showFlowEditor = true;
Expand Down
4 changes: 2 additions & 2 deletions src/netedit/frames/GNEAttributesCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ GNEAttributesCreator::getAttributesAndValues(CommonXMLStructure::SumoBaseObject*
// flag for default attributes
const bool hasDefaultStaticValue = !attrProperties.hasDefaultValue() || (attrProperties.getDefaultValue() != row->getValue());
// flag for enablitables attributes
const bool isFlowDefinitionAttribute = attrProperties.isFlowDefinition();
const bool isFlowDefinitionAttribute = attrProperties.isFlow();
// flag for Terminatel attributes
const bool isActivatableAttribute = attrProperties.isActivatable() && row->getAttributeCheckButtonCheck();
// check if flags configuration allow to include values
Expand Down Expand Up @@ -258,7 +258,7 @@ GNEAttributesCreator::refreshRows(const bool createRows) {
showAttribute = false;
}
// check if attribute is a flow definitionattribute
if (attribute.isFlowDefinition()) {
if (attribute.isFlow()) {
showAttribute = false;
showFlowEditor = true;
}
Expand Down

0 comments on commit 84bb898

Please sign in to comment.