2017-02-07 02:09:00 -06:00
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 - Statoil 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 "RimStimPlanFractureTemplate.h"
2017-02-20 08:39:15 -06:00
# include "RiaApplication.h"
2017-02-28 03:01:31 -06:00
# include "RiaLogging.h"
2017-02-20 08:39:15 -06:00
2017-08-03 06:21:19 -05:00
# include "RifStimPlanXmlReader.h"
2017-02-07 04:08:56 -06:00
# include "RigStimPlanFractureDefinition.h"
2017-06-08 15:54:06 -05:00
# include "RigFractureGrid.h"
2017-02-07 02:09:00 -06:00
2017-08-03 06:21:19 -05:00
# include "RigFractureCell.h"
2017-02-20 08:39:15 -06:00
# include "RimEclipseView.h"
2017-02-10 08:29:15 -06:00
# include "RimFracture.h"
2017-08-03 06:21:19 -05:00
# include "RimFractureContainment.h"
2017-02-10 08:29:15 -06:00
# include "RimProject.h"
2017-02-20 08:39:15 -06:00
# include "RimStimPlanColors.h"
2017-02-17 02:29:46 -06:00
# include "RimStimPlanLegendConfig.h"
2017-08-03 06:21:19 -05:00
# include "RimTools.h"
2017-02-10 08:29:15 -06:00
2017-03-27 07:19:21 -05:00
# include "RivWellFracturePartMgr.h"
2017-02-07 02:09:00 -06:00
# include "cafPdmObject.h"
2017-02-17 08:10:04 -06:00
# include "cafPdmUiDoubleSliderEditor.h"
2017-02-09 03:52:05 -06:00
# include "cafPdmUiFilePathEditor.h"
2017-02-07 02:09:00 -06:00
# include "cvfVector3.h"
2017-02-09 03:52:05 -06:00
2017-02-07 04:08:56 -06:00
# include <QFileInfo>
2017-02-09 03:52:05 -06:00
# include <QMessageBox>
2017-02-07 02:09:00 -06:00
2017-02-17 04:03:20 -06:00
# include <algorithm>
2017-03-17 05:28:00 -05:00
# include <vector>
2017-04-20 05:16:13 -05:00
# include <cmath>
2017-02-17 04:03:20 -06:00
2017-02-07 02:09:00 -06:00
CAF_PDM_SOURCE_INIT ( RimStimPlanFractureTemplate , " RimStimPlanFractureTemplate " ) ;
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimStimPlanFractureTemplate : : RimStimPlanFractureTemplate ( void )
{
CAF_PDM_InitObject ( " Fracture Template " , " :/FractureTemplate16x16.png " , " " , " " ) ;
2017-12-15 07:26:59 -06:00
CAF_PDM_InitField ( & m_stimPlanFileName , " StimPlanFileName " , QString ( " " ) , " File Name " , " " , " " , " " ) ;
2017-02-10 08:29:15 -06:00
m_stimPlanFileName . uiCapability ( ) - > setUiEditorTypeName ( caf : : PdmUiFilePathEditor : : uiEditorTypeName ( ) ) ;
2017-12-15 07:26:59 -06:00
CAF_PDM_InitField ( & m_wellPathDepthAtFracture , " WellPathDepthAtFracture " , 0.0 , " Well/Fracture Intersection Depth " , " " , " " , " " ) ;
2017-06-12 07:42:35 -05:00
m_wellPathDepthAtFracture . uiCapability ( ) - > setUiEditorTypeName ( caf : : PdmUiDoubleSliderEditor : : uiEditorTypeName ( ) ) ;
2017-02-27 07:55:12 -06:00
2017-12-15 07:26:59 -06:00
CAF_PDM_InitField ( & m_borderPolygonResultName , " BorderPolygonResultName " , QString ( " " ) , " Parameter " , " " , " " , " " ) ;
2017-06-30 05:54:51 -05:00
m_borderPolygonResultName . uiCapability ( ) - > setUiHidden ( true ) ;
2017-12-15 07:26:59 -06:00
CAF_PDM_InitField ( & m_activeTimeStepIndex , " ActiveTimeStepIndex " , 0 , " Active TimeStep Index " , " " , " " , " " ) ;
CAF_PDM_InitField ( & m_showStimPlanMesh , " ShowStimPlanMesh " , true , " Show StimPlan Mesh " , " " , " " , " " ) ;
CAF_PDM_InitField ( & m_conductivityScalingFactor , " ConductivityFactor " , 1.0 , " Conductivity Scaling Factor " , " " , " The conductivity values read from file will be scaled with this parameters " , " " ) ;
2017-02-27 07:55:12 -06:00
2017-05-30 07:57:21 -05:00
m_fractureGrid = new RigFractureGrid ( ) ;
2017-02-07 02:09:00 -06:00
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimStimPlanFractureTemplate : : ~ RimStimPlanFractureTemplate ( )
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStimPlanFractureTemplate : : fieldChangedByUi ( const caf : : PdmFieldHandle * changedField , const QVariant & oldValue , const QVariant & newValue )
{
2017-02-23 02:47:30 -06:00
RimFractureTemplate : : fieldChangedByUi ( changedField , oldValue , newValue ) ;
2017-02-07 04:08:56 -06:00
2017-02-10 08:29:15 -06:00
if ( & m_stimPlanFileName = = changedField )
2017-02-07 04:08:56 -06:00
{
updateUiTreeName ( ) ;
2017-02-17 02:29:46 -06:00
loadDataAndUpdate ( ) ;
2017-03-02 04:43:28 -06:00
setDefaultsBasedOnXMLfile ( ) ;
2017-02-07 04:08:56 -06:00
}
2017-02-10 08:29:15 -06:00
2017-06-12 07:42:35 -05:00
if ( & m_activeTimeStepIndex = = changedField )
2017-04-07 04:02:31 -05:00
{
2017-06-13 04:38:22 -05:00
updateFractureGrid ( ) ;
2017-04-07 05:46:09 -05:00
2017-04-07 04:02:31 -05:00
//Changes to this parameters should change all fractures with this fracture template attached.
RimProject * proj ;
this - > firstAncestorOrThisOfType ( proj ) ;
if ( proj )
{
std : : vector < RimFracture * > fractures ;
proj - > descendantsIncludingThisOfType ( fractures ) ;
for ( RimFracture * fracture : fractures )
{
2017-06-09 10:21:59 -05:00
if ( fracture - > fractureTemplate ( ) = = this )
2017-04-07 04:02:31 -05:00
{
2018-01-03 04:00:05 -06:00
fracture - > stimPlanTimeIndexToPlot = m_activeTimeStepIndex ;
2017-04-07 04:02:31 -05:00
}
}
proj - > createDisplayModelAndRedrawAllViews ( ) ;
}
}
2017-08-03 06:39:52 -05:00
if ( & m_wellPathDepthAtFracture = = changedField
| | & m_borderPolygonResultName = = changedField
| | & m_activeTimeStepIndex = = changedField
| | & m_showStimPlanMesh = = changedField
| | & m_conductivityScalingFactor = = changedField )
2017-02-10 08:29:15 -06:00
{
2017-08-03 06:39:52 -05:00
if ( & m_conductivityScalingFactor = = changedField )
{
loadDataAndUpdate ( ) ;
}
2017-02-10 08:29:15 -06:00
RimProject * proj ;
this - > firstAncestorOrThisOfType ( proj ) ;
if ( proj )
{
//Regenerate geometry
2018-01-03 04:00:05 -06:00
proj - > createDisplayModelAndRedrawAllViews ( ) ;
2017-02-10 08:29:15 -06:00
}
}
2017-02-07 02:09:00 -06:00
}
2017-02-07 04:08:56 -06:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStimPlanFractureTemplate : : updateUiTreeName ( )
{
2017-02-10 08:29:15 -06:00
this - > uiCapability ( ) - > setUiName ( fileNameWithOutPath ( ) ) ;
2017-02-07 04:08:56 -06:00
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStimPlanFractureTemplate : : setFileName ( const QString & fileName )
{
2017-02-10 08:29:15 -06:00
m_stimPlanFileName = fileName ;
2017-02-07 04:08:56 -06:00
updateUiTreeName ( ) ;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const QString & RimStimPlanFractureTemplate : : fileName ( )
{
2017-02-10 08:29:15 -06:00
return m_stimPlanFileName ( ) ;
2017-02-07 04:08:56 -06:00
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
2017-02-10 08:29:15 -06:00
QString RimStimPlanFractureTemplate : : fileNameWithOutPath ( )
2017-02-07 04:08:56 -06:00
{
2017-02-10 08:29:15 -06:00
QFileInfo stimplanfileFileInfo ( m_stimPlanFileName ( ) ) ;
2017-02-07 04:08:56 -06:00
return stimplanfileFileInfo . fileName ( ) ;
}
2017-08-03 06:21:19 -05:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStimPlanFractureTemplate : : updateFilePathsFromProjectPath ( const QString & newProjectPath , const QString & oldProjectPath )
{
m_stimPlanFileName = RimTools : : relocateFile ( m_stimPlanFileName ( ) , newProjectPath , oldProjectPath , nullptr , nullptr ) ;
}
2017-02-09 03:52:05 -06:00
2017-03-02 04:43:28 -06:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStimPlanFractureTemplate : : setDefaultsBasedOnXMLfile ( )
{
setDepthOfWellPathAtFracture ( ) ;
2017-06-12 07:42:35 -05:00
RiaLogging : : info ( QString ( " Setting well/fracture intersection depth at %1 " ) . arg ( m_wellPathDepthAtFracture ) ) ;
m_activeTimeStepIndex = static_cast < int > ( m_stimPlanFractureDefinitionData - > totalNumberTimeSteps ( ) - 1 ) ;
2017-06-13 04:23:53 -05:00
bool polygonPropertySet = setBorderPolygonResultNameToDefault ( ) ;
2017-03-02 04:43:28 -06:00
2017-06-14 02:20:15 -05:00
if ( polygonPropertySet ) RiaLogging : : info ( QString ( " Calculating polygon outline based on %1 at timestep %2 " ) . arg ( m_borderPolygonResultName ) . arg ( m_stimPlanFractureDefinitionData - > timeSteps ( ) [ m_activeTimeStepIndex ] ) ) ;
2017-03-02 04:43:28 -06:00
else RiaLogging : : info ( QString ( " Property for polygon calculation not set. " ) ) ;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
2017-06-13 04:23:53 -05:00
bool RimStimPlanFractureTemplate : : setBorderPolygonResultNameToDefault ( )
2017-03-02 04:43:28 -06:00
{
2017-09-14 06:48:30 -05:00
// first option: Width
2017-06-13 04:38:22 -05:00
for ( std : : pair < QString , QString > property : resultNamesWithUnit ( ) )
2017-03-02 04:43:28 -06:00
{
if ( property . first = = " WIDTH " )
{
2017-06-13 04:23:53 -05:00
m_borderPolygonResultName = property . first ;
2017-03-02 04:43:28 -06:00
return true ;
}
}
2017-09-14 06:48:30 -05:00
// if width not found, use conductivity
if ( hasConductivity ( ) )
2017-03-02 04:43:28 -06:00
{
2017-09-14 06:48:30 -05:00
m_borderPolygonResultName = m_stimPlanFractureDefinitionData - > conductivityResultName ( ) ;
return true ;
2017-03-02 04:43:28 -06:00
}
2017-09-14 06:48:30 -05:00
// else: Set to first property
2017-07-03 04:36:58 -05:00
if ( resultNamesWithUnit ( ) . size ( ) > 0 )
2017-06-30 05:54:51 -05:00
{
m_borderPolygonResultName = resultNamesWithUnit ( ) [ 0 ] . first ;
return true ;
}
2017-03-02 04:43:28 -06:00
return false ;
}
2017-02-15 08:49:53 -06:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStimPlanFractureTemplate : : loadDataAndUpdate ( )
{
QString errorMessage ;
2017-08-03 06:39:52 -05:00
m_stimPlanFractureDefinitionData = RifStimPlanXmlReader : : readStimPlanXMLFile ( m_stimPlanFileName ( ) , m_conductivityScalingFactor ( ) , & errorMessage ) ;
2017-02-28 03:01:31 -06:00
if ( errorMessage . size ( ) > 0 ) RiaLogging : : error ( errorMessage ) ;
2017-02-17 02:29:46 -06:00
2017-06-12 07:30:18 -05:00
if ( m_stimPlanFractureDefinitionData . notNull ( ) )
{
2017-06-14 02:20:15 -05:00
fractureTemplateUnit = m_stimPlanFractureDefinitionData - > unitSet ( ) ;
2017-06-12 07:30:18 -05:00
}
else
{
2017-06-14 00:25:34 -05:00
fractureTemplateUnit = RiaEclipseUnitTools : : UNITS_UNKNOWN ;
2017-06-12 07:30:18 -05:00
}
2017-06-13 04:38:22 -05:00
updateFractureGrid ( ) ;
2017-04-06 02:34:38 -05:00
2017-06-12 07:30:18 -05:00
// Todo: Must update all views using this fracture template
RimEclipseView * activeView = dynamic_cast < RimEclipseView * > ( RiaApplication : : instance ( ) - > activeReservoirView ( ) ) ;
if ( activeView ) activeView - > stimPlanColors - > loadDataAndUpdate ( ) ;
2017-02-17 02:29:46 -06:00
updateConnectedEditors ( ) ;
2017-02-15 08:49:53 -06:00
}
2017-02-27 07:55:12 -06:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList < caf : : PdmOptionItemInfo > RimStimPlanFractureTemplate : : calculateValueOptions ( const caf : : PdmFieldHandle * fieldNeedingOptions , bool * useOptionsOnly )
{
QList < caf : : PdmOptionItemInfo > options ;
2017-06-13 04:23:53 -05:00
if ( fieldNeedingOptions = = & m_borderPolygonResultName )
2017-02-27 07:55:12 -06:00
{
2017-06-13 04:38:22 -05:00
for ( std : : pair < QString , QString > nameUnit : resultNamesWithUnit ( ) )
2017-02-27 07:55:12 -06:00
{
2017-03-15 09:02:20 -05:00
//options.push_back(caf::PdmOptionItemInfo(nameUnit.first + " [" + nameUnit.second + "]", nameUnit.first + " " + nameUnit.second));
options . push_back ( caf : : PdmOptionItemInfo ( nameUnit . first , nameUnit . first ) ) ;
2017-02-27 07:55:12 -06:00
}
}
2017-06-12 07:42:35 -05:00
else if ( fieldNeedingOptions = = & m_activeTimeStepIndex )
2017-02-27 07:55:12 -06:00
{
2017-06-13 04:38:22 -05:00
std : : vector < double > timeValues = timeSteps ( ) ;
2017-02-27 07:55:12 -06:00
int index = 0 ;
for ( double value : timeValues )
{
options . push_back ( caf : : PdmOptionItemInfo ( QString : : number ( value ) , index ) ) ;
index + + ;
}
}
return options ;
}
2017-02-17 08:10:04 -06:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStimPlanFractureTemplate : : setDepthOfWellPathAtFracture ( )
{
if ( ! m_stimPlanFractureDefinitionData . isNull ( ) )
{
2017-06-14 02:20:15 -05:00
double firstDepth = m_stimPlanFractureDefinitionData - > minDepth ( ) ;
double lastDepth = m_stimPlanFractureDefinitionData - > maxDepth ( ) ;
2017-02-17 08:10:04 -06:00
double averageDepth = ( firstDepth + lastDepth ) / 2 ;
2017-06-12 07:42:35 -05:00
m_wellPathDepthAtFracture = averageDepth ;
2017-02-17 08:10:04 -06:00
}
}
2017-03-15 09:02:20 -05:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimStimPlanFractureTemplate : : getUnitForStimPlanParameter ( QString parameterName )
{
QString unit ;
bool found = false ;
bool foundMultiple = false ;
2017-06-13 04:38:22 -05:00
for ( std : : pair < QString , QString > nameUnit : resultNamesWithUnit ( ) )
2017-03-15 09:02:20 -05:00
{
if ( nameUnit . first = = parameterName )
{
unit = nameUnit . second ;
if ( found ) foundMultiple = true ;
found = true ;
}
}
if ( foundMultiple ) RiaLogging : : error ( QString ( " Multiple units found for same parameter " ) ) ;
2017-07-03 04:36:58 -05:00
if ( ! found ) RiaLogging : : error ( QString ( " Requested unit / parameter not found for %1 template " ) . arg ( name ( ) ) ) ;
2017-03-15 09:02:20 -05:00
return unit ;
}
2017-02-07 02:09:00 -06:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
2017-06-14 02:20:15 -05:00
const std : : vector < double > & RimStimPlanFractureTemplate : : timeSteps ( )
2017-02-15 05:16:01 -06:00
{
2017-02-15 08:49:53 -06:00
if ( m_stimPlanFractureDefinitionData . isNull ( ) ) loadDataAndUpdate ( ) ;
2017-06-14 02:20:15 -05:00
return m_stimPlanFractureDefinitionData - > timeSteps ( ) ;
2017-02-15 05:16:01 -06:00
}
2017-02-17 07:11:47 -06:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
2017-06-13 04:38:22 -05:00
std : : vector < std : : pair < QString , QString > > RimStimPlanFractureTemplate : : resultNamesWithUnit ( ) const
2017-02-17 07:11:47 -06:00
{
std : : vector < std : : pair < QString , QString > > propertyNamesUnits ;
2017-02-23 03:14:28 -06:00
if ( m_stimPlanFractureDefinitionData . notNull ( ) )
2017-02-17 07:11:47 -06:00
{
2017-06-12 08:39:28 -05:00
propertyNamesUnits = m_stimPlanFractureDefinitionData - > getStimPlanPropertyNamesUnits ( ) ;
2017-02-17 07:11:47 -06:00
}
return propertyNamesUnits ;
}
2017-02-20 02:31:24 -06:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
2017-06-30 09:16:27 -05:00
void RimStimPlanFractureTemplate : : computeMinMax ( const QString & resultName , const QString & unitName , double * minValue , double * maxValue , double * posClosestToZero , double * negClosestToZero ) const
2017-02-20 02:31:24 -06:00
{
if ( m_stimPlanFractureDefinitionData . notNull ( ) )
{
2017-06-30 09:16:27 -05:00
m_stimPlanFractureDefinitionData - > computeMinMax ( resultName , unitName , minValue , maxValue , posClosestToZero , negClosestToZero ) ;
2017-02-20 02:31:24 -06:00
}
}
2017-03-27 07:19:21 -05:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
2017-06-13 04:38:22 -05:00
std : : vector < std : : vector < double > > RimStimPlanFractureTemplate : : resultValues ( const QString & resultName , const QString & unitName , size_t timeStepIndex ) const
{
return m_stimPlanFractureDefinitionData - > getDataAtTimeIndex ( resultName , unitName , timeStepIndex ) ;
}
2017-06-26 03:28:23 -05:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std : : vector < double > RimStimPlanFractureTemplate : : fractureGridResults ( const QString & resultName , const QString & unitName , size_t timeStepIndex ) const
{
return m_stimPlanFractureDefinitionData - > fractureGridResults ( resultName , unitName , timeStepIndex ) ;
}
2017-09-14 06:48:30 -05:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimStimPlanFractureTemplate : : hasConductivity ( ) const
{
if ( m_stimPlanFractureDefinitionData . notNull ( ) & &
! m_stimPlanFractureDefinitionData - > conductivityResultName ( ) . isEmpty ( ) )
{
return true ;
}
return false ;
}
2017-06-13 04:38:22 -05:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const RigFractureGrid * RimStimPlanFractureTemplate : : fractureGrid ( ) const
{
return m_fractureGrid . p ( ) ;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStimPlanFractureTemplate : : updateFractureGrid ( )
2017-03-27 07:19:21 -05:00
{
2017-06-26 03:28:23 -05:00
m_fractureGrid = m_stimPlanFractureDefinitionData - > createFractureGrid ( m_activeTimeStepIndex ,
2017-06-13 07:44:04 -05:00
fractureTemplateUnit ,
m_wellPathDepthAtFracture ) ;
2017-04-06 02:34:38 -05:00
}
2017-06-13 04:38:22 -05:00
2017-06-13 07:44:04 -05:00
2017-04-06 02:34:38 -05:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
2017-06-13 04:38:22 -05:00
void RimStimPlanFractureTemplate : : fractureTriangleGeometry ( std : : vector < cvf : : Vec3f > * nodeCoords ,
std : : vector < cvf : : uint > * triangleIndices ,
2017-06-14 00:25:34 -05:00
RiaEclipseUnitTools : : UnitSystem neededUnit )
2017-04-06 02:34:38 -05:00
{
2017-06-13 04:38:22 -05:00
if ( m_stimPlanFractureDefinitionData . isNull ( ) )
{
loadDataAndUpdate ( ) ;
}
2017-06-13 07:44:04 -05:00
m_stimPlanFractureDefinitionData - > createFractureTriangleGeometry ( m_wellPathDepthAtFracture ,
neededUnit ,
name ,
nodeCoords ,
triangleIndices ) ;
return ;
2017-03-27 07:19:21 -05:00
}
2017-02-15 08:14:16 -06:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
2017-06-14 00:25:34 -05:00
std : : vector < cvf : : Vec3f > RimStimPlanFractureTemplate : : fractureBorderPolygon ( RiaEclipseUnitTools : : UnitSystem neededUnit )
2017-02-15 08:14:16 -06:00
{
2017-02-27 07:55:12 -06:00
2017-06-13 04:23:53 -05:00
QString parameterName = m_borderPolygonResultName ;
2017-03-15 09:02:20 -05:00
QString parameterUnit = getUnitForStimPlanParameter ( parameterName ) ;
2017-06-13 07:44:04 -05:00
return m_stimPlanFractureDefinitionData - > createFractureBorderPolygon ( parameterName ,
parameterUnit ,
m_activeTimeStepIndex ,
m_wellPathDepthAtFracture ,
neededUnit ,
name ) ;
2017-02-07 02:09:00 -06:00
}
2017-03-06 04:32:09 -06:00
2017-02-07 02:09:00 -06:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStimPlanFractureTemplate : : defineUiOrdering ( QString uiConfigName , caf : : PdmUiOrdering & uiOrdering )
{
2017-02-10 03:33:07 -06:00
RimFractureTemplate : : defineUiOrdering ( uiConfigName , uiOrdering ) ;
2017-02-07 02:09:00 -06:00
2017-02-10 03:33:07 -06:00
uiOrdering . add ( & name ) ;
2017-06-12 07:42:35 -05:00
uiOrdering . add ( & m_showStimPlanMesh ) ;
2017-02-10 03:33:07 -06:00
2017-04-07 05:46:09 -05:00
caf : : PdmUiGroup * fileGroup = uiOrdering . addNewGroup ( " Input " ) ;
2017-02-10 08:29:15 -06:00
fileGroup - > add ( & m_stimPlanFileName ) ;
2017-06-12 07:42:35 -05:00
fileGroup - > add ( & m_activeTimeStepIndex ) ;
fileGroup - > add ( & m_wellPathDepthAtFracture ) ;
2017-02-10 03:33:07 -06:00
2017-02-22 04:52:06 -06:00
caf : : PdmUiGroup * geometryGroup = uiOrdering . addNewGroup ( " Geometry " ) ;
2017-06-09 10:21:59 -05:00
geometryGroup - > add ( & orientationType ) ;
2017-02-10 03:33:07 -06:00
geometryGroup - > add ( & azimuthAngle ) ;
2017-06-08 15:54:06 -05:00
caf : : PdmUiGroup * trGr = uiOrdering . addNewGroup ( " Fracture Truncation " ) ;
2017-06-09 10:21:59 -05:00
m_fractureContainment ( ) - > defineUiOrdering ( uiConfigName , * trGr ) ;
2017-06-08 15:54:06 -05:00
2017-02-22 04:52:06 -06:00
caf : : PdmUiGroup * propertyGroup = uiOrdering . addNewGroup ( " Properties " ) ;
2017-08-03 06:39:52 -05:00
propertyGroup - > add ( & m_conductivityScalingFactor ) ;
2017-06-09 10:21:59 -05:00
propertyGroup - > add ( & conductivityType ) ;
2017-02-10 03:33:07 -06:00
propertyGroup - > add ( & skinFactor ) ;
2017-04-19 04:00:52 -05:00
propertyGroup - > add ( & perforationLength ) ;
propertyGroup - > add ( & perforationEfficiency ) ;
2017-06-08 02:15:50 -05:00
propertyGroup - > add ( & wellDiameter ) ;
2017-02-07 02:09:00 -06:00
}
2017-02-07 04:08:56 -06:00
2017-02-17 08:10:04 -06:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStimPlanFractureTemplate : : defineEditorAttribute ( const caf : : PdmFieldHandle * field , QString uiConfigName , caf : : PdmUiEditorAttribute * attribute )
{
2017-04-19 04:00:52 -05:00
RimFractureTemplate : : defineEditorAttribute ( field , uiConfigName , attribute ) ;
2017-02-22 07:46:28 -06:00
if ( field = = & m_stimPlanFileName )
{
caf : : PdmUiFilePathEditorAttribute * myAttr = dynamic_cast < caf : : PdmUiFilePathEditorAttribute * > ( attribute ) ;
if ( myAttr )
{
myAttr - > m_fileSelectionFilter = " StimPlan Xml Files(*.xml);;All Files (*.*) " ;
}
}
2017-06-12 07:42:35 -05:00
if ( field = = & m_wellPathDepthAtFracture )
2017-02-17 08:10:04 -06:00
{
2017-06-14 02:20:15 -05:00
if ( ! m_stimPlanFractureDefinitionData . isNull ( ) & & ( m_stimPlanFractureDefinitionData - > depthCount ( ) > 0 ) )
2017-02-17 08:10:04 -06:00
{
2017-06-14 02:20:15 -05:00
caf : : PdmUiDoubleSliderEditorAttribute * myAttr = dynamic_cast < caf : : PdmUiDoubleSliderEditorAttribute * > ( attribute ) ;
if ( myAttr )
{
myAttr - > m_minimum = m_stimPlanFractureDefinitionData - > minDepth ( ) ;
myAttr - > m_maximum = m_stimPlanFractureDefinitionData - > maxDepth ( ) ;
}
2017-02-17 08:10:04 -06:00
}
}
}