mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix RFT segment plot issues
* RFT curves: Disable auto color by default * RFT curves: Fix wiggling legend caused by too many plot updates * RFT Curves: Search multiple layers for CONFAC data * Move plot orientation to Depth Axis, Advanced group
This commit is contained in:
parent
46b364d0b0
commit
d36ab7e2d7
@ -516,7 +516,6 @@ RimWellLogRftCurve* RicWellLogTools::addSummaryRftSegmentCurve( RimWellLogTrack*
|
||||
RifEclipseRftAddress adr =
|
||||
RifEclipseRftAddress::createBranchSegmentAddress( wellName, dateTime, resultName, 1, branchType );
|
||||
curve->setRftAddress( adr );
|
||||
curve->enableColorFromResultName( true );
|
||||
curve->assignColorFromResultName( resultName );
|
||||
curve->setLineThickness( 4 );
|
||||
|
||||
@ -527,6 +526,30 @@ RimWellLogRftCurve* RicWellLogTools::addSummaryRftSegmentCurve( RimWellLogTrack*
|
||||
return curve;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicWellLogTools::hasData( const QString& resultName,
|
||||
const QString& wellName,
|
||||
RiaDefines::RftBranchType branchType,
|
||||
RimSummaryCase* rimCase )
|
||||
{
|
||||
auto rftReader = rimCase->rftReader();
|
||||
|
||||
QDateTime dateTime;
|
||||
|
||||
auto timeSteps = rftReader->availableTimeSteps( wellName );
|
||||
if ( !timeSteps.empty() ) dateTime = *timeSteps.rbegin();
|
||||
|
||||
RifEclipseRftAddress adr =
|
||||
RifEclipseRftAddress::createBranchSegmentAddress( wellName, dateTime, resultName, 1, branchType );
|
||||
|
||||
std::vector<double> values;
|
||||
rftReader->values( adr, &values );
|
||||
|
||||
return !values.empty();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -83,6 +83,10 @@ public:
|
||||
const QString& wellName,
|
||||
RiaDefines::RftBranchType branchType,
|
||||
RimSummaryCase* rimCase );
|
||||
static bool hasData( const QString& resultName,
|
||||
const QString& wellName,
|
||||
RiaDefines::RftBranchType branchType,
|
||||
RimSummaryCase* rimCase );
|
||||
|
||||
private:
|
||||
template <typename ExtractionCurveType>
|
||||
|
@ -269,14 +269,31 @@ void RicNewRftSegmentWellLogPlotFeature::appendConnectionFactorTrack( RimWellLog
|
||||
const QString& wellName,
|
||||
RimSummaryCase* summaryCase )
|
||||
{
|
||||
QString trackName = "Connection Factors";
|
||||
QString resultName = "CONFAC";
|
||||
auto curve = appendTrackAndCurveForBranchType( plot,
|
||||
trackName,
|
||||
resultName,
|
||||
wellName,
|
||||
RiaDefines::RftBranchType::RFT_ANNULUS,
|
||||
summaryCase );
|
||||
|
||||
// Connection factor data can be found in the tubing, device and annulus branches.
|
||||
// Search for data ordered by annulus, device and tubing.
|
||||
RiaDefines::RftBranchType branchType = RiaDefines::RftBranchType::RFT_ANNULUS;
|
||||
bool foundData = false;
|
||||
if ( RicWellLogTools::hasData( resultName, wellName, branchType, summaryCase ) )
|
||||
{
|
||||
foundData = true;
|
||||
}
|
||||
|
||||
if ( !foundData && RicWellLogTools::hasData( resultName, wellName, RiaDefines::RftBranchType::RFT_DEVICE, summaryCase ) )
|
||||
{
|
||||
branchType = RiaDefines::RftBranchType::RFT_DEVICE;
|
||||
foundData = true;
|
||||
}
|
||||
|
||||
if ( !foundData && RicWellLogTools::hasData( resultName, wellName, RiaDefines::RftBranchType::RFT_TUBING, summaryCase ) )
|
||||
{
|
||||
branchType = RiaDefines::RftBranchType::RFT_TUBING;
|
||||
foundData = true;
|
||||
}
|
||||
|
||||
QString trackName = "Connection Factors";
|
||||
auto curve = appendTrackAndCurveForBranchType( plot, trackName, resultName, wellName, branchType, summaryCase );
|
||||
|
||||
auto curveColor = cvf::Color3f( cvf::Color3f::ColorIdent::ORANGE );
|
||||
curve->setColor( curveColor );
|
||||
|
@ -574,6 +574,7 @@ void RimDepthTrackPlot::uiOrderingForDepthAxis( QString uiConfigName, caf::PdmUi
|
||||
|
||||
auto group = uiOrdering.addNewGroup( "Advanced" );
|
||||
group->setCollapsedByDefault();
|
||||
group->add( &m_depthOrientation );
|
||||
group->add( &m_depthAxisGridVisibility );
|
||||
group->add( &m_depthAxisVisibility );
|
||||
group->add( &m_showDepthMarkerLine );
|
||||
@ -1139,7 +1140,6 @@ void RimDepthTrackPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderi
|
||||
fontGroup->add( &m_subTitleFontSize );
|
||||
fontGroup->add( &m_axisTitleFontSize );
|
||||
fontGroup->add( &m_axisValueFontSize );
|
||||
fontGroup->add( &m_depthOrientation );
|
||||
|
||||
std::vector<RimEnsembleWellLogCurveSet*> ensembleWellLogCurveSets;
|
||||
descendantsOfType( ensembleWellLogCurveSets );
|
||||
|
@ -832,10 +832,7 @@ void RimWellLogRftCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrder
|
||||
else
|
||||
{
|
||||
curveDataGroup->add( &m_segmentResultName );
|
||||
if ( isSegmentResult( m_segmentResultName() ) )
|
||||
{
|
||||
curveDataGroup->add( &m_segmentBranchType );
|
||||
}
|
||||
curveDataGroup->add( &m_segmentBranchType );
|
||||
curveDataGroup->add( &m_segmentBranchIndex );
|
||||
curveDataGroup->add( &m_curveColorByPhase );
|
||||
}
|
||||
|
@ -1095,20 +1095,6 @@ void RimWellLogTrack::onAxisSelected( RiuPlotAxis axis, bool toggle )
|
||||
void RimWellLogTrack::updateAxes()
|
||||
{
|
||||
updatePropertyValueZoom();
|
||||
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
RimDepthTrackPlot* wellLogPlot;
|
||||
this->firstAncestorOrThisOfTypeAsserted( wellLogPlot );
|
||||
if ( wellLogPlot->isDepthMarkerLineEnabled() )
|
||||
{
|
||||
m_plotWidget->createAnnotationsInPlot( wellLogPlot->depthAxisAnnotations() );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_plotWidget->createAnnotationsInPlot( {} );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1359,6 +1345,28 @@ bool RimWellLogTrack::isCurveHighlightSupported() const
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogTrack::updateDepthMarkerLine()
|
||||
{
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
RimDepthTrackPlot* wellLogPlot;
|
||||
this->firstAncestorOrThisOfTypeAsserted( wellLogPlot );
|
||||
if ( wellLogPlot->isDepthMarkerLineEnabled() )
|
||||
{
|
||||
m_plotWidget->createAnnotationsInPlot( wellLogPlot->depthAxisAnnotations() );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_plotWidget->createAnnotationsInPlot( {} );
|
||||
}
|
||||
|
||||
m_plotWidget->scheduleReplot();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -241,6 +241,7 @@ public:
|
||||
void setEnsembleWellLogCurveSet( RimEnsembleWellLogCurveSet* curveSet );
|
||||
void updateAxesVisibility( RiaDefines::Orientation orientation, bool isFirstTrack, bool isLastTrack );
|
||||
bool isCurveHighlightSupported() const override;
|
||||
void updateDepthMarkerLine();
|
||||
|
||||
protected:
|
||||
// RimViewWindow overrides
|
||||
|
@ -233,6 +233,9 @@ void RiuWellLogTrack::createAnnotationsInPlot( const std::vector<RimPlotAxisAnno
|
||||
{
|
||||
m_annotationTool->detachAllAnnotations();
|
||||
|
||||
// Not required to update annotations in an invisible plot
|
||||
if ( !plotDefinition()->showWindow() ) return;
|
||||
|
||||
RimDepthTrackPlot* depthTrackPlot = nullptr;
|
||||
m_plotDefinition->firstAncestorOfType( depthTrackPlot );
|
||||
if ( !depthTrackPlot ) return;
|
||||
@ -251,8 +254,11 @@ void RiuWellLogTrack::createAnnotationsInPlot( const std::vector<RimPlotAxisAnno
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogTrack::onMouseMoveEvent( QMouseEvent* mouseEvent )
|
||||
{
|
||||
if ( !m_plotDefinition ) return;
|
||||
// The mouse move event here is a mouse move event local to one track. The depth information here must be
|
||||
// communicated to all tracks in the same depth track plot. And then, after the depth information has been updated,
|
||||
// all well log tracks must be updated with the new depth marker line location.
|
||||
|
||||
if ( !m_plotDefinition ) return;
|
||||
if ( mouseEvent->type() != QMouseEvent::MouseMove ) return;
|
||||
|
||||
RimDepthTrackPlot* depthTrackPlot = nullptr;
|
||||
@ -262,14 +268,14 @@ void RiuWellLogTrack::onMouseMoveEvent( QMouseEvent* mouseEvent )
|
||||
auto plotwidget = dynamic_cast<RiuQwtPlotWidget*>( m_plotDefinition->plotWidget() );
|
||||
if ( !plotwidget ) return;
|
||||
|
||||
auto plot = plotwidget->qwtPlot();
|
||||
auto qwtPlot = plotwidget->qwtPlot();
|
||||
if ( !qwtPlot ) return;
|
||||
|
||||
auto riuPlotAxis = depthTrackPlot->depthAxis();
|
||||
auto qwtAxis = plotwidget->toQwtPlotAxis( riuPlotAxis );
|
||||
const QwtScaleMap axisMap = qwtPlot->canvasMap( qwtAxis );
|
||||
|
||||
double depth = 0.0;
|
||||
|
||||
auto riuPlotAxis = depthTrackPlot->depthAxis();
|
||||
auto qwtAxis = plotwidget->toQwtPlotAxis( riuPlotAxis );
|
||||
|
||||
const QwtScaleMap axisMap = plot->canvasMap( qwtAxis );
|
||||
if ( depthTrackPlot->depthOrientation() == RiaDefines::Orientation::HORIZONTAL )
|
||||
{
|
||||
depth = axisMap.invTransform( mouseEvent->pos().x() );
|
||||
@ -283,6 +289,7 @@ void RiuWellLogTrack::onMouseMoveEvent( QMouseEvent* mouseEvent )
|
||||
|
||||
for ( auto p : depthTrackPlot->plots() )
|
||||
{
|
||||
p->updateAxes();
|
||||
auto wellLogTrack = dynamic_cast<RimWellLogTrack*>( p );
|
||||
if ( wellLogTrack ) wellLogTrack->updateDepthMarkerLine();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user