mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Introduce RimGridPlotWindow and RiuQwtPlotWidget
This commit is contained in:
@@ -229,26 +229,31 @@ void RimWellPltPlot::setPlotXAxisTitles( RimWellLogTrack* plotTrack )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPltPlot::updateFormationsOnPlot() const
|
||||
{
|
||||
if ( trackCount() > 0 )
|
||||
if ( plotCount() > 0 )
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
RimWellPath* wellPath = proj->wellPathByName( m_wellPathName );
|
||||
|
||||
RimCase* formationNamesCase = trackByIndex( 0 )->formationNamesCase();
|
||||
|
||||
if ( !formationNamesCase )
|
||||
RimWellLogTrack* track = dynamic_cast<RimWellLogTrack*>( plotByIndex( 0 ) );
|
||||
CAF_ASSERT( track );
|
||||
if ( track )
|
||||
{
|
||||
/// Set default case. Todo : Use the first of the selected cases in the plot
|
||||
std::vector<RimCase*> cases;
|
||||
proj->allCases( cases );
|
||||
RimCase* formationNamesCase = track->formationNamesCase();
|
||||
|
||||
if ( !cases.empty() )
|
||||
if ( !formationNamesCase )
|
||||
{
|
||||
formationNamesCase = cases[0];
|
||||
}
|
||||
}
|
||||
/// Set default case. Todo : Use the first of the selected cases in the plot
|
||||
std::vector<RimCase*> cases;
|
||||
proj->allCases( cases );
|
||||
|
||||
trackByIndex( 0 )->setAndUpdateWellPathFormationNamesData( formationNamesCase, wellPath );
|
||||
if ( !cases.empty() )
|
||||
{
|
||||
formationNamesCase = cases[0];
|
||||
}
|
||||
}
|
||||
|
||||
track->setAndUpdateWellPathFormationNamesData( formationNamesCase, wellPath );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,7 +491,11 @@ public:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPltPlot::syncCurvesFromUiSelection()
|
||||
{
|
||||
RimWellLogTrack* plotTrack = trackByIndex( 0 );
|
||||
RimWellLogTrack* plotTrack = dynamic_cast<RimWellLogTrack*>( plotByIndex( 0 ) );
|
||||
|
||||
CAF_ASSERT( plotTrack );
|
||||
if ( !plotTrack ) return;
|
||||
|
||||
const std::set<RiaRftPltCurveDefinition>& curveDefs = selectedCurveDefs();
|
||||
|
||||
setPlotXAxisTitles( plotTrack );
|
||||
@@ -700,8 +709,8 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
|
||||
curveGroupId++;
|
||||
}
|
||||
|
||||
plotTrack->setAutoScaleXEnabled( true );
|
||||
RimWellLogPlot::onLoadDataAndUpdate();
|
||||
plotTrack->calculateXZoomRange();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -886,11 +895,15 @@ void RimWellPltPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
|
||||
if ( changedField == &m_wellPathName )
|
||||
{
|
||||
RimWellLogTrack* const plotTrack = trackByIndex( 0 );
|
||||
plotTrack->deleteAllCurves();
|
||||
m_selectedSources.v().clear();
|
||||
m_selectedTimeSteps.v().clear();
|
||||
updateFormationsOnPlot();
|
||||
RimWellLogTrack* const plotTrack = dynamic_cast<RimWellLogTrack*>( plotByIndex( 0 ) );
|
||||
CAF_ASSERT( plotTrack );
|
||||
if ( plotTrack )
|
||||
{
|
||||
plotTrack->deleteAllCurves();
|
||||
m_selectedSources.v().clear();
|
||||
m_selectedTimeSteps.v().clear();
|
||||
updateFormationsOnPlot();
|
||||
}
|
||||
}
|
||||
else if ( changedField == &m_selectedSources )
|
||||
{
|
||||
@@ -924,20 +937,28 @@ void RimWellPltPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
updateFormationsOnPlot();
|
||||
syncSourcesIoFieldFromGuiField();
|
||||
syncCurvesFromUiSelection();
|
||||
updateDepthZoom();
|
||||
|
||||
RimWellLogTrack* const plotTrack = trackByIndex( 0 );
|
||||
plotTrack->calculateXZoomRangeAndUpdateQwt();
|
||||
RimWellLogTrack* const plotTrack = dynamic_cast<RimWellLogTrack*>( plotByIndex( 0 ) );
|
||||
CAF_ASSERT( plotTrack );
|
||||
if ( plotTrack )
|
||||
{
|
||||
plotTrack->setAutoScaleXEnabled( true );
|
||||
}
|
||||
updateZoom();
|
||||
}
|
||||
|
||||
if ( changedField == &m_useStandardConditionCurves || changedField == &m_useReservoirConditionCurves ||
|
||||
changedField == &m_phases )
|
||||
{
|
||||
syncCurvesFromUiSelection();
|
||||
updateDepthZoom();
|
||||
|
||||
RimWellLogTrack* const plotTrack = trackByIndex( 0 );
|
||||
plotTrack->calculateXZoomRangeAndUpdateQwt();
|
||||
RimWellLogTrack* const plotTrack = dynamic_cast<RimWellLogTrack*>( plotByIndex( 0 ) );
|
||||
CAF_ASSERT( plotTrack );
|
||||
if ( plotTrack )
|
||||
{
|
||||
plotTrack->setAutoScaleXEnabled( true );
|
||||
}
|
||||
updateZoom();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -970,20 +991,23 @@ void RimWellPltPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
|
||||
flowGroup->add( &m_phases );
|
||||
|
||||
if ( trackCount() > 0 )
|
||||
if ( plotCount() > 0 )
|
||||
{
|
||||
RimWellLogTrack* track = trackByIndex( 0 );
|
||||
RimWellLogTrack* const track = dynamic_cast<RimWellLogTrack*>( plotByIndex( 0 ) );
|
||||
CAF_ASSERT( track );
|
||||
if ( track )
|
||||
{
|
||||
track->uiOrderingForRftPltFormations( uiOrdering );
|
||||
|
||||
track->uiOrderingForRftPltFormations( uiOrdering );
|
||||
caf::PdmUiGroup* legendAndAxisGroup = uiOrdering.addNewGroup( "Legend and Axis" );
|
||||
legendAndAxisGroup->setCollapsedByDefault( true );
|
||||
|
||||
caf::PdmUiGroup* legendAndAxisGroup = uiOrdering.addNewGroup( "Legend and Axis" );
|
||||
legendAndAxisGroup->setCollapsedByDefault( true );
|
||||
createPlotSettingsUiGroup( *legendAndAxisGroup );
|
||||
|
||||
uiOrderingForPlotSettings( *legendAndAxisGroup );
|
||||
track->uiOrderingForXAxisSettings( *legendAndAxisGroup );
|
||||
|
||||
track->uiOrderingForXAxisSettings( *legendAndAxisGroup );
|
||||
|
||||
uiOrderingForDepthAxis( *legendAndAxisGroup );
|
||||
uiOrderingForDepthAxis( *legendAndAxisGroup );
|
||||
}
|
||||
}
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
@@ -1098,9 +1122,14 @@ void RimWellPltPlot::onLoadDataAndUpdate()
|
||||
|
||||
if ( m_isOnLoad )
|
||||
{
|
||||
if ( trackCount() > 0 )
|
||||
if ( plotCount() > 0 )
|
||||
{
|
||||
trackByIndex( 0 )->setAnnotationType( RiuPlotAnnotationTool::FORMATION_ANNOTATIONS );
|
||||
RimWellLogTrack* const plotTrack = dynamic_cast<RimWellLogTrack*>( plotByIndex( 0 ) );
|
||||
CAF_ASSERT( plotTrack );
|
||||
if ( plotTrack )
|
||||
{
|
||||
plotTrack->setAnnotationType( RiuPlotAnnotationTool::FORMATION_ANNOTATIONS );
|
||||
}
|
||||
}
|
||||
m_isOnLoad = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user