diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp index f217257975..910025fc58 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp @@ -206,6 +206,8 @@ void RimWellAllocationPlot::deleteViewWidget() //-------------------------------------------------------------------------------------------------- void RimWellAllocationPlot::updateFromWell() { + std::set uncheckedCurveNames; + // Delete existing tracks { std::vector tracks; @@ -213,6 +215,14 @@ void RimWellAllocationPlot::updateFromWell() for ( RimWellLogTrack* t : tracks ) { + for ( auto c : t->curves() ) + { + if ( !c->isCurveVisible() ) + { + uncheckedCurveNames.insert( c->curveName() ); + } + } + accumulatedWellFlowPlot()->removePlot( t ); delete t; } @@ -325,8 +335,8 @@ void RimWellAllocationPlot::updateFromWell() curveDepthValues.insert( curveDepthValues.begin(), curveDepthValues[0] ); accFlow.insert( accFlow.begin(), 0.0 ); - if ( m_flowType == ACCUMULATED && brIdx == 0 && !accFlow.empty() ) // Add fictitious point to -1 for - // first branch + if ( m_flowType == ACCUMULATED && brIdx == 0 && !accFlow.empty() ) // Add fictitious point to -1 + // for first branch { accFlow.push_back( accFlow.back() ); curveDepthValues.push_back( -1.0 ); @@ -378,8 +388,8 @@ void RimWellAllocationPlot::updateFromWell() if ( !accFlow.empty() ) { - addStackedCurve( tracerName, depthType, curveDepthValues, accFlow, plotTrack ); - // TODO: THIs is the data to be plotted... + bool showCurve = uncheckedCurveNames.count( tracerName ) == 0; + addStackedCurve( tracerName, depthType, curveDepthValues, accFlow, plotTrack, showCurve ); } } } @@ -534,7 +544,8 @@ void RimWellAllocationPlot::addStackedCurve( const QString& tracerNa RiaDefines::DepthTypeEnum depthType, const std::vector& depthValues, const std::vector& accFlow, - RimWellLogTrack* plotTrack ) + RimWellLogTrack* plotTrack, + bool showCurve ) { RimWellFlowRateCurve* curve = new RimWellFlowRateCurve; curve->setFlowValuesPrDepthValue( tracerName, depthType, depthValues, accFlow ); @@ -551,6 +562,7 @@ void RimWellAllocationPlot::addStackedCurve( const QString& tracerNa plotTrack->addCurve( curve ); curve->loadDataAndUpdate( true ); + curve->setCurveVisibility( showCurve ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.h b/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.h index 3b5f3cd2d5..5588ccded9 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.h +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.h @@ -117,7 +117,8 @@ private: RiaDefines::DepthTypeEnum depthType, const std::vector& depthValues, const std::vector& accFlow, - RimWellLogTrack* plotTrack ); + RimWellLogTrack* plotTrack, + bool showCurve ); void updateWidgetTitleWindowTitle(); static QString wellStatusTextForTimeStep( const QString& wellName, diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index 33edc7c402..93446c5ad5 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -159,7 +159,15 @@ RimSummaryPlot::RimSummaryPlot( bool isCrossPlot ) CAF_PDM_InitFieldNoDefault( &m_sourceStepping, "SourceStepping", "" ); m_sourceStepping = new RimSummaryPlotSourceStepping; - m_sourceStepping->setSourceSteppingType( RimSummaryDataSourceStepping::Axis::Y_AXIS ); + if ( m_isCrossPlot ) + { + m_sourceStepping->setSourceSteppingType( RimSummaryDataSourceStepping::Axis::UNION_X_Y_AXIS ); + } + else + { + m_sourceStepping->setSourceSteppingType( RimSummaryDataSourceStepping::Axis::Y_AXIS ); + } + m_sourceStepping->setSourceSteppingObject( this ); m_sourceStepping.uiCapability()->setUiTreeHidden( true ); m_sourceStepping.uiCapability()->setUiTreeChildrenHidden( true ); diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewItemDelegate.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewItemDelegate.cpp index 65b436a2d5..ec3d41abcd 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewItemDelegate.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewItemDelegate.cpp @@ -287,8 +287,11 @@ bool PdmUiTreeViewItemDelegate::editorEvent( QEvent* event, PdmFieldReorderCapability* reorderability = PdmFieldReorderCapability::reorderCapabilityOfParentContainer( pdmObject ); - size_t indexInParent = reorderability->indexOf( pdmObject ); - tag->clicked.send( indexInParent ); + if ( reorderability ) + { + size_t indexInParent = reorderability->indexOf( pdmObject ); + tag->clicked.send( indexInParent ); + } } }