mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#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:
@@ -78,7 +78,7 @@ public:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellPlotTools::hasPressureData( const RimWellLogLasFile* wellLogFile )
|
||||
bool RimWellPlotTools::hasPressureData( const RimWellLogFile* wellLogFile )
|
||||
{
|
||||
for ( RimWellLogFileChannel* const wellLogChannel : wellLogFile->wellLogChannels() )
|
||||
{
|
||||
@@ -92,7 +92,7 @@ bool RimWellPlotTools::hasPressureData( const RimWellLogLasFile* wellLogFile )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellPlotTools::hasPressureData( RimWellPath* wellPath )
|
||||
{
|
||||
for ( RimWellLogLasFile* const wellLogFile : wellPath->wellLogFiles() )
|
||||
for ( RimWellLogFile* const wellLogFile : wellPath->wellLogFiles() )
|
||||
{
|
||||
if ( hasPressureData( wellLogFile ) )
|
||||
{
|
||||
@@ -144,7 +144,7 @@ bool RimWellPlotTools::hasPressureData( RimEclipseResultCase* gridCase )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellPlotTools::hasFlowData( const RimWellLogLasFile* wellLogFile )
|
||||
bool RimWellPlotTools::hasFlowData( const RimWellLogFile* wellLogFile )
|
||||
{
|
||||
for ( RimWellLogFileChannel* const wellLogChannel : wellLogFile->wellLogChannels() )
|
||||
{
|
||||
@@ -158,7 +158,7 @@ bool RimWellPlotTools::hasFlowData( const RimWellLogLasFile* wellLogFile )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellPlotTools::hasFlowData( const RimWellPath* wellPath )
|
||||
{
|
||||
for ( RimWellLogLasFile* const wellLogFile : wellPath->wellLogFiles() )
|
||||
for ( RimWellLogFile* const wellLogFile : wellPath->wellLogFiles() )
|
||||
{
|
||||
if ( hasFlowData( wellLogFile ) )
|
||||
{
|
||||
@@ -268,20 +268,20 @@ void RimWellPlotTools::addTimeStepsToMap( std::map<QDateTime, std::set<RifDataSo
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellLogLasFile*> RimWellPlotTools::wellLogFilesContainingPressure( const QString& wellPathNameOrSimWellName )
|
||||
std::vector<RimWellLogFile*> RimWellPlotTools::wellLogFilesContainingPressure( const QString& wellPathNameOrSimWellName )
|
||||
{
|
||||
std::vector<RimWellLogLasFile*> wellLogFiles;
|
||||
const RimProject* const project = RimProject::current();
|
||||
std::vector<RimWellPath*> wellPaths = project->allWellPaths();
|
||||
std::vector<RimWellLogFile*> wellLogFiles;
|
||||
const RimProject* const project = RimProject::current();
|
||||
std::vector<RimWellPath*> wellPaths = project->allWellPaths();
|
||||
|
||||
for ( auto wellPath : wellPaths )
|
||||
{
|
||||
if ( !wellPathNameOrSimWellName.isEmpty() &&
|
||||
( wellPathNameOrSimWellName == wellPath->associatedSimulationWellName() || wellPathNameOrSimWellName == wellPath->name() ) )
|
||||
{
|
||||
const std::vector<RimWellLogLasFile*> files = wellPath->wellLogFiles();
|
||||
const std::vector<RimWellLogFile*> files = wellPath->wellLogFiles();
|
||||
|
||||
for ( RimWellLogLasFile* file : files )
|
||||
for ( RimWellLogFile* file : files )
|
||||
{
|
||||
if ( hasPressureData( file ) )
|
||||
{
|
||||
@@ -297,7 +297,7 @@ std::vector<RimWellLogLasFile*> RimWellPlotTools::wellLogFilesContainingPressure
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogFileChannel* RimWellPlotTools::getPressureChannelFromWellFile( const RimWellLogLasFile* wellLogFile )
|
||||
RimWellLogFileChannel* RimWellPlotTools::getPressureChannelFromWellFile( const RimWellLogFile* wellLogFile )
|
||||
{
|
||||
if ( wellLogFile != nullptr )
|
||||
{
|
||||
@@ -315,19 +315,19 @@ RimWellLogFileChannel* RimWellPlotTools::getPressureChannelFromWellFile( const R
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellLogLasFile*> RimWellPlotTools::wellLogFilesContainingFlow( const QString& wellPathName )
|
||||
std::vector<RimWellLogFile*> RimWellPlotTools::wellLogFilesContainingFlow( const QString& wellPathName )
|
||||
{
|
||||
std::vector<RimWellLogLasFile*> wellLogFiles;
|
||||
const RimProject* const project = RimProject::current();
|
||||
std::vector<RimWellPath*> wellPaths = project->allWellPaths();
|
||||
std::vector<RimWellLogFile*> wellLogFiles;
|
||||
const RimProject* const project = RimProject::current();
|
||||
std::vector<RimWellPath*> wellPaths = project->allWellPaths();
|
||||
|
||||
for ( auto wellPath : wellPaths )
|
||||
{
|
||||
if ( wellPath->name() == wellPathName )
|
||||
{
|
||||
std::vector<RimWellLogLasFile*> files = wellPath->wellLogFiles();
|
||||
std::vector<RimWellLogFile*> files = wellPath->wellLogFiles();
|
||||
|
||||
for ( RimWellLogLasFile* file : files )
|
||||
for ( RimWellLogFile* file : files )
|
||||
{
|
||||
if ( hasFlowData( file ) )
|
||||
{
|
||||
@@ -342,14 +342,14 @@ std::vector<RimWellLogLasFile*> RimWellPlotTools::wellLogFilesContainingFlow( co
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPath* RimWellPlotTools::wellPathFromWellLogFile( const RimWellLogLasFile* wellLogFile )
|
||||
RimWellPath* RimWellPlotTools::wellPathFromWellLogFile( const RimWellLogFile* wellLogFile )
|
||||
{
|
||||
RimProject* const project = RimProject::current();
|
||||
for ( const auto& oilField : project->oilFields )
|
||||
{
|
||||
for ( const auto& wellPath : oilField->wellPathCollection()->allWellPaths() )
|
||||
{
|
||||
for ( RimWellLogLasFile* const file : wellPath->wellLogFiles() )
|
||||
for ( RimWellLogFile* const file : wellPath->wellLogFiles() )
|
||||
{
|
||||
if ( file == wellLogFile )
|
||||
{
|
||||
@@ -676,7 +676,7 @@ RiaRftPltCurveDefinition RimWellPlotTools::curveDefFromCurve( const RimWellLogCu
|
||||
}
|
||||
else if ( wellLogFileCurve != nullptr )
|
||||
{
|
||||
RimWellLogLasFile* const wellLogFile = wellLogFileCurve->wellLogFile();
|
||||
RimWellLogFile* const wellLogFile = wellLogFileCurve->wellLogFile();
|
||||
|
||||
if ( wellLogFile != nullptr )
|
||||
{
|
||||
@@ -684,7 +684,10 @@ RiaRftPltCurveDefinition RimWellPlotTools::curveDefFromCurve( const RimWellLogCu
|
||||
|
||||
if ( date.isValid() )
|
||||
{
|
||||
return RiaRftPltCurveDefinition( RifDataSourceForRftPlt( wellLogFile ), wellLogFile->wellName(), date );
|
||||
if ( auto wellLogLasFile = dynamic_cast<RimWellLogLasFile*>( wellLogFile ) )
|
||||
{
|
||||
return RiaRftPltCurveDefinition( RifDataSourceForRftPlt( wellLogLasFile ), wellLogFile->wellName(), date );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,24 +75,24 @@ public:
|
||||
static bool isTotalFlowChannel( const QString& channelName );
|
||||
static FlowPhase flowPhaseFromChannelName( const QString& channelName );
|
||||
|
||||
static std::vector<RimWellLogLasFile*> wellLogFilesContainingFlow( const QString& wellName );
|
||||
static RimWellPath* wellPathByWellPathNameOrSimWellName( const QString& wellPathNameOrSimwellName );
|
||||
static std::vector<RimWellLogFile*> wellLogFilesContainingFlow( const QString& wellName );
|
||||
static RimWellPath* wellPathByWellPathNameOrSimWellName( const QString& wellPathNameOrSimwellName );
|
||||
|
||||
// RFT Only
|
||||
private:
|
||||
static std::pair<RigEclipseResultAddress, QString> pressureResultDataInfo( const RigEclipseCaseData* eclipseCaseData );
|
||||
|
||||
public:
|
||||
static void addTimeStepsToMap( std::map<QDateTime, std::set<RifDataSourceForRftPlt>>& destMap,
|
||||
const std::map<QDateTime, std::set<RifDataSourceForRftPlt>>& timeStepsToAdd );
|
||||
static std::vector<RimWellLogLasFile*> wellLogFilesContainingPressure( const QString& wellPathNameOrSimWellName );
|
||||
static RimWellLogFileChannel* getPressureChannelFromWellFile( const RimWellLogLasFile* wellLogFile );
|
||||
static RimWellPath* wellPathFromWellLogFile( const RimWellLogLasFile* wellLogFile );
|
||||
static void addTimeStepsToMap( std::map<QDateTime, std::set<RifDataSourceForRftPlt>>& destMap,
|
||||
const std::map<QDateTime, std::set<RifDataSourceForRftPlt>>& timeStepsToAdd );
|
||||
static std::vector<RimWellLogFile*> wellLogFilesContainingPressure( const QString& wellPathNameOrSimWellName );
|
||||
static RimWellLogFileChannel* getPressureChannelFromWellFile( const RimWellLogFile* wellLogFile );
|
||||
static RimWellPath* wellPathFromWellLogFile( const RimWellLogFile* wellLogFile );
|
||||
static std::map<QDateTime, std::set<RifDataSourceForRftPlt>> timeStepsMapFromGridCase( RimEclipseCase* gridCase );
|
||||
static RiaRftPltCurveDefinition curveDefFromCurve( const RimWellLogCurve* curve );
|
||||
|
||||
// others
|
||||
static bool hasFlowData( const RimWellLogLasFile* wellLogFile );
|
||||
static bool hasFlowData( const RimWellLogFile* wellLogFile );
|
||||
static bool hasAssociatedWellPath( const QString& wellName );
|
||||
|
||||
// Both
|
||||
@@ -145,7 +145,7 @@ private:
|
||||
|
||||
static std::set<QString> FLOW_DATA_NAMES;
|
||||
|
||||
static bool hasPressureData( const RimWellLogLasFile* wellLogFile );
|
||||
static bool hasPressureData( const RimWellLogFile* wellLogFile );
|
||||
static bool isPressureChannel( RimWellLogFileChannel* channel );
|
||||
static bool hasPressureData( RimEclipseResultCase* gridCase );
|
||||
static bool hasPressureData( RimWellPath* wellPath );
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "RimSummaryCurveAppearanceCalculator.h"
|
||||
#include "RimWellFlowRateCurve.h"
|
||||
#include "RimWellLogExtractionCurve.h"
|
||||
#include "RimWellLogFile.h"
|
||||
#include "RimWellLogFileChannel.h"
|
||||
#include "RimWellLogLasFile.h"
|
||||
#include "RimWellLogLasFileCurve.h"
|
||||
@@ -780,10 +781,13 @@ QList<caf::PdmOptionItemInfo> RimWellPltPlot::calculateValueOptions( const caf::
|
||||
|
||||
for ( const auto& wellLogFile : wellLogFiles )
|
||||
{
|
||||
auto addr = RifDataSourceForRftPlt( wellLogFile );
|
||||
auto item = caf::PdmOptionItemInfo( wellLogFile->name(), QVariant::fromValue( addr ) );
|
||||
item.setLevel( 1 );
|
||||
options.push_back( item );
|
||||
if ( auto wellLogLasFile = dynamic_cast<RimWellLogLasFile*>( wellLogFile ) )
|
||||
{
|
||||
auto addr = RifDataSourceForRftPlt( wellLogLasFile );
|
||||
auto item = caf::PdmOptionItemInfo( wellLogFile->name(), QVariant::fromValue( addr ) );
|
||||
item.setLevel( 1 );
|
||||
options.push_back( item );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -994,8 +998,11 @@ void RimWellPltPlot::initAfterLoad()
|
||||
{
|
||||
for ( const auto& wellLogFile : wellLogFiles )
|
||||
{
|
||||
auto addr = RifDataSourceForRftPlt( wellLogFile );
|
||||
selectedSources.push_back( addr );
|
||||
if ( auto wellLogLasFile = dynamic_cast<RimWellLogLasFile*>( wellLogFile ) )
|
||||
{
|
||||
auto addr = RifDataSourceForRftPlt( wellLogLasFile );
|
||||
selectedSources.push_back( addr );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -294,12 +294,15 @@ void RimWellRftPlot::applyInitialSelections( std::variant<RimSummaryCase*, RimSu
|
||||
if ( ensemble ) sourcesToSelect.push_back( RifDataSourceForRftPlt( ensemble ) );
|
||||
}
|
||||
|
||||
std::vector<RimWellLogLasFile*> wellLogFiles = RimWellPlotTools::wellLogFilesContainingPressure( m_wellPathNameOrSimWellName );
|
||||
std::vector<RimWellLogFile*> wellLogFiles = RimWellPlotTools::wellLogFilesContainingPressure( m_wellPathNameOrSimWellName );
|
||||
if ( !wellLogFiles.empty() )
|
||||
{
|
||||
for ( RimWellLogLasFile* const wellLogFile : wellLogFiles )
|
||||
for ( RimWellLogFile* const wellLogFile : wellLogFiles )
|
||||
{
|
||||
sourcesToSelect.push_back( RifDataSourceForRftPlt( wellLogFile ) );
|
||||
if ( auto wellLogLasFile = dynamic_cast<RimWellLogLasFile*>( wellLogFile ) )
|
||||
{
|
||||
sourcesToSelect.push_back( RifDataSourceForRftPlt( wellLogLasFile ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -721,9 +724,12 @@ std::vector<RifDataSourceForRftPlt> RimWellRftPlot::selectedSourcesExpanded() co
|
||||
{
|
||||
if ( addr.sourceType() == RifDataSourceForRftPlt::SourceType::OBSERVED_LAS_FILE )
|
||||
{
|
||||
for ( RimWellLogLasFile* const wellLogFile : RimWellPlotTools::wellLogFilesContainingPressure( m_wellPathNameOrSimWellName ) )
|
||||
for ( RimWellLogFile* const wellLogFile : RimWellPlotTools::wellLogFilesContainingPressure( m_wellPathNameOrSimWellName ) )
|
||||
{
|
||||
sources.push_back( RifDataSourceForRftPlt( wellLogFile ) );
|
||||
if ( auto wellLogLasFile = dynamic_cast<RimWellLogLasFile*>( wellLogFile ) )
|
||||
{
|
||||
sources.push_back( RifDataSourceForRftPlt( wellLogLasFile ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -931,10 +937,13 @@ QList<caf::PdmOptionItemInfo> RimWellRftPlot::calculateValueOptionsForSources()
|
||||
|
||||
for ( const auto& wellLogFile : wellLogFiles )
|
||||
{
|
||||
auto addr = RifDataSourceForRftPlt( wellLogFile );
|
||||
auto item = caf::PdmOptionItemInfo( "Observed Data", QVariant::fromValue( addr ) );
|
||||
item.setLevel( 1 );
|
||||
options.push_back( item );
|
||||
if ( auto wellLogLasFile = dynamic_cast<RimWellLogLasFile*>( wellLogFile ) )
|
||||
{
|
||||
auto addr = RifDataSourceForRftPlt( wellLogLasFile );
|
||||
auto item = caf::PdmOptionItemInfo( "Observed Data", QVariant::fromValue( addr ) );
|
||||
item.setLevel( 1 );
|
||||
options.push_back( item );
|
||||
}
|
||||
}
|
||||
}
|
||||
const std::vector<RimObservedFmuRftData*> observedFmuRftCases = RimWellPlotTools::observedFmuRftDataForWell( m_wellPathNameOrSimWellName );
|
||||
|
||||
@@ -1492,6 +1492,7 @@ int RimContextCommandBuilder::appendImportMenu( caf::CmdFeatureMenuBuilder& menu
|
||||
candidates << "RicWellPathsImportFileFeature";
|
||||
candidates << "RicWellPathFormationsImportFileFeature";
|
||||
candidates << "RicWellLogsImportFileFeature";
|
||||
candidates << "RicImportWellLogCsvFileFeature";
|
||||
candidates << "RicReloadWellPathFormationNamesFeature";
|
||||
|
||||
return appendSubMenuWithCommands( menuBuilder, candidates, "Import", QIcon(), addSeparatorBeforeMenu );
|
||||
|
||||
@@ -120,6 +120,8 @@ RimWbsParameters::RimWbsParameters()
|
||||
{ RigWbsParameter::K0_FG(), &m_userDefinedK0FG },
|
||||
{ RigWbsParameter::K0_SH(), &m_userDefinedK0SH },
|
||||
{ RigWbsParameter::FG_Shale(), &m_FGShaleMultiplier },
|
||||
{ RigWbsParameter::FG_MkMin(), &m_FGShaleMultiplier },
|
||||
{ RigWbsParameter::FG_MkExp(), &m_FGShaleMultiplier },
|
||||
{ RigWbsParameter::waterDensity(), &m_userDefinedDensity } };
|
||||
|
||||
for ( auto parameterFieldPair : m_parameterSourceFields )
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 ) );
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
@@ -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 );
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -578,18 +578,18 @@ void RimWellPath::setNameNoUpdateOfExportName( const QString& name )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellLogLasFile*> RimWellPath::wellLogFiles() const
|
||||
std::vector<RimWellLogFile*> RimWellPath::wellLogFiles() const
|
||||
{
|
||||
return std::vector<RimWellLogLasFile*>( m_wellLogFiles.begin(), m_wellLogFiles.end() );
|
||||
return std::vector<RimWellLogFile*>( m_wellLogFiles.begin(), m_wellLogFiles.end() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogLasFile* RimWellPath::firstWellLogFileMatchingChannelName( const QString& channelName ) const
|
||||
RimWellLogFile* RimWellPath::firstWellLogFileMatchingChannelName( const QString& channelName ) const
|
||||
{
|
||||
std::vector<RimWellLogLasFile*> allWellLogFiles = wellLogFiles();
|
||||
for ( RimWellLogLasFile* logFile : allWellLogFiles )
|
||||
std::vector<RimWellLogFile*> allWellLogFiles = wellLogFiles();
|
||||
for ( RimWellLogFile* logFile : allWellLogFiles )
|
||||
{
|
||||
std::vector<RimWellLogFileChannel*> channels = logFile->wellLogChannels();
|
||||
for ( RimWellLogFileChannel* channel : channels )
|
||||
@@ -895,12 +895,12 @@ double RimWellPath::datumElevation() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPath::addWellLogFile( RimWellLogLasFile* logFileInfo )
|
||||
void RimWellPath::addWellLogFile( RimWellLogFile* logFileInfo )
|
||||
{
|
||||
// Prevent the same file from being loaded more than once
|
||||
auto itr = std::find_if( m_wellLogFiles.begin(),
|
||||
m_wellLogFiles.end(),
|
||||
[&]( const RimWellLogLasFile* file )
|
||||
[&]( const RimWellLogFile* file )
|
||||
{ return QString::compare( file->fileName(), logFileInfo->fileName(), Qt::CaseInsensitive ) == 0; } );
|
||||
|
||||
// Todo: Verify well name to ensure all well log files having the same well name
|
||||
@@ -919,7 +919,7 @@ void RimWellPath::addWellLogFile( RimWellLogLasFile* logFileInfo )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPath::deleteWellLogFile( RimWellLogLasFile* logFileInfo )
|
||||
void RimWellPath::deleteWellLogFile( RimWellLogFile* logFileInfo )
|
||||
{
|
||||
detachWellLogFile( logFileInfo );
|
||||
delete logFileInfo;
|
||||
@@ -928,7 +928,7 @@ void RimWellPath::deleteWellLogFile( RimWellLogLasFile* logFileInfo )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPath::detachWellLogFile( RimWellLogLasFile* logFileInfo )
|
||||
void RimWellPath::detachWellLogFile( RimWellLogFile* logFileInfo )
|
||||
{
|
||||
auto pdmObject = dynamic_cast<caf::PdmObjectHandle*>( logFileInfo );
|
||||
for ( size_t i = 0; i < m_wellLogFiles.size(); i++ )
|
||||
|
||||
@@ -47,7 +47,7 @@ class RigWellPath;
|
||||
class RigWellPathFormations;
|
||||
|
||||
class RimProject;
|
||||
class RimWellLogLasFile;
|
||||
class RimWellLogFile;
|
||||
class RimFractureTemplateCollection;
|
||||
class RimStimPlanModelCollection;
|
||||
class RimFishbonesCollection;
|
||||
@@ -61,6 +61,7 @@ class Rim3dWellLogCurveCollection;
|
||||
class RimWellPathTieIn;
|
||||
class RimMswCompletionParameters;
|
||||
class RimWellIASettingsCollection;
|
||||
class RimWellLogFile;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -104,11 +105,11 @@ public:
|
||||
double uniqueStartMD() const;
|
||||
double uniqueEndMD() const;
|
||||
|
||||
void addWellLogFile( RimWellLogLasFile* logFileInfo );
|
||||
void deleteWellLogFile( RimWellLogLasFile* logFileInfo );
|
||||
void detachWellLogFile( RimWellLogLasFile* logFileInfo );
|
||||
std::vector<RimWellLogLasFile*> wellLogFiles() const;
|
||||
RimWellLogLasFile* firstWellLogFileMatchingChannelName( const QString& channelName ) const;
|
||||
void addWellLogFile( RimWellLogFile* logFileInfo );
|
||||
void deleteWellLogFile( RimWellLogFile* logFileInfo );
|
||||
void detachWellLogFile( RimWellLogFile* logFileInfo );
|
||||
std::vector<RimWellLogFile*> wellLogFiles() const;
|
||||
RimWellLogFile* firstWellLogFileMatchingChannelName( const QString& channelName ) const;
|
||||
|
||||
void setFormationsGeometry( cvf::ref<RigWellPathFormations> wellPathFormations );
|
||||
bool readWellPathFormationsFile( QString* errorMessage, RifWellPathFormationsImporter* wellPathFormationsImporter );
|
||||
@@ -209,7 +210,7 @@ private:
|
||||
caf::PdmField<double> m_wellPathRadiusScaleFactor;
|
||||
caf::PdmField<cvf::Color3f> m_wellPathColor;
|
||||
|
||||
caf::PdmChildArrayField<RimWellLogLasFile*> m_wellLogFiles;
|
||||
caf::PdmChildArrayField<RimWellLogFile*> m_wellLogFiles;
|
||||
caf::PdmChildField<Rim3dWellLogCurveCollection*> m_3dWellLogCurves;
|
||||
caf::PdmChildField<RimWellPathCompletionSettings*> m_completionSettings;
|
||||
caf::PdmChildField<RimWellPathCompletions*> m_completions;
|
||||
|
||||
@@ -169,7 +169,7 @@ void RimWellPathCollection::loadDataAndUpdate()
|
||||
|
||||
if ( wellPath )
|
||||
{
|
||||
for ( RimWellLogLasFile* const wellLogFile : wellPath->wellLogFiles() )
|
||||
for ( RimWellLogFile* const wellLogFile : wellPath->wellLogFiles() )
|
||||
{
|
||||
if ( wellLogFile )
|
||||
{
|
||||
@@ -386,6 +386,16 @@ std::vector<RimWellLogLasFile*> RimWellPathCollection::addWellLogs( const QStrin
|
||||
return logFileInfos;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCollection::addWellLog( RimWellLogFile* wellLogFile, RimWellPath* wellPath )
|
||||
{
|
||||
wellPath->addWellLogFile( wellLogFile );
|
||||
sortWellsByName();
|
||||
updateAllRequiredEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -44,6 +44,7 @@ class RimFileWellPath;
|
||||
class RimEclipseView;
|
||||
class RimProject;
|
||||
class RimWellLogLasFile;
|
||||
class RimWellLogFile;
|
||||
class RimWellPath;
|
||||
class RifWellPathFormationsImporter;
|
||||
class RimWellMeasurementCollection;
|
||||
@@ -116,6 +117,7 @@ public:
|
||||
|
||||
std::vector<RimWellLogLasFile*> addWellLogs( const QStringList& filePaths, QStringList* errorMessages );
|
||||
void addWellPathFormations( const QStringList& filePaths );
|
||||
void addWellLog( RimWellLogFile* wellLogFile, RimWellPath* wellPath );
|
||||
|
||||
void scheduleRedrawAffectedViews();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user