RFT plot improvements

* Make curve selection optional to avoid flickering in depth plots
* Replace undefined with zero for some curves
* Add spacing factor for min and max depth
This commit is contained in:
Magne Sjaastad 2022-10-28 15:37:45 +02:00 committed by GitHub
parent 26dd61a604
commit 0d3347d4d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 85 additions and 27 deletions

View File

@ -65,15 +65,6 @@ void RicNewMultiPhaseRftSegmentPlotFeature::onActionTriggered( bool isChecked )
if ( !summaryCase ) return;
auto plot = RicNewWellLogPlotFeatureImpl::createHorizontalWellLogPlot();
plot->setNamingMethod( RiaDefines::ObjectNamingMethod::TEMPLATE );
QString templateText = RiaDefines::namingVariableCase() + ", " + RiaDefines::namingVariableWell() + " - Branch " +
RiaDefines::namingVariableWellBranch() + ", " + RiaDefines::namingVariableTime();
plot->setNameTemplateText( templateText );
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";

View File

@ -65,15 +65,6 @@ void RicNewRftSegmentWellLogPlotFeature::onActionTriggered( bool isChecked )
if ( !summaryCase ) return;
auto plot = RicNewWellLogPlotFeatureImpl::createHorizontalWellLogPlot();
plot->setNamingMethod( RiaDefines::ObjectNamingMethod::TEMPLATE );
QString templateText = RiaDefines::namingVariableCase() + ", " + RiaDefines::namingVariableWell() + " - Branch " +
RiaDefines::namingVariableWellBranch() + ", " + RiaDefines::namingVariableTime();
plot->setNameTemplateText( templateText );
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";

View File

@ -89,8 +89,19 @@ RimWellBoreStabilityPlot*
RimWellLogPlot* RicNewWellLogPlotFeatureImpl::createHorizontalWellLogPlot()
{
auto plot = createWellLogPlot();
plot->setDepthOrientation( RiaDefines::Orientation::HORIZONTAL );
plot->setLegendsHorizontal( true );
plot->setNamingMethod( RiaDefines::ObjectNamingMethod::TEMPLATE );
QString templateText = RiaDefines::namingVariableCase() + ", " + RiaDefines::namingVariableWell() + " - Branch " +
RiaDefines::namingVariableWellBranch() + ", " + RiaDefines::namingVariableTime();
plot->setNameTemplateText( templateText );
plot->setPlotTitleVisible( true );
plot->setLegendItemsClickable( false );
plot->enableDepthMarkerLine( true );
plot->setLegendPosition( RimPlotWindow::LegendPosition::INSIDE_UPPER_RIGHT );
plot->setLegendFontSize( caf::FontTools::RelativeSize::XSmall );
plot->setLegendsHorizontal( false );
plot->setAutoZoomMaximumDepthFactor( 0.1 );
return plot;
}

View File

@ -159,6 +159,12 @@ void RifReaderOpmRft::values( const RifEclipseRftAddress& rftAddress, std::vecto
values->push_back( data[i] );
}
}
if ( resultName == "CONFAC" || resultName == "CONKH" )
{
// Replace undefined values with zero to improve readability of plots
std::replace( values->begin(), values->end(), std::numeric_limits<double>::infinity(), 0.0 );
}
}
else
{

View File

@ -1086,8 +1086,8 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
}
else if ( dynamic_cast<RimRftCase*>( firstUiItem ) )
{
menuBuilder << "RicNewRftSegmentWellLogPlotFeature";
menuBuilder << "RicNewMultiPhaseRftSegmentPlotFeature";
menuBuilder << "RicNewRftSegmentWellLogPlotFeature";
menuBuilder.addSeparator();
menuBuilder << "RicNewRftWellLogPlotFeature";
}

View File

@ -136,6 +136,10 @@ RimDepthTrackPlot::RimDepthTrackPlot()
CAF_PDM_InitField( &m_depthAxisVisibility, "DepthAxisVisibility", depthAxisVisibility, "Axis Visibility" );
CAF_PDM_InitScriptableField( &m_showDepthMarkerLine, "ShowDepthMarkerLine", false, "Show Depth Marker Line" );
CAF_PDM_InitScriptableField( &m_autoZoomMinDepthFactor, "AutoZoomMinDepthFactor", 0.0, "Auto Zoom Minimum Factor" );
CAF_PDM_InitScriptableField( &m_autoZoomMaxDepthFactor, "AutoZoomMaxDepthFactor", 0.0, "Auto Zoom Maximum Factor" );
CAF_PDM_InitFieldNoDefault( &m_depthAnnotations, "DepthAnnotations", "Depth Annotations" );
m_depthAnnotations.uiCapability()->setUiTreeHidden( true );
m_depthAnnotations.uiCapability()->setUiTreeChildrenHidden( true );
@ -333,8 +337,10 @@ void RimDepthTrackPlot::updateZoom()
calculateAvailableDepthRange();
if ( m_minAvailableDepth < HUGE_VAL && m_maxAvailableDepth > -HUGE_VAL )
{
m_minVisibleDepth = m_minAvailableDepth;
m_maxVisibleDepth = m_maxAvailableDepth + 0.01 * ( m_maxAvailableDepth - m_minAvailableDepth );
auto depthRange = m_maxAvailableDepth - m_minAvailableDepth;
m_minVisibleDepth = m_minAvailableDepth - m_autoZoomMinDepthFactor * depthRange;
m_maxVisibleDepth = m_maxAvailableDepth + ( 0.01 + m_autoZoomMaxDepthFactor ) * depthRange;
}
}
@ -348,6 +354,9 @@ void RimDepthTrackPlot::updateZoom()
{
m_viewer->updateVerticalScrollBar( m_minVisibleDepth(), m_maxVisibleDepth(), m_minAvailableDepth, m_maxAvailableDepth );
}
// Required to make sure the tracks are aligned correctly for vertical plots
updateLayout();
}
//--------------------------------------------------------------------------------------------------
@ -494,6 +503,22 @@ std::vector<RimPlotAxisAnnotation*> RimDepthTrackPlot::depthAxisAnnotations() co
return m_depthAnnotations.children();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimDepthTrackPlot::setAutoZoomMinimumDepthFactor( double factor )
{
m_autoZoomMinDepthFactor = factor;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimDepthTrackPlot::setAutoZoomMaximumDepthFactor( double factor )
{
m_autoZoomMaxDepthFactor = factor;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -546,9 +571,15 @@ void RimDepthTrackPlot::uiOrderingForDepthAxis( QString uiConfigName, caf::PdmUi
uiOrdering.add( &m_minVisibleDepth );
uiOrdering.add( &m_maxVisibleDepth );
uiOrdering.add( &m_depthAxisGridVisibility );
uiOrdering.add( &m_depthAxisVisibility );
uiOrdering.add( &m_showDepthMarkerLine );
auto group = uiOrdering.addNewGroup( "Advanced" );
group->setCollapsedByDefault();
group->add( &m_depthAxisGridVisibility );
group->add( &m_depthAxisVisibility );
group->add( &m_showDepthMarkerLine );
group->add( &m_autoZoomMinDepthFactor );
group->add( &m_autoZoomMaxDepthFactor );
}
//--------------------------------------------------------------------------------------------------
@ -1002,7 +1033,8 @@ void RimDepthTrackPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedFiel
m_isAutoScaleDepthEnabled = false;
updateZoom();
}
else if ( changedField == &m_depthAxisGridVisibility )
else if ( changedField == &m_depthAxisGridVisibility || changedField == &m_autoZoomMaxDepthFactor ||
changedField == &m_autoZoomMinDepthFactor )
{
updateZoom();
}

View File

@ -135,6 +135,8 @@ public:
void setDepthMarkerPosition( double depth );
void clearDepthAnnotations();
std::vector<RimPlotAxisAnnotation*> depthAxisAnnotations() const;
void setAutoZoomMinimumDepthFactor( double factor );
void setAutoZoomMaximumDepthFactor( double factor );
void uiOrderingForDepthAxis( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
void uiOrderingForAutoName( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
@ -221,6 +223,8 @@ protected:
caf::PdmField<bool> m_isAutoScaleDepthEnabled;
caf::PdmField<caf::AppEnum<RiaDefines::MultiPlotAxisVisibility>> m_depthAxisVisibility;
caf::PdmField<bool> m_showDepthMarkerLine;
caf::PdmField<double> m_autoZoomMinDepthFactor;
caf::PdmField<double> m_autoZoomMaxDepthFactor;
caf::PdmChildArrayField<RimPlotAxisAnnotation*> m_depthAnnotations;
caf::PdmField<caf::FontTools::RelativeSizeEnum> m_subTitleFontSize;

View File

@ -303,6 +303,14 @@ void RimPlot::handleWheelEvent( QWheelEvent* event )
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimPlot::isCurveHighlightSupported() const
{
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -105,6 +105,7 @@ public:
virtual void handleDroppedObjects( const std::vector<caf::PdmObjectHandle*>& objects );
virtual std::vector<RimPlotCurve*> visibleCurvesForLegend();
virtual bool isCurveHighlightSupported() const;
protected:
virtual RiuPlotWidget* doCreatePlotViewWidget( QWidget* parent ) = 0;

View File

@ -1351,6 +1351,14 @@ void RimWellLogTrack::onChildrenUpdated( caf::PdmChildArrayFieldHandle* chi
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogTrack::isCurveHighlightSupported() const
{
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -240,6 +240,7 @@ public:
void setEnsembleWellLogCurveSet( RimEnsembleWellLogCurveSet* curveSet );
void updateAxesVisibility( RiaDefines::Orientation orientation, bool isFirstTrack, bool isLastTrack );
bool isCurveHighlightSupported() const override;
protected:
// RimViewWindow overrides

View File

@ -601,7 +601,11 @@ bool RiuQwtPlotWidget::eventFilter( QObject* watched, QEvent* event )
!m_clickPosition.isNull() )
{
endZoomOperations();
selectClosestPlotItem( mouseEvent->pos(), toggleItemInSelection );
if ( m_plotDefinition->isCurveHighlightSupported() )
{
selectClosestPlotItem( mouseEvent->pos(), toggleItemInSelection );
}
m_clickPosition = QPoint();
return true;
}

View File

@ -181,4 +181,5 @@ void RiuWellLogPlot::performUpdate( RiaDefines::MultiPlotPageUpdateType /* whatT
int axisShift = alignCanvasTops();
alignScrollbar( axisShift );
alignAxes();
updatePlotLayouts();
}