From 62cf62b9a2739306632d3c6aa1d4b5b5ff920188 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 16 Jun 2022 13:55:42 +0200 Subject: [PATCH] Improve UI for RFT segment curves (#9061) * Make sure all curve values are set correctly for plot orientation * Make sure depth zoom is propagated to the Qwt plot * Expand min/max value range to allow more space around curves * Use int values to represent RFT segment branch number --- .../FileInterface/RifEclipseRftAddress.cpp | 42 +++--- .../FileInterface/RifEclipseRftAddress.h | 19 ++- .../FileInterface/RifReaderEclipseRft.cpp | 24 ++-- .../RifReaderEnsembleStatisticsRft.cpp | 20 ++- .../FileInterface/RifReaderFmuRft.cpp | 22 ++-- .../FileInterface/RifReaderOpmRft.cpp | 20 +-- .../ProjectDataModel/Flow/RimWellPltPlot.cpp | 21 +-- .../ProjectDataModel/Flow/RimWellRftPlot.cpp | 21 +-- .../ProjectDataModel/WellLog/RimRftTools.cpp | 6 +- .../WellLog/RimWellLogCurve.cpp | 35 +++-- .../WellLog/RimWellLogCurve.h | 57 +++++---- .../RimWellLogCurveCommonDataSource.cpp | 30 +++-- .../WellLog/RimWellLogCurveCommonDataSource.h | 4 +- .../WellLog/RimWellLogRftCurve.cpp | 120 ++++++++++-------- .../WellLog/RimWellLogRftCurve.h | 6 +- .../WellLog/RimWellLogTrack.cpp | 25 +++- .../WellLog/RimWellLogTrack.h | 2 +- 17 files changed, 291 insertions(+), 183 deletions(-) diff --git a/ApplicationLibCode/FileInterface/RifEclipseRftAddress.cpp b/ApplicationLibCode/FileInterface/RifEclipseRftAddress.cpp index 25b210d2da..7ab3d925cd 100644 --- a/ApplicationLibCode/FileInterface/RifEclipseRftAddress.cpp +++ b/ApplicationLibCode/FileInterface/RifEclipseRftAddress.cpp @@ -21,24 +21,29 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RifEclipseRftAddress::RifEclipseRftAddress( QString wellName, QDateTime timeStep, RftWellLogChannelType wellLogChannelName ) +RifEclipseRftAddress::RifEclipseRftAddress( const QString& wellName, + const QDateTime& timeStep, + RftWellLogChannelType wellLogChannelName, + const QString& segmentResultName, + int segmentBranchNumber ) : m_wellName( wellName ) , m_timeStep( timeStep ) , m_wellLogChannel( wellLogChannelName ) - , m_segmentBranchNumber( -1 ) + , m_segmentResultName( segmentResultName ) + , m_segmentBranchNumber( segmentBranchNumber ) { } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RifEclipseRftAddress RifEclipseRftAddress::createSegmentResult( const QString& wellName, - const QDateTime& dateTime, - const QString& resultName ) +RifEclipseRftAddress RifEclipseRftAddress::createAddress( const QString& wellName, + const QDateTime& timeStep, + RftWellLogChannelType wellLogChannel ) { - auto adr = RifEclipseRftAddress( wellName, dateTime, RifEclipseRftAddress::RftWellLogChannelType::SEGMENT_VALUES ); - - adr.setSegmentResultName( resultName ); + auto segmentResultName = ""; + auto segmentBranchNumber = -1; + auto adr = RifEclipseRftAddress( wellName, timeStep, wellLogChannel, segmentResultName, segmentBranchNumber ); return adr; } @@ -46,9 +51,18 @@ RifEclipseRftAddress RifEclipseRftAddress::createSegmentResult( const QString& //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RifEclipseRftAddress::setSegmentResultName( const QString& resultName ) +RifEclipseRftAddress RifEclipseRftAddress::createSegmentAddress( const QString& wellName, + const QDateTime& dateTime, + const QString& resultName, + int segmentBranchNumber ) { - m_segmentResultName = resultName; + auto adr = RifEclipseRftAddress( wellName, + dateTime, + RifEclipseRftAddress::RftWellLogChannelType::SEGMENT_VALUES, + resultName, + segmentBranchNumber ); + + return adr; } //-------------------------------------------------------------------------------------------------- @@ -59,14 +73,6 @@ QString RifEclipseRftAddress::segmentResultName() const return m_segmentResultName; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RifEclipseRftAddress::setSegmentBranchNumber( int branchNumber ) -{ - m_segmentBranchNumber = branchNumber; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/FileInterface/RifEclipseRftAddress.h b/ApplicationLibCode/FileInterface/RifEclipseRftAddress.h index bd8cf929a7..92e5ac1903 100644 --- a/ApplicationLibCode/FileInterface/RifEclipseRftAddress.h +++ b/ApplicationLibCode/FileInterface/RifEclipseRftAddress.h @@ -52,15 +52,16 @@ public: }; public: - RifEclipseRftAddress( QString wellName, QDateTime timeStep, RftWellLogChannelType wellLogChannel ); - static RifEclipseRftAddress - createSegmentResult( const QString& wellName, const QDateTime& dateTime, const QString& resultName ); + createAddress( const QString& wellName, const QDateTime& timeStep, RftWellLogChannelType wellLogChannel ); + + static RifEclipseRftAddress createSegmentAddress( const QString& wellName, + const QDateTime& dateTime, + const QString& resultName, + int segmentBranchNumber ); QString segmentResultName() const; - - void setSegmentBranchNumber( int branchNumber ); - int segmentBranchNumber() const; + int segmentBranchNumber() const; const QString& wellName() const; QDateTime timeStep() const; @@ -70,7 +71,11 @@ public: static std::set pltPlotChannelTypes(); private: - void setSegmentResultName( const QString& resultName ); + RifEclipseRftAddress( const QString& wellName, + const QDateTime& timeStep, + RftWellLogChannelType wellLogChannel, + const QString& segmentResultName, + int segmentBranchNumber ); private: QString m_wellName; diff --git a/ApplicationLibCode/FileInterface/RifReaderEclipseRft.cpp b/ApplicationLibCode/FileInterface/RifReaderEclipseRft.cpp index 474de5ad53..54873a3cd1 100644 --- a/ApplicationLibCode/FileInterface/RifReaderEclipseRft.cpp +++ b/ApplicationLibCode/FileInterface/RifReaderEclipseRft.cpp @@ -89,39 +89,47 @@ void RifReaderEclipseRft::open() QDateTime timeStep = RiaQDateTimeTools::createUtcDateTime(); timeStep.setTime_t( timeStepTime_t ); - RifEclipseRftAddress addressPressure( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::PRESSURE ); + RifEclipseRftAddress addressPressure = + RifEclipseRftAddress::createAddress( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::PRESSURE ); m_eclipseRftAddresses.insert( addressPressure ); m_rftAddressToLibeclNodeIdx[addressPressure] = i; - RifEclipseRftAddress addressDepth( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::TVD ); + RifEclipseRftAddress addressDepth = + RifEclipseRftAddress::createAddress( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::TVD ); m_eclipseRftAddresses.insert( addressDepth ); m_rftAddressToLibeclNodeIdx[addressDepth] = i; if ( ecl_rft_node_is_RFT( node ) ) { - RifEclipseRftAddress addressSwat( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::SWAT ); + RifEclipseRftAddress addressSwat = + RifEclipseRftAddress::createAddress( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::SWAT ); m_eclipseRftAddresses.insert( addressSwat ); m_rftAddressToLibeclNodeIdx[addressSwat] = i; - RifEclipseRftAddress addressSoil( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::SOIL ); + RifEclipseRftAddress addressSoil = + RifEclipseRftAddress::createAddress( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::SOIL ); m_eclipseRftAddresses.insert( addressSoil ); m_rftAddressToLibeclNodeIdx[addressSoil] = i; - RifEclipseRftAddress addressSgas( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::SGAS ); + RifEclipseRftAddress addressSgas = + RifEclipseRftAddress::createAddress( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::SGAS ); m_eclipseRftAddresses.insert( addressSgas ); m_rftAddressToLibeclNodeIdx[addressSgas] = i; } else if ( ecl_rft_node_is_PLT( node ) ) { - RifEclipseRftAddress addressWrat( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::WRAT ); + RifEclipseRftAddress addressWrat = + RifEclipseRftAddress::createAddress( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::WRAT ); m_eclipseRftAddresses.insert( addressWrat ); m_rftAddressToLibeclNodeIdx[addressWrat] = i; - RifEclipseRftAddress addressOrat( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::ORAT ); + RifEclipseRftAddress addressOrat = + RifEclipseRftAddress::createAddress( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::ORAT ); m_eclipseRftAddresses.insert( addressOrat ); m_rftAddressToLibeclNodeIdx[addressOrat] = i; - RifEclipseRftAddress addressGrat( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::GRAT ); + RifEclipseRftAddress addressGrat = + RifEclipseRftAddress::createAddress( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::GRAT ); m_eclipseRftAddresses.insert( addressGrat ); m_rftAddressToLibeclNodeIdx[addressGrat] = i; } diff --git a/ApplicationLibCode/FileInterface/RifReaderEnsembleStatisticsRft.cpp b/ApplicationLibCode/FileInterface/RifReaderEnsembleStatisticsRft.cpp index 9efaa1b232..427bab8558 100644 --- a/ApplicationLibCode/FileInterface/RifReaderEnsembleStatisticsRft.cpp +++ b/ApplicationLibCode/FileInterface/RifReaderEnsembleStatisticsRft.cpp @@ -67,7 +67,7 @@ std::set RifReaderEnsembleStatisticsRft::eclipseRftAddress for ( auto channel : statChannels ) { statisticsAddresses.insert( - RifEclipseRftAddress( regularAddress.wellName(), regularAddress.timeStep(), channel ) ); + RifEclipseRftAddress::createAddress( regularAddress.wellName(), regularAddress.timeStep(), channel ) ); } } } @@ -192,13 +192,19 @@ void RifReaderEnsembleStatisticsRft::calculateStatistics( const RifEclipseRftAdd { const QString& wellName = rftAddress.wellName(); const QDateTime& timeStep = rftAddress.timeStep(); - RifEclipseRftAddress depthAddress( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::TVD ); - RifEclipseRftAddress pressAddress( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::PRESSURE ); + RifEclipseRftAddress depthAddress = + RifEclipseRftAddress::createAddress( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::TVD ); + RifEclipseRftAddress pressAddress = + RifEclipseRftAddress::createAddress( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::PRESSURE ); - RifEclipseRftAddress p10Address( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_P10 ); - RifEclipseRftAddress p50Address( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_P50 ); - RifEclipseRftAddress p90Address( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_P90 ); - RifEclipseRftAddress meanAddress( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_MEAN ); + RifEclipseRftAddress p10Address = + RifEclipseRftAddress::createAddress( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_P10 ); + RifEclipseRftAddress p50Address = + RifEclipseRftAddress::createAddress( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_P50 ); + RifEclipseRftAddress p90Address = + RifEclipseRftAddress::createAddress( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_P90 ); + RifEclipseRftAddress meanAddress = + RifEclipseRftAddress::createAddress( wellName, timeStep, RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_MEAN ); RiaCurveMerger curveMerger; diff --git a/ApplicationLibCode/FileInterface/RifReaderFmuRft.cpp b/ApplicationLibCode/FileInterface/RifReaderFmuRft.cpp index a1f085cba9..eedc034379 100644 --- a/ApplicationLibCode/FileInterface/RifReaderFmuRft.cpp +++ b/ApplicationLibCode/FileInterface/RifReaderFmuRft.cpp @@ -195,14 +195,20 @@ std::set RifReaderFmuRft::eclipseRftAddresses() { if ( observation.valid() ) { - RifEclipseRftAddress tvdAddress( wellName, dateTime, RifEclipseRftAddress::RftWellLogChannelType::TVD ); - RifEclipseRftAddress mdAddress( wellName, dateTime, RifEclipseRftAddress::RftWellLogChannelType::MD ); - RifEclipseRftAddress pressureAddress( wellName, - dateTime, - RifEclipseRftAddress::RftWellLogChannelType::PRESSURE ); - RifEclipseRftAddress pressureErrorAddress( wellName, - dateTime, - RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_ERROR ); + RifEclipseRftAddress tvdAddress = + RifEclipseRftAddress::createAddress( wellName, + dateTime, + RifEclipseRftAddress::RftWellLogChannelType::TVD ); + RifEclipseRftAddress mdAddress = + RifEclipseRftAddress::createAddress( wellName, dateTime, RifEclipseRftAddress::RftWellLogChannelType::MD ); + RifEclipseRftAddress pressureAddress = + RifEclipseRftAddress::createAddress( wellName, + dateTime, + RifEclipseRftAddress::RftWellLogChannelType::PRESSURE ); + RifEclipseRftAddress pressureErrorAddress = + RifEclipseRftAddress::createAddress( wellName, + dateTime, + RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_ERROR ); allAddresses.insert( tvdAddress ); allAddresses.insert( mdAddress ); allAddresses.insert( pressureAddress ); diff --git a/ApplicationLibCode/FileInterface/RifReaderOpmRft.cpp b/ApplicationLibCode/FileInterface/RifReaderOpmRft.cpp index 81db96f123..ec6daaed52 100644 --- a/ApplicationLibCode/FileInterface/RifReaderOpmRft.cpp +++ b/ApplicationLibCode/FileInterface/RifReaderOpmRft.cpp @@ -276,10 +276,10 @@ void RifReaderOpmRft::buildMetaData() auto dt = RiaQDateTimeTools::createUtcDateTime( QDate( y, m, d ) ); - auto channelTypes = identifyChannelType( resultDataName ); - if ( channelTypes != RifEclipseRftAddress::RftWellLogChannelType::NONE ) + auto channelType = identifyChannelType( resultDataName ); + if ( channelType != RifEclipseRftAddress::RftWellLogChannelType::NONE ) { - auto adr = RifEclipseRftAddress( QString::fromStdString( wellName ), dt, channelTypes ); + auto adr = RifEclipseRftAddress::createAddress( QString::fromStdString( wellName ), dt, channelType ); m_addresses.insert( adr ); } } @@ -310,16 +310,18 @@ void RifReaderOpmRft::buildMetaData() if ( static_cast( resultValueCount ) != segmentCount ) continue; auto resultName = std::get<0>( resultNameAndSize ); - auto adr = RifEclipseRftAddress::createSegmentResult( QString::fromStdString( wellName ), - dt, - QString::fromStdString( resultName ) ); + auto adr = RifEclipseRftAddress::createSegmentAddress( QString::fromStdString( wellName ), + dt, + QString::fromStdString( resultName ), + -1 ); m_addresses.insert( adr ); } - auto adr = RifEclipseRftAddress::createSegmentResult( QString::fromStdString( wellName ), - dt, - RiaDefines::segmentNumberResultName() ); + auto adr = RifEclipseRftAddress::createSegmentAddress( QString::fromStdString( wellName ), + dt, + RiaDefines::segmentNumberResultName(), + -1 ); m_addresses.insert( adr ); } diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellPltPlot.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellPltPlot.cpp index c233327357..f07a0a66d1 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellPltPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellPltPlot.cpp @@ -300,15 +300,18 @@ class RigRftResultPointCalculator : public RigResultPointCalculator public: RigRftResultPointCalculator( const QString& wellPathName, RimEclipseResultCase* eclCase, QDateTime m_timeStep ) { - RifEclipseRftAddress gasRateAddress( RimWellPlotTools::simWellName( wellPathName ), - m_timeStep, - RifEclipseRftAddress::RftWellLogChannelType::GRAT ); - RifEclipseRftAddress oilRateAddress( RimWellPlotTools::simWellName( wellPathName ), - m_timeStep, - RifEclipseRftAddress::RftWellLogChannelType::ORAT ); - RifEclipseRftAddress watRateAddress( RimWellPlotTools::simWellName( wellPathName ), - m_timeStep, - RifEclipseRftAddress::RftWellLogChannelType::WRAT ); + RifEclipseRftAddress gasRateAddress = + RifEclipseRftAddress::createAddress( RimWellPlotTools::simWellName( wellPathName ), + m_timeStep, + RifEclipseRftAddress::RftWellLogChannelType::GRAT ); + RifEclipseRftAddress oilRateAddress = + RifEclipseRftAddress::createAddress( RimWellPlotTools::simWellName( wellPathName ), + m_timeStep, + RifEclipseRftAddress::RftWellLogChannelType::ORAT ); + RifEclipseRftAddress watRateAddress = + RifEclipseRftAddress::createAddress( RimWellPlotTools::simWellName( wellPathName ), + m_timeStep, + RifEclipseRftAddress::RftWellLogChannelType::WRAT ); std::vector rftIndices; eclCase->rftReader()->cellIndices( gasRateAddress, &rftIndices ); diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellRftPlot.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellRftPlot.cpp index f4c91261fd..6da96b0eaf 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellRftPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellRftPlot.cpp @@ -499,9 +499,10 @@ void RimWellRftPlot::updateCurvesInPlot( const std::setsetEclipseResultCase( dynamic_cast( rftCase ) ); - RifEclipseRftAddress address( simWellName, - curveDefToAdd.timeStep(), - RifEclipseRftAddress::RftWellLogChannelType::PRESSURE ); + RifEclipseRftAddress address = + RifEclipseRftAddress::createAddress( simWellName, + curveDefToAdd.timeStep(), + RifEclipseRftAddress::RftWellLogChannelType::PRESSURE ); curve->setRftAddress( address ); curve->setZOrder( 1 ); curve->setSimWellBranchData( m_branchDetection, m_branchIndex ); @@ -515,9 +516,10 @@ void RimWellRftPlot::updateCurvesInPlot( const std::setsetObservedFmuRftData( observedFmuRftData ); - RifEclipseRftAddress address( m_wellPathNameOrSimWellName, - curveDefToAdd.timeStep(), - RifEclipseRftAddress::RftWellLogChannelType::PRESSURE ); + RifEclipseRftAddress address = + RifEclipseRftAddress::createAddress( m_wellPathNameOrSimWellName, + curveDefToAdd.timeStep(), + RifEclipseRftAddress::RftWellLogChannelType::PRESSURE ); curve->setRftAddress( address ); curve->setZOrder( RiuQwtPlotCurveDefines::zDepthForIndex( RiuQwtPlotCurveDefines::ZIndex::Z_SINGLE_CURVE_OBSERVED ) ); @@ -532,9 +534,10 @@ void RimWellRftPlot::updateCurvesInPlot( const std::setsetEnsemble( curveDefToAdd.address().ensemble() ); curve->setObservedFmuRftData( this->findObservedFmuData( m_wellPathNameOrSimWellName, curveDefToAdd.timeStep() ) ); - RifEclipseRftAddress address( m_wellPathNameOrSimWellName, - curveDefToAdd.timeStep(), - RifEclipseRftAddress::RftWellLogChannelType::PRESSURE ); + RifEclipseRftAddress address = + RifEclipseRftAddress::createAddress( m_wellPathNameOrSimWellName, + curveDefToAdd.timeStep(), + RifEclipseRftAddress::RftWellLogChannelType::PRESSURE ); curve->setRftAddress( address ); curve->setZOrder( 1 ); applyCurveAppearance( curve ); diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimRftTools.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimRftTools.cpp index a2da5205fb..0d51edc996 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimRftTools.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimRftTools.cpp @@ -146,21 +146,21 @@ QList RimRftTools::segmentBranchIdOptions( RifReaderRftI { QList options; - options.push_front( caf::PdmOptionItemInfo( RiaDefines::allBranches(), RiaDefines::allBranches() ) ); + options.push_front( caf::PdmOptionItemInfo( RiaDefines::allBranches(), -1 ) ); if ( readerRft ) { std::vector values; auto adr = - RifEclipseRftAddress::createSegmentResult( wellName, timeStep, RiaDefines::segmentBranchNumberResultName() ); + RifEclipseRftAddress::createSegmentAddress( wellName, timeStep, RiaDefines::segmentBranchNumberResultName(), -1 ); readerRft->values( adr, &values ); for ( const auto& v : values ) { int intValue = v; auto txt = QString::number( intValue ); - options.push_back( caf::PdmOptionItemInfo( txt, txt ) ); + options.push_back( caf::PdmOptionItemInfo( txt, intValue ) ); } } diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.cpp index ccb9058a01..7f2510c472 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.cpp @@ -148,6 +148,33 @@ void RimWellLogCurve::setPropertyValuesAndDepths( const std::vector& pro calculateCurveDataPropertyValueRange(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogCurve::setPropertyAndDepthsAndErrors( const std::vector& propertyValues, + const std::vector& depthValues, + const std::vector& errorValues ) +{ + bool useLogarithmicScale = false; + + if ( isVerticalCurve() ) + { + this->setSamplesFromXYErrorValues( propertyValues, + depthValues, + errorValues, + useLogarithmicScale, + RiaCurveDataTools::ErrorAxis::ERROR_ALONG_X_AXIS ); + } + else + { + this->setSamplesFromXYErrorValues( depthValues, + propertyValues, + errorValues, + useLogarithmicScale, + RiaCurveDataTools::ErrorAxis::ERROR_ALONG_Y_AXIS ); + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -265,14 +292,6 @@ void RimWellLogCurve::setOverrideCurveData( const std::vector& } } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RiaDefines::PhaseType RimWellLogCurve::resultPhase() const -{ - return RiaDefines::PhaseType::PHASE_NOT_APPLICABLE; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.h index bbfaa414fa..19618f0a5d 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.h +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.h @@ -45,6 +45,30 @@ public: bool propertyValueRangeInData( double* minimumValue, double* maximumValue ) const; bool depthValueRangeInData( double* minimumValue, double* maximumValue ) const; + const RigWellLogCurveData* curveData() const; + + void updateCurveAppearance() override; + + virtual QString wellName() const = 0; + virtual QString wellLogChannelUiName() const = 0; + virtual QString wellLogChannelName() const; + virtual QString wellLogChannelUnits() const = 0; + virtual QString wellDate() const { return ""; }; + + static QString wellLogCurveIconName(); + + void setOverrideCurveData( const std::vector& propertyValues, + const std::vector& depthValues, + const RiaCurveDataTools::CurveIntervals& curveIntervals ); + +protected: + void updateZoomInParentPlot() override; + void updateLegendsInPlot() override; + void setOverrideCurveDataPropertyValueRange( double minimumValue, double maximumValue ); + void calculateCurveDataPropertyValueRange(); + + void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; + void setPropertyValuesAndDepths( const std::vector& propertyValues, const std::vector& depths, RiaDefines::DepthTypeEnum depthType, @@ -63,6 +87,9 @@ public: bool useLogarithmicScale, const QString& propertyUnit = RiaWellLogUnitTools::noUnitString() ); + void setPropertyAndDepthValuesToPlotCurve( const std::vector& propertyValues, + const std::vector& depthValues ); + void setPropertyValuesAndDepths( const std::vector& propertyValues, const std::map>& depths, double rkbDiff, @@ -71,33 +98,9 @@ public: bool useLogarithmicScale, const QString& propertyUnit = RiaWellLogUnitTools::noUnitString() ); - void setPropertyAndDepthValuesToPlotCurve( const std::vector& propertyValues, - const std::vector& depthValues ); - - const RigWellLogCurveData* curveData() const; - - void updateCurveAppearance() override; - - virtual QString wellName() const = 0; - virtual QString wellLogChannelUiName() const = 0; - virtual QString wellLogChannelName() const; - virtual QString wellLogChannelUnits() const = 0; - virtual QString wellDate() const { return ""; }; - - static QString wellLogCurveIconName(); - - void setOverrideCurveData( const std::vector& propertyValues, - const std::vector& depthValues, - const RiaCurveDataTools::CurveIntervals& curveIntervals ); - - virtual RiaDefines::PhaseType resultPhase() const; - -protected: - void updateZoomInParentPlot() override; - void updateLegendsInPlot() override; - void setOverrideCurveDataPropertyValueRange( double minimumValue, double maximumValue ); - void calculateCurveDataPropertyValueRange(); - void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; + void setPropertyAndDepthsAndErrors( const std::vector& propertyValues, + const std::vector& depthValues, + const std::vector& errorValues ); bool isVerticalCurve() const; RiuPlotAxis depthAxis() const; diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurveCommonDataSource.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurveCommonDataSource.cpp index c44703ed2b..4f8243caad 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurveCommonDataSource.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurveCommonDataSource.cpp @@ -359,9 +359,13 @@ void RimWellLogCurveCommonDataSource::analyseCurvesAndTracks( const std::vector< m_uniqueCases.insert( rftCurve->eclipseResultCase() ); auto adr = rftCurve->rftAddress(); - m_uniqueRftWellNames.insert( adr.wellName() ); - m_uniqueRftTimeSteps.insert( adr.timeStep() ); - m_uniqueRftBranchIds.insert( QString::number( adr.segmentBranchNumber() ) ); + if ( adr.wellLogChannel() == RifEclipseRftAddress::RftWellLogChannelType::SEGMENT_VALUES && + adr.segmentResultName() != "None" ) + { + m_uniqueRftWellNames.insert( adr.wellName() ); + m_uniqueRftTimeSteps.insert( adr.timeStep() ); + m_uniqueRftBranchIds.insert( adr.segmentBranchNumber() ); + } } } for ( RimWellLogTrack* track : tracks ) @@ -443,6 +447,11 @@ void RimWellLogCurveCommonDataSource::analyseCurvesAndTracks( const std::vector< { m_rftTimeStep = *( m_uniqueRftTimeSteps.begin() ); } + + if ( m_uniqueRftBranchIds.size() == 1u ) + { + m_rftSegmentBranchId = *( m_uniqueRftBranchIds.begin() ); + } } //-------------------------------------------------------------------------------------------------- @@ -745,7 +754,12 @@ std::vector RimWellLogCurveCommonDataSource::fieldsToShowI { fieldsToDisplay.push_back( &m_simWellName ); } - fieldsToDisplay.push_back( &m_timeStep ); + + if ( m_uniqueRftWellNames.size() == 1u ) fieldsToDisplay.push_back( &m_rftWellName ); + if ( m_uniqueTimeSteps.size() == 1u ) fieldsToDisplay.push_back( &m_timeStep ); + if ( m_uniqueRftTimeSteps.size() == 1u ) fieldsToDisplay.push_back( &m_rftTimeStep ); + if ( m_uniqueRftBranchIds.size() == 1u ) fieldsToDisplay.push_back( &m_rftSegmentBranchId ); + return fieldsToDisplay; } @@ -932,7 +946,7 @@ QList else if ( fieldNeedingOptions == &m_rftTimeStep ) { auto eclipseCase = dynamic_cast( m_case() ); - if ( eclipseCase && eclipseCase->rftReader() ) + if ( eclipseCase && eclipseCase->rftReader() && !m_uniqueRftWellNames.empty() ) { options = RimRftTools::segmentTimeStepOptions( eclipseCase->rftReader(), *( m_uniqueRftWellNames.begin() ) ); } @@ -1005,9 +1019,9 @@ void RimWellLogCurveCommonDataSource::defineUiOrdering( QString uiConfigName, ca group->add( &m_wbsSmoothingThreshold ); } - group->add( &m_rftWellName ); - group->add( &m_rftTimeStep ); - group->add( &m_rftSegmentBranchId ); + if ( !m_uniqueRftTimeSteps.empty() ) group->add( &m_rftTimeStep ); + if ( !m_uniqueRftWellNames.empty() ) group->add( &m_rftWellName ); + if ( !m_uniqueRftBranchIds.empty() ) group->add( &m_rftSegmentBranchId ); uiOrdering.skipRemainingFields( true ); } diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurveCommonDataSource.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurveCommonDataSource.h index 6f0b3ce44f..180b307769 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurveCommonDataSource.h +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurveCommonDataSource.h @@ -117,7 +117,7 @@ private: caf::PdmField m_rftTimeStep; caf::PdmField m_rftWellName; - caf::PdmField m_rftSegmentBranchId; + caf::PdmField m_rftSegmentBranchId; std::set m_uniqueCases; std::set m_uniqueTrajectoryTypes; @@ -131,5 +131,5 @@ private: std::set m_uniqueRftTimeSteps; std::set m_uniqueRftWellNames; - std::set m_uniqueRftBranchIds; + std::set m_uniqueRftBranchIds; }; diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.cpp index f5441f089f..0dfcd2b634 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.cpp @@ -173,7 +173,7 @@ RimWellLogRftCurve::RimWellLogRftCurve() CAF_PDM_InitFieldNoDefault( &m_rftDataType, "RftDataType", "Data Type" ); CAF_PDM_InitField( &m_segmentResultName, "SegmentResultName", RiaResultNames::undefinedResultName(), "Segment Result Name" ); - CAF_PDM_InitField( &m_segmentBranchId, "SegmentBranchId", RiaResultNames::undefinedResultName(), "Segment Branch" ); + CAF_PDM_InitField( &m_segmentBranchId, "SegmentBranchId", -1, "Segment Branch" ); } //-------------------------------------------------------------------------------------------------- @@ -234,7 +234,7 @@ QDateTime RimWellLogRftCurve::timeStep() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogRftCurve::setSegmentBranchId( const QString& branchId ) +void RimWellLogRftCurve::setSegmentBranchId( int branchId ) { m_segmentBranchId = branchId; } @@ -308,9 +308,20 @@ RimObservedFmuRftData* RimWellLogRftCurve::observedFmuRftData() const //-------------------------------------------------------------------------------------------------- void RimWellLogRftCurve::setRftAddress( RifEclipseRftAddress address ) { - m_timeStep = address.timeStep(); - m_wellName = address.wellName(); - m_wellLogChannelName = address.wellLogChannel(); + m_timeStep = address.timeStep(); + m_wellName = address.wellName(); + + if ( address.wellLogChannel() == RifEclipseRftAddress::RftWellLogChannelType::SEGMENT_VALUES ) + { + m_rftDataType = RftDataType::RFT_SEGMENT_DATA; + m_segmentResultName = address.segmentResultName(); + m_segmentBranchId = address.segmentBranchNumber(); + } + else + { + m_rftDataType = RftDataType::RFT_DATA; + m_wellLogChannelName = address.wellLogChannel(); + } } //-------------------------------------------------------------------------------------------------- @@ -318,7 +329,12 @@ void RimWellLogRftCurve::setRftAddress( RifEclipseRftAddress address ) //-------------------------------------------------------------------------------------------------- RifEclipseRftAddress RimWellLogRftCurve::rftAddress() const { - return { m_wellName, m_timeStep, m_wellLogChannelName() }; + if ( m_rftDataType == RftDataType::RFT_SEGMENT_DATA ) + { + return RifEclipseRftAddress::createSegmentAddress( m_wellName, m_timeStep, m_segmentResultName(), m_segmentBranchId() ); + } + + return RifEclipseRftAddress::createAddress( m_wellName, m_timeStep, m_wellLogChannelName() ); } //-------------------------------------------------------------------------------------------------- @@ -453,7 +469,7 @@ QString RimWellLogRftCurve::createCurveAutoName() { name.push_back( m_segmentResultName ); - QString branchText = "Branch " + m_segmentBranchId(); + QString branchText = QString( "Branch %1" ).arg( m_segmentBranchId() ); name.push_back( branchText ); } @@ -573,15 +589,10 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot ) auto propertyValues = this->curveData()->propertyValues(); auto depthValues = this->curveData()->depths( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, displayUnit ); - bool useLogarithmicScale = false; if ( !errors.empty() ) { - this->setSamplesFromXYErrorValues( propertyValues, - depthValues, - errors, - useLogarithmicScale, - RiaCurveDataTools::ErrorAxis::ERROR_ALONG_X_AXIS ); + setPropertyAndDepthsAndErrors( propertyValues, depthValues, errors ); } else { @@ -620,22 +631,25 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot ) { m_plotCurve->setPerPointLabels( perPointLabels ); - auto xValues = this->curveData()->propertyValuesByIntervals(); - auto yValues = + auto propertyValues = this->curveData()->propertyValuesByIntervals(); + auto depthValues = this->curveData()->depthValuesByIntervals( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, displayUnit ); bool useLogarithmicScale = false; if ( !errors.empty() ) { - this->setSamplesFromXYErrorValues( xValues, - yValues, - errors, - useLogarithmicScale, - RiaCurveDataTools::ErrorAxis::ERROR_ALONG_X_AXIS ); + setPropertyAndDepthsAndErrors( propertyValues, depthValues, errors ); } else { - m_plotCurve->setSamplesFromXValuesAndYValues( xValues, yValues, useLogarithmicScale ); + if ( isVerticalCurve() ) + { + m_plotCurve->setSamplesFromXValuesAndYValues( propertyValues, depthValues, useLogarithmicScale ); + } + else + { + m_plotCurve->setSamplesFromXValuesAndYValues( depthValues, propertyValues, useLogarithmicScale ); + } } } @@ -803,7 +817,9 @@ std::vector RimWellLogRftCurve::perPointLabels() const { if ( m_observedFmuRftData() ) { - RifEclipseRftAddress address( m_wellName(), m_timeStep, RifEclipseRftAddress::RftWellLogChannelType::PRESSURE ); + auto address = RifEclipseRftAddress::createAddress( m_wellName(), + m_timeStep, + RifEclipseRftAddress::RftWellLogChannelType::PRESSURE ); return m_observedFmuRftData()->labels( address ); } return {}; @@ -901,7 +917,8 @@ bool RimWellLogRftCurve::createWellPathIdxToRftFileIdxMapping() globCellIndicesToIndexInWell[intersections[idx].globCellIndex] = idx; } - RifEclipseRftAddress depthAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::RftWellLogChannelType::TVD ); + RifEclipseRftAddress depthAddress = + RifEclipseRftAddress::createAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::RftWellLogChannelType::TVD ); std::vector rftIndices; if ( !rftReader() ) return false; @@ -972,15 +989,15 @@ std::vector RimWellLogRftCurve::xValues() if ( m_rftDataType() == RftDataType::RFT_SEGMENT_DATA ) { - auto depthAddress = RifEclipseRftAddress::createSegmentResult( m_wellName(), m_timeStep, m_segmentResultName() ); - depthAddress.setSegmentBranchNumber( segmentBranchNumber() ); + auto depthAddress = + RifEclipseRftAddress::createSegmentAddress( m_wellName(), m_timeStep, m_segmentResultName(), segmentBranchId() ); reader->values( depthAddress, &values ); return values; } - RifEclipseRftAddress address( m_wellName(), m_timeStep, m_wellLogChannelName() ); + auto address = RifEclipseRftAddress::createAddress( m_wellName(), m_timeStep, m_wellLogChannelName() ); reader->values( address, &values ); @@ -1014,9 +1031,10 @@ std::vector RimWellLogRftCurve::errorValues() if ( reader && m_rftDataType() == RftDataType::RFT_DATA ) { - RifEclipseRftAddress errorAddress( m_wellName(), - m_timeStep, - RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_ERROR ); + RifEclipseRftAddress errorAddress = + RifEclipseRftAddress::createAddress( m_wellName(), + m_timeStep, + RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_ERROR ); reader->values( errorAddress, &errorValues ); } @@ -1035,15 +1053,17 @@ std::vector RimWellLogRftCurve::tvDepthValues() if ( m_rftDataType() == RftDataType::RFT_SEGMENT_DATA ) { - auto depthAddress = - RifEclipseRftAddress::createSegmentResult( m_wellName(), m_timeStep, RiaDefines::segmentTvdDepthResultName() ); - depthAddress.setSegmentBranchNumber( segmentBranchNumber() ); + auto depthAddress = RifEclipseRftAddress::createSegmentAddress( m_wellName(), + m_timeStep, + RiaDefines::segmentTvdDepthResultName(), + segmentBranchId() ); reader->values( depthAddress, &values ); return values; } - RifEclipseRftAddress depthAddress( 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(); @@ -1078,10 +1098,10 @@ std::vector RimWellLogRftCurve::measuredDepthValues() RifReaderRftInterface* reader = rftReader(); if ( reader ) { - auto depthAddress = RifEclipseRftAddress::createSegmentResult( m_wellName(), - m_timeStep, - RiaDefines::segmentStartDepthResultName() ); - depthAddress.setSegmentBranchNumber( segmentBranchNumber() ); + auto depthAddress = RifEclipseRftAddress::createSegmentAddress( m_wellName(), + m_timeStep, + RiaDefines::segmentStartDepthResultName(), + segmentBranchId() ); reader->values( depthAddress, &values ); } @@ -1095,7 +1115,8 @@ std::vector RimWellLogRftCurve::measuredDepthValues() if ( !reader ) return values; - RifEclipseRftAddress depthAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::RftWellLogChannelType::MD ); + RifEclipseRftAddress depthAddress = + RifEclipseRftAddress::createAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::RftWellLogChannelType::MD ); reader->values( depthAddress, &values ); return values; } @@ -1144,7 +1165,7 @@ bool RimWellLogRftCurve::deriveMeasuredDepthValuesFromWellPath( const std::vecto RimProject* proj = RimProject::current(); RimWellPath* wellPath = proj->wellPathByName( m_wellName ); - if ( wellPath ) + if ( wellPath && wellPath->wellPathGeometry() ) { const std::vector& mdValuesOfWellPath = wellPath->wellPathGeometry()->measuredDepths(); const std::vector& tvdValuesOfWellPath = wellPath->wellPathGeometry()->trueVerticalDepths(); @@ -1171,8 +1192,14 @@ bool RimWellLogRftCurve::deriveMeasuredDepthFromObservedData( const std::vector< std::vector tvdValuesOfObservedData; std::vector mdValuesOfObservedData; - RifEclipseRftAddress tvdAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::RftWellLogChannelType::TVD ); - RifEclipseRftAddress mdAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::RftWellLogChannelType::MD ); + RifEclipseRftAddress tvdAddress = + RifEclipseRftAddress::createAddress( m_wellName(), + m_timeStep, + RifEclipseRftAddress::RftWellLogChannelType::TVD ); + RifEclipseRftAddress mdAddress = + RifEclipseRftAddress::createAddress( m_wellName(), + m_timeStep, + RifEclipseRftAddress::RftWellLogChannelType::MD ); reader->values( tvdAddress, &tvdValuesOfObservedData ); reader->values( mdAddress, &mdValuesOfObservedData ); @@ -1193,14 +1220,7 @@ bool RimWellLogRftCurve::deriveMeasuredDepthFromObservedData( const std::vector< //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -int RimWellLogRftCurve::segmentBranchNumber() const +int RimWellLogRftCurve::segmentBranchId() const { - if ( m_segmentBranchId() != RiaDefines::allBranches() ) - { - QString text = m_segmentBranchId(); - auto intValue = text.toInt(); - return intValue; - } - - return -1; + return m_segmentBranchId(); } diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.h index 64fe815ac6..73ddae2aee 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.h +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.h @@ -76,7 +76,7 @@ public: void setTimeStep( const QDateTime& dateTime ); QDateTime timeStep() const; - void setSegmentBranchId( const QString& branchId ); + void setSegmentBranchId( int branchId ); void setEclipseResultCase( RimEclipseResultCase* eclipseResultCase ); RimEclipseResultCase* eclipseResultCase() const; @@ -130,7 +130,7 @@ private: bool deriveMeasuredDepthFromObservedData( const std::vector& tvDepthValues, std::vector& derivedMDValues ); - int segmentBranchNumber() const; + int segmentBranchId() const; private: caf::PdmPtrField m_eclipseResultCase; @@ -145,7 +145,7 @@ private: caf::PdmField> m_rftDataType; caf::PdmField m_segmentResultName; - caf::PdmField m_segmentBranchId; + caf::PdmField m_segmentBranchId; std::map m_idxInWellPathToIdxInRftFile; caf::PdmField> m_wellLogChannelName; diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp index c9af9f159c..6e65a48e76 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp @@ -401,6 +401,17 @@ void RimWellLogTrack::calculatePropertyValueZoomRange() { std::tie( minValue, maxValue ) = adjustXRange( minValue, maxValue, m_minorTickInterval() ); } + else + { + auto range = std::fabs( maxValue - minValue ); + maxValue += 0.1 * range; + + auto candidateMinValue = minValue - 0.1 * range; + if ( std::signbit( minValue ) == std::signbit( candidateMinValue ) ) + { + minValue = candidateMinValue; + } + } m_availablePropertyValueRangeMin = minValue; m_availablePropertyValueRangeMax = maxValue; @@ -573,7 +584,7 @@ void RimWellLogTrack::fieldChangedByUi( const caf::PdmFieldHandle* changedField, } else if ( changedField == &m_visiblePropertyValueRangeMin || changedField == &m_visiblePropertyValueRangeMax ) { - bool emptyRange = isEmptyVisibleXRange(); + bool emptyRange = isEmptyVisiblePropertyRange(); m_explicitTickIntervals.uiCapability()->setUiReadOnly( emptyRange ); m_propertyValueAxisGridVisibility.uiCapability()->setUiReadOnly( emptyRange ); @@ -775,7 +786,7 @@ void RimWellLogTrack::updatePropertyValueAxisAndGridTickIntervals() { if ( !m_plotWidget ) return; - bool emptyRange = isEmptyVisibleXRange(); + bool emptyRange = isEmptyVisiblePropertyRange(); if ( emptyRange ) { m_plotWidget->enableGridLines( valueAxis(), false, false ); @@ -1227,7 +1238,7 @@ void RimWellLogTrack::visibleDepthRange( double* minDepth, double* maxDepth ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RimWellLogTrack::isEmptyVisibleXRange() const +bool RimWellLogTrack::isEmptyVisiblePropertyRange() const { return std::abs( m_visiblePropertyValueRangeMax() - m_visiblePropertyValueRangeMin ) < 1.0e-6 * std::max( 1.0, std::max( m_visiblePropertyValueRangeMax(), m_visiblePropertyValueRangeMin() ) ); @@ -1304,10 +1315,12 @@ void RimWellLogTrack::onLoadDataAndUpdate() m_majorTickInterval.uiCapability()->setUiHidden( !m_explicitTickIntervals() ); m_minorTickInterval.uiCapability()->setUiHidden( !m_explicitTickIntervals() ); - bool emptyRange = isEmptyVisibleXRange(); + bool emptyRange = isEmptyVisiblePropertyRange(); m_explicitTickIntervals.uiCapability()->setUiReadOnly( emptyRange ); m_propertyValueAxisGridVisibility.uiCapability()->setUiReadOnly( emptyRange ); + updateDepthZoom(); + updateLegend(); } @@ -1404,7 +1417,7 @@ void RimWellLogTrack::setAutoScaleDepthValuesEnabled( bool enabled ) void RimWellLogTrack::setAutoScalePropertyValuesIfNecessary() { // Avoid resetting if visible range has set to empty by user - bool emptyRange = isEmptyVisibleXRange(); + bool emptyRange = isEmptyVisiblePropertyRange(); if ( !m_isAutoScalePropertyValuesEnabled && emptyRange ) return; const double eps = 1.0e-8; @@ -2332,7 +2345,7 @@ void RimWellLogTrack::uiOrderingForRftPltFormations( caf::PdmUiOrdering& uiOrder //-------------------------------------------------------------------------------------------------- void RimWellLogTrack::uiOrderingForXAxisSettings( caf::PdmUiOrdering& uiOrdering ) { - caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup( "X Axis Settings" ); + caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup( "Property Axis Settings" ); gridGroup->add( &m_isLogarithmicScaleEnabled ); gridGroup->add( &m_visiblePropertyValueRangeMin ); gridGroup->add( &m_visiblePropertyValueRangeMax ); diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.h index 26c597e49b..00496431df 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.h +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.h @@ -309,7 +309,7 @@ private: const RigGeoMechWellLogExtractor* extractor ) const; void connectCurveSignals( RimWellLogCurve* curve ); - bool isEmptyVisibleXRange() const; + bool isEmptyVisiblePropertyRange() const; private: QString m_propertyValueAxisTitle;