Skip to content

Commit

Permalink
Updated GNEAttributeRow. Refs #15776
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Nov 27, 2024
1 parent d7954c3 commit 84b3848
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions src/netedit/frames/GNEAttributeRow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ GNEAttributeRow::GNEAttributeRow(GNEAttributeTable* attributeTable) :
void
GNEAttributeRow::showAttributeRow(const GNEAttributeProperties& attrProperty) {
const auto multipleEditedACs = (myAttributeTable->myEditedACs.size() > 1);
const auto &tagProperty = attrProperty.getTagPropertyParent();
myAttribute = attrProperty.getAttr();
if (multipleEditedACs && attrProperty.isUnique()) {
// disable editing for unique attributes in case of multi-selection
Expand All @@ -139,7 +140,7 @@ GNEAttributeRow::showAttributeRow(const GNEAttributeProperties& attrProperty) {
attributeEnabled = true;
}
// extra check for person and container expected, because depends of triggered
if (attrProperty.getTagPropertyParent().isVehicleStop()) {
if (tagProperty.isVehicleStop()) {
if ((myAttribute == SUMO_ATTR_EXPECTED) && (firstEditedAC->isAttributeEnabled(SUMO_ATTR_TRIGGERED) == false)) {
attributeEnabled = false;
} else if ((myAttribute == SUMO_ATTR_EXPECTED_CONTAINERS) && (firstEditedAC->isAttributeEnabled(SUMO_ATTR_CONTAINER_TRIGGERED) == false)) {
Expand All @@ -165,7 +166,7 @@ GNEAttributeRow::showAttributeRow(const GNEAttributeProperties& attrProperty) {
// show elements depending of attribute properties
if (attrProperty.isActivatable()) {
showAttributeCheckButton(attrProperty, attributeEnabled);
} else if ((myAttribute == SUMO_ATTR_TYPE) && (attrProperty.getTagPropertyParent().isVehicle() || attrProperty.getTagPropertyParent().isPerson() || attrProperty.getTagPropertyParent().isContainer())) {
} else if ((myAttribute == SUMO_ATTR_TYPE) && (tagProperty.isVehicle() || tagProperty.isPerson() || tagProperty.isContainer())) {
showAttributeParent(attrProperty, attributeEnabled);
} else if (myAttribute == SUMO_ATTR_ALLOW) {
showAttributeVClass(attrProperty, attributeEnabled);
Expand All @@ -182,6 +183,15 @@ GNEAttributeRow::showAttributeRow(const GNEAttributeProperties& attrProperty) {
} else {
showValueString(attrProperty, value, attributeEnabled, computedAttribute);
}
// check if show move lane buttons
if (!multipleEditedACs && !tagProperty.isNetworkElement() && (myAttribute == SUMO_ATTR_LANE)) {
showMoveLaneButtons(value);
myValueLaneUpButton->show();
myValueLaneDownButton->show();
} else {
myValueLaneUpButton->hide();
myValueLaneDownButton->hide();
}
// Show GNEAttributeRow
show();
}
Expand Down Expand Up @@ -653,23 +663,13 @@ GNEAttributeRow::showValueString(const GNEAttributeProperties& attrProperty, con
// hide other value elements
myValueCheckButton->hide();
myValueComboBox->hide();
// check if show move lane buttons
if (!attrProperty.getTagPropertyParent().isNetworkElement() && (myAttribute == SUMO_ATTR_LANE)) {
showMoveLaneButtons(attrProperty, value);
} else {
myValueLaneUpButton->hide();
myValueLaneDownButton->hide();
}
// enable depending of supermode
enableDependingOfSupermode(attrProperty);
}


void
GNEAttributeRow::showMoveLaneButtons(const GNEAttributeProperties& attrProperty, const std::string& laneID) {
// first show move lane buttons
myValueLaneUpButton->show();
myValueLaneDownButton->show();
GNEAttributeRow::showMoveLaneButtons(const std::string& laneID) {
// retrieve lane
const auto lane = myAttributeTable->myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveLane(laneID, false);
// check lane
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/frames/GNEAttributeRow.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class GNEAttributeRow : protected FXHorizontalFrame {
void showValueString(const GNEAttributeProperties& attrProperty, const std::string& value, const bool enabled, const bool computed);

/// @brief show move lane buttons
void showMoveLaneButtons(const GNEAttributeProperties& attrProperty, const std::string& laneID);
void showMoveLaneButtons(const std::string& laneID);

/// @brief check if enable or disable depending of current supermode
void enableDependingOfSupermode(const GNEAttributeProperties& attrProperty);
Expand Down

0 comments on commit 84b3848

Please sign in to comment.