mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Osdu Well Log: make it possible to add Osdu well logs to plot.
This commit is contained in:
@@ -645,7 +645,8 @@ RimSummaryCase* RimEnsembleWellLogCurveSet::findMatchingSummaryCase( RimWellLogL
|
||||
std::vector<RimSummaryCase*> sumCases = summaryCaseCollection->allSummaryCases();
|
||||
for ( auto sumCase : sumCases )
|
||||
{
|
||||
if ( isSameRealization( sumCase, wellLogCurve->wellLogFile() ) )
|
||||
RimWellLogFile* wellLogFile = dynamic_cast<RimWellLogFile*>( wellLogCurve->wellLog() );
|
||||
if ( wellLogFile && isSameRealization( sumCase, wellLogFile ) )
|
||||
{
|
||||
return sumCase;
|
||||
}
|
||||
@@ -794,7 +795,7 @@ void RimEnsembleWellLogCurveSet::updateEnsembleCurves( const std::vector<RimWell
|
||||
|
||||
curve->setWellPath( wellPath );
|
||||
curve->setWellLogChannelName( wellLogChannelName );
|
||||
curve->setWellLogFile( wellLogFile );
|
||||
curve->setWellLog( wellLogFile );
|
||||
|
||||
curve->setSymbol( m_curveAppearance->symbol() );
|
||||
curve->setSymbolSize( m_curveAppearance->symbolSize() );
|
||||
|
||||
@@ -48,7 +48,6 @@ RimOsduWellLog::RimOsduWellLog()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_name, "Name", "" );
|
||||
m_name.uiCapability()->setUiReadOnly( true );
|
||||
RiaFieldHandleTools::disableWriteAndSetFieldHidden( &m_name );
|
||||
|
||||
m_date.uiCapability()->setUiReadOnly( true );
|
||||
|
||||
@@ -126,6 +125,14 @@ caf::PdmFieldHandle* RimOsduWellLog::userDescriptionField()
|
||||
return &m_name;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimOsduWellLog::setName( const QString& name )
|
||||
{
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -46,6 +46,7 @@ public:
|
||||
RimOsduWellLog();
|
||||
~RimOsduWellLog() override;
|
||||
|
||||
void setName( const QString& name );
|
||||
QString name() const override;
|
||||
|
||||
QString wellName() const override;
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "RimTools.h"
|
||||
#include "RimWellFlowRateCurve.h"
|
||||
#include "RimWellLogExtractionCurve.h"
|
||||
#include "RimWellLogFile.h"
|
||||
#include "RimWellLogLasFileCurve.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogPlotCollection.h"
|
||||
@@ -528,7 +529,7 @@ void RimWellLogCurveCommonDataSource::applyDataSourceChanges( const std::vector<
|
||||
if ( !fileCurve->wellLogChannelUiName().isEmpty() )
|
||||
{
|
||||
RimWellLogFile* logFile = wellPathToApply()->firstWellLogFileMatchingChannelName( fileCurve->wellLogChannelUiName() );
|
||||
fileCurve->setWellLogFile( logFile );
|
||||
fileCurve->setWellLog( logFile );
|
||||
auto parentPlot = fileCurve->firstAncestorOrThisOfTypeAsserted<RimWellLogPlot>();
|
||||
plots.insert( parentPlot );
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ RimWellLogLasFileCurve::RimWellLogLasFileCurve()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_wellLogChannelName, "CurveWellLogChannel", "Well Log Channel" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_wellLogFile, "WellLogFile", "Well Log File" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_wellLog, "WellLogFile", "Well Log File" );
|
||||
|
||||
m_wellPath = nullptr;
|
||||
}
|
||||
@@ -83,9 +83,9 @@ void RimWellLogLasFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
{
|
||||
auto wellLogPlot = firstAncestorOrThisOfTypeAsserted<RimWellLogPlot>();
|
||||
|
||||
if ( m_wellPath && m_wellLogFile )
|
||||
if ( m_wellPath && m_wellLog )
|
||||
{
|
||||
RigWellLogData* wellLogFile = m_wellLogFile->wellLogData();
|
||||
RigWellLogData* wellLogFile = m_wellLog->wellLogData();
|
||||
if ( wellLogFile )
|
||||
{
|
||||
std::vector<double> values = wellLogFile->values( m_wellLogChannelName );
|
||||
@@ -287,9 +287,9 @@ void RimWellLogLasFileCurve::setWellLogChannelName( const QString& name )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogLasFileCurve::setWellLogFile( RimWellLogFile* wellLogFile )
|
||||
void RimWellLogLasFileCurve::setWellLog( RimWellLog* wellLogFile )
|
||||
{
|
||||
m_wellLogFile = wellLogFile;
|
||||
m_wellLog = wellLogFile;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -315,7 +315,7 @@ void RimWellLogLasFileCurve::fieldChangedByUi( const caf::PdmFieldHandle* change
|
||||
{
|
||||
loadDataAndUpdate( true );
|
||||
}
|
||||
else if ( changedField == &m_wellLogFile )
|
||||
else if ( changedField == &m_wellLog )
|
||||
{
|
||||
loadDataAndUpdate( true );
|
||||
}
|
||||
@@ -331,7 +331,7 @@ void RimWellLogLasFileCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiO
|
||||
|
||||
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Curve Data" );
|
||||
curveDataGroup->add( &m_wellPath );
|
||||
curveDataGroup->add( &m_wellLogFile );
|
||||
curveDataGroup->add( &m_wellLog );
|
||||
curveDataGroup->add( &m_wellLogChannelName );
|
||||
|
||||
RimStackablePlotCurve::defaultUiOrdering( uiOrdering );
|
||||
@@ -362,8 +362,8 @@ QList<caf::PdmOptionItemInfo> RimWellLogLasFileCurve::calculateValueOptions( con
|
||||
{
|
||||
for ( auto wellPath : wellPathColl->allWellPaths() )
|
||||
{
|
||||
// Only include well paths coming from a well log file
|
||||
if ( !wellPath->wellLogFiles().empty() )
|
||||
// Only include well paths coming with a well log
|
||||
if ( !wellPath->wellLogs().empty() )
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo( wellPath->name(), wellPath ) );
|
||||
}
|
||||
@@ -378,17 +378,12 @@ QList<caf::PdmOptionItemInfo> RimWellLogLasFileCurve::calculateValueOptions( con
|
||||
|
||||
if ( fieldNeedingOptions == &m_wellLogChannelName )
|
||||
{
|
||||
if ( m_wellPath() )
|
||||
if ( m_wellPath() && m_wellLog() )
|
||||
{
|
||||
if ( m_wellLogFile )
|
||||
for ( RimWellLogChannel* wellLogChannel : m_wellLog->wellLogChannels() )
|
||||
{
|
||||
std::vector<RimWellLogChannel*> fileLogs = m_wellLogFile->wellLogChannels();
|
||||
|
||||
for ( size_t i = 0; i < fileLogs.size(); i++ )
|
||||
{
|
||||
QString wellLogChannelName = fileLogs[i]->name();
|
||||
options.push_back( caf::PdmOptionItemInfo( wellLogChannelName, wellLogChannelName ) );
|
||||
}
|
||||
QString wellLogChannelName = wellLogChannel->name();
|
||||
options.push_back( caf::PdmOptionItemInfo( wellLogChannelName, wellLogChannelName ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -398,14 +393,21 @@ QList<caf::PdmOptionItemInfo> RimWellLogLasFileCurve::calculateValueOptions( con
|
||||
}
|
||||
}
|
||||
|
||||
if ( fieldNeedingOptions == &m_wellLogFile )
|
||||
if ( fieldNeedingOptions == &m_wellLog )
|
||||
{
|
||||
if ( m_wellPath() && !m_wellPath->wellLogFiles().empty() )
|
||||
if ( m_wellPath() && !m_wellPath->wellLogs().empty() )
|
||||
{
|
||||
for ( RimWellLogFile* const wellLogFile : m_wellPath->wellLogFiles() )
|
||||
for ( RimWellLog* const wellLog : m_wellPath->wellLogs() )
|
||||
{
|
||||
QFileInfo fileInfo( wellLogFile->fileName() );
|
||||
options.push_back( caf::PdmOptionItemInfo( fileInfo.baseName(), wellLogFile ) );
|
||||
if ( RimWellLogFile* wellLogFile = dynamic_cast<RimWellLogFile*>( wellLog ) )
|
||||
{
|
||||
QFileInfo fileInfo( wellLogFile->fileName() );
|
||||
options.push_back( caf::PdmOptionItemInfo( fileInfo.baseName(), wellLog ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo( wellLog->name(), wellLog ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -424,7 +426,7 @@ void RimWellLogLasFileCurve::initAfterRead()
|
||||
|
||||
if ( m_wellPath->wellLogFiles().size() == 1 )
|
||||
{
|
||||
m_wellLogFile = dynamic_cast<RimWellLogLasFile*>( m_wellPath->wellLogFiles().front() );
|
||||
m_wellLog = dynamic_cast<RimWellLogLasFile*>( m_wellPath->wellLogFiles().front() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -457,14 +459,14 @@ QString RimWellLogLasFileCurve::createCurveAutoName()
|
||||
channelNameAvailable = true;
|
||||
}
|
||||
|
||||
RigWellLogData* wellLogFile = m_wellLogFile ? m_wellLogFile->wellLogData() : nullptr;
|
||||
RigWellLogData* wellLogData = m_wellLog ? m_wellLog->wellLogData() : nullptr;
|
||||
|
||||
if ( wellLogFile )
|
||||
if ( wellLogData )
|
||||
{
|
||||
if ( channelNameAvailable )
|
||||
{
|
||||
auto wellLogPlot = firstAncestorOrThisOfTypeAsserted<RimWellLogPlot>();
|
||||
QString unitName = wellLogFile->convertedWellLogChannelUnitString( m_wellLogChannelName, wellLogPlot->depthUnit() );
|
||||
QString unitName = wellLogData->convertedWellLogChannelUnitString( m_wellLogChannelName, wellLogPlot->depthUnit() );
|
||||
|
||||
if ( !unitName.isEmpty() )
|
||||
{
|
||||
@@ -472,7 +474,7 @@ QString RimWellLogLasFileCurve::createCurveAutoName()
|
||||
}
|
||||
}
|
||||
|
||||
QString date = m_wellLogFile->date().toString( RiaQDateTimeTools::dateFormatString() );
|
||||
QString date = m_wellLog->date().toString( RiaQDateTimeTools::dateFormatString() );
|
||||
if ( !date.isEmpty() )
|
||||
{
|
||||
name.push_back( date );
|
||||
@@ -498,9 +500,9 @@ QString RimWellLogLasFileCurve::wellLogChannelUiName() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellLogLasFileCurve::wellLogChannelUnits() const
|
||||
{
|
||||
if ( m_wellLogFile && m_wellLogFile->wellLogData() )
|
||||
if ( m_wellLog && m_wellLog->wellLogData() )
|
||||
{
|
||||
return m_wellLogFile->wellLogData()->wellLogChannelUnitString( m_wellLogChannelName );
|
||||
return m_wellLog->wellLogData()->wellLogChannelUnitString( m_wellLogChannelName );
|
||||
}
|
||||
return RiaWellLogUnitTools<double>::noUnitString();
|
||||
}
|
||||
@@ -508,9 +510,9 @@ QString RimWellLogLasFileCurve::wellLogChannelUnits() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogFile* RimWellLogLasFileCurve::wellLogFile() const
|
||||
RimWellLog* RimWellLogLasFileCurve::wellLog() const
|
||||
{
|
||||
return m_wellLogFile();
|
||||
return m_wellLog();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -30,6 +30,7 @@ class RimWellPath;
|
||||
class RimWellLogChannel;
|
||||
class RimWellLogFile;
|
||||
class RigWellLogIndexDepthOffset;
|
||||
class RimWellLog;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -46,7 +47,7 @@ public:
|
||||
void setWellPath( RimWellPath* wellPath );
|
||||
RimWellPath* wellPath() const;
|
||||
void setWellLogChannelName( const QString& name );
|
||||
void setWellLogFile( RimWellLogFile* wellLogFile );
|
||||
void setWellLog( RimWellLog* wellLog );
|
||||
void setIndexDepthOffsets( std::shared_ptr<RigWellLogIndexDepthOffset> depthOffsets );
|
||||
|
||||
// Overrides from RimWellLogPlotCurve
|
||||
@@ -54,7 +55,7 @@ public:
|
||||
QString wellLogChannelUiName() const override;
|
||||
QString wellLogChannelUnits() const override;
|
||||
|
||||
RimWellLogFile* wellLogFile() const;
|
||||
RimWellLog* wellLog() const;
|
||||
|
||||
protected:
|
||||
// Overrides from RimWellLogPlotCurve
|
||||
@@ -75,10 +76,10 @@ protected:
|
||||
const std::vector<double>& kIndexValues ) const;
|
||||
|
||||
protected:
|
||||
caf::PdmPtrField<RimWellPath*> m_wellPath;
|
||||
caf::PdmPtrField<RimWellLogFile*> m_wellLogFile;
|
||||
caf::PdmField<QString> m_wellLogChannelName;
|
||||
caf::PdmField<QString> m_wellLogChannnelUnit;
|
||||
caf::PdmPtrField<RimWellPath*> m_wellPath;
|
||||
caf::PdmPtrField<RimWellLog*> m_wellLog;
|
||||
caf::PdmField<QString> m_wellLogChannelName;
|
||||
caf::PdmField<QString> m_wellLogChannnelUnit;
|
||||
|
||||
std::shared_ptr<RigWellLogIndexDepthOffset> m_indexDepthOffsets;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user