mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Osdu Well Log: show more values in filter.
This commit is contained in:
parent
122b724a83
commit
0d845938b6
@ -629,24 +629,49 @@ void RiaOsduConnector::parseWellLogs( QNetworkReply* reply, const QString& wellb
|
|||||||
QString id = resultObj["id"].toString();
|
QString id = resultObj["id"].toString();
|
||||||
QString kind = resultObj["kind"].toString();
|
QString kind = resultObj["kind"].toString();
|
||||||
|
|
||||||
QJsonArray curvesArray = resultObj["data"].toObject()["Curves"].toArray();
|
QJsonObject dataObj = resultObj["data"].toObject();
|
||||||
QStringList curveIds;
|
QString name = dataObj["Name"].toString();
|
||||||
|
QString description = dataObj["Description"].toString();
|
||||||
|
double samplingStart = dataObj["SamplingStart"].toDouble( std::numeric_limits<double>::infinity() );
|
||||||
|
double samplingStop = dataObj["SamplingStop"].toDouble( std::numeric_limits<double>::infinity() );
|
||||||
|
|
||||||
|
QJsonArray curvesArray = dataObj["Curves"].toArray();
|
||||||
|
QStringList curveMnemonics;
|
||||||
RiaLogging::debug( QString( "Curves for '%1':" ).arg( id ) );
|
RiaLogging::debug( QString( "Curves for '%1':" ).arg( id ) );
|
||||||
|
|
||||||
|
std::vector<OsduWellLogChannel> channels;
|
||||||
for ( const QJsonValue& curve : curvesArray )
|
for ( const QJsonValue& curve : curvesArray )
|
||||||
{
|
{
|
||||||
QString curveId = curve["CurveID"].toString();
|
QString mnemonic = curve["Mnemonic"].toString();
|
||||||
QString curveDescription = curve["CurveDescription"].toString();
|
QString curveDescription = curve["CurveDescription"].toString();
|
||||||
double curveBaseDepth = curve["BaseDepth"].toDouble( 0.0 );
|
double curveBaseDepth = curve["BaseDepth"].toDouble( std::numeric_limits<double>::infinity() );
|
||||||
double curveTopDepth = curve["TopDepth"].toDouble( 0.0 );
|
double curveTopDepth = curve["TopDepth"].toDouble( std::numeric_limits<double>::infinity() );
|
||||||
|
QString interpreterName = curve["InterpreterName"].toString();
|
||||||
|
QString quality = curve["CurveQuality"].toString();
|
||||||
|
QString unit = curve["CurveUnit"].toString();
|
||||||
|
QString depthUnit = curve["DepthUnit"].toString();
|
||||||
|
|
||||||
curveIds << curveId;
|
curveMnemonics << mnemonic;
|
||||||
RiaLogging::debug(
|
RiaLogging::debug(
|
||||||
QString( "%1: '%2' (%3 - %4)" ).arg( curveId ).arg( curveDescription ).arg( curveTopDepth ).arg( curveBaseDepth ) );
|
QString( "%1: '%2' (%3 - %4)" ).arg( mnemonic ).arg( curveDescription ).arg( curveTopDepth ).arg( curveBaseDepth ) );
|
||||||
|
channels.push_back( OsduWellLogChannel{ .mnemonic = mnemonic,
|
||||||
|
.description = curveDescription,
|
||||||
|
.topDepth = curveTopDepth,
|
||||||
|
.baseDepth = curveBaseDepth,
|
||||||
|
.interpreterName = interpreterName,
|
||||||
|
.quality = quality,
|
||||||
|
.unit = unit,
|
||||||
|
.depthUnit = depthUnit } );
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name = curveIds.join( ", " );
|
m_wellLogs[wellboreId].push_back( OsduWellLog{ .id = id,
|
||||||
|
.kind = kind,
|
||||||
m_wellLogs[wellboreId].push_back( OsduWellLog{ id, kind, wellboreId, name } );
|
.name = name,
|
||||||
|
.description = description,
|
||||||
|
.samplingStart = samplingStart,
|
||||||
|
.samplingStop = samplingStop,
|
||||||
|
.wellboreId = wellboreId,
|
||||||
|
.channels = channels } );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,12 +37,28 @@ struct OsduWellboreTrajectory
|
|||||||
QString wellboreId;
|
QString wellboreId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct OsduWellLogChannel
|
||||||
|
{
|
||||||
|
QString mnemonic;
|
||||||
|
QString description;
|
||||||
|
double topDepth;
|
||||||
|
double baseDepth;
|
||||||
|
QString interpreterName;
|
||||||
|
QString quality;
|
||||||
|
QString unit;
|
||||||
|
QString depthUnit;
|
||||||
|
};
|
||||||
|
|
||||||
struct OsduWellLog
|
struct OsduWellLog
|
||||||
{
|
{
|
||||||
QString id;
|
QString id;
|
||||||
QString kind;
|
QString kind;
|
||||||
QString wellboreId;
|
QString name;
|
||||||
QString name;
|
QString description;
|
||||||
|
double samplingStart;
|
||||||
|
double samplingStop;
|
||||||
|
QString wellboreId;
|
||||||
|
std::vector<OsduWellLogChannel> channels;
|
||||||
};
|
};
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <QAbstractTableModel>
|
#include <QAbstractTableModel>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QTextEdit>
|
||||||
|
|
||||||
#include <QtNetwork>
|
#include <QtNetwork>
|
||||||
#include <QtWidgets>
|
#include <QtWidgets>
|
||||||
@ -43,6 +44,8 @@ RiuWellLogImportWizard::RiuWellLogImportWizard( RiaOsduConnector* osduConnector,
|
|||||||
|
|
||||||
addPage( new WellLogAuthenticationPage( m_osduConnector, this ) );
|
addPage( new WellLogAuthenticationPage( m_osduConnector, this ) );
|
||||||
addPage( new WellLogSelectionPage( m_osduConnector, this ) );
|
addPage( new WellLogSelectionPage( m_osduConnector, this ) );
|
||||||
|
|
||||||
|
setMinimumSize( 800, 800 );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -87,17 +90,17 @@ QString RiuWellLogImportWizard::wellboreId() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<RiuWellLogImportWizard::WellLogInfo> RiuWellLogImportWizard::importedWellLogs() const
|
std::vector<OsduWellLog> RiuWellLogImportWizard::importedWellLogs() const
|
||||||
{
|
{
|
||||||
return m_wellLogInfos;
|
return m_wellLogs;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuWellLogImportWizard::addWellLogInfo( RiuWellLogImportWizard::WellLogInfo wellLogInfo )
|
void RiuWellLogImportWizard::addWellLog( OsduWellLog wellLog )
|
||||||
{
|
{
|
||||||
m_wellLogInfos.push_back( wellLogInfo );
|
m_wellLogs.push_back( wellLog );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -198,6 +201,10 @@ WellLogSelectionPage::WellLogSelectionPage( RiaOsduConnector* osduConnector, QWi
|
|||||||
m_tableView->setModel( m_proxyModel );
|
m_tableView->setModel( m_proxyModel );
|
||||||
m_tableView->setSortingEnabled( true );
|
m_tableView->setSortingEnabled( true );
|
||||||
|
|
||||||
|
m_detailText = new QTextEdit( this );
|
||||||
|
m_detailText->setReadOnly( true );
|
||||||
|
layout->addWidget( m_detailText );
|
||||||
|
|
||||||
QObject::connect( filterLineEdit, &QLineEdit::textChanged, m_proxyModel, &QSortFilterProxyModel::setFilterWildcard );
|
QObject::connect( filterLineEdit, &QLineEdit::textChanged, m_proxyModel, &QSortFilterProxyModel::setFilterWildcard );
|
||||||
|
|
||||||
m_osduConnector = osduConnector;
|
m_osduConnector = osduConnector;
|
||||||
@ -271,6 +278,37 @@ void WellLogSelectionPage::selectWellLogs( const QItemSelection& newSelection, c
|
|||||||
return {};
|
return {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
auto generateWellLogDetailsText = []( const OsduWellLog& wellLog ) -> QString
|
||||||
|
{
|
||||||
|
QString text = QString( "Name: %1\n" ).arg( wellLog.name );
|
||||||
|
if ( !wellLog.description.isEmpty() )
|
||||||
|
{
|
||||||
|
text.append( QString( "Description: %2\n" ).arg( wellLog.description ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( auto channel : wellLog.channels )
|
||||||
|
{
|
||||||
|
QString channelText = QString( " %1: \"%2\". Depth: %3 - %4." )
|
||||||
|
.arg( channel.mnemonic )
|
||||||
|
.arg( channel.description )
|
||||||
|
.arg( channel.topDepth )
|
||||||
|
.arg( channel.baseDepth );
|
||||||
|
if ( !channel.interpreterName.isEmpty() )
|
||||||
|
{
|
||||||
|
channelText.append( QString( " Interpreter: %1." ).arg( channel.interpreterName ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !channel.quality.isEmpty() )
|
||||||
|
{
|
||||||
|
channelText.append( QString( " Quality: %1." ).arg( channel.quality ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
text.append( channelText + "\n" );
|
||||||
|
}
|
||||||
|
|
||||||
|
return text;
|
||||||
|
};
|
||||||
|
|
||||||
QModelIndexList selection = m_tableView->selectionModel()->selectedRows();
|
QModelIndexList selection = m_tableView->selectionModel()->selectedRows();
|
||||||
for ( QModelIndex index : selection )
|
for ( QModelIndex index : selection )
|
||||||
{
|
{
|
||||||
@ -282,7 +320,8 @@ void WellLogSelectionPage::selectWellLogs( const QItemSelection& newSelection, c
|
|||||||
std::optional<const OsduWellLog> wellLog = findWellLogById( wellLogs, wellLogId );
|
std::optional<const OsduWellLog> wellLog = findWellLogById( wellLogs, wellLogId );
|
||||||
if ( wellLog.has_value() )
|
if ( wellLog.has_value() )
|
||||||
{
|
{
|
||||||
wiz->addWellLogInfo( { .name = wellLog->name, .wellLog = wellLogId } );
|
wiz->addWellLog( wellLog.value() );
|
||||||
|
m_detailText->setText( generateWellLogDetailsText( wellLog.value() ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,8 +55,7 @@ public:
|
|||||||
int columnCount( const QModelIndex& parent = QModelIndex() ) const override
|
int columnCount( const QModelIndex& parent = QModelIndex() ) const override
|
||||||
{
|
{
|
||||||
Q_UNUSED( parent );
|
Q_UNUSED( parent );
|
||||||
// Assuming you have three fields: id, kind, and name
|
return 7;
|
||||||
return 3;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const override
|
QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const override
|
||||||
@ -65,6 +64,16 @@ public:
|
|||||||
|
|
||||||
if ( index.row() >= static_cast<int>( m_osduWellLogs.size() ) || index.row() < 0 ) return QVariant();
|
if ( index.row() >= static_cast<int>( m_osduWellLogs.size() ) || index.row() < 0 ) return QVariant();
|
||||||
|
|
||||||
|
auto createChannelsText = []( const OsduWellLog& wellLog ) -> QString
|
||||||
|
{
|
||||||
|
QStringList channels;
|
||||||
|
for ( auto c : wellLog.channels )
|
||||||
|
{
|
||||||
|
channels.push_back( c.mnemonic );
|
||||||
|
}
|
||||||
|
return channels.join( ", " );
|
||||||
|
};
|
||||||
|
|
||||||
if ( role == Qt::DisplayRole )
|
if ( role == Qt::DisplayRole )
|
||||||
{
|
{
|
||||||
const OsduWellLog& field = m_osduWellLogs.at( index.row() );
|
const OsduWellLog& field = m_osduWellLogs.at( index.row() );
|
||||||
@ -76,6 +85,14 @@ public:
|
|||||||
return field.kind;
|
return field.kind;
|
||||||
case 2:
|
case 2:
|
||||||
return field.name;
|
return field.name;
|
||||||
|
case 3:
|
||||||
|
return createChannelsText( field );
|
||||||
|
case 4:
|
||||||
|
return field.description;
|
||||||
|
case 5:
|
||||||
|
return field.samplingStart;
|
||||||
|
case 6:
|
||||||
|
return field.samplingStop;
|
||||||
default:
|
default:
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
@ -98,6 +115,14 @@ public:
|
|||||||
return tr( "Kind" );
|
return tr( "Kind" );
|
||||||
case 2:
|
case 2:
|
||||||
return tr( "Name" );
|
return tr( "Name" );
|
||||||
|
case 3:
|
||||||
|
return tr( "Channels" );
|
||||||
|
case 4:
|
||||||
|
return tr( "Description" );
|
||||||
|
case 5:
|
||||||
|
return tr( "Sampling Start" );
|
||||||
|
case 6:
|
||||||
|
return tr( "Sampling Stop" );
|
||||||
default:
|
default:
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
@ -187,6 +212,7 @@ private:
|
|||||||
QTableView* m_tableView;
|
QTableView* m_tableView;
|
||||||
OsduWellLogTableModel* m_osduWellLogsModel;
|
OsduWellLogTableModel* m_osduWellLogsModel;
|
||||||
QSortFilterProxyModel* m_proxyModel;
|
QSortFilterProxyModel* m_proxyModel;
|
||||||
|
QTextEdit* m_detailText;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -197,20 +223,14 @@ class RiuWellLogImportWizard : public QWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
struct WellLogInfo
|
|
||||||
{
|
|
||||||
QString name;
|
|
||||||
QString wellLog;
|
|
||||||
};
|
|
||||||
|
|
||||||
RiuWellLogImportWizard( RiaOsduConnector* osduConnector, const QString& wellboreId, QWidget* parent = nullptr );
|
RiuWellLogImportWizard( RiaOsduConnector* osduConnector, const QString& wellboreId, QWidget* parent = nullptr );
|
||||||
~RiuWellLogImportWizard() override;
|
~RiuWellLogImportWizard() override;
|
||||||
|
|
||||||
void setSelectedWellLogs( const std::vector<QString>& wellLogIds );
|
void setSelectedWellLogs( const std::vector<QString>& wellLogIds );
|
||||||
std::vector<QString> selectedWellLogs() const;
|
std::vector<QString> selectedWellLogs() const;
|
||||||
|
|
||||||
void addWellLogInfo( RiuWellLogImportWizard::WellLogInfo wellLogInfo );
|
void addWellLog( OsduWellLog wellLogInfo );
|
||||||
std::vector<RiuWellLogImportWizard::WellLogInfo> importedWellLogs() const;
|
std::vector<OsduWellLog> importedWellLogs() const;
|
||||||
|
|
||||||
QString wellboreId() const;
|
QString wellboreId() const;
|
||||||
|
|
||||||
@ -221,6 +241,6 @@ private:
|
|||||||
RiaOsduConnector* m_osduConnector;
|
RiaOsduConnector* m_osduConnector;
|
||||||
std::vector<QString> m_selectedWellLogs;
|
std::vector<QString> m_selectedWellLogs;
|
||||||
|
|
||||||
QString m_wellboreId;
|
QString m_wellboreId;
|
||||||
std::vector<RiuWellLogImportWizard::WellLogInfo> m_wellLogInfos;
|
std::vector<OsduWellLog> m_wellLogs;
|
||||||
};
|
};
|
||||||
|
@ -68,16 +68,16 @@ void RicImportWellLogOsduFeature::onActionTriggered( bool isChecked )
|
|||||||
|
|
||||||
if ( QDialog::Accepted == wellLogImportWizard.exec() )
|
if ( QDialog::Accepted == wellLogImportWizard.exec() )
|
||||||
{
|
{
|
||||||
std::vector<RiuWellLogImportWizard::WellLogInfo> wellLogs = wellLogImportWizard.importedWellLogs();
|
std::vector<OsduWellLog> wellLogs = wellLogImportWizard.importedWellLogs();
|
||||||
|
|
||||||
for ( RiuWellLogImportWizard::WellLogInfo wellLog : wellLogs )
|
for ( OsduWellLog wellLog : wellLogs )
|
||||||
{
|
{
|
||||||
auto [wellLogData, errorMessage] = RimWellPathCollection::loadWellLogFromOsdu( osduConnector, wellLog.wellLog );
|
auto [wellLogData, errorMessage] = RimWellPathCollection::loadWellLogFromOsdu( osduConnector, wellLog.id );
|
||||||
if ( wellLogData.notNull() )
|
if ( wellLogData.notNull() )
|
||||||
{
|
{
|
||||||
RimOsduWellLog* osduWellLog = new RimOsduWellLog;
|
RimOsduWellLog* osduWellLog = new RimOsduWellLog;
|
||||||
osduWellLog->setName( wellLog.name );
|
osduWellLog->setName( wellLog.name );
|
||||||
osduWellLog->setWellLogId( wellLog.wellLog );
|
osduWellLog->setWellLogId( wellLog.id );
|
||||||
oilField->wellPathCollection->addWellLog( osduWellLog, wellPath );
|
oilField->wellPathCollection->addWellLog( osduWellLog, wellPath );
|
||||||
|
|
||||||
osduWellLog->setWellLogData( wellLogData.p() );
|
osduWellLog->setWellLogData( wellLogData.p() );
|
||||||
|
@ -18,20 +18,14 @@
|
|||||||
|
|
||||||
#include "RimOsduWellLog.h"
|
#include "RimOsduWellLog.h"
|
||||||
|
|
||||||
#include "RiaDateStringParser.h"
|
|
||||||
#include "RiaFieldHandleTools.h"
|
#include "RiaFieldHandleTools.h"
|
||||||
#include "RiaGuiApplication.h"
|
|
||||||
#include "RiaLogging.h"
|
|
||||||
#include "RiaQDateTimeTools.h"
|
|
||||||
|
|
||||||
#include "RimFileWellPath.h"
|
|
||||||
#include "RimTools.h"
|
#include "RimTools.h"
|
||||||
#include "RimWellLogChannel.h"
|
#include "RimWellLogChannel.h"
|
||||||
|
#include "RimWellPath.h"
|
||||||
#include "RimWellPathCollection.h"
|
#include "RimWellPathCollection.h"
|
||||||
#include "RimWellPlotTools.h"
|
#include "RimWellPlotTools.h"
|
||||||
|
|
||||||
#include "Riu3DMainWindowTools.h"
|
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RimOsduWellLog, "OsduWellLog" );
|
CAF_PDM_SOURCE_INIT( RimOsduWellLog, "OsduWellLog" );
|
||||||
|
Loading…
Reference in New Issue
Block a user