Skip to content

Commit

Permalink
Restored flow editor. Refs #15776
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Nov 28, 2024
1 parent 3cd1aa6 commit deb42ab
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/netedit/frames/GNEAttributesEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ GNEAttributesEditor::refreshAttributeTable() {
// Iterate over tag property of first AC and show row for every attribute
int itRows = 0;
for (const auto& attrProperty : myEditedACs.front()->getTagProperty()) {
// check if show extended attributes
// check if avoid show extended attributes
if (((myEditorOptions & EditorOptions::EXTENDED_ATTRIBUTES) == 0) && attrProperty.isExtended()) {
continue;
}
// check if show flow attributes
if (((myEditorOptions & EditorOptions::FLOW_ATTRIBUTES) == 0) && attrProperty.isFlow()) {
// check if force show flow attributes
if (((myEditorOptions & EditorOptions::FLOW_ATTRIBUTES) != 0) && !attrProperty.isFlow()) {
continue;
}
myAttributesEditorRows[itRows]->showAttributeRow(attrProperty);
Expand Down
4 changes: 0 additions & 4 deletions src/netedit/frames/GNEAttributesEditorRow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,6 @@ GNEAttributesEditorRow::showAttributeRow(const GNEAttributeProperties& attrPrope
if (multipleEditedACs && attrProperty.isUnique()) {
// disable editing for unique attributes in case of multi-selection
hideAttributeRow();
} else if (attrProperty.isFlow()) {
// disable editing of flow definition attributes, but enable flow editor
hideAttributeRow();
//showFlowEditor = true;
} else {
const auto firstEditedAC = myAttributeTable->myEditedACs.front();
// declare a flag for enabled attributes
Expand Down
14 changes: 11 additions & 3 deletions src/netedit/frames/common/GNEInspectorFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ GNEInspectorFrame::NeteditAttributesEditor::onCmdSetNeteditAttribute(FXObject* o
}
// force refresh values of AttributesEditor and GEOAttributesEditor
myInspectorFrameParent->myAttributesEditor->refreshAttributeTable();
myInspectorFrameParent->myFlowAttributesEditor->refreshAttributeTable();
myInspectorFrameParent->myGEOAttributesEditor->refreshGEOAttributesEditor(true);
}
return 1;
Expand Down Expand Up @@ -533,6 +534,7 @@ GNEInspectorFrame::GEOAttributesEditor::onCmdSetGEOAttribute(FXObject* obj, FXSe
}
// force refresh values of Attributes editor and NeteditAttributesEditor
myInspectorFrameParent->myAttributesEditor->refreshAttributeTable();
myInspectorFrameParent->myFlowAttributesEditor->refreshAttributeTable();
myInspectorFrameParent->myNeteditAttributesEditor->refreshNeteditAttributesEditor(true);
}
return 1;
Expand Down Expand Up @@ -843,6 +845,9 @@ GNEInspectorFrame::GNEInspectorFrame(GNEViewParent* viewParent, GNEViewNet* view
// Create Attributes Editor module
myAttributesEditor = new GNEAttributesEditor(this, GNEAttributesEditor::EditorOptions::EXTENDED_ATTRIBUTES);

// Create Flow Attributes Editor module
myFlowAttributesEditor = new GNEAttributesEditor(this, GNEAttributesEditor::EditorOptions::FLOW_ATTRIBUTES);

// Create GEO Parameters Editor module
myGEOAttributesEditor = new GEOAttributesEditor(this);

Expand Down Expand Up @@ -1029,6 +1034,7 @@ GNEInspectorFrame::refreshInspection() {
myBackButton->hide();
// Hide all elements
myAttributesEditor->hideAttributeTableModule();
myFlowAttributesEditor->hideAttributeTableModule();
myNeteditAttributesEditor->hideNeteditAttributesEditor();
myGEOAttributesEditor->hideGEOAttributesEditor();
myParametersEditor->hideParametersEditor();
Expand Down Expand Up @@ -1080,6 +1086,9 @@ GNEInspectorFrame::refreshInspection() {
// Show attributes editor
myAttributesEditor->showAttributeTableModule(inspectedElements.getACs());

// Show flow attributes editor
myFlowAttributesEditor->showAttributeTableModule(inspectedElements.getACs());

// show netedit attributes editor if we're inspecting elements with Netedit Attributes
myNeteditAttributesEditor->showNeteditAttributesEditor();

Expand Down Expand Up @@ -1193,11 +1202,9 @@ GNEInspectorFrame::onCmdGoBack(FXObject*, FXSelector, void*) {

void
GNEInspectorFrame::updateFrameAfterUndoRedo() {
// refresh Attribute Editor
myAttributesEditor->refreshAttributeTable();
// refresh parametersEditor
myFlowAttributesEditor->refreshAttributeTable();
myParametersEditor->refreshParametersEditor();
// refresh AC Hierarchy
myHierarchicalElementTree->refreshHierarchicalElementTree();
}

Expand Down Expand Up @@ -1227,6 +1234,7 @@ GNEInspectorFrame::inspectClickedElement(const GNEViewNetHelper::ViewObjectsSele
void
GNEInspectorFrame::attributeUpdated(SumoXMLAttr /*attribute*/) {
myAttributesEditor->refreshAttributeTable();
myFlowAttributesEditor->refreshAttributeTable();
myNeteditAttributesEditor->refreshNeteditAttributesEditor(true);
myGEOAttributesEditor->refreshGEOAttributesEditor(true);
}
Expand Down
5 changes: 4 additions & 1 deletion src/netedit/frames/common/GNEInspectorFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,12 @@ class GNEInspectorFrame : public GNEFrame {
/// @brief Overlapped Inspection
GNEOverlappedInspection* myOverlappedInspection;

/// @brief Attribute editor
/// @brief Attributes editor
GNEAttributesEditor* myAttributesEditor;

/// @brief Flow attributes editor
GNEAttributesEditor* myFlowAttributesEditor;

/// @brief Netedit Attributes editor
NeteditAttributesEditor* myNeteditAttributesEditor;

Expand Down

0 comments on commit deb42ab

Please sign in to comment.