Improve curve naming for plot and use in RFT segment plots

* Improve plot naming for depth track plots
* Move template text replace to string tools
* More data available for object template text
* Set plot visible and define default object name template text
This commit is contained in:
Magne Sjaastad
2022-10-12 12:41:08 +02:00
committed by GitHub
parent 5e184df670
commit e7a486c802
29 changed files with 373 additions and 203 deletions

View File

@@ -1194,3 +1194,29 @@ void RimWellLogCurveCommonDataSource::selectWell( QString wellName )
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimWellLogCurveCommonDataSource::rftWellName() const
{
return m_rftWellName();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QDateTime RimWellLogCurveCommonDataSource::rftTime() const
{
return m_rftTimeStep();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimWellLogCurveCommonDataSource::rftBranchIndex() const
{
if ( m_uniqueRftBranchIndices.size() == 1 ) return m_rftSegmentBranchIndex();
return -1;
}

View File

@@ -83,6 +83,10 @@ public:
void selectWell( QString wellName );
QString rftWellName() const;
QDateTime rftTime() const;
int rftBranchIndex() const;
void resetDefaultOptions();
void analyseCurvesAndTracks( const std::vector<RimWellLogCurve*>& curves, const std::vector<RimWellLogTrack*>& tracks );
void analyseCurvesAndTracks();

View File

@@ -32,84 +32,6 @@ RimWellLogPlotNameConfig::RimWellLogPlotNameConfig()
: RimNameConfig( "Well Log Plot" )
{
CAF_PDM_InitObject( "Well Log Plot Name Generator" );
CAF_PDM_InitField( &m_addCaseName, "AddCaseName", false, "Show Case Name" );
CAF_PDM_InitField( &m_addWellName, "AddWellName", false, "Show Well Name" );
CAF_PDM_InitField( &m_addTimestep, "AddTimeStep", false, "Show Time Step" );
CAF_PDM_InitField( &m_addAirGap, "AddAirGap", false, "Show Air Gap" );
CAF_PDM_InitField( &m_addWaterDepth, "AddWaterDepth", false, "Show Water Depth" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogPlotNameConfig::addCaseName() const
{
return m_addCaseName();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogPlotNameConfig::addWellName() const
{
return m_addWellName();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogPlotNameConfig::addTimeStep() const
{
return m_addTimestep();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogPlotNameConfig::addAirGap() const
{
return m_addAirGap();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogPlotNameConfig::addWaterDepth() const
{
return m_addWaterDepth();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlotNameConfig::setAutoNameTags( bool addCaseName,
bool addWellName,
bool addTimeStep,
bool addAirGap,
bool addWaterDepth )
{
m_addCaseName = addCaseName;
m_addWellName = addWellName;
m_addTimestep = addTimeStep;
m_addAirGap = addAirGap;
m_addWaterDepth = addWaterDepth;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlotNameConfig::setFieldVisibility( bool caseNameVisible,
bool wellNameVisible,
bool timeStepVisible,
bool airGapVisible,
bool waterDepthVisible )
{
m_addCaseName.uiCapability()->setUiHidden( !caseNameVisible );
m_addWellName.uiCapability()->setUiHidden( !wellNameVisible );
m_addTimestep.uiCapability()->setUiHidden( !timeStepVisible );
m_addAirGap.uiCapability()->setUiHidden( !airGapVisible );
m_addWaterDepth.uiCapability()->setUiHidden( !waterDepthVisible );
}
//--------------------------------------------------------------------------------------------------
@@ -117,19 +39,6 @@ void RimWellLogPlotNameConfig::setFieldVisibility( bool caseNameVisible,
//--------------------------------------------------------------------------------------------------
void RimWellLogPlotNameConfig::doEnableAllAutoNameTags( bool enable )
{
setAutoNameTags( enable, enable, enable, enable, enable );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlotNameConfig::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
RimNameConfig::defineUiOrdering( uiConfigName, uiOrdering );
uiOrdering.add( &m_addCaseName );
uiOrdering.add( &m_addWellName );
uiOrdering.add( &m_addTimestep );
uiOrdering.add( &m_addAirGap );
uiOrdering.add( &m_addWaterDepth );
// TODO: Dummy implementation to implement the pure abstract method
// To be removed when the plot naming is transferred to use of plot template text string
}

View File

@@ -31,29 +31,6 @@ class RimWellLogPlotNameConfig : public RimNameConfig
public:
RimWellLogPlotNameConfig();
bool addCaseName() const;
bool addWellName() const;
bool addTimeStep() const;
bool addAirGap() const;
bool addWaterDepth() const;
void setAutoNameTags( bool addCaseName, bool addWellName, bool addTimeStep, bool addAirGap, bool addWaterDepth );
void setFieldVisibility( bool caseNameVisible,
bool wellNameVisible,
bool timeStepVisible,
bool airGapVisible,
bool waterDepthVisible );
protected:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
private:
void doEnableAllAutoNameTags( bool enable ) override;
private:
caf::PdmField<bool> m_addCaseName;
caf::PdmField<bool> m_addWellName;
caf::PdmField<bool> m_addTimestep;
caf::PdmField<bool> m_addAirGap;
caf::PdmField<bool> m_addWaterDepth;
};

View File

@@ -27,6 +27,7 @@
#include "RiaRftDefines.h"
#include "RiaSimWellBranchTools.h"
#include "RiaSummaryTools.h"
#include "RiaTextStringTools.h"
#include "RifEclipseRftAddress.h"
#include "RifReaderEclipseRft.h"
@@ -567,14 +568,7 @@ QString RimWellLogRftCurve::createCurveAutoName()
//--------------------------------------------------------------------------------------------------
QString RimWellLogRftCurve::createCurveNameFromTemplate( const QString& templateText )
{
QString curveName = templateText;
for ( const auto& [key, value] : createCurveNameKeyValueMap() )
{
curveName.replace( key, value );
}
return curveName;
return RiaTextStringTools::replaceTemplateTextWithValues( templateText, createCurveNameKeyValueMap() );
}
//--------------------------------------------------------------------------------------------------