2020-05-13 23:39:55 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2020- Equinor ASA
|
|
|
|
//
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#include "RimFractureModelPlot.h"
|
|
|
|
|
|
|
|
#include "RiaDefines.h"
|
2020-08-26 00:01:16 -05:00
|
|
|
#include "RiaFractureModelDefines.h"
|
2020-06-16 12:22:43 -05:00
|
|
|
|
2020-05-13 23:39:55 -05:00
|
|
|
#include "RimFractureModel.h"
|
2020-06-05 08:58:25 -05:00
|
|
|
#include "RimFractureModelCurve.h"
|
2020-07-02 06:53:39 -05:00
|
|
|
#include "RimFractureModelPropertyCurve.h"
|
2020-09-03 09:35:03 -05:00
|
|
|
#include "RimWellLogTrack.h"
|
2020-06-05 08:58:25 -05:00
|
|
|
|
2020-05-13 23:39:55 -05:00
|
|
|
#include "cafPdmBase.h"
|
2020-08-21 04:13:07 -05:00
|
|
|
#include "cafPdmFieldScriptingCapability.h"
|
2020-05-13 23:39:55 -05:00
|
|
|
#include "cafPdmObject.h"
|
2020-10-16 04:27:46 -05:00
|
|
|
#include "cafPdmObjectScriptingCapability.h"
|
2020-05-13 23:39:55 -05:00
|
|
|
#include "cafPdmUiGroup.h"
|
|
|
|
|
|
|
|
CAF_PDM_SOURCE_INIT( RimFractureModelPlot, "FractureModelPlot" );
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimFractureModelPlot::RimFractureModelPlot()
|
|
|
|
{
|
|
|
|
CAF_PDM_InitScriptableObject( "Fracture Model Plot", "", "", "A fracture model plot" );
|
2020-06-16 12:22:43 -05:00
|
|
|
|
2020-08-07 03:51:07 -05:00
|
|
|
CAF_PDM_InitScriptableFieldNoDefault( &m_fractureModel, "FractureModel", "Fracture Model", "", "", "" );
|
2020-06-16 12:22:43 -05:00
|
|
|
m_fractureModel.uiCapability()->setUiTreeChildrenHidden( true );
|
|
|
|
m_fractureModel.uiCapability()->setUiHidden( true );
|
2020-07-10 05:07:59 -05:00
|
|
|
|
2020-09-24 08:02:40 -05:00
|
|
|
setLegendsVisible( true );
|
2020-07-10 05:07:59 -05:00
|
|
|
setDeletable( true );
|
2020-06-16 12:22:43 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimFractureModelPlot::setFractureModel( RimFractureModel* fractureModel )
|
|
|
|
{
|
|
|
|
m_fractureModel = fractureModel;
|
2020-05-13 23:39:55 -05:00
|
|
|
}
|
|
|
|
|
2020-08-25 04:39:32 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimFractureModel* RimFractureModelPlot::fractureModel()
|
|
|
|
{
|
|
|
|
return m_fractureModel;
|
|
|
|
}
|
|
|
|
|
2020-05-13 23:39:55 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimFractureModelPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
|
|
|
{
|
|
|
|
caf::PdmUiGroup* depthGroup = uiOrdering.addNewGroup( "Depth Axis" );
|
|
|
|
RimDepthTrackPlot::uiOrderingForDepthAxis( uiConfigName, *depthGroup );
|
|
|
|
|
|
|
|
caf::PdmUiGroup* titleGroup = uiOrdering.addNewGroup( "Plot Title" );
|
|
|
|
RimDepthTrackPlot::uiOrderingForAutoName( uiConfigName, *titleGroup );
|
|
|
|
|
|
|
|
caf::PdmUiGroup* plotLayoutGroup = uiOrdering.addNewGroup( "Plot Layout" );
|
|
|
|
RimPlotWindow::uiOrderingForPlotLayout( uiConfigName, *plotLayoutGroup );
|
|
|
|
|
|
|
|
uiOrdering.skipRemainingFields( true );
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimFractureModelPlot::onLoadDataAndUpdate()
|
|
|
|
{
|
2020-09-03 09:35:03 -05:00
|
|
|
// Enable and disable detailed fluid loss curves
|
|
|
|
if ( fractureModel() != nullptr )
|
|
|
|
{
|
|
|
|
std::vector<RiaDefines::CurveProperty> fluidLossCurves = {RiaDefines::CurveProperty::PORO_ELASTIC_CONSTANT,
|
|
|
|
RiaDefines::CurveProperty::RELATIVE_PERMEABILITY_FACTOR,
|
|
|
|
RiaDefines::CurveProperty::THERMAL_EXPANSION_COEFFICIENT,
|
|
|
|
RiaDefines::CurveProperty::IMMOBILE_FLUID_SATURATION};
|
|
|
|
|
|
|
|
bool detailedFluidLoss = fractureModel()->useDetailedFluidLoss();
|
|
|
|
|
|
|
|
for ( auto curveProperty : fluidLossCurves )
|
|
|
|
{
|
|
|
|
RimWellLogExtractionCurve* curve = findCurveByProperty( curveProperty );
|
|
|
|
if ( curve )
|
|
|
|
{
|
|
|
|
RimWellLogTrack* track = nullptr;
|
|
|
|
curve->firstAncestorOfType( track );
|
|
|
|
if ( track )
|
|
|
|
{
|
|
|
|
track->setShowWindow( detailedFluidLoss );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-13 23:39:55 -05:00
|
|
|
RimDepthTrackPlot::onLoadDataAndUpdate();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimFractureModelPlot::applyDataSource()
|
|
|
|
{
|
|
|
|
this->updateConnectedEditors();
|
|
|
|
}
|
2020-06-05 08:58:25 -05:00
|
|
|
|
2020-06-12 04:38:20 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-07-02 06:53:39 -05:00
|
|
|
RimWellLogExtractionCurve* RimFractureModelPlot::findCurveByProperty( RiaDefines::CurveProperty curveProperty ) const
|
2020-06-12 04:38:20 -05:00
|
|
|
{
|
2020-07-02 06:53:39 -05:00
|
|
|
std::vector<RimFractureModelPropertyCurve*> curves;
|
2020-06-12 04:38:20 -05:00
|
|
|
descendantsIncludingThisOfType( curves );
|
|
|
|
|
2020-07-02 06:53:39 -05:00
|
|
|
for ( RimFractureModelPropertyCurve* curve : curves )
|
2020-06-12 04:38:20 -05:00
|
|
|
{
|
2020-07-02 06:53:39 -05:00
|
|
|
if ( curve->curveProperty() == curveProperty )
|
2020-06-12 04:38:20 -05:00
|
|
|
{
|
2020-07-02 06:53:39 -05:00
|
|
|
return dynamic_cast<RimWellLogExtractionCurve*>( curve );
|
2020-06-12 04:38:20 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
}
|