#11497 3D Well Log: show 3d well logs for OSDU log too.

This commit is contained in:
Kristian Bendiksen
2024-06-17 14:15:31 +02:00
parent 33466f5d84
commit 81eca2c893
2 changed files with 27 additions and 34 deletions

View File

@@ -45,7 +45,7 @@ Rim3dWellLogFileCurve::Rim3dWellLogFileCurve()
CAF_PDM_InitFieldNoDefault( &m_wellLogChannelName, "CurveWellLogChannel", "Well Log Channel" ); 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" );
CAF_PDM_InitFieldNoDefault( &m_nameConfig, "NameConfig", "" ); CAF_PDM_InitFieldNoDefault( &m_nameConfig, "NameConfig", "" );
m_nameConfig = new RimWellLogLasFileCurveNameConfig(); m_nameConfig = new RimWellLogLasFileCurveNameConfig();
@@ -65,18 +65,17 @@ void Rim3dWellLogFileCurve::setDefaultFileCurveDataInfo()
{ {
auto wellPath = firstAncestorOrThisOfType<RimWellPath>(); auto wellPath = firstAncestorOrThisOfType<RimWellPath>();
if ( wellPath && !wellPath->wellLogFiles().empty() ) if ( wellPath && !wellPath->wellLogs().empty() )
{ {
m_wellLogFile = wellPath->wellLogFiles()[0]; m_wellLog = wellPath->wellLogs()[0];
} }
if ( m_wellLogFile ) if ( m_wellLog )
{ {
std::vector<RimWellLogChannel*> fileLogs = m_wellLogFile->wellLogChannels(); std::vector<RimWellLogChannel*> wellLogChannels = m_wellLog->wellLogChannels();
if ( !wellLogChannels.empty() )
if ( !fileLogs.empty() )
{ {
m_wellLogChannelName = fileLogs[0]->name(); m_wellLogChannelName = wellLogChannels[0]->name();
} }
} }
} }
@@ -89,13 +88,13 @@ void Rim3dWellLogFileCurve::curveValuesAndMds( std::vector<double>* values, std:
CAF_ASSERT( values != nullptr ); CAF_ASSERT( values != nullptr );
CAF_ASSERT( measuredDepthValues != nullptr ); CAF_ASSERT( measuredDepthValues != nullptr );
if ( m_wellLogFile ) if ( m_wellLog )
{ {
RigWellLogData* wellLogFile = m_wellLogFile->wellLogData(); RigWellLogData* wellLogData = m_wellLog->wellLogData();
if ( wellLogFile ) if ( wellLogData )
{ {
*values = wellLogFile->values( m_wellLogChannelName ); *values = wellLogData->values( m_wellLogChannelName );
*measuredDepthValues = wellLogFile->depthValues(); *measuredDepthValues = wellLogData->depthValues();
} }
} }
} }
@@ -137,9 +136,8 @@ QString Rim3dWellLogFileCurve::createAutoName() const
channelNameAvailable = true; channelNameAvailable = true;
} }
RigWellLogData* wellLogFile = m_wellLogFile ? m_wellLogFile->wellLogData() : nullptr; RigWellLogData* wellLogData = m_wellLog ? m_wellLog->wellLogData() : nullptr;
if ( wellLogData )
if ( wellLogFile )
{ {
if ( channelNameAvailable ) if ( channelNameAvailable )
{ {
@@ -155,7 +153,7 @@ QString Rim3dWellLogFileCurve::createAutoName() const
} */ } */
} }
QString date = m_wellLogFile->date().toString( RiaQDateTimeTools::dateFormatString() ); QString date = m_wellLog->date().toString( RiaQDateTimeTools::dateFormatString() );
if ( !date.isEmpty() ) if ( !date.isEmpty() )
{ {
name.push_back( date ); name.push_back( date );
@@ -181,7 +179,7 @@ caf::PdmFieldHandle* Rim3dWellLogFileCurve::userDescriptionField()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void Rim3dWellLogFileCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) void Rim3dWellLogFileCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{ {
if ( changedField == &m_wellLogFile || changedField == &m_wellLogChannelName ) if ( changedField == &m_wellLog || changedField == &m_wellLogChannelName )
{ {
resetMinMaxValues(); resetMinMaxValues();
updateConnectedEditors(); updateConnectedEditors();
@@ -194,21 +192,16 @@ void Rim3dWellLogFileCurve::fieldChangedByUi( const caf::PdmFieldHandle* changed
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> Rim3dWellLogFileCurve::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) QList<caf::PdmOptionItemInfo> Rim3dWellLogFileCurve::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
{ {
QList<caf::PdmOptionItemInfo> options; QList<caf::PdmOptionItemInfo> options = Rim3dWellLogCurve::calculateValueOptions( fieldNeedingOptions );
options = Rim3dWellLogCurve::calculateValueOptions( fieldNeedingOptions );
if ( !options.empty() ) return options; if ( !options.empty() ) return options;
if ( fieldNeedingOptions == &m_wellLogChannelName ) if ( fieldNeedingOptions == &m_wellLogChannelName )
{ {
if ( m_wellLogFile ) if ( m_wellLog )
{ {
std::vector<RimWellLogChannel*> fileLogs = m_wellLogFile->wellLogChannels(); for ( RimWellLogChannel* wellLogChannel : m_wellLog->wellLogChannels() )
for ( size_t i = 0; i < fileLogs.size(); i++ )
{ {
QString wellLogChannelName = fileLogs[i]->name(); QString wellLogChannelName = wellLogChannel->name();
options.push_back( caf::PdmOptionItemInfo( wellLogChannelName, wellLogChannelName ) ); options.push_back( caf::PdmOptionItemInfo( wellLogChannelName, wellLogChannelName ) );
} }
} }
@@ -219,16 +212,15 @@ QList<caf::PdmOptionItemInfo> Rim3dWellLogFileCurve::calculateValueOptions( cons
} }
} }
if ( fieldNeedingOptions == &m_wellLogFile ) if ( fieldNeedingOptions == &m_wellLog )
{ {
auto wellPath = firstAncestorOrThisOfType<RimWellPath>(); auto wellPath = firstAncestorOrThisOfType<RimWellPath>();
if ( wellPath && !wellPath->wellLogFiles().empty() ) if ( wellPath )
{ {
for ( RimWellLogFile* const wellLogFile : wellPath->wellLogFiles() ) for ( RimWellLog* const wellLog : wellPath->wellLogs() )
{ {
QFileInfo fileInfo( wellLogFile->fileName() ); options.push_back( caf::PdmOptionItemInfo( wellLog->name(), wellLog ) );
options.push_back( caf::PdmOptionItemInfo( fileInfo.baseName(), wellLogFile ) );
} }
} }
} }
@@ -242,7 +234,7 @@ QList<caf::PdmOptionItemInfo> Rim3dWellLogFileCurve::calculateValueOptions( cons
void Rim3dWellLogFileCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) void Rim3dWellLogFileCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{ {
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Curve Data" ); caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Curve Data" );
curveDataGroup->add( &m_wellLogFile ); curveDataGroup->add( &m_wellLog );
curveDataGroup->add( &m_wellLogChannelName ); curveDataGroup->add( &m_wellLogChannelName );
Rim3dWellLogCurve::configurationUiOrdering( uiOrdering ); Rim3dWellLogCurve::configurationUiOrdering( uiOrdering );

View File

@@ -24,6 +24,7 @@
#include "cafPdmField.h" #include "cafPdmField.h"
#include "cafPdmPtrField.h" #include "cafPdmPtrField.h"
class RimWellLog;
class RimWellLogFile; class RimWellLogFile;
class RimWellLogLasFileCurveNameConfig; class RimWellLogLasFileCurveNameConfig;
@@ -55,7 +56,7 @@ private:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
private: private:
caf::PdmPtrField<RimWellLogFile*> m_wellLogFile; caf::PdmPtrField<RimWellLog*> m_wellLog;
caf::PdmField<QString> m_wellLogChannelName; caf::PdmField<QString> m_wellLogChannelName;
caf::PdmChildField<RimWellLogLasFileCurveNameConfig*> m_nameConfig; caf::PdmChildField<RimWellLogLasFileCurveNameConfig*> m_nameConfig;
}; };