#10663 WBS Plot: Import well log from CSV file.

Also compute SH_MK_MIN/EXP/MAX and FG_MK_MIN/EXP results.
This commit is contained in:
Kristian Bendiksen
2023-10-02 10:38:51 +02:00
parent e83b2e92f3
commit a8c719b289
45 changed files with 1361 additions and 259 deletions

View File

@@ -19,6 +19,7 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RimWellLogLasCurve.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurve.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogLasFile.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogCsvFile.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogFile.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileUtil.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogChannel.h
@@ -38,6 +39,7 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurve.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurve.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogLasFile.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogCsvFile.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogFile.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileUtil.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileChannel.cpp

View File

@@ -25,6 +25,8 @@
#include "RimWellLogLasFileCurveNameConfig.h"
#include "RimWellPath.h"
#include "RiaQDateTimeTools.h"
#include <QFileInfo>
//==================================================================================================
@@ -89,7 +91,7 @@ void Rim3dWellLogFileCurve::curveValuesAndMds( std::vector<double>* values, std:
if ( m_wellLogFile )
{
RigWellLogLasFile* wellLogFile = m_wellLogFile->wellLogFileData();
RigWellLogFile* wellLogFile = m_wellLogFile->wellLogFileData();
if ( wellLogFile )
{
*values = wellLogFile->values( m_wellLogChannelName );
@@ -135,7 +137,7 @@ QString Rim3dWellLogFileCurve::createAutoName() const
channelNameAvailable = true;
}
RigWellLogLasFile* wellLogFile = m_wellLogFile ? m_wellLogFile->wellLogFileData() : nullptr;
RigWellLogFile* wellLogFile = m_wellLogFile ? m_wellLogFile->wellLogFileData() : nullptr;
if ( wellLogFile )
{
@@ -153,10 +155,10 @@ QString Rim3dWellLogFileCurve::createAutoName() const
} */
}
QString date = wellLogFile->date();
QString date = m_wellLogFile->date().toString( RiaQDateTimeTools::dateFormatString() );
if ( !date.isEmpty() )
{
name.push_back( wellLogFile->date() );
name.push_back( date );
}
}
@@ -223,7 +225,7 @@ QList<caf::PdmOptionItemInfo> Rim3dWellLogFileCurve::calculateValueOptions( cons
if ( wellPath && !wellPath->wellLogFiles().empty() )
{
for ( RimWellLogLasFile* const wellLogFile : wellPath->wellLogFiles() )
for ( RimWellLogFile* const wellLogFile : wellPath->wellLogFiles() )
{
QFileInfo fileInfo( wellLogFile->fileName() );
options.push_back( caf::PdmOptionItemInfo( fileInfo.baseName(), wellLogFile ) );

View File

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

View File

@@ -1021,7 +1021,7 @@ std::vector<RimWellLogLasFile*> RimEnsembleWellLogCurveSet::filterEnsembleCases(
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimEnsembleWellLogCurveSet::isSameRealization( RimSummaryCase* summaryCase, RimWellLogLasFile* wellLogFile ) const
bool RimEnsembleWellLogCurveSet::isSameRealization( RimSummaryCase* summaryCase, RimWellLogFile* wellLogFile ) const
{
QString wellLogFileName = wellLogFile->fileName();

View File

@@ -45,7 +45,7 @@ class RimEnsembleStatistics;
class RimEnsembleStatisticsCase;
class RimWellLogCurve;
class RimWellLogLasFileCurve;
class RimWellLogLasFile;
class RimWellLogFile;
class RimPlotCurveAppearance;
class RigWellPathFormations;
@@ -150,7 +150,7 @@ private:
void updateCurveColors();
bool isSameRealization( RimSummaryCase* summaryCase, RimWellLogLasFile* wellLogFile ) const;
bool isSameRealization( RimSummaryCase* summaryCase, RimWellLogFile* wellLogFile ) const;
RimSummaryCase* findMatchingSummaryCase( RimWellLogLasFileCurve* wellLogCurve ) const;
void connectEnsembleCurveSetFilterSignals();

View File

@@ -0,0 +1,147 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2023- 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 "RimWellLogCsvFile.h"
#include "RiaFieldHandleTools.h"
#include "RiaLogging.h"
#include "RigWellLogCsvFile.h"
#include "RimFileWellPath.h"
#include "RimTools.h"
#include "RimWellLogFileChannel.h"
#include <QFileInfo>
#include <QString>
#include <QStringList>
CAF_PDM_SOURCE_INIT( RimWellLogCsvFile, "WellLogCsvFile" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogCsvFile::RimWellLogCsvFile()
{
CAF_PDM_InitObject( "Well CSV File Info", ":/LasFile16x16.png" );
CAF_PDM_InitFieldNoDefault( &m_wellName, "WellName", "" );
m_wellName.uiCapability()->setUiReadOnly( true );
RiaFieldHandleTools::disableWriteAndSetFieldHidden( &m_wellName );
CAF_PDM_InitFieldNoDefault( &m_name, "Name", "" );
m_name.uiCapability()->setUiReadOnly( true );
RiaFieldHandleTools::disableWriteAndSetFieldHidden( &m_name );
m_wellLogDataFile = nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogCsvFile::~RimWellLogCsvFile()
{
m_wellLogChannelNames.deleteChildren();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogCsvFile::readFile( QString* errorMessage )
{
if ( !m_wellLogDataFile.p() )
{
m_wellLogDataFile = new RigWellLogCsvFile;
}
m_name = QFileInfo( m_fileName().path() ).fileName();
auto wellPath = firstAncestorOrThisOfType<RimFileWellPath>();
if ( !wellPath )
{
RiaLogging::error( "No well path found" );
return false;
}
if ( !m_wellLogDataFile->open( m_fileName().path(), wellPath->wellPathGeometry(), errorMessage ) )
{
m_wellLogDataFile = nullptr;
RiaLogging::error( "Failed to open file." );
return false;
}
m_wellLogChannelNames.deleteChildren();
QStringList wellLogNames = m_wellLogDataFile->wellLogChannelNames();
for ( int logIdx = 0; logIdx < wellLogNames.size(); logIdx++ )
{
RimWellLogFileChannel* wellLog = new RimWellLogFileChannel();
wellLog->setName( wellLogNames[logIdx] );
m_wellLogChannelNames.push_back( wellLog );
}
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimWellLogCsvFile::wellName() const
{
return m_wellName;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::pair<double, double>> RimWellLogCsvFile::findMdAndChannelValuesForWellPath( const RimWellPath& wellPath,
const QString& channelName,
QString* unitString /*=nullptr*/ )
{
std::vector<RimWellLogCsvFile*> wellLogFiles = wellPath.descendantsIncludingThisOfType<RimWellLogCsvFile>();
for ( RimWellLogCsvFile* wellLogFile : wellLogFiles )
{
RigWellLogCsvFile* fileData = wellLogFile->wellLogFileData();
std::vector<double> channelValues = fileData->values( channelName );
if ( !channelValues.empty() )
{
if ( unitString )
{
*unitString = fileData->wellLogChannelUnitString( channelName );
}
std::vector<double> depthValues = fileData->depthValues();
CVF_ASSERT( depthValues.size() == channelValues.size() );
std::vector<std::pair<double, double>> depthValuePairs;
for ( size_t i = 0; i < depthValues.size(); ++i )
{
depthValuePairs.push_back( std::make_pair( depthValues[i], channelValues[i] ) );
}
return depthValuePairs;
}
}
return std::vector<std::pair<double, double>>();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigWellLogCsvFile* RimWellLogCsvFile::wellLogFileData()
{
return m_wellLogDataFile.p();
}

View File

@@ -0,0 +1,64 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- Ceetron Solutions AS
//
// 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 "RimWellLogFile.h"
#include "RigWellLogCsvFile.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include <QDateTime>
#include <QString>
class RimWellPath;
//==================================================================================================
///
///
//==================================================================================================
class RimWellLogCsvFile : public RimWellLogFile
{
CAF_PDM_HEADER_INIT;
public:
RimWellLogCsvFile();
~RimWellLogCsvFile() override;
QString name() const override { return m_name; }
bool readFile( QString* errorMessage ) override;
QString wellName() const override;
RigWellLogCsvFile* wellLogFileData() override;
std::vector<std::pair<double, double>>
findMdAndChannelValuesForWellPath( const RimWellPath& wellPath, const QString& channelName, QString* unitString = nullptr ) override;
private:
caf::PdmFieldHandle* userDescriptionField() override { return &m_name; }
private:
cvf::ref<RigWellLogCsvFile> m_wellLogDataFile;
caf::PdmField<QString> m_wellName;
caf::PdmField<QString> m_name;
};

View File

@@ -527,7 +527,7 @@ void RimWellLogCurveCommonDataSource::applyDataSourceChanges( const std::vector<
fileCurve->setWellPath( wellPathToApply() );
if ( !fileCurve->wellLogChannelUiName().isEmpty() )
{
RimWellLogLasFile* logFile = wellPathToApply()->firstWellLogFileMatchingChannelName( fileCurve->wellLogChannelUiName() );
RimWellLogFile* logFile = wellPathToApply()->firstWellLogFileMatchingChannelName( fileCurve->wellLogChannelUiName() );
fileCurve->setWellLogFile( logFile );
auto parentPlot = fileCurve->firstAncestorOrThisOfTypeAsserted<RimWellLogPlot>();
plots.insert( parentPlot );

View File

@@ -885,12 +885,10 @@ void RimWellLogExtractionCurve::findAndLoadWbsParametersFromFiles( const RimWell
else
{
QString errMsg =
QString( "Could not convert units of LAS-channel %1 from %2 to %3" ).arg( lasAddress ).arg( lasUnits ).arg( extractorUnits );
QString( "Could not convert units of LAS-channel '%1' from '%2' to '%3'" ).arg( lasAddress ).arg( lasUnits ).arg( extractorUnits );
RiaLogging::error( errMsg );
}
}
// csv
}
}

View File

@@ -23,11 +23,19 @@
#include "RimWellLogFileChannel.h"
#include "RiaFieldHandleTools.h"
#include "RiaQDateTimeTools.h"
#include "cafPdmUiDateEditor.h"
#include <QString>
CAF_PDM_ABSTRACT_SOURCE_INIT( RimWellLogFile, "WellLogFileInterface" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const QDateTime RimWellLogFile::DEFAULT_DATE_TIME = RiaQDateTimeTools::createUtcDateTime( QDate( 1900, 1, 1 ) );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -38,6 +46,8 @@ RimWellLogFile::RimWellLogFile()
CAF_PDM_InitFieldNoDefault( &m_fileName, "FileName", "Filename" );
m_fileName.uiCapability()->setUiReadOnly( true );
CAF_PDM_InitFieldNoDefault( &m_date, "Date", "Date" );
CAF_PDM_InitFieldNoDefault( &m_wellLogChannelNames, "WellLogFileChannels", "" );
RiaFieldHandleTools::disableWriteAndSetFieldHidden( &m_wellLogChannelNames );
}
@@ -78,3 +88,33 @@ std::vector<RimWellLogFileChannel*> RimWellLogFile::wellLogChannels() const
}
return channels;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QDateTime RimWellLogFile::date() const
{
return m_date;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogFile::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
if ( changedField == &m_date )
{
// Due to a possible bug in QDateEdit/PdmUiDateEditor, convert m_date to a QDateTime having UTC timespec
m_date = RiaQDateTimeTools::createUtcDateTime( m_date().date(), m_date().time() );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogFile::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
{
if ( caf::PdmUiDateEditorAttribute* attrib = dynamic_cast<caf::PdmUiDateEditorAttribute*>( attribute ) )
{
attrib->dateFormat = RiaQDateTimeTools::dateFormatString();
}
}

View File

@@ -22,11 +22,14 @@
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include <QDateTime>
#include <QString>
class RimWellLogFileChannel;
class RimWellPath;
class RigWellLogFile;
//==================================================================================================
///
///
@@ -43,10 +46,23 @@ public:
virtual QString fileName() const;
virtual std::vector<RimWellLogFileChannel*> wellLogChannels() const;
virtual QString wellName() const = 0;
virtual QString name() const = 0;
virtual bool readFile( QString* errorMessage ) = 0;
virtual RigWellLogFile* wellLogFileData() = 0;
virtual QDateTime date() const;
virtual std::vector<std::pair<double, double>>
findMdAndChannelValuesForWellPath( const RimWellPath& wellPath, const QString& channelName, QString* unitString = nullptr ) = 0;
const static QDateTime DEFAULT_DATE_TIME;
protected:
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
caf::PdmChildArrayField<RimWellLogFileChannel*> m_wellLogChannelNames;
caf::PdmField<caf::FilePath> m_fileName;
caf::PdmField<QDateTime> m_date;
};

View File

@@ -36,8 +36,6 @@
#include "Riu3DMainWindowTools.h"
#include "cafPdmUiDateEditor.h"
#include <QFileInfo>
#include <QString>
#include <QStringList>
@@ -54,11 +52,6 @@ void caf::AppEnum<RimWellLogLasFile::WellFlowCondition>::setUp()
}
} // namespace caf
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const QDateTime RimWellLogLasFile::DEFAULT_DATE_TIME = RiaQDateTimeTools::createUtcDateTime( QDate( 1900, 1, 1 ) );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -70,13 +63,12 @@ RimWellLogLasFile::RimWellLogLasFile()
m_wellName.uiCapability()->setUiReadOnly( true );
RiaFieldHandleTools::disableWriteAndSetFieldHidden( &m_wellName );
CAF_PDM_InitFieldNoDefault( &m_date, "Date", "Date" );
m_date.uiCapability()->setUiReadOnly( true );
CAF_PDM_InitFieldNoDefault( &m_name, "Name", "" );
m_name.uiCapability()->setUiReadOnly( true );
RiaFieldHandleTools::disableWriteAndSetFieldHidden( &m_name );
m_date.uiCapability()->setUiReadOnly( true );
CAF_PDM_InitField( &m_wellFlowCondition,
"WellFlowCondition",
caf::AppEnum<RimWellLogLasFile::WellFlowCondition>( RimWellLogLasFile::WELL_FLOW_COND_STANDARD ),
@@ -188,14 +180,6 @@ QString RimWellLogLasFile::wellName() const
return m_wellName;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QDateTime RimWellLogLasFile::date() const
{
return m_date;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -265,30 +249,6 @@ void RimWellLogLasFile::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderi
uiOrdering.skipRemainingFields( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogLasFile::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
if ( changedField == &m_date )
{
// Due to a possible bug in QDateEdit/PdmUiDateEditor, convert m_date to a QDateTime having UTC timespec
m_date = RiaQDateTimeTools::createUtcDateTime( m_date().date(), m_date().time() );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogLasFile::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
{
caf::PdmUiDateEditorAttribute* attrib = dynamic_cast<caf::PdmUiDateEditorAttribute*>( attribute );
if ( attrib != nullptr )
{
attrib->dateFormat = RiaQDateTimeTools::dateFormatString();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -42,22 +42,19 @@ class RimWellLogLasFile : public RimWellLogFile
{
CAF_PDM_HEADER_INIT;
const static QDateTime DEFAULT_DATE_TIME;
public:
RimWellLogLasFile();
~RimWellLogLasFile() override;
static RimWellLogLasFile* readWellLogFile( const QString& logFilePath, QString* errorMessage );
QString name() const { return m_name; }
QString name() const override { return m_name; }
bool readFile( QString* errorMessage );
bool readFile( QString* errorMessage ) override;
QString wellName() const;
QDateTime date() const;
QString wellName() const override;
RigWellLogLasFile* wellLogFileData() { return m_wellLogDataFile.p(); }
RigWellLogLasFile* wellLogFileData() override { return m_wellLogDataFile.p(); }
bool hasFlowData() const;
@@ -75,8 +72,6 @@ public:
private:
void setupBeforeSave() override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
caf::PdmFieldHandle* userDescriptionField() override { return &m_name; }
@@ -86,7 +81,6 @@ private:
cvf::ref<RigWellLogLasFile> m_wellLogDataFile;
caf::PdmField<QString> m_wellName;
caf::PdmField<QString> m_name;
caf::PdmField<QDateTime> m_date;
bool m_lasFileHasValidDate;
caf::PdmField<caf::AppEnum<WellFlowCondition>> m_wellFlowCondition;

View File

@@ -22,6 +22,7 @@
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "RiaQDateTimeTools.h"
#include "RiaResultNames.h"
#include "RigWellLogCurveData.h"
#include "RigWellLogIndexDepthOffset.h"
@@ -84,7 +85,7 @@ void RimWellLogLasFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
if ( m_wellPath && m_wellLogFile )
{
RigWellLogLasFile* wellLogFile = m_wellLogFile->wellLogFileData();
RigWellLogFile* wellLogFile = m_wellLogFile->wellLogFileData();
if ( wellLogFile )
{
std::vector<double> values = wellLogFile->values( m_wellLogChannelName );
@@ -286,7 +287,7 @@ void RimWellLogLasFileCurve::setWellLogChannelName( const QString& name )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogLasFileCurve::setWellLogFile( RimWellLogLasFile* wellLogFile )
void RimWellLogLasFileCurve::setWellLogFile( RimWellLogFile* wellLogFile )
{
m_wellLogFile = wellLogFile;
}
@@ -401,7 +402,7 @@ QList<caf::PdmOptionItemInfo> RimWellLogLasFileCurve::calculateValueOptions( con
{
if ( m_wellPath() && !m_wellPath->wellLogFiles().empty() )
{
for ( RimWellLogLasFile* const wellLogFile : m_wellPath->wellLogFiles() )
for ( RimWellLogFile* const wellLogFile : m_wellPath->wellLogFiles() )
{
QFileInfo fileInfo( wellLogFile->fileName() );
options.push_back( caf::PdmOptionItemInfo( fileInfo.baseName(), wellLogFile ) );
@@ -423,7 +424,7 @@ void RimWellLogLasFileCurve::initAfterRead()
if ( m_wellPath->wellLogFiles().size() == 1 )
{
m_wellLogFile = m_wellPath->wellLogFiles().front();
m_wellLogFile = dynamic_cast<RimWellLogLasFile*>( m_wellPath->wellLogFiles().front() );
}
}
@@ -456,14 +457,14 @@ QString RimWellLogLasFileCurve::createCurveAutoName()
channelNameAvailable = true;
}
RigWellLogLasFile* wellLogFile = m_wellLogFile ? m_wellLogFile->wellLogFileData() : nullptr;
RigWellLogFile* wellLogFile = m_wellLogFile ? m_wellLogFile->wellLogFileData() : nullptr;
if ( wellLogFile )
{
if ( channelNameAvailable )
{
auto wellLogPlot = firstAncestorOrThisOfTypeAsserted<RimWellLogPlot>();
QString unitName = wellLogFile->wellLogChannelUnitString( m_wellLogChannelName, wellLogPlot->depthUnit() );
QString unitName = wellLogFile->convertedWellLogChannelUnitString( m_wellLogChannelName, wellLogPlot->depthUnit() );
if ( !unitName.isEmpty() )
{
@@ -471,10 +472,10 @@ QString RimWellLogLasFileCurve::createCurveAutoName()
}
}
QString date = wellLogFile->date();
QString date = m_wellLogFile->date().toString( RiaQDateTimeTools::dateFormatString() );
if ( !date.isEmpty() )
{
name.push_back( wellLogFile->date() );
name.push_back( date );
}
}
@@ -507,7 +508,7 @@ QString RimWellLogLasFileCurve::wellLogChannelUnits() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogLasFile* RimWellLogLasFileCurve::wellLogFile() const
RimWellLogFile* RimWellLogLasFileCurve::wellLogFile() const
{
return m_wellLogFile();
}

View File

@@ -28,7 +28,7 @@
class RimWellPath;
class RimWellLogFileChannel;
class RimWellLogLasFile;
class RimWellLogFile;
class RigWellLogIndexDepthOffset;
//==================================================================================================
@@ -46,7 +46,7 @@ public:
void setWellPath( RimWellPath* wellPath );
RimWellPath* wellPath() const;
void setWellLogChannelName( const QString& name );
void setWellLogFile( RimWellLogLasFile* wellLogFile );
void setWellLogFile( RimWellLogFile* wellLogFile );
void setIndexDepthOffsets( std::shared_ptr<RigWellLogIndexDepthOffset> depthOffsets );
// Overrides from RimWellLogPlotCurve
@@ -54,7 +54,7 @@ public:
QString wellLogChannelUiName() const override;
QString wellLogChannelUnits() const override;
RimWellLogLasFile* wellLogFile() const;
RimWellLogFile* wellLogFile() const;
protected:
// Overrides from RimWellLogPlotCurve
@@ -75,10 +75,10 @@ protected:
const std::vector<double>& kIndexValues ) const;
protected:
caf::PdmPtrField<RimWellPath*> m_wellPath;
caf::PdmPtrField<RimWellLogLasFile*> m_wellLogFile;
caf::PdmField<QString> m_wellLogChannelName;
caf::PdmField<QString> m_wellLogChannnelUnit;
caf::PdmPtrField<RimWellPath*> m_wellPath;
caf::PdmPtrField<RimWellLogFile*> m_wellLogFile;
caf::PdmField<QString> m_wellLogChannelName;
caf::PdmField<QString> m_wellLogChannnelUnit;
std::shared_ptr<RigWellLogIndexDepthOffset> m_indexDepthOffsets;
};