#6233: Fracture Model: Add command to change MD location from python.

This commit is contained in:
Kristian Bendiksen 2020-10-07 15:49:21 +02:00
parent 6c8dda3869
commit 752f0f5100
4 changed files with 14 additions and 4 deletions

View File

@ -65,5 +65,9 @@ export_folder = tempfile.gettempdir()
print("Exporting fracture model to: ", export_folder) print("Exporting fracture model to: ", export_folder)
fracture_model_plot.export_to_file(directory_path=export_folder) fracture_model_plot.export_to_file(directory_path=export_folder)
fracture_model_plot.export_snapshot(export_folder=export_folder) fracture_model_plot.export_snapshot(export_folder=export_folder)
print("Setting measured depth and perforation length.")
fracture_model.measured_depth = 3300.0
fracture_model.perforation_length = 123.445
fracture_model.update()

View File

@ -113,7 +113,7 @@ RimFractureModel::RimFractureModel()
m_editFractureModelTemplate.uiCapability()->setUiEditorTypeName( caf::PdmUiToolButtonEditor::uiEditorTypeName() ); m_editFractureModelTemplate.uiCapability()->setUiEditorTypeName( caf::PdmUiToolButtonEditor::uiEditorTypeName() );
m_editFractureModelTemplate.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN ); m_editFractureModelTemplate.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
CAF_PDM_InitScriptableField( &m_MD, "MD", 0.0, "MD", "", "", "" ); CAF_PDM_InitScriptableField( &m_MD, "MeasuredDepth", 0.0, "Measured Depth", "", "", "" );
m_MD.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() ); m_MD.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
CAF_PDM_InitScriptableField( &m_extractionType, CAF_PDM_InitScriptableField( &m_extractionType,

View File

@ -311,6 +311,12 @@ void RimFractureModelCurve::performDataExtraction( bool* isUsingPseudoLength )
return; return;
} }
if ( values.size() != initialValues.size() )
{
RiaLogging::error( QString( "Inconsistent state." ) );
return;
}
replaceMissingValues( values, initialValues ); replaceMissingValues( values, initialValues );
} }
} }
@ -325,7 +331,7 @@ void RimFractureModelCurve::performDataExtraction( bool* isUsingPseudoLength )
} }
bool performDataSmoothing = false; bool performDataSmoothing = false;
if ( !values.empty() && !measuredDepthValues.empty() ) if ( !values.empty() && !measuredDepthValues.empty() && measuredDepthValues.size() == values.size() )
{ {
if ( tvDepthValues.empty() ) if ( tvDepthValues.empty() )
{ {

View File

@ -165,7 +165,7 @@ void RimLayerCurve::performDataExtraction( bool* isUsingPseudoLength )
return; return;
} }
assert( faciesValues.size() == curveData.data.size() ); if ( faciesValues.size() != curveData.data.size() || faciesValues.size() != measuredDepthValues.size() ) return;
values.resize( faciesValues.size() ); values.resize( faciesValues.size() );