Fix some smaller issues

* #9253 Well allocation plot: Keep checked state of curves when changing time step
* #9254 Guard pointer when clicking on linked time axis icon
* #9250 Cross Plot : Ensure summary case change update both x and y data sources
This commit is contained in:
Magne Sjaastad 2022-09-01 07:50:40 +02:00 committed by GitHub
parent 7c2720f980
commit 7f78cb8c89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 9 deletions

View File

@ -206,6 +206,8 @@ void RimWellAllocationPlot::deleteViewWidget()
//--------------------------------------------------------------------------------------------------
void RimWellAllocationPlot::updateFromWell()
{
std::set<QString> uncheckedCurveNames;
// Delete existing tracks
{
std::vector<RimWellLogTrack*> 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<double>& depthValues,
const std::vector<double>& 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 );
}
//--------------------------------------------------------------------------------------------------

View File

@ -117,7 +117,8 @@ private:
RiaDefines::DepthTypeEnum depthType,
const std::vector<double>& depthValues,
const std::vector<double>& accFlow,
RimWellLogTrack* plotTrack );
RimWellLogTrack* plotTrack,
bool showCurve );
void updateWidgetTitleWindowTitle();
static QString wellStatusTextForTimeStep( const QString& wellName,

View File

@ -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 );

View File

@ -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 );
}
}
}