#7329 Report MD and formation dip from StimPlan template XML.

This commit is contained in:
Kristian Bendiksen 2021-02-04 09:03:03 +01:00
parent f2c25a5f13
commit 4d49302e82
2 changed files with 53 additions and 0 deletions

View File

@ -47,6 +47,7 @@
#include "cafPdmObject.h"
#include "cafPdmUiDoubleSliderEditor.h"
#include "cafPdmUiFilePathEditor.h"
#include "cafPdmUiTextEditor.h"
#include "cvfMath.h"
#include "cvfVector3.h"
@ -91,6 +92,12 @@ RimStimPlanFractureTemplate::RimStimPlanFractureTemplate()
"",
"" );
CAF_PDM_InitFieldNoDefault( &m_propertiesTable, "PropertiesTable", "Properties Table", "", "", "" );
m_propertiesTable.uiCapability()->setUiEditorTypeName( caf::PdmUiTextEditor::uiEditorTypeName() );
m_propertiesTable.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
m_propertiesTable.uiCapability()->setUiReadOnly( true );
m_propertiesTable.xmlCapability()->disableIO();
CAF_PDM_InitField( &m_showStimPlanMesh_OBSOLETE, "ShowStimPlanMesh", true, "", "", "", "" );
m_showStimPlanMesh_OBSOLETE.uiCapability()->setUiHidden( true );
@ -231,6 +238,8 @@ void RimStimPlanFractureTemplate::setDefaultsBasedOnXMLfile()
{
m_conductivityResultNameOnFile = m_stimPlanFractureDefinitionData->conductivityResultNames().front();
}
m_propertiesTable = generatePropertiesTable();
}
//--------------------------------------------------------------------------------------------------
@ -1058,6 +1067,8 @@ void RimStimPlanFractureTemplate::defineUiOrdering( QString uiConfigName, caf::P
group->add( &m_wellDiameter );
}
uiOrdering.add( &m_propertiesTable );
if ( widthResultValues().empty() )
{
m_fractureWidthType = USER_DEFINED_WIDTH;
@ -1083,6 +1094,16 @@ void RimStimPlanFractureTemplate::defineEditorAttribute( const caf::PdmFieldHand
myAttr->m_fileSelectionFilter = "StimPlan Xml Files(*.xml);;All Files (*.*)";
}
}
if ( field == &m_propertiesTable )
{
auto myAttr = dynamic_cast<caf::PdmUiTextEditorAttribute*>( attribute );
if ( myAttr )
{
myAttr->wrapMode = caf::PdmUiTextEditorAttribute::NoWrap;
myAttr->textMode = caf::PdmUiTextEditorAttribute::HTML;
}
}
}
//--------------------------------------------------------------------------------------------------
@ -1141,3 +1162,31 @@ double RimStimPlanFractureTemplate::formationDip() const
return m_stimPlanFractureDefinitionData->formationDip();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimStimPlanFractureTemplate::generatePropertiesTable() const
{
QString body;
if ( formationDip() != HUGE_VAL )
{
body += QString( "Formation Dip: %1<br>" ).arg( formationDip() );
}
if ( !m_stimPlanFractureDefinitionData.isNull() )
{
if ( m_stimPlanFractureDefinitionData->topPerfMd() != HUGE_VAL )
{
body += QString( "Top MD: %1<br>" ).arg( m_stimPlanFractureDefinitionData->topPerfMd() );
}
if ( m_stimPlanFractureDefinitionData->bottomPerfMd() != HUGE_VAL )
{
body += QString( "Bottom MD: %1<br>" ).arg( m_stimPlanFractureDefinitionData->bottomPerfMd() );
}
}
return body;
}

View File

@ -133,6 +133,8 @@ private:
double conversionFactorForBetaValues() const;
QString generatePropertiesTable() const;
private:
caf::PdmField<int> m_activeTimeStepIndex;
caf::PdmField<QString> m_conductivityResultNameOnFile;
@ -144,5 +146,7 @@ private:
cvf::ref<RigStimPlanFractureDefinition> m_stimPlanFractureDefinitionData;
bool m_readError;
caf::PdmField<QString> m_propertiesTable;
caf::PdmField<bool> m_showStimPlanMesh_OBSOLETE;
};