RFT segment plot adjustments (#9912)

* Delete RFT plot when associated case is deleted
* Rename
* Hide track/curves with no data
This commit is contained in:
Magne Sjaastad
2023-03-06 14:34:22 +01:00
committed by GitHub
parent 8f786fed5d
commit c248c9fb57
32 changed files with 355 additions and 169 deletions

View File

@@ -179,6 +179,14 @@ void RimWellLogCurve::setPropertyAndDepthsAndErrors( const std::vector<double>&
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogCurve::clearCurveData()
{
m_curveData->clear();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -458,3 +466,11 @@ RiuPlotAxis RimWellLogCurve::valueAxis() const
return depthTrackPlot->valueAxis();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogCurve::isAnyCurveDataPresent() const
{
return !m_curveData->propertyValues().empty();
}

View File

@@ -48,6 +48,7 @@ public:
bool depthValueRangeInData( double* minimumValue, double* maximumValue ) const;
const RigWellLogCurveData* curveData() const;
bool isAnyCurveDataPresent() const override;
void updateCurveAppearance() override;
@@ -105,6 +106,8 @@ protected:
const std::vector<double>& depthValues,
const std::vector<double>& errorValues );
void clearCurveData();
bool isVerticalCurve() const;
RiuPlotAxis depthAxis() const;
RiuPlotAxis valueAxis() const;

View File

@@ -328,10 +328,6 @@ void RimWellLogCurveCommonDataSource::analyseCurvesAndTracks( const std::vector<
// Check to see if the parameters are unique
for ( RimWellLogCurve* curve : curves )
{
if ( !curve->isCurveVisible() )
{
continue;
}
auto* extractionCurve = dynamic_cast<RimWellLogExtractionCurve*>( curve );
auto* fileCurve = dynamic_cast<RimWellLogFileCurve*>( curve );
auto* flowRateCurve = dynamic_cast<RimWellFlowRateCurve*>( curve );
@@ -521,10 +517,6 @@ void RimWellLogCurveCommonDataSource::applyDataSourceChanges( const std::vector<
std::set<RimWellLogPlot*> plots;
for ( RimWellLogCurve* curve : curves )
{
if ( !curve->isCurveVisible() )
{
continue;
}
auto* fileCurve = dynamic_cast<RimWellLogFileCurve*>( curve );
auto* extractionCurve = dynamic_cast<RimWellLogExtractionCurve*>( curve );
auto* measurementCurve = dynamic_cast<RimWellMeasurementCurve*>( curve );
@@ -719,6 +711,11 @@ void RimWellLogCurveCommonDataSource::applyDataSourceChanges()
parentPlot->descendantsIncludingThisOfType( tracks );
this->applyDataSourceChanges( curves, tracks );
for ( auto& track : tracks )
{
track->updateCheckStateBasedOnCurveData();
}
}
}

View File

@@ -344,7 +344,7 @@ void RimWellLogExtractionCurve::fieldChangedByUi( const caf::PdmFieldHandle* cha
//--------------------------------------------------------------------------------------------------
void RimWellLogExtractionCurve::onLoadDataAndUpdate( bool updateParentPlot )
{
if ( isCurveVisible() )
if ( isChecked() )
{
bool isUsingPseudoLength = false;
performDataExtraction( &isUsingPseudoLength );

View File

@@ -78,7 +78,7 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
{
this->RimPlotCurve::updateCurvePresentation( updateParentPlot );
if ( isCurveVisible() )
if ( isChecked() )
{
RimWellLogPlot* wellLogPlot;
firstAncestorOrThisOfType( wellLogPlot );

View File

@@ -648,7 +648,7 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
DerivedMDSource derivedMDSource = DerivedMDSource::NO_SOURCE;
if ( isCurveVisible() )
if ( m_autoCheckStateBasedOnCurveData() || isChecked() )
{
RimDepthTrackPlot* wellLogPlot;
firstAncestorOrThisOfType( wellLogPlot );
@@ -666,6 +666,7 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
if ( values.empty() || values.size() != tvDepthVector.size() )
{
clearCurveData();
this->detach( true );
return;
}
@@ -747,78 +748,81 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
displayUnit = wellLogPlot->depthUnit();
}
if ( wellLogPlot->depthType() == RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
if ( m_plotCurve )
{
m_plotCurve->setPerPointLabels( perPointLabels );
auto propertyValues = this->curveData()->propertyValuesByIntervals();
auto depthValues = this->curveData()->depthValuesByIntervals( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, displayUnit );
if ( !errors.empty() )
if ( wellLogPlot->depthType() == RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
{
setPropertyAndDepthsAndErrors( propertyValues, depthValues, errors );
}
else
{
setPropertyAndDepthValuesToPlotCurve( propertyValues, depthValues );
}
m_plotCurve->setPerPointLabels( perPointLabels );
m_plotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() );
auto propertyValues = this->curveData()->propertyValuesByIntervals();
auto depthValues = this->curveData()->depthValuesByIntervals( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, displayUnit );
RimWellLogTrack* wellLogTrack;
firstAncestorOrThisOfType( wellLogTrack );
CVF_ASSERT( wellLogTrack );
RiuQwtPlotWidget* viewer = wellLogTrack->viewer();
if ( viewer )
{
QString text;
if ( derivedMDSource != DerivedMDSource::NO_SOURCE )
if ( !errors.empty() )
{
if ( derivedMDSource == DerivedMDSource::WELL_PATH )
{
text = "WELL/" + wellLogPlot->depthAxisTitle();
}
else
{
text = "OBS/" + wellLogPlot->depthAxisTitle();
}
}
else // Standard depth title set from plot
{
text = wellLogPlot->depthAxisTitle();
}
viewer->setAxisTitleText( wellLogPlot->depthAxis(), text );
}
}
else
{
m_plotCurve->setPerPointLabels( perPointLabels );
auto propertyValues = this->curveData()->propertyValuesByIntervals();
auto depthValues = this->curveData()->depthValuesByIntervals( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, displayUnit );
bool useLogarithmicScale = false;
if ( !errors.empty() )
{
setPropertyAndDepthsAndErrors( propertyValues, depthValues, errors );
}
else
{
if ( isVerticalCurve() )
{
m_plotCurve->setSamplesFromXValuesAndYValues( propertyValues, depthValues, useLogarithmicScale );
setPropertyAndDepthsAndErrors( propertyValues, depthValues, errors );
}
else
{
m_plotCurve->setSamplesFromXValuesAndYValues( depthValues, propertyValues, useLogarithmicScale );
setPropertyAndDepthValuesToPlotCurve( propertyValues, depthValues );
}
m_plotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() );
RimWellLogTrack* wellLogTrack;
firstAncestorOrThisOfType( wellLogTrack );
CVF_ASSERT( wellLogTrack );
RiuQwtPlotWidget* viewer = wellLogTrack->viewer();
if ( viewer )
{
QString text;
if ( derivedMDSource != DerivedMDSource::NO_SOURCE )
{
if ( derivedMDSource == DerivedMDSource::WELL_PATH )
{
text = "WELL/" + wellLogPlot->depthAxisTitle();
}
else
{
text = "OBS/" + wellLogPlot->depthAxisTitle();
}
}
else // Standard depth title set from plot
{
text = wellLogPlot->depthAxisTitle();
}
viewer->setAxisTitleText( wellLogPlot->depthAxis(), text );
}
}
}
else
{
m_plotCurve->setPerPointLabels( perPointLabels );
m_plotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() );
auto propertyValues = this->curveData()->propertyValuesByIntervals();
auto depthValues = this->curveData()->depthValuesByIntervals( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, displayUnit );
bool useLogarithmicScale = false;
if ( !errors.empty() )
{
setPropertyAndDepthsAndErrors( propertyValues, depthValues, errors );
}
else
{
if ( isVerticalCurve() )
{
m_plotCurve->setSamplesFromXValuesAndYValues( propertyValues, depthValues, useLogarithmicScale );
}
else
{
m_plotCurve->setSamplesFromXValuesAndYValues( depthValues, propertyValues, useLogarithmicScale );
}
}
}
m_plotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() );
}
if ( updateParentPlot )
{
@@ -847,6 +851,10 @@ void RimWellLogRftCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrder
curveDataGroup->add( &m_rftDataType );
curveDataGroup->add( &m_scaleFactor );
caf::PdmUiGroup* automationGroup = uiOrdering.addNewGroup( "Automation" );
automationGroup->setCollapsedByDefault();
automationGroup->add( &m_autoCheckStateBasedOnCurveData );
if ( m_rftDataType() == RimWellLogRftCurve::RftDataType::RFT_DATA )
{
curveDataGroup->add( &m_wellLogChannelName );

View File

@@ -270,6 +270,8 @@ RimWellLogTrack::RimWellLogTrack()
CAF_PDM_InitFieldNoDefault( &m_wellPathComponentSource, "AttributesWellPathSource", "Well Path" );
CAF_PDM_InitFieldNoDefault( &m_wellPathAttributeCollection, "AttributesCollection", "Well Attributes" );
CAF_PDM_InitField( &m_autoCheckStateBasedOnCurveData, "AutoCheckStateBasedOnCurveData", false, "Hide Track if No Curve Data" );
CAF_PDM_InitField( &m_overburdenHeight, "OverburdenHeight", 0.0, "Overburden Height" );
m_overburdenHeight.uiCapability()->setUiHidden( true );
CAF_PDM_InitField( &m_underburdenHeight, "UnderburdenHeight", 0.0, "Underburden Height" );
@@ -379,7 +381,7 @@ void RimWellLogTrack::calculatePropertyValueZoomRange()
double minCurveValue = HUGE_VAL;
double maxCurveValue = -HUGE_VAL;
if ( curve->isCurveVisible() )
if ( curve->isChecked() )
{
visibleCurves++;
if ( curve->propertyValueRangeInData( &minCurveValue, &maxCurveValue ) )
@@ -443,7 +445,7 @@ void RimWellLogTrack::calculateDepthZoomRange()
double minCurveDepth = HUGE_VAL;
double maxCurveDepth = -HUGE_VAL;
if ( curve->isCurveVisible() && curve->depthValueRangeInData( &minCurveDepth, &maxCurveDepth ) )
if ( curve->isChecked() && curve->depthValueRangeInData( &minCurveDepth, &maxCurveDepth ) )
{
if ( minCurveDepth < minDepth )
{
@@ -759,6 +761,10 @@ void RimWellLogTrack::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
updateParentLayout();
RiuPlotMainWindowTools::refreshToolbars();
}
else if ( changedField == &m_autoCheckStateBasedOnCurveData )
{
updateCheckStateBasedOnCurveData();
}
}
//--------------------------------------------------------------------------------------------------
@@ -954,7 +960,7 @@ QString RimWellLogTrack::asciiDataForPlotExport() const
for ( RimWellLogCurve* curve : m_curves() )
{
if ( !curve->isCurveVisible() ) continue;
if ( !curve->isChecked() ) continue;
const RigWellLogCurveData* curveData = curve->curveData();
if ( !curveData ) continue;
@@ -1281,6 +1287,36 @@ bool RimWellLogTrack::isEmptyVisiblePropertyRange() const
1.0e-6 * std::max( 1.0, std::max( m_visiblePropertyValueRangeMax(), m_visiblePropertyValueRangeMin() ) );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setAutoCheckStateBasedOnCurveData( bool enable )
{
m_autoCheckStateBasedOnCurveData = enable;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::updateCheckStateBasedOnCurveData()
{
bool curveDataPresent = false;
for ( const auto& curve : curves() )
{
curve->updateCheckStateBasedOnCurveData();
curve->updateCurveVisibility();
if ( curve->isAnyCurveDataPresent() ) curveDataPresent = true;
}
// As the visibility of a curve might have changed, update the legend
updateLegend();
if ( !m_autoCheckStateBasedOnCurveData ) return;
setShowWindow( curveDataPresent );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -1999,6 +2035,10 @@ void RimWellLogTrack::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
else
uiOrdering.add( &m_colSpan );
caf::PdmUiGroup* automationGroup = uiOrdering.addNewGroup( "Automation" );
automationGroup->setCollapsedByDefault();
automationGroup->add( &m_autoCheckStateBasedOnCurveData );
caf::PdmUiGroup* annotationGroup = uiOrdering.addNewGroup( "Regions/Annotations" );
annotationGroup->setCollapsedByDefault();
@@ -2373,11 +2413,11 @@ void RimWellLogTrack::computeAndSetPropertyValueRangeMinForLogarithmicScale()
double pos = HUGE_VAL;
double neg = -HUGE_VAL;
for ( size_t cIdx = 0; cIdx < m_curves.size(); cIdx++ )
for ( const auto& curve : m_curves )
{
if ( m_curves[cIdx]->isCurveVisible() && m_curves[cIdx]->curveData() )
if ( curve->isChecked() && curve->curveData() )
{
RigStatisticsCalculator::posNegClosestToZero( m_curves[cIdx]->curveData()->propertyValuesByIntervals(), pos, neg );
RigStatisticsCalculator::posNegClosestToZero( curve->curveData()->propertyValuesByIntervals(), pos, neg );
}
}
@@ -2415,7 +2455,7 @@ std::map<int, std::vector<RimWellLogCurve*>> RimWellLogTrack::visibleStackedCurv
std::map<int, std::vector<RimWellLogCurve*>> stackedCurves;
for ( RimWellLogCurve* curve : m_curves )
{
if ( curve && curve->isCurveVisible() )
if ( curve && curve->isChecked() )
{
RimWellFlowRateCurve* wfrCurve = dynamic_cast<RimWellFlowRateCurve*>( curve );
if ( wfrCurve != nullptr ) // Flow rate curves are always stacked
@@ -2449,7 +2489,7 @@ std::vector<RimWellLogCurve*> RimWellLogTrack::visibleCurves() const
for ( RimWellLogCurve* curve : m_curves.children() )
{
if ( curve->isCurveVisible() )
if ( curve->isChecked() )
{
curvesVector.push_back( curve );
}

View File

@@ -236,6 +236,9 @@ public:
void updateAxesVisibility( RiaDefines::Orientation orientation, bool isFirstTrack, bool isLastTrack );
void updateDepthMarkerLine();
void setAutoCheckStateBasedOnCurveData( bool enable );
void updateCheckStateBasedOnCurveData();
protected:
// RimViewWindow overrides
void deleteViewWidget() override;
@@ -361,6 +364,8 @@ private:
caf::PdmField<double> m_underburdenHeight;
caf::PdmChildField<RimEnsembleWellLogCurveSet*> m_ensembleWellLogCurveSet;
caf::PdmField<bool> m_autoCheckStateBasedOnCurveData;
std::vector<std::unique_ptr<RiuWellPathComponentPlotItem>> m_wellPathAttributePlotObjects;
bool m_formationsForCaseWithSimWellOnly;