Add topology curves and show in additional track

* Add topology curves and default plot
* Improve visual appearance
* Update sub module opm-common
* Add support for INCLUDE keyword to allow parsing of include files recursively
* Search for *.DATA with fallback to *.SCH to automatically import WESEGLINK data
* Find annulus branch based on MD diff on segment start
* Stop growing device branch if segment starts at a lower MD than previous
This commit is contained in:
Magne Sjaastad
2022-10-07 12:37:23 +02:00
committed by GitHub
parent f155da0179
commit 6d5e303361
21 changed files with 893 additions and 149 deletions

View File

@@ -24,6 +24,7 @@
#include "opm/input/eclipse/Deck/Deck.hpp"
#include "opm/input/eclipse/Parser/ParseContext.hpp"
#include "opm/input/eclipse/Parser/Parser.hpp"
#include "opm/input/eclipse/Parser/ParserKeywords/I.hpp"
#include "opm/input/eclipse/Parser/ParserKeywords/V.hpp"
#include "opm/input/eclipse/Parser/ParserKeywords/W.hpp"
@@ -131,8 +132,10 @@ std::map<std::string, std::vector<std::pair<int, int>>> RiaOpmParserTools::extra
Opm::Parser parser( false );
const Opm::ParserKeywords::WSEGLINK kw1;
const Opm::ParserKeywords::INCLUDE kw2;
parser.addParserKeyword( kw1 );
parser.addParserKeyword( kw2 );
std::stringstream ss;
Opm::ParseContext parseContext( Opm::InputError::Action::WARN );

View File

@@ -139,12 +139,43 @@ void RimFileSummaryCase::createRftReaderInterface()
QFileInfo fileInfo( summaryHeaderFilename() );
QString folder = fileInfo.absolutePath();
QString rftFileName = folder + "/" + fileInfo.completeBaseName() + ".RFT";
QFileInfo rftFileInfo( rftFileName );
if ( rftFileInfo.exists() )
QString rftFileName = folder + "/" + fileInfo.completeBaseName() + ".RFT";
{
m_rftCase()->setRftFileName( rftFileName );
QFileInfo fi( rftFileName );
if ( fi.exists() )
{
m_rftCase()->setRftFileName( rftFileName );
}
}
if ( m_rftCase->dataDeckFilePath().isEmpty() )
{
// Search for *.DATA file in same folder as summary file. If not found, search for a schedule file.
QString validDataDeckFileName;
QString dataDeckFileName = folder + "/" + fileInfo.completeBaseName() + ".DATA";
QFileInfo fi( dataDeckFileName );
if ( fi.exists() )
{
validDataDeckFileName = dataDeckFileName;
}
else
{
QString scheduleFileName = folder + "/" + fileInfo.completeBaseName() + ".SCH";
QFileInfo fi( scheduleFileName );
if ( fi.exists() )
{
validDataDeckFileName = scheduleFileName;
}
}
if ( !validDataDeckFileName.isEmpty() )
{
m_rftCase->setDataDeckFileName( dataDeckFileName );
}
}
m_summaryEclipseRftReader =

View File

@@ -24,6 +24,7 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurve.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogWbsCurve.h
${CMAKE_CURRENT_LIST_DIR}/RimRftTools.h
${CMAKE_CURRENT_LIST_DIR}/RimRftTopologyCurve.h
)
set(SOURCE_GROUP_SOURCE_FILES
@@ -52,6 +53,7 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatistics.cpp
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatisticsCurve.cpp
${CMAKE_CURRENT_LIST_DIR}/RimRftTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RimRftTopologyCurve.cpp
)
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})

View File

@@ -141,9 +141,10 @@ QList<caf::PdmOptionItemInfo> RimRftTools::segmentResultNameOptions( RifReaderRf
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RimRftTools::segmentBranchIndexOptions( RifReaderRftInterface* readerRft,
const QString& wellName,
const QDateTime& timeStep )
QList<caf::PdmOptionItemInfo> RimRftTools::segmentBranchIndexOptions( RifReaderRftInterface* readerRft,
const QString& wellName,
const QDateTime& timeStep,
RiaDefines::RftBranchType branchType )
{
auto opmReader = dynamic_cast<RifReaderOpmRft*>( readerRft );
if ( opmReader )
@@ -151,7 +152,7 @@ QList<caf::PdmOptionItemInfo> RimRftTools::segmentBranchIndexOptions( RifReaderR
QList<caf::PdmOptionItemInfo> options;
options.push_front( caf::PdmOptionItemInfo( RiaDefines::allBranches(), -1 ) );
auto branchIdIndex = opmReader->branchIdsAndOneBasedIndices( wellName, timeStep );
auto branchIdIndex = opmReader->branchIdsAndOneBasedIndices( wellName, timeStep, branchType );
std::set<int> indices;
for ( auto b : branchIdIndex )
@@ -169,7 +170,7 @@ QList<caf::PdmOptionItemInfo> RimRftTools::segmentBranchIndexOptions( RifReaderR
auto minMax = std::minmax_element( branchIds.begin(), branchIds.end() );
auto txt = QString( "%1 (%2-%3)" ).arg( i ).arg( *minMax.first ).arg( *minMax.second );
auto txt = QString( "%1 (Branch Id %2-%3)" ).arg( i ).arg( *minMax.first ).arg( *minMax.second );
options.push_back( caf::PdmOptionItemInfo( txt, i ) );
}

View File

@@ -18,6 +18,7 @@
#pragma once
#include "RiaRftDefines.h"
#include "RifEclipseRftAddress.h"
#include <QList>
@@ -40,7 +41,9 @@ public:
static QList<caf::PdmOptionItemInfo> segmentTimeStepOptions( RifReaderRftInterface* readerRft, const QString& wellName );
static QList<caf::PdmOptionItemInfo>
segmentResultNameOptions( RifReaderRftInterface* readerRft, const QString& wellName, const QDateTime& timeStep );
static QList<caf::PdmOptionItemInfo>
segmentBranchIndexOptions( RifReaderRftInterface* readerRft, const QString& wellName, const QDateTime& timeStep );
segmentResultNameOptions( RifReaderRftInterface* readerRft, const QString& wellName, const QDateTime& timeStep );
static QList<caf::PdmOptionItemInfo> segmentBranchIndexOptions( RifReaderRftInterface* readerRft,
const QString& wellName,
const QDateTime& timeStep,
RiaDefines::RftBranchType branchType );
};

View File

@@ -0,0 +1,297 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2022 Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimRftTopologyCurve.h"
#include "RiaColorTables.h"
#include "RiaSummaryTools.h"
#include "RifReaderOpmRft.h"
#include "RigWellLogCurveData.h"
#include "RimDepthTrackPlot.h"
#include "RimProject.h"
#include "RimRftTools.h"
#include "RimSummaryCase.h"
#include "RimWellLogPlot.h"
#include "RiuPlotCurve.h"
CAF_PDM_SOURCE_INIT( RimRftTopologyCurve, "RimRftTopologyCurve" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimRftTopologyCurve::RimRftTopologyCurve()
{
CAF_PDM_InitObject( "RFT Topology Curve" );
CAF_PDM_InitFieldNoDefault( &m_summaryCase, "SummaryCase", "Summary Case" );
m_summaryCase.uiCapability()->setUiTreeChildrenHidden( true );
CAF_PDM_InitFieldNoDefault( &m_timeStep, "TimeStep", "Time Step" );
CAF_PDM_InitFieldNoDefault( &m_wellName, "WellName", "Well Name" );
CAF_PDM_InitField( &m_segmentBranchIndex, "SegmentBranchIndex", -1, "Branch" );
CAF_PDM_InitFieldNoDefault( &m_segmentBranchType, "SegmentBranchType", "Completion" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimRftTopologyCurve::setDataSource( RimSummaryCase* summaryCase,
const QDateTime& timeStep,
const QString& wellName,
int segmentBranchIndex,
RiaDefines::RftBranchType branchType )
{
setDataSource( summaryCase, timeStep, wellName, segmentBranchIndex );
m_segmentBranchType = branchType;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimRftTopologyCurve::setDataSource( RimSummaryCase* summaryCase,
const QDateTime& timeStep,
const QString& wellName,
int segmentBranchIndex )
{
m_summaryCase = summaryCase;
m_timeStep = timeStep;
m_wellName = wellName;
m_segmentBranchIndex = segmentBranchIndex;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimRftTopologyCurve::wellName() const
{
return "Topology curve";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimRftTopologyCurve::wellLogChannelUiName() const
{
return "Topology curve channel";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimRftTopologyCurve::wellLogChannelUnits() const
{
return "Topology curve units";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimRftTopologyCurve::createCurveAutoName()
{
QString text;
if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_ANNULUS ) text += "Annulus";
if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_DEVICE ) text += "Device";
if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_TUBING ) text += "Tubing";
text += QString( " (%1)" ).arg( m_segmentBranchIndex() );
return text;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimRftTopologyCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
RimPlotCurve::updateOptionSensitivity();
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Data Source" );
curveDataGroup->add( &m_summaryCase );
curveDataGroup->add( &m_wellName );
curveDataGroup->add( &m_timeStep );
curveDataGroup->add( &m_segmentBranchIndex );
curveDataGroup->add( &m_segmentBranchType );
caf::PdmUiGroup* stackingGroup = uiOrdering.addNewGroup( "Stacking" );
RimStackablePlotCurve::stackingUiOrdering( *stackingGroup );
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup( "Appearance" );
RimPlotCurve::appearanceUiOrdering( *appearanceGroup );
caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup( "Curve Name" );
nameGroup->setCollapsedByDefault();
nameGroup->add( &m_showLegend );
RimPlotCurve::curveNameUiOrdering( *nameGroup );
uiOrdering.skipRemainingFields( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RimRftTopologyCurve::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
{
if ( !m_summaryCase ) return {};
QList<caf::PdmOptionItemInfo> options;
auto reader = m_summaryCase->rftReader();
if ( fieldNeedingOptions == &m_summaryCase )
{
options = RiaSummaryTools::optionsForSummaryCases( RimProject::current()->allSummaryCases() );
options.push_front( caf::PdmOptionItemInfo( "None", nullptr ) );
}
else if ( fieldNeedingOptions == &m_wellName )
{
options = RimRftTools::wellNameOptions( reader );
}
else if ( fieldNeedingOptions == &m_timeStep )
{
options = RimRftTools::segmentTimeStepOptions( reader, m_wellName );
}
else if ( fieldNeedingOptions == &m_segmentBranchIndex )
{
options = RimRftTools::segmentBranchIndexOptions( reader,
m_wellName(),
m_timeStep(),
RiaDefines::RftBranchType::RFT_UNKNOWN );
}
return options;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimRftTopologyCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
{
RimWellLogCurve::fieldChangedByUi( changedField, oldValue, newValue );
this->loadDataAndUpdate( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimRftTopologyCurve::onLoadDataAndUpdate( bool updateParentPlot )
{
this->RimPlotCurve::updateCurvePresentation( updateParentPlot );
if ( m_summaryCase )
{
auto rftReader = dynamic_cast<RifReaderOpmRft*>( m_summaryCase->rftReader() );
// Update well path attributes, packers and casing based on RFT data
if ( rftReader )
{
std::vector<double> seglenstValues;
std::vector<double> seglenenValues;
auto resultNameSeglenst = RifEclipseRftAddress::createSegmentAddress( m_wellName, m_timeStep, "SEGLENST" );
rftReader->values( resultNameSeglenst, &seglenstValues );
auto resultNameSeglenen = RifEclipseRftAddress::createSegmentAddress( m_wellName, m_timeStep, "SEGLENEN" );
rftReader->values( resultNameSeglenen, &seglenenValues );
auto segment = rftReader->segmentForWell( m_wellName, m_timeStep );
auto segmentIndices = segment.segmentIndicesForBranchIndex( m_segmentBranchIndex(), m_segmentBranchType() );
if ( !segmentIndices.empty() )
{
std::vector<double> depths;
std::vector<double> propertyValues;
// Assign a static property value to each type of curve to make sure they all are separated and easily
// visible
double curveValue = 1.0;
if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_TUBING ) curveValue = 2.0;
if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_DEVICE ) curveValue = 3.0;
if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_ANNULUS ) curveValue = 4.0;
// Adjust the location of each branch if multiple branches are visible at the same time
curveValue += m_segmentBranchIndex() * 0.2;
for ( auto segmentIndex : segmentIndices )
{
depths.push_back( seglenstValues[segmentIndex] );
depths.push_back( seglenenValues[segmentIndex] );
propertyValues.push_back( curveValue );
propertyValues.push_back( curveValue );
}
RimDepthTrackPlot* wellLogPlot;
firstAncestorOrThisOfTypeAsserted( wellLogPlot );
RimWellLogPlot::DepthTypeEnum depthType = wellLogPlot->depthType();
RiaDefines::DepthUnitType displayUnit = wellLogPlot->depthUnit();
bool isExtractionCurve = false;
bool useLogarithmicScale = false;
setPropertyValuesAndDepths( propertyValues, depths, depthType, 0.0, displayUnit, isExtractionCurve, useLogarithmicScale );
// Assign curve values based on horizontal or vertical plot
setPropertyAndDepthValuesToPlotCurve( propertyValues, depths );
if ( updateParentPlot )
{
updateZoomInParentPlot();
}
if ( m_parentPlot )
{
m_parentPlot->replot();
}
}
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimRftTopologyCurve::applyDefaultAppearance()
{
cvf::Color3f color = cvf::Color3f::BLUE;
if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_TUBING )
{
color = RiaColorTables::wellLogPlotPaletteColors().cycledColor3f( 0 );
}
else if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_DEVICE )
{
color = RiaColorTables::wellLogPlotPaletteColors().cycledColor3f( 1 );
setLineStyle( RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_NONE );
}
else if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_ANNULUS )
{
color = RiaColorTables::wellLogPlotPaletteColors().cycledColor3f( 2 );
setLineStyle( RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_NONE );
}
setColor( color );
setLineThickness( 5.0 );
setSymbol( RiuPlotCurveSymbol::PointSymbolEnum::SYMBOL_ELLIPSE );
}

View File

@@ -0,0 +1,70 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2022 Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimWellLogCurve.h"
#include "cafPdmPtrField.h"
#include "RiaRftDefines.h"
#include <QDateTime>
class RimSummaryCase;
//==================================================================================================
///
///
//==================================================================================================
class RimRftTopologyCurve : public RimWellLogCurve
{
CAF_PDM_HEADER_INIT;
public:
RimRftTopologyCurve();
void setDataSource( RimSummaryCase* summaryCase,
const QDateTime& timeStep,
const QString& wellName,
int segmentBranchIndex,
RiaDefines::RftBranchType branchType );
void setDataSource( RimSummaryCase* summaryCase, const QDateTime& timeStep, const QString& wellName, int segmentBranchIndex );
void applyDefaultAppearance();
QString wellName() const override;
QString wellLogChannelUiName() const override;
QString wellLogChannelUnits() const override;
protected:
QString createCurveAutoName() override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void onLoadDataAndUpdate( bool updateParentPlot ) override;
private:
caf::PdmPtrField<RimSummaryCase*> m_summaryCase;
caf::PdmField<QDateTime> m_timeStep;
caf::PdmField<QString> m_wellName;
caf::PdmField<int> m_segmentBranchIndex;
caf::PdmField<caf::AppEnum<RiaDefines::RftBranchType>> m_segmentBranchType;
};

View File

@@ -29,6 +29,7 @@
#include "RimOilField.h"
#include "RimProject.h"
#include "RimRftTools.h"
#include "RimRftTopologyCurve.h"
#include "RimSummaryCase.h"
#include "RimTools.h"
#include "RimWellFlowRateCurve.h"
@@ -108,7 +109,7 @@ RimWellLogCurveCommonDataSource::RimWellLogCurveCommonDataSource()
CAF_PDM_InitFieldNoDefault( &m_rftTimeStep, "RftTimeStep", "RFT Time Step" );
CAF_PDM_InitFieldNoDefault( &m_rftWellName, "RftWellName", "RFT Well Name" );
CAF_PDM_InitFieldNoDefault( &m_rftSegmentBranchIndex, "SegmentBranchIndex", "RFT Branch" );
CAF_PDM_InitFieldNoDefault( &m_rftSegmentBranchType, "SegmentBranchType", "RFT Branch Type" );
CAF_PDM_InitFieldNoDefault( &m_rftSegmentBranchType, "SegmentBranchType", "RFT Completion" );
m_case = nullptr;
m_wellPath = nullptr;
@@ -531,6 +532,7 @@ void RimWellLogCurveCommonDataSource::applyDataSourceChanges( const std::vector<
auto* extractionCurve = dynamic_cast<RimWellLogExtractionCurve*>( curve );
auto* measurementCurve = dynamic_cast<RimWellMeasurementCurve*>( curve );
auto* rftCurve = dynamic_cast<RimWellLogRftCurve*>( curve );
auto* topologyCurve = dynamic_cast<RimRftTopologyCurve*>( curve );
if ( fileCurve )
{
if ( wellPathToApply() != nullptr )
@@ -638,6 +640,10 @@ void RimWellLogCurveCommonDataSource::applyDataSourceChanges( const std::vector<
rftCurve->firstAncestorOrThisOfTypeAsserted( parentPlot );
plots.insert( parentPlot );
}
else if ( topologyCurve )
{
topologyCurve->setDataSource( m_summaryCase, m_rftTimeStep, m_rftWellName, m_rftSegmentBranchIndex );
}
curve->updateConnectedEditors();
}
@@ -1002,7 +1008,8 @@ QList<caf::PdmOptionItemInfo>
}
else if ( fieldNeedingOptions == &m_rftSegmentBranchIndex )
{
options = RimRftTools::segmentBranchIndexOptions( rftReader(), m_rftWellName(), m_rftTimeStep() );
options =
RimRftTools::segmentBranchIndexOptions( rftReader(), m_rftWellName(), m_rftTimeStep(), m_rftSegmentBranchType() );
}
return options;
@@ -1062,8 +1069,8 @@ void RimWellLogCurveCommonDataSource::defineUiOrdering( QString uiConfigName, ca
if ( !m_uniqueRftTimeSteps.empty() ) group->add( &m_rftTimeStep );
if ( !m_uniqueRftWellNames.empty() ) group->add( &m_rftWellName );
if ( !m_uniqueRftBranchIndices.empty() ) group->add( &m_rftSegmentBranchIndex );
if ( !m_uniqueRftBranchTypes.empty() ) group->add( &m_rftSegmentBranchType );
if ( !m_uniqueRftBranchIndices.empty() ) group->add( &m_rftSegmentBranchIndex );
uiOrdering.skipRemainingFields( true );
}

View File

@@ -18,6 +18,8 @@
#include "RimWellLogRftCurve.h"
#include "RiaColorTables.h"
#include "RiaColorTools.h"
#include "RiaDefines.h"
#include "RiaEclipseUnitTools.h"
#include "RiaQDateTimeTools.h"
@@ -175,7 +177,9 @@ RimWellLogRftCurve::RimWellLogRftCurve()
CAF_PDM_InitField( &m_segmentResultName, "SegmentResultName", RiaResultNames::undefinedResultName(), "Result Name" );
CAF_PDM_InitField( &m_segmentBranchIndex, "SegmentBranchIndex", -1, "Branch" );
CAF_PDM_InitFieldNoDefault( &m_segmentBranchType, "SegmentBranchType", "Branch Type" );
CAF_PDM_InitFieldNoDefault( &m_segmentBranchType, "SegmentBranchType", "Completion" );
CAF_PDM_InitField( &m_curveColorByPhase, "CurveColorByPhase", false, "Color by Phase" );
}
//--------------------------------------------------------------------------------------------------
@@ -438,6 +442,43 @@ void RimWellLogRftCurve::setSimWellBranchData( bool branchDetection, int branchI
m_branchIndex = branchIndex;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogRftCurve::enableColorFromResultName( bool enable )
{
m_curveColorByPhase = enable;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogRftCurve::assignColorFromResultName( const QString& resultName )
{
cvf::Color3f color = cvf::Color3f::BLACK;
if ( resultName.startsWith( "SEGO" ) || resultName.startsWith( "CONO" ) )
{
color = RiaColorTables::summaryCurveGreenPaletteColors().cycledColor3f( 0 );
}
else if ( resultName.startsWith( "SEGW" ) || resultName.startsWith( "CONW" ) )
{
color = RiaColorTables::summaryCurveBluePaletteColors().cycledColor3f( 0 );
}
else if ( resultName.startsWith( "SEGG" ) || resultName.startsWith( "CONG" ) )
{
color = RiaColorTables::summaryCurveRedPaletteColors().cycledColor3f( 0 );
}
// Do nothing if not phase is identified
if ( color == cvf::Color3f::BLACK ) return;
float scalingFactor = 0.5;
auto fillColor = RiaColorTools::makeLighter( color, scalingFactor );
setColor( color );
setFillColor( fillColor );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -503,6 +544,11 @@ QString RimWellLogRftCurve::createCurveAutoName()
//--------------------------------------------------------------------------------------------------
void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
{
if ( m_curveColorByPhase && m_rftDataType() == RimWellLogRftCurve::RftDataType::RFT_SEGMENT_DATA )
{
assignColorFromResultName( m_segmentResultName );
}
this->RimPlotCurve::updateCurvePresentation( updateParentPlot );
DerivedMDSource derivedMDSource = DerivedMDSource::NO_SOURCE;
@@ -710,8 +756,9 @@ void RimWellLogRftCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrder
else
{
curveDataGroup->add( &m_segmentResultName );
curveDataGroup->add( &m_segmentBranchIndex );
curveDataGroup->add( &m_segmentBranchType );
curveDataGroup->add( &m_segmentBranchIndex );
curveDataGroup->add( &m_curveColorByPhase );
}
caf::PdmUiGroup* stackingGroup = uiOrdering.addNewGroup( "Stacking" );
@@ -778,7 +825,7 @@ QList<caf::PdmOptionItemInfo> RimWellLogRftCurve::calculateValueOptions( const c
}
else if ( fieldNeedingOptions == &m_segmentBranchIndex )
{
options = RimRftTools::segmentBranchIndexOptions( reader, m_wellName(), m_timeStep() );
options = RimRftTools::segmentBranchIndexOptions( reader, m_wellName(), m_timeStep(), m_segmentBranchType() );
}
return options;

View File

@@ -98,6 +98,9 @@ public:
void setSimWellBranchData( bool branchDetection, int branchIndex );
void enableColorFromResultName( bool enable );
void assignColorFromResultName( const QString& resultName );
protected:
// Overrides from RimWellLogPlotCurve
QString createCurveAutoName() override;
@@ -142,6 +145,7 @@ private:
caf::PdmField<QString> m_wellName;
caf::PdmField<int> m_branchIndex;
caf::PdmField<bool> m_branchDetection;
caf::PdmField<bool> m_curveColorByPhase;
caf::PdmField<caf::AppEnum<RimWellLogRftCurve::RftDataType>> m_rftDataType;