diff --git a/ApplicationLibCode/Commands/RicWellLogTools.cpp b/ApplicationLibCode/Commands/RicWellLogTools.cpp index 26c373dd3a..8879004d63 100644 --- a/ApplicationLibCode/Commands/RicWellLogTools.cpp +++ b/ApplicationLibCode/Commands/RicWellLogTools.cpp @@ -497,11 +497,11 @@ RimWellLogCurve* RicWellLogTools::addSummaryRftCurve( RimWellLogTrack* plotTrack //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimWellLogCurve* RicWellLogTools::addSummaryRftSegmentCurve( RimWellLogTrack* plotTrack, - const QString& resultName, - const QString& wellName, - RiaDefines::RftBranchType branchType, - RimSummaryCase* rimCase ) +RimWellLogRftCurve* RicWellLogTools::addSummaryRftSegmentCurve( RimWellLogTrack* plotTrack, + const QString& resultName, + const QString& wellName, + RiaDefines::RftBranchType branchType, + RimSummaryCase* rimCase ) { auto curve = new RimWellLogRftCurve(); @@ -519,7 +519,6 @@ RimWellLogCurve* RicWellLogTools::addSummaryRftSegmentCurve( RimWellLogTrack* curve->enableColorFromResultName( true ); curve->assignColorFromResultName( resultName ); curve->setLineThickness( 4 ); - curve->setFillStyle( Qt::SolidPattern ); curve->setInterpolation( RiuQwtPlotCurveDefines::CurveInterpolationEnum::INTERPOLATION_STEP_LEFT ); diff --git a/ApplicationLibCode/Commands/RicWellLogTools.h b/ApplicationLibCode/Commands/RicWellLogTools.h index 41306e27fd..cb3fb820fe 100644 --- a/ApplicationLibCode/Commands/RicWellLogTools.h +++ b/ApplicationLibCode/Commands/RicWellLogTools.h @@ -77,12 +77,12 @@ public: const QString& measurementName, bool showPlotWindow = true ); - static RimWellLogCurve* addSummaryRftCurve( RimWellLogTrack* plotTrack, RimSummaryCase* rimCase ); - static RimWellLogCurve* addSummaryRftSegmentCurve( RimWellLogTrack* plotTrack, - const QString& resultName, - const QString& wellName, - RiaDefines::RftBranchType branchType, - RimSummaryCase* rimCase ); + static RimWellLogCurve* addSummaryRftCurve( RimWellLogTrack* plotTrack, RimSummaryCase* rimCase ); + static RimWellLogRftCurve* addSummaryRftSegmentCurve( RimWellLogTrack* plotTrack, + const QString& resultName, + const QString& wellName, + RiaDefines::RftBranchType branchType, + RimSummaryCase* rimCase ); private: template diff --git a/ApplicationLibCode/Commands/WellLogCommands/RicNewMultiPhaseRftSegmentPlotFeature.cpp b/ApplicationLibCode/Commands/WellLogCommands/RicNewMultiPhaseRftSegmentPlotFeature.cpp index 5f9b7731f6..5513507a5e 100644 --- a/ApplicationLibCode/Commands/WellLogCommands/RicNewMultiPhaseRftSegmentPlotFeature.cpp +++ b/ApplicationLibCode/Commands/WellLogCommands/RicNewMultiPhaseRftSegmentPlotFeature.cpp @@ -24,6 +24,7 @@ #include "RicWellLogTools.h" #include "RiaApplication.h" +#include "RiaPlotWindowRedrawScheduler.h" #include "RiaRftDefines.h" #include "RifReaderOpmRft.h" @@ -32,6 +33,7 @@ #include "RimRftTopologyCurve.h" #include "RimSummaryCase.h" #include "RimWellLogPlot.h" +#include "RimWellLogRftCurve.h" #include "RimWellLogTrack.h" #include "RiuPlotMainWindowTools.h" @@ -70,6 +72,8 @@ void RicNewMultiPhaseRftSegmentPlotFeature::onActionTriggered( bool isChecked ) plot->setPlotTitleVisible( true ); plot->setLegendItemsClickable( false ); plot->enableDepthMarkerLine( true ); + plot->setLegendPosition( RimPlotWindow::LegendPosition::INSIDE_UPPER_LEFT ); + plot->setLegendFontSize( caf::FontTools::RelativeSize::XSmall ); QString wellName = "Unknown"; @@ -80,21 +84,36 @@ void RicNewMultiPhaseRftSegmentPlotFeature::onActionTriggered( bool isChecked ) if ( !wellNames.empty() ) wellName = *wellNames.begin(); } - std::vector resultNames = { "SEGGRAT", "SEGORAT", "SEGWRAT" }; + appendTrackAndCurveForBranchType( plot, + "Connection Rates", + { "CONGRAT", "CONORAT", "CONWRAT" }, + wellName, + RiaDefines::RftBranchType::RFT_ANNULUS, + summaryCase ); - std::vector branchTypes{ RiaDefines::RftBranchType::RFT_ANNULUS, - RiaDefines::RftBranchType::RFT_DEVICE, - RiaDefines::RftBranchType::RFT_TUBING }; - - for ( auto branchType : branchTypes ) { - appendTrackAndCurveForBranchType( plot, resultNames, wellName, branchType, summaryCase ); + for ( auto branchType : { RiaDefines::RftBranchType::RFT_ANNULUS, + RiaDefines::RftBranchType::RFT_DEVICE, + RiaDefines::RftBranchType::RFT_TUBING } ) + { + appendTrackAndCurveForBranchType( plot, + "Segment Rates", + { "SEGGRAT", "SEGORAT", "SEGWRAT" }, + wellName, + branchType, + summaryCase ); + } } + RicNewRftSegmentWellLogPlotFeature::appendPressureTrack( plot, wellName, summaryCase ); + RicNewRftSegmentWellLogPlotFeature::appendConnectionFactorTrack( plot, wellName, summaryCase ); RicNewRftSegmentWellLogPlotFeature::appendTopologyTrack( plot, wellName, summaryCase ); plot->loadDataAndUpdate(); + RiaPlotWindowRedrawScheduler::instance()->performScheduledUpdatesAndReplots(); + plot->updateLayout(); + RiuPlotMainWindowTools::onObjectAppended( plot ); } @@ -102,14 +121,15 @@ void RicNewMultiPhaseRftSegmentPlotFeature::onActionTriggered( bool isChecked ) /// //-------------------------------------------------------------------------------------------------- void RicNewMultiPhaseRftSegmentPlotFeature::appendTrackAndCurveForBranchType( RimWellLogPlot* plot, + const QString& trackName, const std::vector& resultNames, const QString& wellName, RiaDefines::RftBranchType branchType, RimSummaryCase* summaryCase ) { - RimWellLogTrack* plotTrack = new RimWellLogTrack(); + auto plotTrack = new RimWellLogTrack(); plot->addPlot( plotTrack ); - plotTrack->setDescription( QString( "Track %1" ).arg( plot->plotCount() ) ); + plotTrack->setDescription( trackName ); plot->loadDataAndUpdate(); @@ -121,11 +141,16 @@ void RicNewMultiPhaseRftSegmentPlotFeature::appendTrackAndCurveForBranchType( Ri QString templateText = RiaDefines::namingVariableResultName() + ", " + RiaDefines::namingVariableResultType(); curve->setCurveNameTemplateText( templateText ); + if ( resultName == "SEGGRAT" || resultName == "CONGRAT" ) + { + curve->setScaleFactor( 1e-3 ); + } + curve->setFillStyle( Qt::SolidPattern ); + curve->setIsStacked( true ); curve->loadDataAndUpdate( true ); curve->updateAllRequiredEditors(); - RiuPlotMainWindowTools::setExpanded( curve ); } } diff --git a/ApplicationLibCode/Commands/WellLogCommands/RicNewMultiPhaseRftSegmentPlotFeature.h b/ApplicationLibCode/Commands/WellLogCommands/RicNewMultiPhaseRftSegmentPlotFeature.h index af6c55f7f8..4ddd255a75 100644 --- a/ApplicationLibCode/Commands/WellLogCommands/RicNewMultiPhaseRftSegmentPlotFeature.h +++ b/ApplicationLibCode/Commands/WellLogCommands/RicNewMultiPhaseRftSegmentPlotFeature.h @@ -39,6 +39,7 @@ private: void setupActionLook( QAction* actionToSetup ) override; void appendTrackAndCurveForBranchType( RimWellLogPlot* plot, + const QString& trackName, const std::vector& resultNames, const QString& wellName, RiaDefines::RftBranchType branchType, diff --git a/ApplicationLibCode/Commands/WellLogCommands/RicNewRftSegmentWellLogPlotFeature.cpp b/ApplicationLibCode/Commands/WellLogCommands/RicNewRftSegmentWellLogPlotFeature.cpp index 2790790438..f4e46be640 100644 --- a/ApplicationLibCode/Commands/WellLogCommands/RicNewRftSegmentWellLogPlotFeature.cpp +++ b/ApplicationLibCode/Commands/WellLogCommands/RicNewRftSegmentWellLogPlotFeature.cpp @@ -23,6 +23,8 @@ #include "RicWellLogTools.h" #include "RiaApplication.h" +#include "RiaColorTools.h" +#include "RiaPlotWindowRedrawScheduler.h" #include "RiaRftDefines.h" #include "RifReaderOpmRft.h" @@ -30,6 +32,7 @@ #include "RimRftCase.h" #include "RimRftTopologyCurve.h" #include "RimSummaryCase.h" +#include "RimWellLogRftCurve.h" #include "RimWellLogTrack.h" #include "RiuPlotMainWindow.h" @@ -69,6 +72,8 @@ void RicNewRftSegmentWellLogPlotFeature::onActionTriggered( bool isChecked ) plot->setPlotTitleVisible( true ); plot->setLegendItemsClickable( false ); plot->enableDepthMarkerLine( true ); + plot->setLegendPosition( RimPlotWindow::LegendPosition::INSIDE_UPPER_LEFT ); + plot->setLegendFontSize( caf::FontTools::RelativeSize::XSmall ); QString wellName = "Unknown"; @@ -79,48 +84,80 @@ void RicNewRftSegmentWellLogPlotFeature::onActionTriggered( bool isChecked ) if ( !wellNames.empty() ) wellName = *wellNames.begin(); } - QString resultName = "SEGGRAT"; - - std::vector branchTypes{ RiaDefines::RftBranchType::RFT_ANNULUS, - RiaDefines::RftBranchType::RFT_DEVICE, - RiaDefines::RftBranchType::RFT_TUBING }; - - for ( auto branchType : branchTypes ) { - appendTrackAndCurveForBranchType( plot, resultName, wellName, branchType, summaryCase ); + RimWellLogTrack* plotTrack = new RimWellLogTrack(); + plot->addPlot( plotTrack ); + plotTrack->setDescription( "Connection Rates" ); + + auto curve = + createAndAddCurve( plotTrack, "CONGRAT", wellName, RiaDefines::RftBranchType::RFT_ANNULUS, summaryCase ); + curve->setScaleFactor( 1e-3 ); + curve->setFillStyle( Qt::SolidPattern ); } + for ( auto branchType : { RiaDefines::RftBranchType::RFT_ANNULUS, + RiaDefines::RftBranchType::RFT_DEVICE, + RiaDefines::RftBranchType::RFT_TUBING } ) + { + QString resultName = "SEGGRAT"; + QString trackName = "Segment Rates"; + auto curve = appendTrackAndCurveForBranchType( plot, trackName, resultName, wellName, branchType, summaryCase ); + curve->setScaleFactor( 1e-3 ); + curve->setFillStyle( Qt::SolidPattern ); + } + + appendPressureTrack( plot, wellName, summaryCase ); + appendConnectionFactorTrack( plot, wellName, summaryCase ); appendTopologyTrack( plot, wellName, summaryCase ); + plot->loadDataAndUpdate(); + RiaPlotWindowRedrawScheduler::instance()->performScheduledUpdatesAndReplots(); + plot->updateLayout(); + RiuPlotMainWindowTools::onObjectAppended( plot ); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicNewRftSegmentWellLogPlotFeature::appendTrackAndCurveForBranchType( RimWellLogPlot* plot, +RimWellLogRftCurve* RicNewRftSegmentWellLogPlotFeature::appendTrackAndCurveForBranchType( RimWellLogPlot* plot, + const QString& trackName, + const QString& resultName, + const QString& wellName, + RiaDefines::RftBranchType branchType, + RimSummaryCase* summaryCase ) +{ + RimWellLogTrack* plotTrack = new RimWellLogTrack(); + plot->addPlot( plotTrack ); + plotTrack->setDescription( trackName ); + + plot->loadDataAndUpdate(); + + auto curve = createAndAddCurve( plotTrack, resultName, wellName, branchType, summaryCase ); + + curve->loadDataAndUpdate( true ); + curve->updateAllRequiredEditors(); + + return curve; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellLogRftCurve* RicNewRftSegmentWellLogPlotFeature::createAndAddCurve( RimWellLogTrack* track, const QString& resultName, const QString& wellName, RiaDefines::RftBranchType branchType, RimSummaryCase* summaryCase ) { - RimWellLogTrack* plotTrack = new RimWellLogTrack(); - plot->addPlot( plotTrack ); - plotTrack->setDescription( QString( "Track %1" ).arg( plot->plotCount() ) ); - - plot->loadDataAndUpdate(); - - auto curve = RicWellLogTools::addSummaryRftSegmentCurve( plotTrack, resultName, wellName, branchType, summaryCase ); + auto curve = RicWellLogTools::addSummaryRftSegmentCurve( track, resultName, wellName, branchType, summaryCase ); curve->setNamingMethod( RiaDefines::ObjectNamingMethod::TEMPLATE ); QString templateText = RiaDefines::namingVariableResultName() + ", " + RiaDefines::namingVariableResultType(); curve->setCurveNameTemplateText( templateText ); - curve->loadDataAndUpdate( true ); - - curve->updateAllRequiredEditors(); - RiuPlotMainWindowTools::setExpanded( curve ); + return curve; } //-------------------------------------------------------------------------------------------------- @@ -205,6 +242,59 @@ void RicNewRftSegmentWellLogPlotFeature::appendTopologyTrack( RimWellLogPlot* pl track->updateAllRequiredEditors(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicNewRftSegmentWellLogPlotFeature::appendPressureTrack( RimWellLogPlot* plot, + const QString& wellName, + RimSummaryCase* summaryCase ) +{ + auto track = new RimWellLogTrack(); + track->setDescription( "Pressure" ); + + plot->addPlot( track ); + + QString resultName = "SEGPRES"; + for ( auto branchType : { RiaDefines::RftBranchType::RFT_TUBING, + RiaDefines::RftBranchType::RFT_DEVICE, + RiaDefines::RftBranchType::RFT_ANNULUS } ) + { + auto curve = createAndAddCurve( track, resultName, wellName, branchType, summaryCase ); + auto color = RimRftTopologyCurve::colorForRftBranchType( branchType ); + curve->setColor( color ); + curve->setLineThickness( 3 ); + } + + auto curve = createAndAddCurve( track, "PRESSURE", wellName, RiaDefines::RftBranchType::RFT_ANNULUS, summaryCase ); + curve->setLineThickness( 3 ); + + track->updateAllRequiredEditors(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicNewRftSegmentWellLogPlotFeature::appendConnectionFactorTrack( RimWellLogPlot* plot, + const QString& wellName, + RimSummaryCase* summaryCase ) +{ + QString trackName = "Connection Factors"; + QString resultName = "CONFAC"; + auto curve = appendTrackAndCurveForBranchType( plot, + trackName, + resultName, + wellName, + RiaDefines::RftBranchType::RFT_ANNULUS, + summaryCase ); + + auto curveColor = cvf::Color3f( cvf::Color3f::ColorIdent::ORANGE ); + curve->setColor( curveColor ); + + auto fillColor = RiaColorTools::makeLighter( curveColor, 0.3f ); + curve->setFillColor( fillColor ); + curve->setFillStyle( Qt::SolidPattern ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Commands/WellLogCommands/RicNewRftSegmentWellLogPlotFeature.h b/ApplicationLibCode/Commands/WellLogCommands/RicNewRftSegmentWellLogPlotFeature.h index fdc7db02ea..25e25f426e 100644 --- a/ApplicationLibCode/Commands/WellLogCommands/RicNewRftSegmentWellLogPlotFeature.h +++ b/ApplicationLibCode/Commands/WellLogCommands/RicNewRftSegmentWellLogPlotFeature.h @@ -25,6 +25,8 @@ class RimWellLogPlot; class RimSummaryCase; class RimPlotCurve; +class RimWellLogTrack; +class RimWellLogRftCurve; //================================================================================================== /// @@ -35,6 +37,8 @@ class RicNewRftSegmentWellLogPlotFeature : public caf::CmdFeature public: static void appendTopologyTrack( RimWellLogPlot* plot, const QString& wellName, RimSummaryCase* summaryCase ); + static void appendPressureTrack( RimWellLogPlot* plot, const QString& wellName, RimSummaryCase* summaryCase ); + static void appendConnectionFactorTrack( RimWellLogPlot* plot, const QString& wellName, RimSummaryCase* summaryCase ); private: bool isCommandEnabled() override; @@ -42,11 +46,18 @@ private: void setupActionLook( QAction* actionToSetup ) override; - void appendTrackAndCurveForBranchType( RimWellLogPlot* plot, - const QString& resultName, - const QString& wellName, - RiaDefines::RftBranchType branchType, - RimSummaryCase* summaryCase ); + static RimWellLogRftCurve* appendTrackAndCurveForBranchType( RimWellLogPlot* plot, + const QString& trackName, + const QString& resultName, + const QString& wellName, + RiaDefines::RftBranchType branchType, + RimSummaryCase* summaryCase ); + + static RimWellLogRftCurve* createAndAddCurve( RimWellLogTrack* track, + const QString& resultName, + const QString& wellName, + RiaDefines::RftBranchType branchType, + RimSummaryCase* summaryCase ); static std::vector appendAdditionalDataSourceTrack( RimWellLogPlot* plot, const QString& wellName, RimSummaryCase* summaryCase ); diff --git a/ApplicationLibCode/FileInterface/RifReaderOpmRft.cpp b/ApplicationLibCode/FileInterface/RifReaderOpmRft.cpp index 9b461e7279..581cd6efd4 100644 --- a/ApplicationLibCode/FileInterface/RifReaderOpmRft.cpp +++ b/ApplicationLibCode/FileInterface/RifReaderOpmRft.cpp @@ -112,7 +112,8 @@ void RifReaderOpmRft::values( const RifEclipseRftAddress& rftAddress, std::vecto try { - auto data = m_opm_rft->getRft( resultName, wellName, y, m, d ); + std::vector data = resultAsFloat( resultName, wellName, y, m, d ); + if ( !data.empty() ) { if ( rftAddress.wellLogChannel() == RifEclipseRftAddress::RftWellLogChannelType::SEGMENT_VALUES ) @@ -391,22 +392,17 @@ void RifReaderOpmRft::buildMetaData() importWellNames(); auto reports = m_opm_rft->listOfRftReports(); - for ( const auto& report : reports ) + for ( const auto& [wellName, reportDate, reportTime] : reports ) { - auto [wellName, reportDate, reportTime] = report; - auto rftVectors = m_opm_rft->listOfRftArrays( wellName, reportDate ); + auto results = m_opm_rft->listOfRftArrays( wellName, reportDate ); - for ( const auto& rftVec : rftVectors ) + for ( const auto& [name, arrayType, size] : results ) { - auto [resultDataName, arrType, itemCount] = rftVec; - - int y = std::get<0>( reportDate ); - int m = std::get<1>( reportDate ); - int d = std::get<2>( reportDate ); + const auto& [y, m, d] = reportDate; auto dt = RiaQDateTimeTools::createUtcDateTime( QDate( y, m, d ) ); - auto channelType = identifyChannelType( resultDataName ); + auto channelType = identifyChannelType( name ); if ( channelType != RifEclipseRftAddress::RftWellLogChannelType::NONE ) { auto adr = RifEclipseRftAddress::createAddress( QString::fromStdString( wellName ), dt, channelType ); @@ -423,22 +419,17 @@ void RifReaderOpmRft::buildMetaData() auto [wellName, reportDate] = segmentWellData.first; auto segmentData = segmentWellData.second; - auto resultNameAndSizes = segmentData.resultNameAndSize(); - - int y = std::get<0>( reportDate ); - int m = std::get<1>( reportDate ); - int d = std::get<2>( reportDate ); - - auto dt = RiaQDateTimeTools::createUtcDateTime( QDate( y, m, d ) ); + const auto& [y, m, d] = reportDate; + auto dt = RiaQDateTimeTools::createUtcDateTime( QDate( y, m, d ) ); m_rftSegmentTimeSteps.insert( dt ); - for ( const auto& resultNameAndSize : resultNameAndSizes ) + auto resultNameAndSizes = segmentData.resultNameAndSize(); + for ( const auto& [name, arrayType, size] : resultNameAndSizes ) { - auto resultName = std::get<0>( resultNameAndSize ); - auto adr = RifEclipseRftAddress::createSegmentAddress( QString::fromStdString( wellName ), + auto adr = RifEclipseRftAddress::createSegmentAddress( QString::fromStdString( wellName ), dt, - QString::fromStdString( resultName ) ); + QString::fromStdString( name ) ); m_addresses.insert( adr ); } @@ -508,11 +499,10 @@ void RifReaderOpmRft::buildSegmentData() RifRftSegment segment; segment.setSegmentData( segmentsForWellDate ); - auto arraysAtWellDate = m_opm_rft->listOfRftArrays( wellName, date ); + auto results = m_opm_rft->listOfRftArrays( wellName, date ); - for ( const auto& rftResultMetaData : arraysAtWellDate ) + for ( const auto& [name, arrayType, size] : results ) { - auto [name, arrayType, size] = rftResultMetaData; if ( ( name.find( "SEG" ) == 0 ) && m_segmentResultItemCount == 0 ) { m_segmentResultItemCount = size; @@ -523,9 +513,9 @@ void RifReaderOpmRft::buildSegmentData() } } - for ( const auto& rftResultMetaData : arraysAtWellDate ) + for ( const auto& rftResultMetaData : results ) { - auto [name, arrayType, size] = rftResultMetaData; + const auto& [name, arrayType, size] = rftResultMetaData; if ( size == static_cast( m_segmentResultItemCount ) || size == static_cast( m_connectionResultItemCount ) ) { @@ -551,8 +541,9 @@ void RifReaderOpmRft::segmentDataDebugLog() const auto [wellName, date] = a.first; auto segmentData = a.second; - std::cout << "\nWell: " << wellName << "Date : " << std::get<0>( date ) << " " << std::get<1>( date ) << " " - << std::get<2>( date ) << " \n"; + const auto& [y, m, d] = date; + + std::cout << "\nWell: " << wellName << "Date : " << y << " " << m << " " << d << " \n"; for ( const auto& r : segmentData.topology() ) { @@ -606,11 +597,8 @@ void RifReaderOpmRft::buildSegmentBranchTypes( const RftSegmentKey& segmentKey ) auto date = segmentKey.second; RifRftSegment& segmentRef = m_rftWellDateSegments[segmentKey]; - int y = std::get<0>( date ); - int m = std::get<1>( date ); - int d = std::get<2>( date ); - - auto dt = RiaQDateTimeTools::createUtcDateTime( QDate( y, m, d ) ); + const auto& [y, m, d] = date; + auto dt = RiaQDateTimeTools::createUtcDateTime( QDate( y, m, d ) ); std::vector seglenstValues; std::vector seglenenValues; @@ -943,3 +931,41 @@ std::string RifReaderOpmRft::resultNameFromChannelType( RifEclipseRftAddress::Rf return {}; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector + RifReaderOpmRft::resultAsFloat( const std::string& resultName, const std::string& wellName, int year, int month, int day ) const +{ + Opm::EclIO::eclArrType resultDataType = Opm::EclIO::eclArrType::REAL; + + auto results = m_opm_rft->listOfRftArrays( wellName, year, month, day ); + for ( const auto& [name, arrayType, size] : results ) + { + if ( resultName == name ) + { + resultDataType = arrayType; + break; + } + } + + if ( resultDataType == Opm::EclIO::eclArrType::INTE ) + { + std::vector data; + + auto integerData = m_opm_rft->getRft( resultName, wellName, year, month, day ); + for ( auto val : integerData ) + { + data.push_back( val ); + } + + return data; + } + else + { + return m_opm_rft->getRft( resultName, wellName, year, month, day ); + } + + return {}; +} diff --git a/ApplicationLibCode/FileInterface/RifReaderOpmRft.h b/ApplicationLibCode/FileInterface/RifReaderOpmRft.h index 1e3418c7a2..bf93ecfea0 100644 --- a/ApplicationLibCode/FileInterface/RifReaderOpmRft.h +++ b/ApplicationLibCode/FileInterface/RifReaderOpmRft.h @@ -89,6 +89,9 @@ private: static RifEclipseRftAddress::RftWellLogChannelType identifyChannelType( const std::string& resultName ); static std::string resultNameFromChannelType( RifEclipseRftAddress::RftWellLogChannelType channelType ); + std::vector + resultAsFloat( const std::string& resultName, const std::string& wellName, int year, int month, int day ) const; + private: std::unique_ptr m_opm_rft; diff --git a/ApplicationLibCode/FileInterface/RifRftSegment.cpp b/ApplicationLibCode/FileInterface/RifRftSegment.cpp index 317a5ee995..4a7a7ebd41 100644 --- a/ApplicationLibCode/FileInterface/RifRftSegment.cpp +++ b/ApplicationLibCode/FileInterface/RifRftSegment.cpp @@ -327,9 +327,10 @@ std::vector RifRftSegment::packerSegmentIndicesOnAnnulus( int branchInde auto segment = m_topology[segmentIndex]; auto outflowSegmentNumber = segment.segNext(); - auto candidateSegment = segmentData( outflowSegmentNumber ); - auto candidateBranchType = branchType( candidateSegment->segBrno() ); + auto candidateSegment = segmentData( outflowSegmentNumber ); + if ( !candidateSegment ) continue; + auto candidateBranchType = branchType( candidateSegment->segBrno() ); if ( candidateBranchType == RiaDefines::RftBranchType::RFT_DEVICE ) { packerSegmentIndices.push_back( segmentIndex ); diff --git a/ApplicationLibCode/ProjectDataModel/RimDepthTrackPlot.cpp b/ApplicationLibCode/ProjectDataModel/RimDepthTrackPlot.cpp index 0a45b855c3..8860862695 100644 --- a/ApplicationLibCode/ProjectDataModel/RimDepthTrackPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimDepthTrackPlot.cpp @@ -21,6 +21,7 @@ #include "RiaGuiApplication.h" #include "RiaOptionItemFactory.h" +#include "RiaPlotWindowRedrawScheduler.h" #include "RiaPreferences.h" #include "RiaQDateTimeTools.h" #include "RiaTextStringTools.h" @@ -924,6 +925,9 @@ void RimDepthTrackPlot::onPlotsReordered( const SignalEmitter* emitter ) updateSubPlotNames(); recreatePlotWidgets(); loadDataAndUpdate(); + + RiaPlotWindowRedrawScheduler::instance()->performScheduledUpdatesAndReplots(); + updateLayout(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimRftTools.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimRftTools.cpp index 5f99fdf437..fdffbe1d85 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimRftTools.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimRftTools.cpp @@ -179,3 +179,31 @@ QList RimRftTools::segmentBranchIndexOptions( RifReaderR return {}; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimRftTools::seglenstValues( RifReaderRftInterface* readerRft, + const QString& wellName, + const QDateTime& dateTime, + int segmentBranchIndex, + RiaDefines::RftBranchType segmentBranchType ) +{ + std::vector seglenstValues; + + auto resultNameSeglenst = RifEclipseRftAddress::createBranchSegmentAddress( wellName, + dateTime, + RiaDefines::segmentStartDepthResultName(), + segmentBranchIndex, + segmentBranchType ); + readerRft->values( resultNameSeglenst, &seglenstValues ); + + if ( seglenstValues.size() > 2 ) + { + // Segment 1 has zero length, assign seglenst to the start value of segment 2 + // Ref mail dated June 10, 2022, topic "SELENST fix" + seglenstValues[0] = seglenstValues[1]; + } + + return seglenstValues; +} diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimRftTools.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimRftTools.h index 7f100ac7d9..8c617dc1d6 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimRftTools.h +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimRftTools.h @@ -46,4 +46,10 @@ public: const QString& wellName, const QDateTime& timeStep, RiaDefines::RftBranchType branchType ); + + static std::vector seglenstValues( RifReaderRftInterface* readerRft, + const QString& wellName, + const QDateTime& dateTime, + int segmentBranchIndex, + RiaDefines::RftBranchType segmentBranchType ); }; diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimRftTopologyCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimRftTopologyCurve.cpp index ea29929d1d..71776ffc72 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimRftTopologyCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimRftTopologyCurve.cpp @@ -36,6 +36,21 @@ CAF_PDM_SOURCE_INIT( RimRftTopologyCurve, "RimRftTopologyCurve" ); +namespace caf +{ +template <> +void caf::AppEnum::setUp() +{ + addItem( RimRftTopologyCurve::CurveType::PACKER, "PACKER", "Packer" ); + addItem( RimRftTopologyCurve::CurveType::TUBING, "TUBING", "Tubing" ); + addItem( RimRftTopologyCurve::CurveType::ANNULUS, "ANNULUS", "Annulus" ); + addItem( RimRftTopologyCurve::CurveType::DEVICE, "DEVICE", "Device" ); + + setDefault( RimRftTopologyCurve::CurveType::TUBING ); +} + +} // End namespace caf + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -52,7 +67,7 @@ RimRftTopologyCurve::RimRftTopologyCurve() CAF_PDM_InitField( &m_segmentBranchIndex, "SegmentBranchIndex", -1, "Branch" ); CAF_PDM_InitFieldNoDefault( &m_segmentBranchType, "SegmentBranchType", "Completion" ); - CAF_PDM_InitField( &m_isPackerCurve, "IsPackerCurve", false, "Packer Curve" ); + CAF_PDM_InitFieldNoDefault( &m_curveType, "CurveType", "Curve Type" ); } //-------------------------------------------------------------------------------------------------- @@ -63,9 +78,9 @@ RimRftTopologyCurve* RimRftTopologyCurve::createPackerCurve( RimSummaryCase* su const QString& wellName, int segmentBranchIndex ) { - RimRftTopologyCurve* curve = new RimRftTopologyCurve(); + auto* curve = new RimRftTopologyCurve(); curve->setDataSource( summaryCase, timeStep, wellName, segmentBranchIndex ); - curve->m_isPackerCurve = true; + curve->m_curveType = CurveType::PACKER; return curve; } @@ -79,8 +94,25 @@ RimRftTopologyCurve* RimRftTopologyCurve::createTopologyCurve( RimSummaryCase* int segmentBranchIndex, RiaDefines::RftBranchType branchType ) { - RimRftTopologyCurve* curve = new RimRftTopologyCurve(); + auto* curve = new RimRftTopologyCurve(); curve->setDataSource( summaryCase, timeStep, wellName, segmentBranchIndex ); + + switch ( branchType ) + { + case RiaDefines::RftBranchType::RFT_TUBING: + curve->m_curveType = CurveType::TUBING; + break; + case RiaDefines::RftBranchType::RFT_DEVICE: + curve->m_curveType = CurveType::DEVICE; + break; + case RiaDefines::RftBranchType::RFT_ANNULUS: + curve->m_curveType = CurveType::ANNULUS; + break; + case RiaDefines::RftBranchType::RFT_UNKNOWN: + break; + default: + break; + } curve->m_segmentBranchType = branchType; return curve; @@ -124,25 +156,60 @@ QString RimRftTopologyCurve::wellLogChannelUnits() const return "Topology curve units"; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::Color3f RimRftTopologyCurve::colorForBranchType( CurveType curveType ) +{ + switch ( curveType ) + { + case RimRftTopologyCurve::CurveType::PACKER: + return RiaColorTools::fromQColorTo3f( QColor( "DarkGoldenRod" ) ); + break; + case RimRftTopologyCurve::CurveType::TUBING: + return colorForRftBranchType( RiaDefines::RftBranchType::RFT_TUBING ); + break; + case RimRftTopologyCurve::CurveType::DEVICE: + return colorForRftBranchType( RiaDefines::RftBranchType::RFT_DEVICE ); + break; + case RimRftTopologyCurve::CurveType::ANNULUS: + return colorForRftBranchType( RiaDefines::RftBranchType::RFT_ANNULUS ); + break; + default: + break; + } + + return RiaColorTools::fromQColorTo3f( QColor( "LightBrown" ) ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::Color3f RimRftTopologyCurve::colorForRftBranchType( RiaDefines::RftBranchType branchType ) +{ + switch ( branchType ) + { + case RiaDefines::RftBranchType::RFT_TUBING: + return RiaColorTools::fromQColorTo3f( QColor( "ForestGreen" ) ); + case RiaDefines::RftBranchType::RFT_DEVICE: + return RiaColorTools::fromQColorTo3f( QColor( "IndianRed" ) ); + case RiaDefines::RftBranchType::RFT_ANNULUS: + return RiaColorTools::fromQColorTo3f( QColor( "DeepSkyBlue" ) ); + case RiaDefines::RftBranchType::RFT_UNKNOWN: + break; + default: + break; + } + + return RiaColorTools::fromQColorTo3f( QColor( "LightBrown" ) ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- QString RimRftTopologyCurve::createCurveAutoName() { - QString text; - - if ( m_isPackerCurve() ) - { - text += "Packer"; - } - else - { - if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_ANNULUS ) text += "Annulus"; - if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_DEVICE ) text += "Device"; - if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_TUBING ) text += "Tubing"; - } - - return text; + return m_curveType().uiText(); } //-------------------------------------------------------------------------------------------------- @@ -156,13 +223,10 @@ void RimRftTopologyCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde curveDataGroup->add( &m_summaryCase ); curveDataGroup->add( &m_wellName ); curveDataGroup->add( &m_timeStep ); - curveDataGroup->add( &m_isPackerCurve ); + curveDataGroup->add( &m_curveType ); curveDataGroup->add( &m_segmentBranchIndex ); - if ( !m_isPackerCurve() ) - { - curveDataGroup->add( &m_segmentBranchType ); - } + curveDataGroup->add( &m_segmentBranchType ); RimStackablePlotCurve::defaultUiOrdering( uiOrdering ); @@ -230,22 +294,16 @@ void RimRftTopologyCurve::onLoadDataAndUpdate( bool updateParentPlot ) // Update well path attributes, packers and casing based on RFT data if ( rftReader ) { - std::vector seglenstValues; - std::vector seglenenValues; + std::vector depths; + std::vector propertyValues; - auto resultNameSeglenst = RifEclipseRftAddress::createSegmentAddress( m_wellName, m_timeStep, "SEGLENST" ); - rftReader->values( resultNameSeglenst, &seglenstValues ); - - auto resultNameSeglenen = RifEclipseRftAddress::createSegmentAddress( m_wellName, m_timeStep, "SEGLENEN" ); - rftReader->values( resultNameSeglenen, &seglenenValues ); + std::vector seglenstValues = + RimRftTools::seglenstValues( rftReader, m_wellName, m_timeStep, -1, RiaDefines::RftBranchType::RFT_UNKNOWN ); auto segment = rftReader->segmentForWell( m_wellName, m_timeStep ); auto segmentIndices = segment.segmentIndicesForBranchIndex( m_segmentBranchIndex(), m_segmentBranchType() ); if ( !segmentIndices.empty() ) { - std::vector depths; - std::vector propertyValues; - // Assign a static property value to each type of curve to make sure they all are separated and // easily visible double curveValue = 1.0; @@ -253,25 +311,23 @@ void RimRftTopologyCurve::onLoadDataAndUpdate( bool updateParentPlot ) if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_DEVICE ) curveValue = 3.0; if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_ANNULUS ) curveValue = 4.0; - if ( m_isPackerCurve ) + if ( m_curveType() == CurveType::PACKER ) { - curveValue = 3.5; + curveValue = 4.0; } // Adjust the location of each branch if multiple branches are visible at the same time curveValue += m_segmentBranchIndex() * 0.2; - if ( m_isPackerCurve ) + if ( m_curveType() == RimRftTopologyCurve::CurveType::PACKER ) { auto packerSegmentIndices = segment.packerSegmentIndicesOnAnnulus( m_segmentBranchIndex() ); for ( auto segmentIndex : packerSegmentIndices ) { depths.push_back( seglenstValues[segmentIndex] ); - depths.push_back( seglenenValues[segmentIndex] ); propertyValues.push_back( curveValue ); - propertyValues.push_back( curveValue ); } } else @@ -279,26 +335,24 @@ void RimRftTopologyCurve::onLoadDataAndUpdate( bool updateParentPlot ) for ( auto segmentIndex : segmentIndices ) { depths.push_back( seglenstValues[segmentIndex] ); - depths.push_back( seglenenValues[segmentIndex] ); propertyValues.push_back( curveValue ); - propertyValues.push_back( curveValue ); } } - - RimDepthTrackPlot* wellLogPlot; - firstAncestorOrThisOfTypeAsserted( wellLogPlot ); - - RimWellLogPlot::DepthTypeEnum depthType = wellLogPlot->depthType(); - RiaDefines::DepthUnitType displayUnit = wellLogPlot->depthUnit(); - bool isExtractionCurve = false; - bool useLogarithmicScale = false; - setPropertyValuesAndDepths( propertyValues, depths, depthType, 0.0, displayUnit, isExtractionCurve, useLogarithmicScale ); - - // Assign curve values based on horizontal or vertical plot - setPropertyAndDepthValuesToPlotCurve( propertyValues, depths ); } + RimDepthTrackPlot* wellLogPlot; + firstAncestorOrThisOfTypeAsserted( wellLogPlot ); + + RimWellLogPlot::DepthTypeEnum depthType = wellLogPlot->depthType(); + RiaDefines::DepthUnitType displayUnit = wellLogPlot->depthUnit(); + bool isExtractionCurve = false; + bool useLogarithmicScale = false; + setPropertyValuesAndDepths( propertyValues, depths, depthType, 0.0, displayUnit, isExtractionCurve, useLogarithmicScale ); + + // Assign curve values based on horizontal or vertical plot + setPropertyAndDepthValuesToPlotCurve( propertyValues, depths ); + if ( updateParentPlot ) { updateZoomInParentPlot(); @@ -325,35 +379,30 @@ void RimRftTopologyCurve::setAdditionalDataSources( const std::vector m_summaryCase; - caf::PdmField m_timeStep; - caf::PdmField m_wellName; - caf::PdmField m_segmentBranchIndex; - caf::PdmField> m_segmentBranchType; - - caf::PdmField m_isPackerCurve; + caf::PdmPtrField m_summaryCase; + caf::PdmField m_timeStep; + caf::PdmField m_wellName; + caf::PdmField m_segmentBranchIndex; + caf::PdmField> m_segmentBranchType; + caf::PdmField> m_curveType; public: void setAdditionalDataSources( const std::vector& additionalDataSources ); diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.cpp index 85b74fe09b..d05d1c5133 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.cpp @@ -482,6 +482,14 @@ void RimWellLogRftCurve::assignColorFromResultName( const QString& resultName ) setFillColor( fillColor ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogRftCurve::setScaleFactor( double factor ) +{ + m_scaleFactor = factor; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -539,7 +547,14 @@ std::map RimWellLogRftCurve::createCurveNameKeyValueMap() cons variableValueMap[RiaDefines::namingVariableWellBranch()] = branchText; - variableValueMap[RiaDefines::namingVariableResultType()] = m_segmentBranchType().uiText(); + if ( isSegmentResult( m_segmentResultName() ) ) + { + variableValueMap[RiaDefines::namingVariableResultType()] = m_segmentBranchType().uiText(); + } + else + { + variableValueMap[RiaDefines::namingVariableResultType()] = "Reservoir"; + } } if ( !m_timeStep().isNull() ) @@ -707,8 +722,9 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot ) { m_plotCurve->setPerPointLabels( perPointLabels ); - auto propertyValues = this->curveData()->propertyValues(); - auto depthValues = this->curveData()->depths( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, displayUnit ); + auto propertyValues = this->curveData()->propertyValuesByIntervals(); + auto depthValues = + this->curveData()->depthValuesByIntervals( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, displayUnit ); if ( !errors.empty() ) { @@ -719,6 +735,8 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot ) setPropertyAndDepthValuesToPlotCurve( propertyValues, depthValues ); } + m_plotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() ); + RimWellLogTrack* wellLogTrack; firstAncestorOrThisOfType( wellLogTrack ); CVF_ASSERT( wellLogTrack ); @@ -814,7 +832,10 @@ void RimWellLogRftCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrder else { curveDataGroup->add( &m_segmentResultName ); - curveDataGroup->add( &m_segmentBranchType ); + if ( isSegmentResult( m_segmentResultName() ) ) + { + curveDataGroup->add( &m_segmentBranchType ); + } curveDataGroup->add( &m_segmentBranchIndex ); curveDataGroup->add( &m_curveColorByPhase ); } @@ -936,7 +957,7 @@ void RimWellLogRftCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedFie loadData = true; } else if ( changedField == &m_timeStep || changedField == &m_segmentResultName || changedField == &m_segmentBranchIndex || - changedField == &m_rftDataType || changedField == &m_segmentBranchType ) + changedField == &m_rftDataType || changedField == &m_segmentBranchType || m_scaleFactor ) { loadData = true; } @@ -1239,27 +1260,12 @@ std::vector RimWellLogRftCurve::measuredDepthValues() { if ( m_rftDataType() == RftDataType::RFT_SEGMENT_DATA ) { - std::vector values; - RifReaderRftInterface* reader = rftReader(); if ( reader ) { - auto depthAddress = - RifEclipseRftAddress::createBranchSegmentAddress( m_wellName(), - m_timeStep, - RiaDefines::segmentStartDepthResultName(), - segmentBranchIndex(), - m_segmentBranchType() ); - - reader->values( depthAddress, &values ); - - // Special handling of first segment - if ( values.size() > 2 && values.front() < 0.001 ) - { - values[0] = values[1]; - } + return RimRftTools::seglenstValues( reader, m_wellName(), m_timeStep, segmentBranchIndex(), m_segmentBranchType() ); } - return values; + return {}; } if ( m_observedFmuRftData && !m_ensemble && !m_summaryCase ) @@ -1378,3 +1384,11 @@ int RimWellLogRftCurve::segmentBranchIndex() const { return m_segmentBranchIndex(); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimWellLogRftCurve::isSegmentResult( const QString& resultName ) +{ + return resultName.startsWith( "SEG" ); +} diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.h index ce01c4562c..13322c4ba4 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.h +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.h @@ -101,6 +101,8 @@ public: void enableColorFromResultName( bool enable ); void assignColorFromResultName( const QString& resultName ); + void setScaleFactor( double factor ); + protected: QString createCurveAutoName() override; QString createCurveNameFromTemplate( const QString& templateText ) override; @@ -140,6 +142,8 @@ private: int segmentBranchIndex() const; + static bool isSegmentResult( const QString& resultName ); + private: caf::PdmPtrField m_eclipseResultCase; caf::PdmPtrField m_summaryCase; diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp index d9b849d993..e13eb75c78 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp @@ -184,8 +184,6 @@ RimWellLogTrack::RimWellLogTrack() CAF_PDM_InitFieldNoDefault( &m_description, "TrackDescription", "Name" ); - m_description.uiCapability()->setUiReadOnly( true ); - CAF_PDM_InitFieldNoDefault( &m_curves, "Curves", "" ); m_curves.uiCapability()->setUiTreeHidden( true ); auto reorderability = caf::PdmFieldReorderCapability::addToField( &m_curves ); diff --git a/ApplicationLibCode/UnitTests/opm-summary-Test.cpp b/ApplicationLibCode/UnitTests/opm-summary-Test.cpp index c6085ba807..448c267c34 100644 --- a/ApplicationLibCode/UnitTests/opm-summary-Test.cpp +++ b/ApplicationLibCode/UnitTests/opm-summary-Test.cpp @@ -99,13 +99,10 @@ TEST( OpmSummaryTests, DISABLED_OpmImportRftData ) { std::cout << "\n"; - auto rftVectors = eRft.listOfRftArrays( i ); - - for ( const auto& rftVec : rftVectors ) + auto results = eRft.listOfRftArrays( i ); + for ( const auto& [name, arrayType, size] : results ) { - auto [name, arrType, itemCount] = rftVec; - - std::cout << name << ", " << itemCount << "\n"; + std::cout << name << ", " << size << "\n"; } } } diff --git a/ApplicationLibCode/UserInterface/RiuWellLogPlot.cpp b/ApplicationLibCode/UserInterface/RiuWellLogPlot.cpp index 69c2f3778c..f839543b98 100644 --- a/ApplicationLibCode/UserInterface/RiuWellLogPlot.cpp +++ b/ApplicationLibCode/UserInterface/RiuWellLogPlot.cpp @@ -110,9 +110,9 @@ bool RiuWellLogPlot::showYAxis( int row, int column ) const } auto index = static_cast( std::max( row, column ) ); - if ( index < depthTrackPlot()->plots().size() ) + if ( index < depthTrackPlot()->visiblePlots().size() ) { - auto track = dynamic_cast( depthTrackPlot()->plotByIndex( index ) ); + auto track = dynamic_cast( depthTrackPlot()->visiblePlots()[index] ); if ( track ) { return track->isPropertyAxisEnabled();