clang-format: Set column width to 140

* Set column width to 140
* Use c++20
* Remove redundant virtual
This commit is contained in:
Magne Sjaastad
2023-02-26 10:48:40 +01:00
committed by GitHub
parent 8768e186d8
commit f8c5cf389f
1535 changed files with 10456 additions and 19398 deletions

View File

@@ -150,9 +150,7 @@ bool Rim3dWellLogCurve::isShowingCurve() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dWellLogCurve::curveValuesAndMdsAtTimeStep( std::vector<double>* values,
std::vector<double>* measuredDepthValues,
int timeStep ) const
void Rim3dWellLogCurve::curveValuesAndMdsAtTimeStep( std::vector<double>* values, std::vector<double>* measuredDepthValues, int timeStep ) const
{
curveValuesAndMds( values, measuredDepthValues );
}
@@ -215,9 +213,7 @@ caf::PdmFieldHandle* Rim3dWellLogCurve::objectToggleField()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dWellLogCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void Rim3dWellLogCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
RimProject* proj;
this->firstAncestorOrThisOfTypeAsserted( proj );
@@ -246,12 +242,9 @@ void Rim3dWellLogCurve::configurationUiOrdering( caf::PdmUiOrdering& uiOrdering
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dWellLogCurve::defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute )
void Rim3dWellLogCurve::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
{
if ( m_minCurveDataValue == -std::numeric_limits<float>::infinity() &&
m_maxCurveDataValue == std::numeric_limits<float>::infinity() )
if ( m_minCurveDataValue == -std::numeric_limits<float>::infinity() && m_maxCurveDataValue == std::numeric_limits<float>::infinity() )
{
this->resetMinMaxValues();
}
@@ -275,10 +268,7 @@ bool Rim3dWellLogCurve::findClosestPointOnCurve( const cvf::Vec3d& globalInterse
{
if ( m_geometryGenerator.notNull() )
{
return m_geometryGenerator->findClosestPointOnCurve( globalIntersection,
closestPoint,
measuredDepthAtPoint,
valueAtPoint );
return m_geometryGenerator->findClosestPointOnCurve( globalIntersection, closestPoint, measuredDepthAtPoint, valueAtPoint );
}
return false;
}

View File

@@ -70,9 +70,7 @@ public:
virtual bool showInView( const Rim3dView* gridView ) const { return isShowingCurve(); }
virtual bool followAnimationTimeStep() const { return false; }
virtual void curveValuesAndMds( std::vector<double>* values, std::vector<double>* measuredDepthValues ) const = 0;
virtual void curveValuesAndMdsAtTimeStep( std::vector<double>* values,
std::vector<double>* measuredDepthValues,
int timeStep ) const;
virtual void curveValuesAndMdsAtTimeStep( std::vector<double>* values, std::vector<double>* measuredDepthValues, int timeStep ) const;
virtual std::pair<double, double> findCurveValueRange();
void setColor( const cvf::Color3f& color );
@@ -90,12 +88,10 @@ public:
protected:
caf::PdmFieldHandle* objectToggleField() override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void configurationUiOrdering( caf::PdmUiOrdering& uiOrdering );
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
void initAfterRead() override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void configurationUiOrdering( caf::PdmUiOrdering& uiOrdering );
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
void initAfterRead() override;
protected:
caf::PdmField<DrawPlaneEnum> m_drawPlane;

View File

@@ -165,8 +165,7 @@ bool Rim3dWellLogExtractionCurve::followAnimationTimeStep() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dWellLogExtractionCurve::curveValuesAndMds( std::vector<double>* values,
std::vector<double>* measuredDepthValues ) const
void Rim3dWellLogExtractionCurve::curveValuesAndMds( std::vector<double>* values, std::vector<double>* measuredDepthValues ) const
{
CVF_ASSERT( m_timeStep() >= 0 );
@@ -189,8 +188,7 @@ void Rim3dWellLogExtractionCurve::curveValuesAndMdsAtTimeStep( std::vector<doubl
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( m_case() );
if ( eclipseCase )
{
cvf::ref<RigEclipseWellLogExtractor> eclExtractor =
RiaExtractionTools::findOrCreateWellLogExtractor( wellPath, eclipseCase );
cvf::ref<RigEclipseWellLogExtractor> eclExtractor = RiaExtractionTools::findOrCreateWellLogExtractor( wellPath, eclipseCase );
if ( eclExtractor.notNull() )
{
*measuredDepthValues = eclExtractor->cellIntersectionMDs();
@@ -198,10 +196,7 @@ void Rim3dWellLogExtractionCurve::curveValuesAndMdsAtTimeStep( std::vector<doubl
m_eclipseResultDefinition->loadResult();
cvf::ref<RigResultAccessor> resAcc =
RigResultAccessorFactory::createFromResultDefinition( eclipseCase->eclipseCaseData(),
0,
timeStep,
m_eclipseResultDefinition );
RigResultAccessorFactory::createFromResultDefinition( eclipseCase->eclipseCaseData(), 0, timeStep, m_eclipseResultDefinition );
if ( resAcc.notNull() )
{
eclExtractor->curveData( resAcc.p(), values );
@@ -213,8 +208,7 @@ void Rim3dWellLogExtractionCurve::curveValuesAndMdsAtTimeStep( std::vector<doubl
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>( m_case() );
if ( geomCase )
{
cvf::ref<RigGeoMechWellLogExtractor> geomExtractor =
RiaExtractionTools::findOrCreateWellLogExtractor( wellPath, geomCase );
cvf::ref<RigGeoMechWellLogExtractor> geomExtractor = RiaExtractionTools::findOrCreateWellLogExtractor( wellPath, geomCase );
if ( geomExtractor.notNull() )
{
@@ -224,8 +218,7 @@ void Rim3dWellLogExtractionCurve::curveValuesAndMdsAtTimeStep( std::vector<doubl
m_geomResultDefinition->loadResult();
auto [stepIndex, frameIndex] =
geomCase->geoMechData()->femPartResults()->stepListIndexToTimeStepAndDataFrameIndex( timeStep );
auto [stepIndex, frameIndex] = geomCase->geoMechData()->femPartResults()->stepListIndexToTimeStepAndDataFrameIndex( timeStep );
geomExtractor->curveData( m_geomResultDefinition->resultAddress(), stepIndex, frameIndex, values );
}
@@ -329,8 +322,7 @@ QString Rim3dWellLogExtractionCurve::createAutoName() const
if ( eclipseCase )
{
addTimeStep = addTimeStep &&
m_eclipseResultDefinition->resultType() != RiaDefines::ResultCatType::STATIC_NATIVE;
addTimeStep = addTimeStep && m_eclipseResultDefinition->resultType() != RiaDefines::ResultCatType::STATIC_NATIVE;
RigEclipseCaseData* data = eclipseCase->eclipseCaseData();
if ( data )
{
@@ -429,9 +421,7 @@ caf::PdmFieldHandle* Rim3dWellLogExtractionCurve::userDescriptionField()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dWellLogExtractionCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void Rim3dWellLogExtractionCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
if ( changedField == &m_case )
{
@@ -461,8 +451,7 @@ void Rim3dWellLogExtractionCurve::fieldChangedByUi( const caf::PdmFieldHandle* c
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo>
Rim3dWellLogExtractionCurve::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
QList<caf::PdmOptionItemInfo> Rim3dWellLogExtractionCurve::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
{
QList<caf::PdmOptionItemInfo> options;

View File

@@ -47,9 +47,7 @@ public:
bool followAnimationTimeStep() const override;
void curveValuesAndMds( std::vector<double>* values, std::vector<double>* measuredDepthValues ) const override;
void curveValuesAndMdsAtTimeStep( std::vector<double>* values,
std::vector<double>* measuredDepthValues,
int timeStep ) const override;
void curveValuesAndMdsAtTimeStep( std::vector<double>* values, std::vector<double>* measuredDepthValues, int timeStep ) const override;
std::pair<double, double> findCurveValueRange() override;
QString name() const override;
@@ -62,7 +60,7 @@ public:
protected:
caf::PdmFieldHandle* userDescriptionField() override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
private:
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;

View File

@@ -180,9 +180,7 @@ caf::PdmFieldHandle* Rim3dWellLogFileCurve::userDescriptionField()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dWellLogFileCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void Rim3dWellLogFileCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
if ( changedField == &m_wellLogFile || changedField == &m_wellLogChannelName )
{

View File

@@ -47,7 +47,7 @@ public:
protected:
caf::PdmFieldHandle* userDescriptionField() override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
private:
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;

View File

@@ -119,8 +119,8 @@ QString Rim3dWellLogRftCurve::createAutoName() const
{
name.push_back( m_eclipseResultCase->caseUserDescription() );
}
if ( m_wellLogChannelName().text() != caf::AppEnum<RifEclipseRftAddress::RftWellLogChannelType>::text(
RifEclipseRftAddress::RftWellLogChannelType::NONE ) )
if ( m_wellLogChannelName().text() !=
caf::AppEnum<RifEclipseRftAddress::RftWellLogChannelType>::text( RifEclipseRftAddress::RftWellLogChannelType::NONE ) )
{
RifEclipseRftAddress::RftWellLogChannelType channelNameEnum = m_wellLogChannelName();
name.push_back( caf::AppEnum<RifEclipseRftAddress::RftWellLogChannelType>::uiText( channelNameEnum ) );
@@ -144,9 +144,7 @@ caf::PdmFieldHandle* Rim3dWellLogRftCurve::userDescriptionField()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dWellLogRftCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void Rim3dWellLogRftCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
if ( changedField == &m_wellLogChannelName || changedField == &m_timeStep )
{

View File

@@ -81,9 +81,7 @@ template <>
void AppEnum<RimEnsembleWellLogCurveSet::ColorMode>::setUp()
{
addItem( RimEnsembleWellLogCurveSet::ColorMode::SINGLE_COLOR, "SINGLE_COLOR", "Single Color" );
addItem( RimEnsembleWellLogCurveSet::ColorMode::COLOR_BY_ENSEMBLE_CURVE_SET,
"BY_ENSEMBLE_CURVE_SET",
"Color by Ensemble Curve Set" );
addItem( RimEnsembleWellLogCurveSet::ColorMode::COLOR_BY_ENSEMBLE_CURVE_SET, "BY_ENSEMBLE_CURVE_SET", "Color by Ensemble Curve Set" );
setDefault( RimEnsembleWellLogCurveSet::ColorMode::SINGLE_COLOR );
}
}; // namespace caf
@@ -392,9 +390,7 @@ void RimEnsembleWellLogCurveSet::updateEditors()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEnsembleWellLogCurveSet::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void RimEnsembleWellLogCurveSet::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
RimWellLogPlot* plot = nullptr;
firstAncestorOrThisOfType( plot );
@@ -525,8 +521,7 @@ void RimEnsembleWellLogCurveSet::appendColorGroup( caf::PdmUiOrdering& uiOrderin
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEnsembleWellLogCurveSet::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering,
QString uiConfigName /*= ""*/ )
void RimEnsembleWellLogCurveSet::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/ )
{
uiTreeOrdering.skipRemainingChildren( true );
@@ -562,16 +557,14 @@ caf::PdmFieldHandle* RimEnsembleWellLogCurveSet::objectToggleField()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo>
RimEnsembleWellLogCurveSet::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
QList<caf::PdmOptionItemInfo> RimEnsembleWellLogCurveSet::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
{
QList<caf::PdmOptionItemInfo> options;
if ( fieldNeedingOptions == &m_ensembleWellLogs )
{
RimProject* proj = RimProject::current();
std::vector<RimEnsembleWellLogs*> groups =
proj->activeOilField()->ensembleWellLogsCollection()->ensembleWellLogs();
RimProject* proj = RimProject::current();
std::vector<RimEnsembleWellLogs*> groups = proj->activeOilField()->ensembleWellLogsCollection()->ensembleWellLogs();
for ( RimEnsembleWellLogs* ensemble : groups )
{
@@ -640,8 +633,8 @@ void RimEnsembleWellLogCurveSet::updateFilterLegend()
{
if ( !m_filterOverlayFrame )
{
m_filterOverlayFrame = new RiuDraggableOverlayFrame( plotTrack->viewer()->qwtPlot()->canvas(),
plotTrack->viewer()->overlayMargins() );
m_filterOverlayFrame =
new RiuDraggableOverlayFrame( plotTrack->viewer()->qwtPlot()->canvas(), plotTrack->viewer()->overlayMargins() );
}
m_filterOverlayFrame->setContentFrame( m_ensembleCurveSet->curveFilters()->makeFilterDescriptionFrame() );
plotTrack->viewer()->addOverlayFrame( m_filterOverlayFrame );
@@ -694,8 +687,7 @@ void RimEnsembleWellLogCurveSet::updateCurveColors()
if ( dynamic_cast<RimEnsembleWellLogStatisticsCurve*>( curve.p() ) == nullptr )
{
// Look for a matching summary case
RimSummaryCase* summaryCase =
findMatchingSummaryCase( dynamic_cast<RimWellLogFileCurve*>( curve.p() ) );
RimSummaryCase* summaryCase = findMatchingSummaryCase( dynamic_cast<RimWellLogFileCurve*>( curve.p() ) );
if ( summaryCase )
{
summaryCases.push_back( summaryCase );
@@ -738,8 +730,8 @@ void RimEnsembleWellLogCurveSet::updateCurveColors()
{
if ( !m_legendOverlayFrame )
{
m_legendOverlayFrame = new RiuDraggableOverlayFrame( plotTrack->viewer()->getParentForOverlay(),
plotTrack->viewer()->overlayMargins() );
m_legendOverlayFrame =
new RiuDraggableOverlayFrame( plotTrack->viewer()->getParentForOverlay(), plotTrack->viewer()->overlayMargins() );
}
m_legendOverlayFrame->setContentFrame( m_ensembleCurveSet->legendConfig()->makeLegendFrame() );
plotTrack->viewer()->addOverlayFrame( m_legendOverlayFrame );
@@ -923,12 +915,9 @@ void RimEnsembleWellLogCurveSet::updateStatisticsCurves( const std::vector<RimWe
}
auto statisticsCurveSymbolFromStatistics = []( RimEnsembleWellLogStatistics::StatisticsType statisticsType ) {
if ( statisticsType == RimEnsembleWellLogStatistics::StatisticsType::P10 )
return RiuPlotCurveSymbol::SYMBOL_TRIANGLE;
if ( statisticsType == RimEnsembleWellLogStatistics::StatisticsType::P90 )
return RiuPlotCurveSymbol::SYMBOL_DOWN_TRIANGLE;
if ( statisticsType == RimEnsembleWellLogStatistics::StatisticsType::P50 )
return RiuPlotCurveSymbol::SYMBOL_DIAMOND;
if ( statisticsType == RimEnsembleWellLogStatistics::StatisticsType::P10 ) return RiuPlotCurveSymbol::SYMBOL_TRIANGLE;
if ( statisticsType == RimEnsembleWellLogStatistics::StatisticsType::P90 ) return RiuPlotCurveSymbol::SYMBOL_DOWN_TRIANGLE;
if ( statisticsType == RimEnsembleWellLogStatistics::StatisticsType::P50 ) return RiuPlotCurveSymbol::SYMBOL_DIAMOND;
return RiuPlotCurveSymbol::SYMBOL_ELLIPSE;
};
@@ -1024,8 +1013,7 @@ void RimEnsembleWellLogCurveSet::updateAllTextInPlot()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimWellLogFile*>
RimEnsembleWellLogCurveSet::filterEnsembleCases( const std::vector<RimWellLogFile*>& wellLogFiles )
std::vector<RimWellLogFile*> RimEnsembleWellLogCurveSet::filterEnsembleCases( const std::vector<RimWellLogFile*>& wellLogFiles )
{
std::vector<RimWellLogFile*> filteredCases;
@@ -1035,8 +1023,7 @@ std::vector<RimWellLogFile*>
RimSummaryCaseCollection* summaryCaseCollection = m_ensembleCurveSet->summaryCaseCollection();
//
std::vector<RimSummaryCase*> sumCases =
m_ensembleCurveSet->filterEnsembleCases( summaryCaseCollection->allSummaryCases() );
std::vector<RimSummaryCase*> sumCases = m_ensembleCurveSet->filterEnsembleCases( summaryCaseCollection->allSummaryCases() );
for ( auto sumCase : sumCases )
{
for ( auto wellLogFile : wellLogFiles )
@@ -1261,11 +1248,9 @@ void RimEnsembleWellLogCurveSet::setWellLogChannelName( const QString& wellLogCh
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::ref<RigWellPathFormations>
RimEnsembleWellLogCurveSet::createWellPathFormations( std::shared_ptr<RigWellLogIndexDepthOffset> offsets )
cvf::ref<RigWellPathFormations> RimEnsembleWellLogCurveSet::createWellPathFormations( std::shared_ptr<RigWellLogIndexDepthOffset> offsets )
{
RimFormationNamesCollection* formationNamesCollection =
RimProject::current()->activeOilField()->formationNamesCollection.v();
RimFormationNamesCollection* formationNamesCollection = RimProject::current()->activeOilField()->formationNamesCollection.v();
if ( !formationNamesCollection ) return nullptr;
if ( formationNamesCollection->formationNamesList().empty() ) return nullptr;

View File

@@ -83,8 +83,7 @@ void RimEnsembleWellLogStatistics::calculate( const std::vector<RimWellLogFile*>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEnsembleWellLogStatistics::calculate( const std::vector<RimWellLogFile*>& wellLogFiles,
const QString& wellLogChannelName )
void RimEnsembleWellLogStatistics::calculate( const std::vector<RimWellLogFile*>& wellLogFiles, const QString& wellLogChannelName )
{
RiaCurveMerger<double> curveMerger;
RiaCurveMerger<double> tvdCurveMerger;
@@ -105,8 +104,7 @@ void RimEnsembleWellLogStatistics::calculate( const std::vector<RimWellLogFile*>
m_depthUnit = depthUnitInFile;
QString logChannelUnitString = fileData->wellLogChannelUnitString( wellLogChannelName );
if ( m_logChannelUnitString != RiaWellLogUnitTools<double>::noUnitString() &&
m_logChannelUnitString != logChannelUnitString )
if ( m_logChannelUnitString != RiaWellLogUnitTools<double>::noUnitString() && m_logChannelUnitString != logChannelUnitString )
{
RiaLogging::error( QString( "Unexpected unit in file %1." ).arg( wellLogFile->fileName() ) );
}
@@ -148,12 +146,7 @@ void RimEnsembleWellLogStatistics::calculate( const std::vector<RimWellLogFile*>
}
double p10, p50, p90, mean;
RigStatisticsMath::calculateStatisticsCurves( valuesAtDepth,
&p10,
&p50,
&p90,
&mean,
RigStatisticsMath::PercentileStyle::SWITCHED );
RigStatisticsMath::calculateStatisticsCurves( valuesAtDepth, &p10, &p50, &p90, &mean, RigStatisticsMath::PercentileStyle::SWITCHED );
// TVD is the mean TVD at a given MD
std::vector<double> tvdsAtDepth;
@@ -191,11 +184,9 @@ void RimEnsembleWellLogStatistics::calculate( const std::vector<RimWellLogFile*>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEnsembleWellLogStatistics::calculateByKLayer( const std::vector<RimWellLogFile*>& wellLogFiles,
const QString& wellLogChannelName )
void RimEnsembleWellLogStatistics::calculateByKLayer( const std::vector<RimWellLogFile*>& wellLogFiles, const QString& wellLogChannelName )
{
std::shared_ptr<RigWellLogIndexDepthOffset> offsets =
RimEnsembleWellLogStatistics::calculateIndexDepthOffset( wellLogFiles );
std::shared_ptr<RigWellLogIndexDepthOffset> offsets = RimEnsembleWellLogStatistics::calculateIndexDepthOffset( wellLogFiles );
if ( !offsets ) return;
std::map<int, std::vector<double>> topValues;
@@ -250,12 +241,7 @@ void RimEnsembleWellLogStatistics::calculateByKLayer( const std::vector<RimWellL
{
std::vector<double> valuesAtDepth = topValues[kIndex];
double p10, p50, p90, mean;
RigStatisticsMath::calculateStatisticsCurves( valuesAtDepth,
&p10,
&p50,
&p90,
&mean,
RigStatisticsMath::PercentileStyle::SWITCHED );
RigStatisticsMath::calculateStatisticsCurves( valuesAtDepth, &p10, &p50, &p90, &mean, RigStatisticsMath::PercentileStyle::SWITCHED );
m_measuredDepths.push_back( offsets->getTopMd( kIndex ) );
m_tvDepths.push_back( offsets->getTopTvd( kIndex ) );
m_p10Data.push_back( p10 );
@@ -270,12 +256,7 @@ void RimEnsembleWellLogStatistics::calculateByKLayer( const std::vector<RimWellL
{
std::vector<double> valuesAtDepth = bottomValues[kIndex];
double p10, p50, p90, mean;
RigStatisticsMath::calculateStatisticsCurves( valuesAtDepth,
&p10,
&p50,
&p90,
&mean,
RigStatisticsMath::PercentileStyle::SWITCHED );
RigStatisticsMath::calculateStatisticsCurves( valuesAtDepth, &p10, &p50, &p90, &mean, RigStatisticsMath::PercentileStyle::SWITCHED );
m_measuredDepths.push_back( offsets->getBottomMd( kIndex ) );
m_tvDepths.push_back( offsets->getBottomTvd( kIndex ) );
m_p10Data.push_back( p10 );
@@ -372,8 +353,7 @@ std::shared_ptr<RigWellLogIndexDepthOffset>
if ( minLayerK > maxLayerK )
{
RiaLogging::error(
QString( "Invalid K layers found. Minimum: %1 > Maximum : %2" ).arg( minLayerK ).arg( maxLayerK ) );
RiaLogging::error( QString( "Invalid K layers found. Minimum: %1 > Maximum : %2" ).arg( minLayerK ).arg( maxLayerK ) );
return nullptr;
}

View File

@@ -65,12 +65,9 @@ public:
bool hasP90Data() const;
bool hasMeanData() const;
void calculate( const std::vector<RimWellLogFile*>& sumCases,
const QString& wellLogChannelName,
DepthEqualization depthEqualization );
void calculate( const std::vector<RimWellLogFile*>& sumCases, const QString& wellLogChannelName, DepthEqualization depthEqualization );
static std::shared_ptr<RigWellLogIndexDepthOffset>
calculateIndexDepthOffset( const std::vector<RimWellLogFile*>& wellLogFiles );
static std::shared_ptr<RigWellLogIndexDepthOffset> calculateIndexDepthOffset( const std::vector<RimWellLogFile*>& wellLogFiles );
void clearData();

View File

@@ -96,8 +96,7 @@ void RimEnsembleWellLogStatisticsCurve::performDataExtraction( bool* isUsingPseu
if ( m_ensembleWellLogCurveSet )
{
const RimEnsembleWellLogStatistics* ensembleWellLogStatistics =
m_ensembleWellLogCurveSet->ensembleWellLogStatistics();
const RimEnsembleWellLogStatistics* ensembleWellLogStatistics = m_ensembleWellLogCurveSet->ensembleWellLogStatistics();
m_ensembleWellLogCurveSet->updateStatistics();
@@ -167,8 +166,7 @@ QString RimEnsembleWellLogStatisticsCurve::createCurveAutoName()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEnsembleWellLogStatisticsCurve::addDatapointsForBottomOfSegment( std::vector<double>& depthValues,
std::vector<double>& values )
void RimEnsembleWellLogStatisticsCurve::addDatapointsForBottomOfSegment( std::vector<double>& depthValues, std::vector<double>& values )
{
std::vector<double> depthValuesWithBottomLayers;
std::vector<double> valuesWithBottomLayers;

View File

@@ -36,12 +36,10 @@ QList<caf::PdmOptionItemInfo> RimRftTools::wellLogChannelsOptions( RifReaderRftI
if ( readerRft )
{
for ( const RifEclipseRftAddress::RftWellLogChannelType& channelName :
readerRft->availableWellLogChannels( wellName ) )
for ( const RifEclipseRftAddress::RftWellLogChannelType& channelName : readerRft->availableWellLogChannels( wellName ) )
{
options.push_back(
caf::PdmOptionItemInfo( caf::AppEnum<RifEclipseRftAddress::RftWellLogChannelType>::uiText( channelName ),
channelName ) );
caf::PdmOptionItemInfo( caf::AppEnum<RifEclipseRftAddress::RftWellLogChannelType>::uiText( channelName ), channelName ) );
}
}
@@ -112,19 +110,16 @@ QList<caf::PdmOptionItemInfo> RimRftTools::segmentTimeStepOptions( RifReaderRftI
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RimRftTools::segmentResultNameOptions( RifReaderRftInterface* readerRft,
const QString& wellName,
const QDateTime& timeStep )
QList<caf::PdmOptionItemInfo>
RimRftTools::segmentResultNameOptions( RifReaderRftInterface* readerRft, const QString& wellName, const QDateTime& timeStep )
{
QList<caf::PdmOptionItemInfo> options;
options.push_front(
caf::PdmOptionItemInfo( RiaResultNames::undefinedResultName(), RiaResultNames::undefinedResultName() ) );
options.push_front( caf::PdmOptionItemInfo( RiaResultNames::undefinedResultName(), RiaResultNames::undefinedResultName() ) );
if ( readerRft )
{
options.push_back(
caf::PdmOptionItemInfo( RiaDefines::segmentNumberResultName(), RiaDefines::segmentNumberResultName() ) );
options.push_back( caf::PdmOptionItemInfo( RiaDefines::segmentNumberResultName(), RiaDefines::segmentNumberResultName() ) );
for ( const auto& resultAdr : readerRft->eclipseRftAddresses( wellName, timeStep ) )
{

View File

@@ -34,9 +34,8 @@ class RimRftTools
public:
static QList<caf::PdmOptionItemInfo> wellLogChannelsOptions( RifReaderRftInterface* readerRft, const QString& wellName );
static QList<caf::PdmOptionItemInfo> wellNameOptions( RifReaderRftInterface* readerRft );
static QList<caf::PdmOptionItemInfo> timeStepOptions( RifReaderRftInterface* readerRft,
const QString& wellName,
RifEclipseRftAddress::RftWellLogChannelType channelType );
static QList<caf::PdmOptionItemInfo>
timeStepOptions( RifReaderRftInterface* readerRft, const QString& wellName, RifEclipseRftAddress::RftWellLogChannelType channelType );
static QList<caf::PdmOptionItemInfo> segmentTimeStepOptions( RifReaderRftInterface* readerRft, const QString& wellName );

View File

@@ -121,10 +121,7 @@ RimRftTopologyCurve* RimRftTopologyCurve::createTopologyCurve( RimSummaryCase*
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimRftTopologyCurve::setDataSource( RimSummaryCase* summaryCase,
const QDateTime& timeStep,
const QString& wellName,
int segmentBranchIndex )
void RimRftTopologyCurve::setDataSource( RimSummaryCase* summaryCase, const QDateTime& timeStep, const QString& wellName, int segmentBranchIndex )
{
m_summaryCase = summaryCase;
m_timeStep = timeStep;
@@ -259,10 +256,7 @@ QList<caf::PdmOptionItemInfo> RimRftTopologyCurve::calculateValueOptions( const
}
else if ( fieldNeedingOptions == &m_segmentBranchIndex )
{
options = RimRftTools::segmentBranchIndexOptions( reader,
m_wellName(),
m_timeStep(),
RiaDefines::RftBranchType::RFT_UNKNOWN );
options = RimRftTools::segmentBranchIndexOptions( reader, m_wellName(), m_timeStep(), RiaDefines::RftBranchType::RFT_UNKNOWN );
}
return options;
@@ -271,9 +265,7 @@ QList<caf::PdmOptionItemInfo> RimRftTopologyCurve::calculateValueOptions( const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimRftTopologyCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void RimRftTopologyCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
RimWellLogCurve::fieldChangedByUi( changedField, oldValue, newValue );

View File

@@ -47,10 +47,8 @@ public:
public:
RimRftTopologyCurve();
static RimRftTopologyCurve* createPackerCurve( RimSummaryCase* summaryCase,
const QDateTime& timeStep,
const QString& wellName,
int segmentBranchIndex );
static RimRftTopologyCurve*
createPackerCurve( RimSummaryCase* summaryCase, const QDateTime& timeStep, const QString& wellName, int segmentBranchIndex );
static RimRftTopologyCurve* createTopologyCurve( RimSummaryCase* summaryCase,
const QDateTime& timeStep,
@@ -74,7 +72,7 @@ protected:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void onLoadDataAndUpdate( bool updateParentPlot ) override;

View File

@@ -54,8 +54,7 @@ RimWellLogCurve::RimWellLogCurve()
m_curveData = new RigWellLogCurveData;
m_curveDataPropertyValueRange =
std::make_pair( std::numeric_limits<double>::infinity(), -std::numeric_limits<double>::infinity() );
m_curveDataPropertyValueRange = std::make_pair( std::numeric_limits<double>::infinity(), -std::numeric_limits<double>::infinity() );
setDeletable( true );
}
@@ -139,12 +138,12 @@ void RimWellLogCurve::setPropertyValuesAndDepths( const std::vector<double>& pro
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogCurve::setPropertyValuesAndDepths( const std::vector<double>& propertyValues,
void RimWellLogCurve::setPropertyValuesAndDepths( const std::vector<double>& propertyValues,
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& depths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
bool useLogarithmicScale,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
bool useLogarithmicScale,
const QString& propertyUnit )
{
@@ -183,8 +182,7 @@ void RimWellLogCurve::setPropertyAndDepthsAndErrors( const std::vector<double>&
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogCurve::setPropertyAndDepthValuesToPlotCurve( const std::vector<double>& propertyValues,
const std::vector<double>& depthValues )
void RimWellLogCurve::setPropertyAndDepthValuesToPlotCurve( const std::vector<double>& propertyValues, const std::vector<double>& depthValues )
{
if ( !m_plotCurve ) return;
@@ -210,10 +208,8 @@ void RimWellLogCurve::setPropertyValuesWithMdAndTVD( const std::vector<double>&
bool useLogarithmicScale,
const QString& propertyUnit )
{
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> depths = { { RiaDefines::DepthTypeEnum::MEASURED_DEPTH,
measuredDepths },
{ RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH,
tvdMSL } };
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> depths = { { RiaDefines::DepthTypeEnum::MEASURED_DEPTH, measuredDepths },
{ RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, tvdMSL } };
setPropertyValuesAndDepths( propertyValues, depths, rkbDiff, depthUnit, isExtractionCurve, useLogarithmicScale, propertyUnit );
}
@@ -348,8 +344,7 @@ void RimWellLogCurve::updateZoomInParentPlot()
wellLogPlot->availableDepthRange( &minPlotDepth, &maxPlotDepth );
bool updateDepthZoom = false;
if ( minPlotDepth == std::numeric_limits<double>::infinity() ||
maxPlotDepth == -std::numeric_limits<double>::infinity() )
if ( minPlotDepth == std::numeric_limits<double>::infinity() || maxPlotDepth == -std::numeric_limits<double>::infinity() )
{
updateDepthZoom = true;
}
@@ -357,12 +352,8 @@ void RimWellLogCurve::updateZoomInParentPlot()
{
double plotRange = std::abs( maxPlotDepth - minPlotDepth );
double minCurveDepth, maxCurveDepth;
m_curveData->calculateDepthRange( wellLogPlot->depthType(),
wellLogPlot->depthUnit(),
&minCurveDepth,
&maxCurveDepth );
updateDepthZoom = minCurveDepth < minPlotDepth - eps * plotRange ||
maxCurveDepth > maxPlotDepth + eps * plotRange;
m_curveData->calculateDepthRange( wellLogPlot->depthType(), wellLogPlot->depthUnit(), &minCurveDepth, &maxCurveDepth );
updateDepthZoom = minCurveDepth < minPlotDepth - eps * plotRange || maxCurveDepth > maxPlotDepth + eps * plotRange;
}
if ( updateDepthZoom )
{
@@ -400,8 +391,7 @@ void RimWellLogCurve::setOverrideCurveDataPropertyValueRange( double minimumValu
void RimWellLogCurve::calculateCurveDataPropertyValueRange()
{
// Invalidate range first
m_curveDataPropertyValueRange =
std::make_pair( std::numeric_limits<double>::infinity(), -std::numeric_limits<double>::infinity() );
m_curveDataPropertyValueRange = std::make_pair( std::numeric_limits<double>::infinity(), -std::numeric_limits<double>::infinity() );
for ( double xValue : m_curveData->propertyValues() )
{
if ( RiaCurveDataTools::isValidValue( xValue, false ) )
@@ -415,9 +405,7 @@ void RimWellLogCurve::calculateCurveDataPropertyValueRange()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void RimWellLogCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
RimStackablePlotCurve::fieldChangedByUi( changedField, oldValue, newValue );

View File

@@ -80,7 +80,7 @@ protected:
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
bool useLogarithmicScale,
const QString& propertyUnit = RiaWellLogUnitTools<double>::noUnitString() );
const QString& propertyUnit = RiaWellLogUnitTools<double>::noUnitString() );
void setPropertyValuesWithMdAndTVD( const std::vector<double>& propertyValues,
const std::vector<double>& measuredDepths,
@@ -89,17 +89,16 @@ protected:
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
bool useLogarithmicScale,
const QString& propertyUnit = RiaWellLogUnitTools<double>::noUnitString() );
const QString& propertyUnit = RiaWellLogUnitTools<double>::noUnitString() );
void setPropertyAndDepthValuesToPlotCurve( const std::vector<double>& propertyValues,
const std::vector<double>& depthValues );
void setPropertyAndDepthValuesToPlotCurve( const std::vector<double>& propertyValues, const std::vector<double>& depthValues );
void setPropertyValuesAndDepths( const std::vector<double>& propertyValues,
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& depths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
bool useLogarithmicScale,
bool useLogarithmicScale,
const QString& propertyUnit = RiaWellLogUnitTools<double>::noUnitString() );
void setPropertyAndDepthsAndErrors( const std::vector<double>& propertyValues,

View File

@@ -388,8 +388,7 @@ void RimWellLogCurveCommonDataSource::analyseCurvesAndTracks( const std::vector<
m_uniqueWellNames.insert( rftCurve->wellName() );
auto adr = rftCurve->rftAddress();
if ( adr.wellLogChannel() == RifEclipseRftAddress::RftWellLogChannelType::SEGMENT_VALUES &&
adr.segmentResultName() != "None" )
if ( adr.wellLogChannel() == RifEclipseRftAddress::RftWellLogChannelType::SEGMENT_VALUES && adr.segmentResultName() != "None" )
{
m_uniqueRftWellNames.insert( adr.wellName() );
m_uniqueRftTimeSteps.insert( adr.timeStep() );
@@ -448,8 +447,7 @@ void RimWellLogCurveCommonDataSource::analyseCurvesAndTracks( const std::vector<
}
if ( m_uniqueBranchDetection.size() == 1u )
{
setBranchDetectionToApply( *m_uniqueBranchDetection.begin() == true ? caf::Tristate::State::True
: caf::Tristate::State::False );
setBranchDetectionToApply( *m_uniqueBranchDetection.begin() == true ? caf::Tristate::State::True : caf::Tristate::State::False );
}
if ( m_uniqueWellNames.size() == 1u )
{
@@ -464,8 +462,7 @@ void RimWellLogCurveCommonDataSource::analyseCurvesAndTracks( const std::vector<
if ( m_uniqueWbsSmoothing.size() == 1u )
{
setWbsSmoothingToApply( *m_uniqueWbsSmoothing.begin() == true ? caf::Tristate::State::True
: caf::Tristate::State::False );
setWbsSmoothingToApply( *m_uniqueWbsSmoothing.begin() == true ? caf::Tristate::State::True : caf::Tristate::State::False );
}
if ( m_uniqueWbsSmoothingThreshold.size() == 1u )
@@ -540,8 +537,7 @@ void RimWellLogCurveCommonDataSource::applyDataSourceChanges( const std::vector<
fileCurve->setWellPath( wellPathToApply() );
if ( !fileCurve->wellLogChannelUiName().isEmpty() )
{
RimWellLogFile* logFile =
wellPathToApply()->firstWellLogFileMatchingChannelName( fileCurve->wellLogChannelUiName() );
RimWellLogFile* logFile = wellPathToApply()->firstWellLogFileMatchingChannelName( fileCurve->wellLogChannelUiName() );
fileCurve->setWellLogFile( logFile );
RimWellLogPlot* parentPlot = nullptr;
fileCurve->firstAncestorOrThisOfTypeAsserted( parentPlot );
@@ -566,8 +562,7 @@ void RimWellLogCurveCommonDataSource::applyDataSourceChanges( const std::vector<
if ( m_trajectoryType() != -1 )
{
extractionCurve->setTrajectoryType(
static_cast<RimWellLogExtractionCurve::TrajectoryType>( m_trajectoryType() ) );
extractionCurve->setTrajectoryType( static_cast<RimWellLogExtractionCurve::TrajectoryType>( m_trajectoryType() ) );
if ( m_trajectoryType() == (int)RimWellLogExtractionCurve::SIMULATION_WELL )
{
if ( m_branchDetection().isTrue() )
@@ -831,9 +826,7 @@ QString RimWellLogCurveCommonDataSource::smoothingUiOrderinglabel()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogCurveCommonDataSource::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void RimWellLogCurveCommonDataSource::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
RimWellLogPlot* parentPlot = nullptr;
this->firstAncestorOrThisOfType( parentPlot );
@@ -862,8 +855,7 @@ void RimWellLogCurveCommonDataSource::fieldChangedByUi( const caf::PdmFieldHandl
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo>
RimWellLogCurveCommonDataSource::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
QList<caf::PdmOptionItemInfo> RimWellLogCurveCommonDataSource::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
{
QList<caf::PdmOptionItemInfo> options;
@@ -875,10 +867,8 @@ QList<caf::PdmOptionItemInfo>
{
RimTools::geoMechCaseOptionItems( &options );
}
else if ( m_caseType == RiaDefines::CaseType::ECLIPSE_RESULT_CASE ||
m_caseType == RiaDefines::CaseType::ECLIPSE_INPUT_CASE ||
m_caseType == RiaDefines::CaseType::ECLIPSE_SOURCE_CASE ||
m_caseType == RiaDefines::CaseType::ECLIPSE_STAT_CASE )
else if ( m_caseType == RiaDefines::CaseType::ECLIPSE_RESULT_CASE || m_caseType == RiaDefines::CaseType::ECLIPSE_INPUT_CASE ||
m_caseType == RiaDefines::CaseType::ECLIPSE_SOURCE_CASE || m_caseType == RiaDefines::CaseType::ECLIPSE_STAT_CASE )
{
RimTools::eclipseCaseOptionItems( &options );
}
@@ -1009,8 +999,7 @@ QList<caf::PdmOptionItemInfo>
}
else if ( fieldNeedingOptions == &m_rftSegmentBranchIndex )
{
options =
RimRftTools::segmentBranchIndexOptions( rftReader(), m_rftWellName(), m_rftTimeStep(), m_rftSegmentBranchType() );
options = RimRftTools::segmentBranchIndexOptions( rftReader(), m_rftWellName(), m_rftTimeStep(), m_rftSegmentBranchType() );
}
return options;
@@ -1086,9 +1075,8 @@ void RimWellLogCurveCommonDataSource::defineEditorAttribute( const caf::PdmField
auto* myAttr = dynamic_cast<caf::PdmUiComboBoxEditorAttribute*>( attribute );
if ( myAttr )
{
if ( field == &m_case || field == &m_summaryCase || field == &m_simWellName || field == &m_wellPath ||
field == &m_timeStep || field == &m_rftTimeStep || field == &m_rftSegmentBranchIndex ||
field == &m_rftWellName )
if ( field == &m_case || field == &m_summaryCase || field == &m_simWellName || field == &m_wellPath || field == &m_timeStep ||
field == &m_rftTimeStep || field == &m_rftSegmentBranchIndex || field == &m_rftWellName )
{
myAttr->showPreviousAndNextButtons = true;
myAttr->nextIcon = QIcon( ":/ComboBoxDown.svg" );
@@ -1125,8 +1113,7 @@ void RimWellLogCurveCommonDataSource::defineEditorAttribute( const caf::PdmField
if ( m_uniqueWbsSmoothingThreshold.size() > 1u )
{
auto minmax_it =
std::minmax_element( m_uniqueWbsSmoothingThreshold.begin(), m_uniqueWbsSmoothingThreshold.end() );
auto minmax_it = std::minmax_element( m_uniqueWbsSmoothingThreshold.begin(), m_uniqueWbsSmoothingThreshold.end() );
displayString += QString( " [%1, %2]" ).arg( *( minmax_it.first ) ).arg( *( minmax_it.second ) );
}
@@ -1172,9 +1159,8 @@ void RimWellLogCurveCommonDataSource::selectWell( QString wellName )
{
if ( opt.optionUiText() == wellName )
{
QVariant oldPath = m_wellPath.toQVariant();
RimWellPath* wellPath =
RimProject::current()->activeOilField()->wellPathCollection->wellPathByName( wellName );
QVariant oldPath = m_wellPath.toQVariant();
RimWellPath* wellPath = RimProject::current()->activeOilField()->wellPathCollection->wellPathByName( wellName );
m_wellPath = wellPath;
m_wellPath.uiCapability()->notifyFieldChanged( oldPath, opt.value() );

View File

@@ -104,14 +104,12 @@ public:
static QString smoothingUiOrderinglabel();
private:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
void modifyCurrentIndex( caf::PdmValueField* field, int indexOffset );
void resetSourceStepFields();
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
void modifyCurrentIndex( caf::PdmValueField* field, int indexOffset );
void resetSourceStepFields();
RifReaderRftInterface* rftReader();

View File

@@ -269,8 +269,7 @@ void RimWellLogExtractionCurve::clampTimestep()
//--------------------------------------------------------------------------------------------------
void RimWellLogExtractionCurve::clampBranchIndex()
{
int branchCount =
static_cast<int>( RiaSimWellBranchTools::simulationWellBranches( m_simWellName, m_branchDetection ).size() );
int branchCount = static_cast<int>( RiaSimWellBranchTools::simulationWellBranches( m_simWellName, m_branchDetection ).size() );
if ( branchCount > 0 )
{
if ( m_branchIndex >= branchCount )
@@ -287,9 +286,7 @@ void RimWellLogExtractionCurve::clampBranchIndex()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogExtractionCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void RimWellLogExtractionCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
RimWellLogCurve::fieldChangedByUi( changedField, oldValue, newValue );
@@ -335,8 +332,7 @@ void RimWellLogExtractionCurve::fieldChangedByUi( const caf::PdmFieldHandle* cha
}
if ( changedField == &m_addCaseNameToCurveName || changedField == &m_addPropertyToCurveName ||
changedField == &m_addWellNameToCurveName || changedField == &m_addTimestepToCurveName ||
changedField == &m_addDateToCurveName )
changedField == &m_addWellNameToCurveName || changedField == &m_addTimestepToCurveName || changedField == &m_addDateToCurveName )
{
this->uiCapability()->updateConnectedEditors();
updateCurveNameAndUpdatePlotLegendAndTitle();
@@ -364,8 +360,7 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate( bool updateParentPlot )
RiaDefines::DepthTypeEnum depthType = wellLogPlot->depthType();
RiaDefines::DepthUnitType displayUnit = wellLogPlot->depthUnit();
if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH ||
depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB )
if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH || depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB )
{
isUsingPseudoLength = false;
}
@@ -432,9 +427,7 @@ void RimWellLogExtractionCurve::performDataExtraction( bool* isUsingPseudoLength
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength,
bool performDataSmoothing /*= false*/,
double smoothingThreshold /*= -1.0 */ )
void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength, bool performDataSmoothing /*= false*/, double smoothingThreshold /*= -1.0 */ )
{
CAF_ASSERT( isUsingPseudoLength );
@@ -496,8 +489,8 @@ void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength,
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogExtractionCurve::WellLogExtractionCurveData
RimWellLogExtractionCurve::extractEclipseData( RimEclipseCase* eclipseCase, bool* isUsingPseudoLength )
RimWellLogExtractionCurve::WellLogExtractionCurveData RimWellLogExtractionCurve::extractEclipseData( RimEclipseCase* eclipseCase,
bool* isUsingPseudoLength )
{
WellLogExtractionCurveData curveData;
RimWellLogPlotCollection* wellLogCollection = RimMainPlotCollection::current()->wellLogPlotCollection();
@@ -512,8 +505,7 @@ RimWellLogExtractionCurve::WellLogExtractionCurveData
}
else
{
std::vector<const RigWellPath*> simWellBranches =
RiaSimWellBranchTools::simulationWellBranches( m_simWellName, m_branchDetection );
std::vector<const RigWellPath*> simWellBranches = RiaSimWellBranchTools::simulationWellBranches( m_simWellName, m_branchDetection );
if ( m_branchIndex >= 0 && m_branchIndex < static_cast<int>( simWellBranches.size() ) )
{
auto wellBranch = simWellBranches[m_branchIndex];
@@ -538,10 +530,8 @@ RimWellLogExtractionCurve::WellLogExtractionCurveData
m_eclipseResultDefinition->loadResult();
resAcc = RigResultAccessorFactory::createFromResultDefinition( eclipseCase->eclipseCaseData(),
0,
m_timeStep,
m_eclipseResultDefinition );
resAcc =
RigResultAccessorFactory::createFromResultDefinition( eclipseCase->eclipseCaseData(), 0, m_timeStep, m_eclipseResultDefinition );
if ( resAcc.notNull() )
{
wellExtractor->curveData( resAcc.p(), &curveData.values );
@@ -559,8 +549,7 @@ RimWellLogExtractionCurve::WellLogExtractionCurveData
// Reference well adjustment does not support simulated wells
if ( m_trajectoryType == WELL_PATH && wellExtractor.notNull() && refWellExtractor.notNull() )
{
RigEclipseResultAddress indexKResAdr( RiaDefines::ResultCatType::STATIC_NATIVE,
RiaResultNames::indexKResultName() );
RigEclipseResultAddress indexKResAdr( RiaDefines::ResultCatType::STATIC_NATIVE, RiaResultNames::indexKResultName() );
eclipseCase->eclipseCaseData()->results( RiaDefines::PorosityModelType::MATRIX_MODEL )->ensureKnownResultLoaded( indexKResAdr );
cvf::ref<RigResultAccessor> indexKResAcc =
@@ -603,20 +592,17 @@ RimWellLogExtractionCurve::WellLogExtractionCurveData
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogExtractionCurve::WellLogExtractionCurveData
RimWellLogExtractionCurve::extractGeomData( RimGeoMechCase* geomCase,
bool* isUsingPseudoLength,
bool performDataSmoothing,
double smoothingThreshold )
RimWellLogExtractionCurve::WellLogExtractionCurveData RimWellLogExtractionCurve::extractGeomData( RimGeoMechCase* geomCase,
bool* isUsingPseudoLength,
bool performDataSmoothing,
double smoothingThreshold )
{
WellLogExtractionCurveData curveData;
RimWellLogPlotCollection* wellLogCollection = RimMainPlotCollection::current()->wellLogPlotCollection();
cvf::ref<RigGeoMechWellLogExtractor> wellExtractor = wellLogCollection->findOrCreateExtractor( m_wellPath, geomCase );
cvf::ref<RigGeoMechWellLogExtractor> refWellExtractor =
wellLogCollection->findOrCreateExtractor( m_refWellPath, geomCase );
cvf::ref<RigGeoMechWellLogExtractor> wellExtractor = wellLogCollection->findOrCreateExtractor( m_wellPath, geomCase );
cvf::ref<RigGeoMechWellLogExtractor> refWellExtractor = wellLogCollection->findOrCreateExtractor( m_refWellPath, geomCase );
auto [timeStepIdx, frameIdx] =
geomCase->geoMechData()->femPartResults()->stepListIndexToTimeStepAndDataFrameIndex( m_timeStep );
auto [timeStepIdx, frameIdx] = geomCase->geoMechData()->femPartResults()->stepListIndexToTimeStepAndDataFrameIndex( m_timeStep );
if ( wellExtractor.notNull() )
{
@@ -638,8 +624,7 @@ RimWellLogExtractionCurve::WellLogExtractionCurveData
}
m_geomResultDefinition->loadResult();
curveData.xUnits =
wellExtractor->curveData( m_geomResultDefinition->resultAddress(), timeStepIdx, frameIdx, &curveData.values );
curveData.xUnits = wellExtractor->curveData( m_geomResultDefinition->resultAddress(), timeStepIdx, frameIdx, &curveData.values );
}
// Do not adjust depth values of Azimuth and Inclination as they are dependent
@@ -716,8 +701,7 @@ void RimWellLogExtractionCurve::mapPropertyValuesFromReferenceWell( std::vector<
const std::vector<double>& refWellIndexKValues )
{
// TODO: Add asserts and checks
CAF_ASSERT( rMeasuredDepthValues.size() == rTvDepthValues.size() &&
"Number of depth values must be equal for well!" );
CAF_ASSERT( rMeasuredDepthValues.size() == rTvDepthValues.size() && "Number of depth values must be equal for well!" );
CAF_ASSERT( rMeasuredDepthValues.size() == rPropertyValues.size() &&
"Number of property values must be equal number of depth values for well!" );
CAF_ASSERT( rMeasuredDepthValues.size() == indexKValues.size() &&
@@ -733,16 +717,13 @@ void RimWellLogExtractionCurve::mapPropertyValuesFromReferenceWell( std::vector<
"Both index-K value vectors must contain common min index-K layer" );
// Find common min and max k-index value for range of depth values to adjust
const auto minLayerK =
static_cast<int>( std::max( *std::min_element( refWellIndexKValues.cbegin(), refWellIndexKValues.cend() ),
*std::min_element( indexKValues.cbegin(), indexKValues.cend() ) ) );
const auto maxLayerK =
static_cast<int>( std::min( *std::max_element( refWellIndexKValues.cbegin(), refWellIndexKValues.cend() ),
*std::max_element( indexKValues.cbegin(), indexKValues.cend() ) ) );
const auto minLayerK = static_cast<int>( std::max( *std::min_element( refWellIndexKValues.cbegin(), refWellIndexKValues.cend() ),
*std::min_element( indexKValues.cbegin(), indexKValues.cend() ) ) );
const auto maxLayerK = static_cast<int>( std::min( *std::max_element( refWellIndexKValues.cbegin(), refWellIndexKValues.cend() ),
*std::max_element( indexKValues.cbegin(), indexKValues.cend() ) ) );
if ( minLayerK > maxLayerK )
{
RiaLogging::error(
QString( "Invalid K layers found. Minimum: %1 > Maximum : %2" ).arg( minLayerK ).arg( maxLayerK ) );
RiaLogging::error( QString( "Invalid K layers found. Minimum: %1 > Maximum : %2" ).arg( minLayerK ).arg( maxLayerK ) );
return;
}
@@ -763,8 +744,7 @@ void RimWellLogExtractionCurve::mapPropertyValuesFromReferenceWell( std::vector<
};
RigWellLogIndexDepthOffset wellLogIndexDepthOffset;
std::map<int, std::vector<size_t>> wellKLayerAndIndexesMap =
createKLayerAndIndexMap( indexKValues, minLayerK, maxLayerK );
std::map<int, std::vector<size_t>> wellKLayerAndIndexesMap = createKLayerAndIndexMap( indexKValues, minLayerK, maxLayerK );
for ( const auto& [kLayer, indexes] : wellKLayerAndIndexesMap )
{
if ( indexes.empty() ) continue;
@@ -777,11 +757,10 @@ void RimWellLogExtractionCurve::mapPropertyValuesFromReferenceWell( std::vector<
rTvDepthValues[indexBottom] );
}
std::vector<double> propertyValues = {};
std::vector<double> measuredDepthValues = {};
std::vector<double> tvDepthValues = {};
std::map<int, std::vector<size_t>> refWellKLayerAndIndexesMap =
createKLayerAndIndexMap( refWellIndexKValues, minLayerK, maxLayerK );
std::vector<double> propertyValues = {};
std::vector<double> measuredDepthValues = {};
std::vector<double> tvDepthValues = {};
std::map<int, std::vector<size_t>> refWellKLayerAndIndexesMap = createKLayerAndIndexMap( refWellIndexKValues, minLayerK, maxLayerK );
for ( const auto& [kLayer, indexes] : refWellKLayerAndIndexesMap )
{
if ( indexes.empty() || !wellLogIndexDepthOffset.hasIndex( kLayer ) ) continue;
@@ -840,8 +819,7 @@ void RimWellLogExtractionCurve::mapPropertyValuesFromReferenceWell( std::vector<
//--------------------------------------------------------------------------------------------------
/// Search well path for LAS-files containing Well Bore Stability data and set them in the extractor.
//--------------------------------------------------------------------------------------------------
void RimWellLogExtractionCurve::findAndLoadWbsParametersFromLasFiles( const RimWellPath* wellPath,
RigGeoMechWellLogExtractor* geomExtractor )
void RimWellLogExtractionCurve::findAndLoadWbsParametersFromLasFiles( const RimWellPath* wellPath, RigGeoMechWellLogExtractor* geomExtractor )
{
auto allParams = RigWbsParameter::allParameters();
for ( const RigWbsParameter& parameter : allParams )
@@ -855,19 +833,14 @@ void RimWellLogExtractionCurve::findAndLoadWbsParametersFromLasFiles( const RimW
{
QString extractorUnits = geomExtractor->parameterInputUnits( parameter );
if ( RiaWellLogUnitTools<double>::convertValues( &lasFileValues,
lasUnits,
extractorUnits,
wellPath->wellPathGeometry() ) )
if ( RiaWellLogUnitTools<double>::convertValues( &lasFileValues, lasUnits, extractorUnits, wellPath->wellPathGeometry() ) )
{
geomExtractor->setWbsLasValues( parameter, lasFileValues );
}
else
{
QString errMsg = QString( "Could not convert units of LAS-channel %1 from %2 to %3" )
.arg( lasAddress )
.arg( lasUnits )
.arg( extractorUnits );
QString errMsg =
QString( "Could not convert units of LAS-channel %1 from %2 to %3" ).arg( lasAddress ).arg( lasUnits ).arg( extractorUnits );
RiaLogging::error( errMsg );
}
}
@@ -877,11 +850,7 @@ void RimWellLogExtractionCurve::findAndLoadWbsParametersFromLasFiles( const RimW
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogExtractionCurve::setAutoNameComponents( bool addCaseName,
bool addProperty,
bool addWellname,
bool addTimeStep,
bool addDate )
void RimWellLogExtractionCurve::setAutoNameComponents( bool addCaseName, bool addProperty, bool addWellname, bool addTimeStep, bool addDate )
{
m_addCaseNameToCurveName = addCaseName;
m_addPropertyToCurveName = addProperty;
@@ -964,8 +933,7 @@ void RimWellLogExtractionCurve::clearGeneratedSimWellPaths()
m_wellPathsWithExtractors.clear();
}
QList<caf::PdmOptionItemInfo>
RimWellLogExtractionCurve::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
QList<caf::PdmOptionItemInfo> RimWellLogExtractionCurve::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
{
QList<caf::PdmOptionItemInfo> options;
@@ -1098,8 +1066,7 @@ QString RimWellLogExtractionCurve::dataSourceGroupKeyword()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogExtractionCurve::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering,
QString uiConfigName /*= ""*/ )
void RimWellLogExtractionCurve::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/ )
{
uiTreeOrdering.skipRemainingChildren( true );
}
@@ -1159,8 +1126,7 @@ QString RimWellLogExtractionCurve::createCurveAutoName()
{
if ( eclipseCase->eclipseCaseData() )
{
maxTimeStep =
eclipseCase->eclipseCaseData()->results( m_eclipseResultDefinition->porosityModel() )->maxTimeStepCount();
maxTimeStep = eclipseCase->eclipseCaseData()->results( m_eclipseResultDefinition->porosityModel() )->maxTimeStepCount();
}
}
else if ( geomCase )

View File

@@ -91,10 +91,9 @@ public:
void setBranchDetection( bool branchDetection );
void setBranchIndex( int index );
static void findAndLoadWbsParametersFromLasFiles( const RimWellPath* wellPath,
RigGeoMechWellLogExtractor* geomExtractor );
static void findAndLoadWbsParametersFromLasFiles( const RimWellPath* wellPath, RigGeoMechWellLogExtractor* geomExtractor );
void setAutoNameComponents( bool addCaseName, bool addProperty, bool addWellname, bool addTimeStep, bool addDate );
void setAutoNameComponents( bool addCaseName, bool addProperty, bool addWellname, bool addTimeStep, bool addDate );
RiaDefines::PhaseType phaseType() const override;
static QString wellDateFromGridCaseModel( RimCase* gridCaseModel, int timeStep );
@@ -106,7 +105,7 @@ protected:
void connectCaseSignals( RimCase* rimCase );
virtual void performDataExtraction( bool* isUsingPseudoLength );
void extractData( bool* isUsingPseudoLength, bool performDataSmoothing = false, double smoothingThreshold = -1.0 );
void extractData( bool* isUsingPseudoLength, bool performDataSmoothing = false, double smoothingThreshold = -1.0 );
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;

View File

@@ -236,8 +236,8 @@ bool RimWellLogFile::hasFlowData() const
///
//--------------------------------------------------------------------------------------------------
std::vector<std::pair<double, double>> RimWellLogFile::findMdAndChannelValuesForWellPath( const RimWellPath* wellPath,
const QString& channelName,
QString* unitString /*=nullptr*/ )
const QString& channelName,
QString* unitString /*=nullptr*/ )
{
CVF_ASSERT( wellPath );
std::vector<RimWellLogFile*> wellLogFiles;
@@ -298,9 +298,7 @@ void RimWellLogFile::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogFile::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void RimWellLogFile::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
if ( changedField == &m_date )
{
@@ -312,9 +310,7 @@ void RimWellLogFile::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogFile::defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute )
void RimWellLogFile::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
{
caf::PdmUiDateEditorAttribute* attrib = dynamic_cast<caf::PdmUiDateEditorAttribute*>( attribute );
if ( attrib != nullptr )

View File

@@ -70,17 +70,14 @@ public:
RimWellLogFile::WellFlowCondition wellFlowRateCondition() const { return m_wellFlowCondition(); }
static std::vector<std::pair<double, double>> findMdAndChannelValuesForWellPath( const RimWellPath* wellPath,
const QString& channelName,
QString* unitString = nullptr );
static std::vector<std::pair<double, double>>
findMdAndChannelValuesForWellPath( const RimWellPath* wellPath, const QString& channelName, QString* unitString = nullptr );
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;
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
caf::PdmFieldHandle* userDescriptionField() override { return &m_name; }

View File

@@ -303,9 +303,7 @@ void RimWellLogFileCurve::setIndexDepthOffsets( std::shared_ptr<RigWellLogIndexD
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogFileCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void RimWellLogFileCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
RimWellLogCurve::fieldChangedByUi( changedField, oldValue, newValue );

View File

@@ -70,10 +70,9 @@ protected:
bool isRftPlotChild() const;
std::pair<std::vector<double>, std::vector<double>>
adjustByIndexDepthOffsets( const std::vector<double>& measuredDepthValues,
const std::vector<double>& values,
const std::vector<double>& kIndexValues ) const;
std::pair<std::vector<double>, std::vector<double>> adjustByIndexDepthOffsets( const std::vector<double>& measuredDepthValues,
const std::vector<double>& values,
const std::vector<double>& kIndexValues ) const;
protected:
caf::PdmPtrField<RimWellPath*> m_wellPath;

View File

@@ -56,10 +56,7 @@ CAF_PDM_SOURCE_INIT( RimWellLogPlot, "WellLogPlot" );
//--------------------------------------------------------------------------------------------------
RimWellLogPlot::RimWellLogPlot()
{
CAF_PDM_InitScriptableObject( "Well Log Plot",
":/WellLogPlot16x16.png",
"",
"A Well Log Plot With a shared Depth Axis and Multiple Tracks" );
CAF_PDM_InitScriptableObject( "Well Log Plot", ":/WellLogPlot16x16.png", "", "A Well Log Plot With a shared Depth Axis and Multiple Tracks" );
setDeletable( true );
}

View File

@@ -62,9 +62,9 @@ RimWellLogPlotCollection::~RimWellLogPlotCollection()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigEclipseWellLogExtractor* RimWellLogPlotCollection::findOrCreateSimWellExtractor( const QString& simWellName,
const QString& caseUserDescription,
const RigWellPath* wellPathGeometry,
RigEclipseWellLogExtractor* RimWellLogPlotCollection::findOrCreateSimWellExtractor( const QString& simWellName,
const QString& caseUserDescription,
const RigWellPath* wellPathGeometry,
const RigEclipseCaseData* eclCaseData )
{
if ( !( wellPathGeometry && eclCaseData ) ) return nullptr;
@@ -78,8 +78,7 @@ RigEclipseWellLogExtractor* RimWellLogPlotCollection::findOrCreateSimWellExtract
}
std::string errorIdName = ( simWellName + " " + caseUserDescription ).toStdString();
cvf::ref<RigEclipseWellLogExtractor> extractor =
new RigEclipseWellLogExtractor( eclCaseData, wellPathGeometry, errorIdName );
cvf::ref<RigEclipseWellLogExtractor> extractor = new RigEclipseWellLogExtractor( eclCaseData, wellPathGeometry, errorIdName );
m_extractors.push_back( extractor.p() );
return extractor.p();
@@ -105,9 +104,8 @@ RigEclipseWellLogExtractor* RimWellLogPlotCollection::findOrCreateExtractor( Rim
}
}
std::string errorIdName = ( wellPath->name() + " " + eclCase->caseUserDescription() ).toStdString();
cvf::ref<RigEclipseWellLogExtractor> extractor =
new RigEclipseWellLogExtractor( eclCaseData, wellPathGeometry, errorIdName );
std::string errorIdName = ( wellPath->name() + " " + eclCase->caseUserDescription() ).toStdString();
cvf::ref<RigEclipseWellLogExtractor> extractor = new RigEclipseWellLogExtractor( eclCaseData, wellPathGeometry, errorIdName );
m_extractors.push_back( extractor.p() );
return extractor.p();
@@ -116,8 +114,7 @@ RigEclipseWellLogExtractor* RimWellLogPlotCollection::findOrCreateExtractor( Rim
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigGeoMechWellLogExtractor* RimWellLogPlotCollection::findOrCreateExtractor( RimWellPath* wellPath,
RimGeoMechCase* geoMechCase )
RigGeoMechWellLogExtractor* RimWellLogPlotCollection::findOrCreateExtractor( RimWellPath* wellPath, RimGeoMechCase* geoMechCase )
{
if ( !( wellPath && geoMechCase ) ) return nullptr;
@@ -127,16 +124,14 @@ RigGeoMechWellLogExtractor* RimWellLogPlotCollection::findOrCreateExtractor( Rim
for ( size_t exIdx = 0; exIdx < m_geomExtractors.size(); ++exIdx )
{
if ( m_geomExtractors[exIdx]->caseData() == caseData &&
m_geomExtractors[exIdx]->wellPathGeometry() == wellPathGeometry )
if ( m_geomExtractors[exIdx]->caseData() == caseData && m_geomExtractors[exIdx]->wellPathGeometry() == wellPathGeometry )
{
return m_geomExtractors[exIdx].p();
}
}
std::string errorIdName = ( wellPath->name() + " " + geoMechCase->caseUserDescription() ).toStdString();
cvf::ref<RigGeoMechWellLogExtractor> extractor =
new RigGeoMechWellLogExtractor( caseData, wellPathGeometry, errorIdName );
std::string errorIdName = ( wellPath->name() + " " + geoMechCase->caseUserDescription() ).toStdString();
cvf::ref<RigGeoMechWellLogExtractor> extractor = new RigGeoMechWellLogExtractor( caseData, wellPathGeometry, errorIdName );
m_geomExtractors.push_back( extractor.p() );
return extractor.p();
@@ -248,8 +243,7 @@ void RimWellLogPlotCollection::removeExtractors( const RigGeoMechCaseData* caseD
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlotCollection::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
std::vector<caf::PdmObjectHandle*>& referringObjects )
void RimWellLogPlotCollection::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, std::vector<caf::PdmObjectHandle*>& referringObjects )
{
updateConnectedEditors();

View File

@@ -72,8 +72,7 @@ public:
void removeExtractors( const RigGeoMechCaseData* caseData );
private:
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
caf::PdmChildArrayField<RimWellLogPlot*> m_wellLogPlots;
cvf::Collection<RigEclipseWellLogExtractor> m_extractors;

View File

@@ -552,8 +552,8 @@ std::map<QString, QString> RimWellLogRftCurve::createCurveNameKeyValueMap() cons
if ( m_rftDataType() == RftDataType::RFT_DATA )
{
if ( wellLogChannelUiName() != caf::AppEnum<RifEclipseRftAddress::RftWellLogChannelType>::text(
RifEclipseRftAddress::RftWellLogChannelType::NONE ) )
if ( wellLogChannelUiName() !=
caf::AppEnum<RifEclipseRftAddress::RftWellLogChannelType>::text( RifEclipseRftAddress::RftWellLogChannelType::NONE ) )
{
RifEclipseRftAddress::RftWellLogChannelType channelNameEnum =
caf::AppEnum<RifEclipseRftAddress::RftWellLogChannelType>::fromText( wellLogChannelUiName() );
@@ -752,8 +752,7 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
m_plotCurve->setPerPointLabels( perPointLabels );
auto propertyValues = this->curveData()->propertyValuesByIntervals();
auto depthValues =
this->curveData()->depthValuesByIntervals( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, displayUnit );
auto depthValues = this->curveData()->depthValuesByIntervals( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, displayUnit );
if ( !errors.empty() )
{
@@ -799,8 +798,7 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
m_plotCurve->setPerPointLabels( perPointLabels );
auto propertyValues = this->curveData()->propertyValuesByIntervals();
auto depthValues =
this->curveData()->depthValuesByIntervals( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, displayUnit );
auto depthValues = this->curveData()->depthValuesByIntervals( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, displayUnit );
bool useLogarithmicScale = false;
if ( !errors.empty() )
@@ -853,10 +851,7 @@ void RimWellLogRftCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrder
{
curveDataGroup->add( &m_wellLogChannelName );
RiaSimWellBranchTools::appendSimWellBranchFieldsIfRequiredFromWellName( curveDataGroup,
m_wellName,
m_branchDetection,
m_branchIndex );
RiaSimWellBranchTools::appendSimWellBranchFieldsIfRequiredFromWellName( curveDataGroup, m_wellName, m_branchDetection, m_branchIndex );
}
else
{
@@ -941,9 +936,7 @@ QList<caf::PdmOptionItemInfo> RimWellLogRftCurve::calculateValueOptions( const c
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogRftCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void RimWellLogRftCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
m_idxInWellPathToIdxInRftFile.clear();
@@ -998,9 +991,7 @@ std::vector<QString> RimWellLogRftCurve::perPointLabels() const
{
if ( m_observedFmuRftData() )
{
auto address = RifEclipseRftAddress::createAddress( m_wellName(),
m_timeStep,
RifEclipseRftAddress::RftWellLogChannelType::PRESSURE );
auto address = RifEclipseRftAddress::createAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::RftWellLogChannelType::PRESSURE );
return m_observedFmuRftData()->labels( address );
}
return {};
@@ -1062,8 +1053,7 @@ RigEclipseWellLogExtractor* RimWellLogRftCurve::extractor()
if ( !eclExtractor && m_eclipseResultCase )
{
QString simWellName = RimWellPlotTools::simWellName( m_wellName );
std::vector<const RigWellPath*> wellPaths =
RiaSimWellBranchTools::simulationWellBranches( simWellName, m_branchDetection );
std::vector<const RigWellPath*> wellPaths = RiaSimWellBranchTools::simulationWellBranches( simWellName, m_branchDetection );
if ( wellPaths.empty() ) return nullptr;
m_branchIndex = RiaSimWellBranchTools::clampBranchIndex( simWellName, m_branchIndex, m_branchDetection );
@@ -1229,9 +1219,7 @@ std::vector<double> RimWellLogRftCurve::errorValues()
if ( reader && m_rftDataType() == RftDataType::RFT_DATA )
{
RifEclipseRftAddress errorAddress =
RifEclipseRftAddress::createAddress( m_wellName(),
m_timeStep,
RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_ERROR );
RifEclipseRftAddress::createAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_ERROR );
reader->values( errorAddress, &errorValues );
}
@@ -1260,8 +1248,7 @@ std::vector<double> RimWellLogRftCurve::tvDepthValues()
return values;
}
auto depthAddress =
RifEclipseRftAddress::createAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::RftWellLogChannelType::TVD );
auto depthAddress = RifEclipseRftAddress::createAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::RftWellLogChannelType::TVD );
reader->values( depthAddress, &values );
bool wellPathExists = createWellPathIdxToRftFileIdxMapping();
@@ -1356,8 +1343,7 @@ std::vector<double> RimWellLogRftCurve::measuredDepthValues()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogRftCurve::deriveMeasuredDepthValuesFromWellPath( const std::vector<double>& tvDepthValues,
std::vector<double>& derivedMDValues )
bool RimWellLogRftCurve::deriveMeasuredDepthValuesFromWellPath( const std::vector<double>& tvDepthValues, std::vector<double>& derivedMDValues )
{
RimProject* proj = RimProject::current();
RimWellPath* wellPath = proj->wellPathByName( m_wellName );
@@ -1367,8 +1353,7 @@ bool RimWellLogRftCurve::deriveMeasuredDepthValuesFromWellPath( const std::vecto
const std::vector<double>& mdValuesOfWellPath = wellPath->wellPathGeometry()->measuredDepths();
const std::vector<double>& tvdValuesOfWellPath = wellPath->wellPathGeometry()->trueVerticalDepths();
derivedMDValues =
RigWellPathGeometryTools::interpolateMdFromTvd( mdValuesOfWellPath, tvdValuesOfWellPath, tvDepthValues );
derivedMDValues = RigWellPathGeometryTools::interpolateMdFromTvd( mdValuesOfWellPath, tvdValuesOfWellPath, tvDepthValues );
CVF_ASSERT( derivedMDValues.size() == tvDepthValues.size() );
return true;
}
@@ -1378,8 +1363,7 @@ bool RimWellLogRftCurve::deriveMeasuredDepthValuesFromWellPath( const std::vecto
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogRftCurve::deriveMeasuredDepthFromObservedData( const std::vector<double>& tvDepthValues,
std::vector<double>& derivedMDValues )
bool RimWellLogRftCurve::deriveMeasuredDepthFromObservedData( const std::vector<double>& tvDepthValues, std::vector<double>& derivedMDValues )
{
if ( m_observedFmuRftData )
{
@@ -1390,13 +1374,9 @@ bool RimWellLogRftCurve::deriveMeasuredDepthFromObservedData( const std::vector<
std::vector<double> mdValuesOfObservedData;
RifEclipseRftAddress tvdAddress =
RifEclipseRftAddress::createAddress( m_wellName(),
m_timeStep,
RifEclipseRftAddress::RftWellLogChannelType::TVD );
RifEclipseRftAddress::createAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::RftWellLogChannelType::TVD );
RifEclipseRftAddress mdAddress =
RifEclipseRftAddress::createAddress( m_wellName(),
m_timeStep,
RifEclipseRftAddress::RftWellLogChannelType::MD );
RifEclipseRftAddress::createAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::RftWellLogChannelType::MD );
reader->values( tvdAddress, &tvdValuesOfObservedData );
reader->values( mdAddress, &mdValuesOfObservedData );
@@ -1404,9 +1384,7 @@ bool RimWellLogRftCurve::deriveMeasuredDepthFromObservedData( const std::vector<
// We are not able to estimate MD/TVD relationship for less than two samples
if ( tvdValuesOfObservedData.size() < 2 ) return false;
derivedMDValues = RigWellPathGeometryTools::interpolateMdFromTvd( mdValuesOfObservedData,
tvdValuesOfObservedData,
tvDepthValues );
derivedMDValues = RigWellPathGeometryTools::interpolateMdFromTvd( mdValuesOfObservedData, tvdValuesOfObservedData, tvDepthValues );
CVF_ASSERT( derivedMDValues.size() == tvDepthValues.size() );
return true;
}

View File

@@ -119,7 +119,7 @@ protected:
// Pdm overrrides
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
std::vector<QString> perPointLabels() const;
@@ -140,10 +140,8 @@ private:
std::vector<double> tvDepthValues();
std::vector<double> measuredDepthValues();
bool deriveMeasuredDepthValuesFromWellPath( const std::vector<double>& tvDepthValues,
std::vector<double>& derivedMDValues );
bool deriveMeasuredDepthFromObservedData( const std::vector<double>& tvDepthValues,
std::vector<double>& derivedMDValues );
bool deriveMeasuredDepthValuesFromWellPath( const std::vector<double>& tvDepthValues, std::vector<double>& derivedMDValues );
bool deriveMeasuredDepthFromObservedData( const std::vector<double>& tvDepthValues, std::vector<double>& derivedMDValues );
int segmentBranchIndex() const;

View File

@@ -571,9 +571,7 @@ int RimWellLogTrack::axisFontSize() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void RimWellLogTrack::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
RimPlot::fieldChangedByUi( changedField, oldValue, newValue );
@@ -652,9 +650,8 @@ void RimWellLogTrack::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
updatePropertyValueZoom();
loadDataAndUpdate();
}
else if ( changedField == &m_regionAnnotationType || changedField == &m_regionAnnotationDisplay ||
changedField == &m_formationSource || changedField == &m_colorShadingTransparency ||
changedField == &m_colorShadingLegend )
else if ( changedField == &m_regionAnnotationType || changedField == &m_regionAnnotationDisplay || changedField == &m_formationSource ||
changedField == &m_colorShadingTransparency || changedField == &m_colorShadingLegend )
{
if ( changedField == &m_formationSource && m_formationSource == FormationSource::WELL_PICK_FILTER )
{
@@ -726,9 +723,8 @@ void RimWellLogTrack::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
}
else if ( changedField == &m_formationBranchIndex || changedField == &m_formationBranchDetection )
{
m_formationBranchIndex = RiaSimWellBranchTools::clampBranchIndex( m_formationSimWellName,
m_formationBranchIndex,
m_formationBranchDetection );
m_formationBranchIndex =
RiaSimWellBranchTools::clampBranchIndex( m_formationSimWellName, m_formationBranchIndex, m_formationBranchDetection );
loadDataAndUpdate();
updateParentLayout();
@@ -1134,9 +1130,8 @@ QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions( const caf:
}
else if ( fieldNeedingOptions == &m_formationBranchIndex )
{
auto simulationWellBranches =
RiaSimWellBranchTools::simulationWellBranches( m_formationSimWellName(), m_formationBranchDetection );
options = RiaSimWellBranchTools::valueOptionsForBranchIndexField( simulationWellBranches );
auto simulationWellBranches = RiaSimWellBranchTools::simulationWellBranches( m_formationSimWellName(), m_formationBranchDetection );
options = RiaSimWellBranchTools::valueOptionsForBranchIndexField( simulationWellBranches );
}
else if ( fieldNeedingOptions == &m_formationLevel )
{
@@ -1147,19 +1142,19 @@ QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions( const caf:
{
using FormationLevelEnum = caf::AppEnum<RigWellPathFormations::FormationLevel>;
options.push_back( caf::PdmOptionItemInfo( FormationLevelEnum::uiText( RigWellPathFormations::NONE ),
RigWellPathFormations::NONE ) );
options.push_back(
caf::PdmOptionItemInfo( FormationLevelEnum::uiText( RigWellPathFormations::NONE ), RigWellPathFormations::NONE ) );
options.push_back( caf::PdmOptionItemInfo( FormationLevelEnum::uiText( RigWellPathFormations::ALL ),
RigWellPathFormations::ALL ) );
options.push_back(
caf::PdmOptionItemInfo( FormationLevelEnum::uiText( RigWellPathFormations::ALL ), RigWellPathFormations::ALL ) );
for ( const RigWellPathFormations::FormationLevel& level : formations->formationsLevelsPresent() )
{
size_t index = FormationLevelEnum::index( level );
if ( index >= FormationLevelEnum::size() ) continue;
options.push_back( caf::PdmOptionItemInfo( FormationLevelEnum::uiTextFromIndex( index ),
FormationLevelEnum::fromIndex( index ) ) );
options.push_back(
caf::PdmOptionItemInfo( FormationLevelEnum::uiTextFromIndex( index ), FormationLevelEnum::fromIndex( index ) ) );
}
}
}
@@ -1309,13 +1304,11 @@ void RimWellLogTrack::updateAxesVisibility( RiaDefines::Orientation orientation,
RimDepthTrackPlot* wellLogPlot;
this->firstAncestorOrThisOfTypeAsserted( wellLogPlot );
bool showFirstTrack =
wellLogPlot->depthAxisVisibility() == RiaDefines::MultiPlotAxisVisibility::ALL_VISIBLE ||
( isFirstTrack && wellLogPlot->depthAxisVisibility() == RiaDefines::MultiPlotAxisVisibility::ONE_VISIBLE );
bool showFirstTrack = wellLogPlot->depthAxisVisibility() == RiaDefines::MultiPlotAxisVisibility::ALL_VISIBLE ||
( isFirstTrack && wellLogPlot->depthAxisVisibility() == RiaDefines::MultiPlotAxisVisibility::ONE_VISIBLE );
bool showLastTrack =
wellLogPlot->depthAxisVisibility() == RiaDefines::MultiPlotAxisVisibility::ALL_VISIBLE ||
( isLastTrack && wellLogPlot->depthAxisVisibility() == RiaDefines::MultiPlotAxisVisibility::ONE_VISIBLE );
bool showLastTrack = wellLogPlot->depthAxisVisibility() == RiaDefines::MultiPlotAxisVisibility::ALL_VISIBLE ||
( isLastTrack && wellLogPlot->depthAxisVisibility() == RiaDefines::MultiPlotAxisVisibility::ONE_VISIBLE );
if ( orientation == RiaDefines::Orientation::VERTICAL )
{
@@ -1340,8 +1333,7 @@ void RimWellLogTrack::updateAxesVisibility( RiaDefines::Orientation orientation,
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::onChildrenUpdated( caf::PdmChildArrayFieldHandle* childArray,
std::vector<caf::PdmObjectHandle*>& updatedObjects )
void RimWellLogTrack::onChildrenUpdated( caf::PdmChildArrayFieldHandle* childArray, std::vector<caf::PdmObjectHandle*>& updatedObjects )
{
if ( childArray == &m_curves )
{
@@ -2115,9 +2107,7 @@ void RimWellLogTrack::initAfterRead()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute )
void RimWellLogTrack::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
{
if ( field == &m_colorShadingTransparency )
{
@@ -2317,8 +2307,7 @@ void RimWellLogTrack::handleWheelEvent( QWheelEvent* wheelEvent )
}
else
{
wellLogPlot->setDepthAxisRangeByPanDepth( wheelEvent->angleDelta().y() < 0 ? RI_SCROLLWHEEL_PANFACTOR
: -RI_SCROLLWHEEL_PANFACTOR );
wellLogPlot->setDepthAxisRangeByPanDepth( wheelEvent->angleDelta().y() < 0 ? RI_SCROLLWHEEL_PANFACTOR : -RI_SCROLLWHEEL_PANFACTOR );
}
}
}
@@ -2326,7 +2315,7 @@ void RimWellLogTrack::handleWheelEvent( QWheelEvent* wheelEvent )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::pair<double, double>> RimWellLogTrack::waterAndRockRegions( RiaDefines::DepthTypeEnum depthType,
std::vector<std::pair<double, double>> RimWellLogTrack::waterAndRockRegions( RiaDefines::DepthTypeEnum depthType,
const RigGeoMechWellLogExtractor* extractor ) const
{
double waterEndTVD = extractor->waterDepth();
@@ -2388,9 +2377,7 @@ void RimWellLogTrack::computeAndSetPropertyValueRangeMinForLogarithmicScale()
{
if ( m_curves[cIdx]->isCurveVisible() && m_curves[cIdx]->curveData() )
{
RigStatisticsCalculator::posNegClosestToZero( m_curves[cIdx]->curveData()->propertyValuesByIntervals(),
pos,
neg );
RigStatisticsCalculator::posNegClosestToZero( m_curves[cIdx]->curveData()->propertyValuesByIntervals(), pos, neg );
}
}
@@ -2554,8 +2541,7 @@ RigEclipseWellLogExtractor* RimWellLogTrack::createSimWellExtractor( RimWellLogP
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( rimCase );
if ( !eclipseCase ) return nullptr;
std::vector<const RigWellPath*> wellPaths =
RiaSimWellBranchTools::simulationWellBranches( simWellName, useBranchDetection );
std::vector<const RigWellPath*> wellPaths = RiaSimWellBranchTools::simulationWellBranches( simWellName, useBranchDetection );
if ( wellPaths.size() == 0 ) return nullptr;
@@ -2570,8 +2556,7 @@ RigEclipseWellLogExtractor* RimWellLogTrack::createSimWellExtractor( RimWellLogP
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
CurveSamplingPointData RimWellLogTrack::curveSamplingPointData( RigEclipseWellLogExtractor* extractor,
RigResultAccessor* resultAccessor )
CurveSamplingPointData RimWellLogTrack::curveSamplingPointData( RigEclipseWellLogExtractor* extractor, RigResultAccessor* resultAccessor )
{
CurveSamplingPointData curveData;
@@ -2587,8 +2572,7 @@ CurveSamplingPointData RimWellLogTrack::curveSamplingPointData( RigEclipseWellLo
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
CurveSamplingPointData RimWellLogTrack::curveSamplingPointData( RigGeoMechWellLogExtractor* extractor,
const RigFemResultAddress& resultAddress )
CurveSamplingPointData RimWellLogTrack::curveSamplingPointData( RigGeoMechWellLogExtractor* extractor, const RigFemResultAddress& resultAddress )
{
CurveSamplingPointData curveData;
@@ -2633,8 +2617,7 @@ void RimWellLogTrack::findRegionNamesToPlot( const CurveSamplingPointData&
{
depthVector = curveData.md;
}
else if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH ||
depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB )
else if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH || depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB )
{
depthVector = curveData.tvd;
if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB )
@@ -2756,8 +2739,7 @@ void RimWellLogTrack::updateStackedCurveData()
{
auto minmaxit = std::minmax_element( depths.begin(), depths.end() );
std::pair<double, double> depthRange = std::make_pair( *minmaxit.first, *minmaxit.second );
if ( std::fabs( depthRange.second - depthRange.first ) >
std::fabs( maxDepthRange.second - maxDepthRange.first ) )
if ( std::fabs( depthRange.second - depthRange.first ) > std::fabs( maxDepthRange.second - maxDepthRange.first ) )
{
maxDepthRange = depthRange;
allDepthValues = depths;
@@ -2782,13 +2764,7 @@ void RimWellLogTrack::updateStackedCurveData()
}
RigWellLogCurveData tempCurveData;
tempCurveData.setValuesAndDepths( allStackedValues,
allDepthValues,
depthType,
0.0,
displayUnit,
false,
m_isPropertyLogarithmicScaleEnabled );
tempCurveData.setValuesAndDepths( allStackedValues, allDepthValues, depthType, 0.0, displayUnit, false, m_isPropertyLogarithmicScaleEnabled );
auto plotDepthValues = tempCurveData.depths( depthType );
auto polyLineStartStopIndices = tempCurveData.polylineStartStopIndices();
@@ -2905,8 +2881,7 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
}
}
std::vector<double> convertedYValues =
RiaWellLogUnitTools<double>::convertDepths( yValues, fromDepthUnit, toDepthUnit );
std::vector<double> convertedYValues = RiaWellLogUnitTools<double>::convertDepths( yValues, fromDepthUnit, toDepthUnit );
m_annotationTool->attachWellPicks( m_plotWidget->qwtPlot(), formationNamesToPlot, convertedYValues );
}
@@ -2932,43 +2907,40 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
}
else
{
eclWellLogExtractor =
RiaExtractionTools::findOrCreateWellLogExtractor( m_formationWellPathForSourceCase,
dynamic_cast<RimEclipseCase*>( m_formationCase() ) );
eclWellLogExtractor = RiaExtractionTools::findOrCreateWellLogExtractor( m_formationWellPathForSourceCase,
dynamic_cast<RimEclipseCase*>( m_formationCase() ) );
}
if ( eclWellLogExtractor )
{
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( m_formationCase() );
cvf::ref<RigResultAccessor> resultAccessor = RigResultAccessorFactory::
createFromResultAddress( eclipseCase->eclipseCaseData(),
0,
RiaDefines::PorosityModelType::MATRIX_MODEL,
0,
RigEclipseResultAddress( RiaDefines::ResultCatType::FORMATION_NAMES,
RiaResultNames::activeFormationNamesResultName() ) );
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( m_formationCase() );
cvf::ref<RigResultAccessor> resultAccessor =
RigResultAccessorFactory::createFromResultAddress( eclipseCase->eclipseCaseData(),
0,
RiaDefines::PorosityModelType::MATRIX_MODEL,
0,
RigEclipseResultAddress( RiaDefines::ResultCatType::FORMATION_NAMES,
RiaResultNames::activeFormationNamesResultName() ) );
curveData = RimWellLogTrack::curveSamplingPointData( eclWellLogExtractor, resultAccessor.p() );
}
else
{
geoMechWellLogExtractor =
RiaExtractionTools::findOrCreateWellLogExtractor( m_formationWellPathForSourceCase,
dynamic_cast<RimGeoMechCase*>( m_formationCase() ) );
geoMechWellLogExtractor = RiaExtractionTools::findOrCreateWellLogExtractor( m_formationWellPathForSourceCase,
dynamic_cast<RimGeoMechCase*>( m_formationCase() ) );
if ( !geoMechWellLogExtractor ) return;
std::string activeFormationNamesResultName = RiaResultNames::activeFormationNamesResultName().toStdString();
curveData = RimWellLogTrack::curveSamplingPointData( geoMechWellLogExtractor,
RigFemResultAddress( RIG_FORMATION_NAMES,
activeFormationNamesResultName,
"" ) );
curveData =
RimWellLogTrack::curveSamplingPointData( geoMechWellLogExtractor,
RigFemResultAddress( RIG_FORMATION_NAMES, activeFormationNamesResultName, "" ) );
}
if ( geoMechWellLogExtractor )
{
// Attach water and rock base formations
const caf::ColorTable waterAndRockColors = RiaColorTables::waterAndRockPaletteColors();
const caf::ColorTable waterAndRockColors = RiaColorTables::waterAndRockPaletteColors();
const std::vector<std::pair<double, double>> waterAndRockIntervals =
waterAndRockRegions( plot->depthType(), geoMechWellLogExtractor );
@@ -2989,8 +2961,7 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
if ( m_formationSource == FormationSource::CASE && m_plotWidget )
{
if ( ( m_formationSimWellName == QString( "None" ) && m_formationWellPathForSourceCase == nullptr ) ||
m_formationCase == nullptr )
if ( ( m_formationSimWellName == QString( "None" ) && m_formationWellPathForSourceCase == nullptr ) || m_formationCase == nullptr )
return;
std::vector<QString> formationNamesVector = RimWellLogTrack::formationNamesVector( m_formationCase );
@@ -3008,11 +2979,7 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
std::vector<std::pair<double, double>> yValues;
std::vector<QString> formationNamesToPlot;
RimWellLogTrack::findRegionNamesToPlot( curveData,
formationNamesVector,
plot->depthType(),
&formationNamesToPlot,
&yValues );
RimWellLogTrack::findRegionNamesToPlot( curveData, formationNamesVector, plot->depthType(), &formationNamesToPlot, &yValues );
std::vector<std::pair<double, double>> convertedYValues =
RiaWellLogUnitTools<double>::convertDepths( yValues, fromDepthUnit, toDepthUnit );
@@ -3044,8 +3011,7 @@ void RimWellLogTrack::updateResultPropertyNamesOnPlot()
auto orientation = plot->depthOrientation();
RigEclipseWellLogExtractor* eclWellLogExtractor =
RiaExtractionTools::findOrCreateWellLogExtractor( m_formationWellPathForSourceCase,
dynamic_cast<RimEclipseCase*>( m_formationCase() ) );
RiaExtractionTools::findOrCreateWellLogExtractor( m_formationWellPathForSourceCase, dynamic_cast<RimEclipseCase*>( m_formationCase() ) );
if ( !eclWellLogExtractor )
{
@@ -3063,12 +3029,11 @@ void RimWellLogTrack::updateResultPropertyNamesOnPlot()
if ( !resultAccessor.notNull() )
{
QString resultTypeStr = caf::AppEnum<RiaDefines::ResultCatType>( m_resultDefinition->resultType() ).uiText();
RiaLogging::error(
QString( "Unable to find result for region annotation for '%1' track. Tried '%2' (%3) on case: '%4'" )
.arg( m_description() )
.arg( m_resultDefinition->resultVariable() )
.arg( resultTypeStr )
.arg( eclipseCase->caseUserDescription() ) );
RiaLogging::error( QString( "Unable to find result for region annotation for '%1' track. Tried '%2' (%3) on case: '%4'" )
.arg( m_description() )
.arg( m_resultDefinition->resultVariable() )
.arg( resultTypeStr )
.arg( eclipseCase->caseUserDescription() ) );
return;
}
@@ -3078,8 +3043,7 @@ void RimWellLogTrack::updateResultPropertyNamesOnPlot()
if ( m_formationSource == FormationSource::CASE )
{
if ( ( m_formationSimWellName == QString( "None" ) && m_formationWellPathForSourceCase == nullptr ) ||
m_formationCase == nullptr )
if ( ( m_formationSimWellName == QString( "None" ) && m_formationWellPathForSourceCase == nullptr ) || m_formationCase == nullptr )
return;
std::vector<cvf::Color3ub> colors;
@@ -3144,8 +3108,7 @@ void RimWellLogTrack::updateResultPropertyNamesOnPlot()
caf::ColorTable colorTable( colors );
int fontSize = caf::FontTools::absolutePointSize( RiaPreferences::current()->defaultPlotFontSize(),
m_regionLabelFontSize() );
int fontSize = caf::FontTools::absolutePointSize( RiaPreferences::current()->defaultPlotFontSize(), m_regionLabelFontSize() );
m_annotationTool->attachNamedRegions( m_plotWidget->qwtPlot(),
namesToPlot,
@@ -3176,14 +3139,12 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
auto orientation = wellBoreStabilityPlot->depthOrientation();
wellBoreStabilityPlot->updateCommonDataSource();
RimGeoMechCase* geoMechCase =
dynamic_cast<RimGeoMechCase*>( wellBoreStabilityPlot->commonDataSource()->caseToApply() );
RimWellPath* wellPath = wellBoreStabilityPlot->commonDataSource()->wellPathToApply();
int timeStep = wellBoreStabilityPlot->commonDataSource()->timeStepToApply();
RimGeoMechCase* geoMechCase = dynamic_cast<RimGeoMechCase*>( wellBoreStabilityPlot->commonDataSource()->caseToApply() );
RimWellPath* wellPath = wellBoreStabilityPlot->commonDataSource()->wellPathToApply();
int timeStep = wellBoreStabilityPlot->commonDataSource()->timeStepToApply();
if ( geoMechCase && wellPath && timeStep >= 0 )
{
auto [stepIdx, frameIdx] =
geoMechCase->geoMechData()->femPartResults()->stepListIndexToTimeStepAndDataFrameIndex( timeStep );
auto [stepIdx, frameIdx] = geoMechCase->geoMechData()->femPartResults()->stepListIndexToTimeStepAndDataFrameIndex( timeStep );
RigGeoMechWellLogExtractor* geoMechWellLogExtractor = nullptr;
geoMechWellLogExtractor =
@@ -3202,7 +3163,7 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
wbsPlot->applyWbsParametersToExtractor( geoMechWellLogExtractor );
}
std::vector<double> ppSourceRegions = geoMechWellLogExtractor->porePressureSourceRegions( stepIdx, frameIdx );
std::vector<double> ppSourceRegions = geoMechWellLogExtractor->porePressureSourceRegions( stepIdx, frameIdx );
std::vector<double> poissonSourceRegions = geoMechWellLogExtractor->poissonSourceRegions( stepIdx, frameIdx );
std::vector<double> ucsSourceRegions = geoMechWellLogExtractor->ucsSourceRegions( stepIdx, frameIdx );
@@ -3210,18 +3171,12 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
caf::ColorTable colorTable( m_colorShadingLegend->colorArray() );
std::vector<QString> sourceNames =
RigWbsParameter::PP_Reservoir().allSourceUiLabels( "\n",
wbsPlot->userDefinedValue(
RigWbsParameter::PP_NonReservoir() ) );
RigWbsParameter::PP_Reservoir().allSourceUiLabels( "\n", wbsPlot->userDefinedValue( RigWbsParameter::PP_NonReservoir() ) );
curveData.data = ppSourceRegions;
std::vector<QString> sourceNamesToPlot;
std::vector<std::pair<double, double>> yValues;
RimWellLogTrack::findRegionNamesToPlot( curveData,
sourceNames,
wellBoreStabilityPlot->depthType(),
&sourceNamesToPlot,
&yValues );
RimWellLogTrack::findRegionNamesToPlot( curveData, sourceNames, wellBoreStabilityPlot->depthType(), &sourceNamesToPlot, &yValues );
// convert to plot depth unit
std::vector<std::pair<double, double>> convertedYValues =
@@ -3241,18 +3196,12 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
caf::ColorTable colorTable( m_colorShadingLegend->colorArray() );
std::vector<QString> sourceNames =
RigWbsParameter::poissonRatio().allSourceUiLabels( "\n",
wbsPlot->userDefinedValue(
RigWbsParameter::poissonRatio() ) );
RigWbsParameter::poissonRatio().allSourceUiLabels( "\n", wbsPlot->userDefinedValue( RigWbsParameter::poissonRatio() ) );
curveData.data = poissonSourceRegions;
std::vector<QString> sourceNamesToPlot;
std::vector<std::pair<double, double>> yValues;
RimWellLogTrack::findRegionNamesToPlot( curveData,
sourceNames,
wellBoreStabilityPlot->depthType(),
&sourceNamesToPlot,
&yValues );
RimWellLogTrack::findRegionNamesToPlot( curveData, sourceNames, wellBoreStabilityPlot->depthType(), &sourceNamesToPlot, &yValues );
// convert to plot depth unit
std::vector<std::pair<double, double>> convertedYValues =
@@ -3278,11 +3227,7 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
std::vector<QString> sourceNamesToPlot;
std::vector<std::pair<double, double>> yValues;
RimWellLogTrack::findRegionNamesToPlot( curveData,
sourceNames,
wellBoreStabilityPlot->depthType(),
&sourceNamesToPlot,
&yValues );
RimWellLogTrack::findRegionNamesToPlot( curveData, sourceNames, wellBoreStabilityPlot->depthType(), &sourceNamesToPlot, &yValues );
// convert to plot depth unit
std::vector<std::pair<double, double>> convertedYValues =
@@ -3315,8 +3260,8 @@ void RimWellLogTrack::updateWellPathAttributesOnPlot()
if ( wellPathAttributeSource()->wellPathGeometry() && ( m_showWellPathAttributes || m_showWellPathCompletions ) )
{
m_wellPathAttributePlotObjects.push_back( std::unique_ptr<RiuWellPathComponentPlotItem>(
new RiuWellPathComponentPlotItem( wellPathAttributeSource() ) ) );
m_wellPathAttributePlotObjects.push_back(
std::unique_ptr<RiuWellPathComponentPlotItem>( new RiuWellPathComponentPlotItem( wellPathAttributeSource() ) ) );
}
if ( m_showWellPathAttributes )
@@ -3335,8 +3280,8 @@ void RimWellLogTrack::updateWellPathAttributesOnPlot()
}
if ( m_showWellPathCompletions )
{
const RimWellPathCompletions* completionsCollection = wellPathAttributeSource()->completions();
std::vector<const RimWellPathComponentInterface*> allCompletions = completionsCollection->allCompletions();
const RimWellPathCompletions* completionsCollection = wellPathAttributeSource()->completions();
std::vector<const RimWellPathComponentInterface*> allCompletions = completionsCollection->allCompletions();
for ( const RimWellPathComponentInterface* completion : allCompletions )
{
@@ -3347,31 +3292,28 @@ void RimWellLogTrack::updateWellPathAttributesOnPlot()
}
}
const std::map<RiaDefines::WellPathComponentType, int> sortIndices =
{ { RiaDefines::WellPathComponentType::WELL_PATH, 0 },
{ RiaDefines::WellPathComponentType::CASING, 1 },
{ RiaDefines::WellPathComponentType::LINER, 2 },
{ RiaDefines::WellPathComponentType::PERFORATION_INTERVAL, 3 },
{ RiaDefines::WellPathComponentType::FISHBONES, 4 },
{ RiaDefines::WellPathComponentType::FRACTURE, 5 },
{ RiaDefines::WellPathComponentType::PACKER, 6 },
{ RiaDefines::WellPathComponentType::ICD, 7 },
{ RiaDefines::WellPathComponentType::AICD, 8 },
{ RiaDefines::WellPathComponentType::ICV, 9 } };
const std::map<RiaDefines::WellPathComponentType, int> sortIndices = { { RiaDefines::WellPathComponentType::WELL_PATH, 0 },
{ RiaDefines::WellPathComponentType::CASING, 1 },
{ RiaDefines::WellPathComponentType::LINER, 2 },
{ RiaDefines::WellPathComponentType::PERFORATION_INTERVAL, 3 },
{ RiaDefines::WellPathComponentType::FISHBONES, 4 },
{ RiaDefines::WellPathComponentType::FRACTURE, 5 },
{ RiaDefines::WellPathComponentType::PACKER, 6 },
{ RiaDefines::WellPathComponentType::ICD, 7 },
{ RiaDefines::WellPathComponentType::AICD, 8 },
{ RiaDefines::WellPathComponentType::ICV, 9 } };
std::stable_sort( allWellPathComponents.begin(),
allWellPathComponents.end(),
[&sortIndices]( const RimWellPathComponentInterface* lhs,
const RimWellPathComponentInterface* rhs ) {
[&sortIndices]( const RimWellPathComponentInterface* lhs, const RimWellPathComponentInterface* rhs ) {
return sortIndices.at( lhs->componentType() ) < sortIndices.at( rhs->componentType() );
} );
std::set<QString> completionsAssignedToLegend;
for ( const RimWellPathComponentInterface* component : allWellPathComponents )
{
std::unique_ptr<RiuWellPathComponentPlotItem> plotItem(
new RiuWellPathComponentPlotItem( wellPathAttributeSource(), component ) );
QString legendTitle = plotItem->legendTitle();
std::unique_ptr<RiuWellPathComponentPlotItem> plotItem( new RiuWellPathComponentPlotItem( wellPathAttributeSource(), component ) );
QString legendTitle = plotItem->legendTitle();
bool contributeToLegend = m_wellPathCompletionsInLegend() && !completionsAssignedToLegend.count( legendTitle );
plotItem->setContributeToLegend( contributeToLegend );
m_wellPathAttributePlotObjects.push_back( std::move( plotItem ) );
@@ -3418,8 +3360,7 @@ void RimWellLogTrack::doUpdateLayout()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
std::vector<caf::PdmObjectHandle*>& referringObjects )
void RimWellLogTrack::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, std::vector<caf::PdmObjectHandle*>& referringObjects )
{
setAutoScalePropertyValuesEnabled( true );
updateZoomInParentPlot();

View File

@@ -127,21 +127,18 @@ public:
RimCase* formationNamesCase() const;
void setFormationTrajectoryType( TrajectoryType trajectoryType );
TrajectoryType formationTrajectoryType() const;
void setRegionPropertyResultType( RiaDefines::ResultCatType resultCatType, const QString& resultVariable );
void setRegionPropertyResultType( RiaDefines::ResultCatType resultCatType, const QString& resultVariable );
void detachAllCurves() override;
void reattachAllCurves() override;
void setAndUpdateWellPathFormationNamesData( RimCase* rimCase, RimWellPath* wellPath );
void setAndUpdateSimWellFormationNamesAndBranchData( RimCase* rimCase,
const QString& simWellName,
int branchIndex,
bool useBranchDetection );
void setAndUpdateSimWellFormationNamesAndBranchData( RimCase* rimCase, const QString& simWellName, int branchIndex, bool useBranchDetection );
void setAndUpdateSimWellFormationNamesData( RimCase* rimCase, const QString& simWellName );
[[deprecated( "Use setAutoScalePropertyValuesEnabled() instead." )]] void setAutoScaleXEnabled( bool enabled ) override;
[[deprecated( "Use setAutoScaleDepthValuesEnabled() instead." )]] void setAutoScaleYEnabled( bool enabled ) override;
[[deprecated( "Use setAutoScaleDepthValuesEnabled() instead." )]] void setAutoScaleYEnabled( bool enabled ) override;
void setAutoScalePropertyValuesEnabled( bool enabled );
void setAutoScaleDepthValuesEnabled( bool enabled );
@@ -214,15 +211,12 @@ public:
QString asciiDataForPlotExport() const override;
void onAxisSelected( RiuPlotAxis axis, bool toggle ) override;
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
void updateAxes() override;
static CurveSamplingPointData curveSamplingPointData( RigEclipseWellLogExtractor* extractor,
RigResultAccessor* resultAccessor );
static CurveSamplingPointData curveSamplingPointData( RigGeoMechWellLogExtractor* extractor,
const RigFemResultAddress& resultAddress );
static CurveSamplingPointData curveSamplingPointData( RigEclipseWellLogExtractor* extractor, RigResultAccessor* resultAccessor );
static CurveSamplingPointData curveSamplingPointData( RigGeoMechWellLogExtractor* extractor, const RigFemResultAddress& resultAddress );
static void findRegionNamesToPlot( const CurveSamplingPointData& curveData,
const std::vector<QString>& formationNamesVector,
@@ -246,8 +240,7 @@ protected:
// RimViewWindow overrides
void deleteViewWidget() override;
void onLoadDataAndUpdate() override;
void onChildrenUpdated( caf::PdmChildArrayFieldHandle* childArray,
std::vector<caf::PdmObjectHandle*>& updatedObjects ) override;
void onChildrenUpdated( caf::PdmChildArrayFieldHandle* childArray, std::vector<caf::PdmObjectHandle*>& updatedObjects ) override;
private:
RiuPlotWidget* doCreatePlotViewWidget( QWidget* mainWindowParent = nullptr ) override;
@@ -275,9 +268,7 @@ private:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void initAfterRead() override;
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
caf::PdmFieldHandle* userDescriptionField() override;

View File

@@ -73,9 +73,7 @@ void RimWellLogWbsCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrder
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogWbsCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void RimWellLogWbsCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
RimWellLogExtractionCurve::fieldChangedByUi( changedField, oldValue, newValue );