Osdu Well Log: cache channel meta data from Osdu.

This commit is contained in:
Kristian Bendiksen 2024-07-10 15:09:05 +02:00
parent 0d845938b6
commit ed7a3e98da
7 changed files with 192 additions and 13 deletions

View File

@ -187,7 +187,6 @@ WellLogSelectionPage::WellLogSelectionPage( RiaOsduConnector* osduConnector, QWi
QHeaderView* header = m_tableView->horizontalHeader(); QHeaderView* header = m_tableView->horizontalHeader();
header->setSectionResizeMode( QHeaderView::Interactive ); header->setSectionResizeMode( QHeaderView::Interactive );
header->setStretchLastSection( true );
m_osduWellLogsModel = new OsduWellLogTableModel; m_osduWellLogsModel = new OsduWellLogTableModel;
layout->addWidget( m_tableView ); layout->addWidget( m_tableView );
@ -201,6 +200,10 @@ WellLogSelectionPage::WellLogSelectionPage( RiaOsduConnector* osduConnector, QWi
m_tableView->setModel( m_proxyModel ); m_tableView->setModel( m_proxyModel );
m_tableView->setSortingEnabled( true ); m_tableView->setSortingEnabled( true );
// Hide the ID and kind columns
m_tableView->hideColumn( 0 );
m_tableView->hideColumn( 1 );
m_detailText = new QTextEdit( this ); m_detailText = new QTextEdit( this );
m_detailText->setReadOnly( true ); m_detailText->setReadOnly( true );
layout->addWidget( m_detailText ); layout->addWidget( m_detailText );

View File

@ -23,6 +23,7 @@
#include "RimOilField.h" #include "RimOilField.h"
#include "RimOsduWellLog.h" #include "RimOsduWellLog.h"
#include "RimOsduWellLogChannel.h"
#include "RimOsduWellPath.h" #include "RimOsduWellPath.h"
#include "RimProject.h" #include "RimProject.h"
#include "RimWellPathCollection.h" #include "RimWellPathCollection.h"
@ -78,6 +79,21 @@ void RicImportWellLogOsduFeature::onActionTriggered( bool isChecked )
RimOsduWellLog* osduWellLog = new RimOsduWellLog; RimOsduWellLog* osduWellLog = new RimOsduWellLog;
osduWellLog->setName( wellLog.name ); osduWellLog->setName( wellLog.name );
osduWellLog->setWellLogId( wellLog.id ); osduWellLog->setWellLogId( wellLog.id );
for ( OsduWellLogChannel c : wellLog.channels )
{
RimOsduWellLogChannel* osduWellLogChannel = new RimOsduWellLogChannel;
osduWellLogChannel->setName( c.mnemonic );
osduWellLogChannel->setDescription( c.description );
osduWellLogChannel->setTopDepth( c.topDepth );
osduWellLogChannel->setBaseDepth( c.baseDepth );
osduWellLogChannel->setInterpreterName( c.interpreterName );
osduWellLogChannel->setQuality( c.quality );
osduWellLogChannel->setUnit( c.unit );
osduWellLogChannel->setDepthUnit( c.depthUnit );
osduWellLog->addWellLogChannel( osduWellLogChannel );
}
oilField->wellPathCollection->addWellLog( osduWellLog, wellPath ); oilField->wellPathCollection->addWellLog( osduWellLog, wellPath );
osduWellLog->setWellLogData( wellLogData.p() ); osduWellLog->setWellLogData( wellLogData.p() );

View File

@ -23,7 +23,7 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RimWellLog.h ${CMAKE_CURRENT_LIST_DIR}/RimWellLog.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogFile.h ${CMAKE_CURRENT_LIST_DIR}/RimWellLogFile.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileUtil.h ${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileUtil.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogChannel.h ${CMAKE_CURRENT_LIST_DIR}/RimOsduWellLogChannel.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogLasFileCurve.h ${CMAKE_CURRENT_LIST_DIR}/RimWellLogLasFileCurve.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurve.h ${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurve.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogWbsCurve.h ${CMAKE_CURRENT_LIST_DIR}/RimWellLogWbsCurve.h
@ -46,6 +46,7 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RimWellLogFile.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellLogFile.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileUtil.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileUtil.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogChannel.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellLogChannel.cpp
${CMAKE_CURRENT_LIST_DIR}/RimOsduWellLogChannel.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogLasFileCurve.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellLogLasFileCurve.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurve.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurve.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogWbsCurve.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellLogWbsCurve.cpp

View File

@ -20,8 +20,8 @@
#include "RiaFieldHandleTools.h" #include "RiaFieldHandleTools.h"
#include "RimOsduWellLogChannel.h"
#include "RimTools.h" #include "RimTools.h"
#include "RimWellLogChannel.h"
#include "RimWellPath.h" #include "RimWellPath.h"
#include "RimWellPathCollection.h" #include "RimWellPathCollection.h"
#include "RimWellPlotTools.h" #include "RimWellPlotTools.h"
@ -146,15 +146,6 @@ RigOsduWellLogData* RimOsduWellLog::wellLogData()
void RimOsduWellLog::setWellLogData( RigOsduWellLogData* wellLogData ) void RimOsduWellLog::setWellLogData( RigOsduWellLogData* wellLogData )
{ {
m_wellLogData = wellLogData; m_wellLogData = wellLogData;
m_wellLogChannels.deleteChildren();
for ( const QString& wellLogName : wellLogData->wellLogChannelNames() )
{
RimWellLogChannel* wellLog = new RimWellLogChannel();
wellLog->setName( wellLogName );
m_wellLogChannels.push_back( wellLog );
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -172,3 +163,11 @@ QString RimOsduWellLog::wellLogId() const
{ {
return m_wellLogId; return m_wellLogId;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimOsduWellLog::addWellLogChannel( RimOsduWellLogChannel* channel )
{
m_wellLogChannels.push_back( channel );
}

View File

@ -29,7 +29,7 @@
#include <QDateTime> #include <QDateTime>
class RimWellLogChannel; class RimOsduWellLogChannel;
class RimWellPath; class RimWellPath;
class QString; class QString;
@ -54,6 +54,8 @@ public:
RigOsduWellLogData* wellLogData() override; RigOsduWellLogData* wellLogData() override;
void setWellLogData( RigOsduWellLogData* wellLogData ); void setWellLogData( RigOsduWellLogData* wellLogData );
void addWellLogChannel( RimOsduWellLogChannel* channel );
void setWellLogId( const QString& wellLogId ); void setWellLogId( const QString& wellLogId );
QString wellLogId() const; QString wellLogId() const;

View File

@ -0,0 +1,108 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2024- 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 "RimOsduWellLogChannel.h"
#include "RiaFieldHandleTools.h"
CAF_PDM_SOURCE_INIT( RimOsduWellLogChannel, "OsduWellLogChannel" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimOsduWellLogChannel::RimOsduWellLogChannel()
{
CAF_PDM_InitObject( "OSDU Well Log Channel" );
CAF_PDM_InitFieldNoDefault( &m_description, "Description", "Description" );
m_description.uiCapability()->setUiReadOnly( true );
CAF_PDM_InitFieldNoDefault( &m_topDepth, "TopDepth", "Top Depth" );
m_topDepth.uiCapability()->setUiReadOnly( true );
CAF_PDM_InitFieldNoDefault( &m_baseDepth, "BaseDepth", "Base Depth" );
m_baseDepth.uiCapability()->setUiReadOnly( true );
CAF_PDM_InitFieldNoDefault( &m_interpreterName, "InterpreterName", "Interpreter Name" );
m_interpreterName.uiCapability()->setUiReadOnly( true );
CAF_PDM_InitFieldNoDefault( &m_quality, "Quality", "Quality" );
m_quality.uiCapability()->setUiReadOnly( true );
CAF_PDM_InitFieldNoDefault( &m_unit, "Unit", "Unit" );
m_unit.uiCapability()->setUiReadOnly( true );
CAF_PDM_InitFieldNoDefault( &m_depthUnit, "DepthUnit", "Depth Unit" );
m_depthUnit.uiCapability()->setUiReadOnly( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimOsduWellLogChannel::setDescription( const QString& description )
{
m_description = description;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimOsduWellLogChannel::setTopDepth( double topDepth )
{
m_topDepth = topDepth;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimOsduWellLogChannel::setBaseDepth( double baseDepth )
{
m_baseDepth = baseDepth;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimOsduWellLogChannel::setInterpreterName( const QString& interpreterName )
{
m_interpreterName = interpreterName;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimOsduWellLogChannel::setQuality( const QString& quality )
{
m_quality = quality;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimOsduWellLogChannel::setUnit( const QString& unit )
{
m_unit = unit;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimOsduWellLogChannel::setDepthUnit( const QString& depthUnit )
{
m_depthUnit = depthUnit;
}

View File

@ -0,0 +1,50 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2024- 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 "RimWellLogChannel.h"
//==================================================================================================
///
///
//==================================================================================================
class RimOsduWellLogChannel : public RimWellLogChannel
{
CAF_PDM_HEADER_INIT;
public:
RimOsduWellLogChannel();
void setDescription( const QString& description );
void setTopDepth( double topDepth );
void setBaseDepth( double baseDepth );
void setInterpreterName( const QString& interpreterName );
void setQuality( const QString& quality );
void setUnit( const QString& unit );
void setDepthUnit( const QString& depthUnit );
private:
caf::PdmField<QString> m_description;
caf::PdmField<double> m_topDepth;
caf::PdmField<double> m_baseDepth;
caf::PdmField<QString> m_interpreterName;
caf::PdmField<QString> m_quality;
caf::PdmField<QString> m_unit;
caf::PdmField<QString> m_depthUnit;
};