From deb42ab194ac3f22dc170f66b550d832638ab69c Mon Sep 17 00:00:00 2001 From: Pablo Alvarez Lopez Date: Thu, 28 Nov 2024 16:10:08 +0100 Subject: [PATCH] Restored flow editor. Refs #15776 --- src/netedit/frames/GNEAttributesEditor.cpp | 6 +++--- src/netedit/frames/GNEAttributesEditorRow.cpp | 4 ---- src/netedit/frames/common/GNEInspectorFrame.cpp | 14 +++++++++++--- src/netedit/frames/common/GNEInspectorFrame.h | 5 ++++- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/netedit/frames/GNEAttributesEditor.cpp b/src/netedit/frames/GNEAttributesEditor.cpp index 47bdb057791..4bfc0d989fa 100644 --- a/src/netedit/frames/GNEAttributesEditor.cpp +++ b/src/netedit/frames/GNEAttributesEditor.cpp @@ -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); diff --git a/src/netedit/frames/GNEAttributesEditorRow.cpp b/src/netedit/frames/GNEAttributesEditorRow.cpp index 486628ffa8d..553605f72fd 100644 --- a/src/netedit/frames/GNEAttributesEditorRow.cpp +++ b/src/netedit/frames/GNEAttributesEditorRow.cpp @@ -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 diff --git a/src/netedit/frames/common/GNEInspectorFrame.cpp b/src/netedit/frames/common/GNEInspectorFrame.cpp index 2ebfa0f6361..65cb0979515 100644 --- a/src/netedit/frames/common/GNEInspectorFrame.cpp +++ b/src/netedit/frames/common/GNEInspectorFrame.cpp @@ -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; @@ -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; @@ -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); @@ -1029,6 +1034,7 @@ GNEInspectorFrame::refreshInspection() { myBackButton->hide(); // Hide all elements myAttributesEditor->hideAttributeTableModule(); + myFlowAttributesEditor->hideAttributeTableModule(); myNeteditAttributesEditor->hideNeteditAttributesEditor(); myGEOAttributesEditor->hideGEOAttributesEditor(); myParametersEditor->hideParametersEditor(); @@ -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(); @@ -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(); } @@ -1227,6 +1234,7 @@ GNEInspectorFrame::inspectClickedElement(const GNEViewNetHelper::ViewObjectsSele void GNEInspectorFrame::attributeUpdated(SumoXMLAttr /*attribute*/) { myAttributesEditor->refreshAttributeTable(); + myFlowAttributesEditor->refreshAttributeTable(); myNeteditAttributesEditor->refreshNeteditAttributesEditor(true); myGEOAttributesEditor->refreshGEOAttributesEditor(true); } diff --git a/src/netedit/frames/common/GNEInspectorFrame.h b/src/netedit/frames/common/GNEInspectorFrame.h index 55f96d610f9..cebf765d843 100644 --- a/src/netedit/frames/common/GNEInspectorFrame.h +++ b/src/netedit/frames/common/GNEInspectorFrame.h @@ -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;