#7027 Stim Plan Model: add unit to legend text for relevant curves

This commit is contained in:
Kristian Bendiksen 2021-11-05 16:05:20 +01:00 committed by Magne Sjaastad
parent 53f102ee55
commit 5ad7bfac77
3 changed files with 36 additions and 0 deletions

View File

@ -232,6 +232,7 @@ void RicNewStimPlanModelPlotFeature::createFormationTrack( RimStimPlanModelPlot*
formationTrack->setOverburdenHeight( stimPlanModel->overburdenHeight() );
formationTrack->setUnderburdenHeight( stimPlanModel->underburdenHeight() );
formationTrack->setColSpan( RimPlot::ONE );
formationTrack->setXAxisTitle( stimPlanModel->unitForProperty( RiaDefines::CurveProperty::FORMATIONS ) );
formationTrack->setLegendsVisible( true );
}
@ -259,6 +260,7 @@ void RicNewStimPlanModelPlotFeature::createFaciesTrack( RimStimPlanModelPlot* pl
faciesTrack->setAnnotationDisplay( RiuPlotAnnotationTool::COLOR_SHADING );
faciesTrack->setOverburdenHeight( stimPlanModel->overburdenHeight() );
faciesTrack->setUnderburdenHeight( stimPlanModel->underburdenHeight() );
faciesTrack->setXAxisTitle( stimPlanModel->unitForProperty( RiaDefines::CurveProperty::FACIES ) );
faciesTrack->setLegendsVisible( false );
faciesTrack->setPlotTitleVisible( true );
@ -334,6 +336,8 @@ void RicNewStimPlanModelPlotFeature::createLayersTrack( RimStimPlanModelPlot* pl
faciesTrack->addCurve( curve );
faciesTrack->setAutoScaleXEnabled( true );
faciesTrack->setXAxisTitle( stimPlanModel->unitForProperty( RiaDefines::CurveProperty::LAYERS ) );
curve->loadDataAndUpdate( true );
curve->updateConnectedEditors();
@ -423,6 +427,7 @@ void RicNewStimPlanModelPlotFeature::createParametersTrack( RimStimPlanModelPlot
plotTrack->setLogarithmicScale( isPlotLogarithmic );
plotTrack->setAutoScaleXEnabled( true );
plotTrack->setMinAndMaxTicksOnly( useMinMaxTicksOnly( propertyTypes[0] ) );
plotTrack->setXAxisTitle( stimPlanModel->unitForProperty( propertyTypes[0] ) );
plotTrack->updateConnectedEditors();
plot->updateConnectedEditors();

View File

@ -1840,3 +1840,32 @@ RimEclipseCase* RimStimPlanModel::eclipseCaseForType( RimExtractionConfiguration
return nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimStimPlanModel::unitForProperty( RiaDefines::CurveProperty curveProperty ) const
{
std::map<RiaDefines::CurveProperty, QString> propertyToUnitMapping;
propertyToUnitMapping[RiaDefines::CurveProperty::PERMEABILITY_X] = "mD";
propertyToUnitMapping[RiaDefines::CurveProperty::PERMEABILITY_Z] = "mD";
propertyToUnitMapping[RiaDefines::CurveProperty::YOUNGS_MODULUS] = "MMpsi";
propertyToUnitMapping[RiaDefines::CurveProperty::K_IC] = "<html>psi * &radic;in</html>";
propertyToUnitMapping[RiaDefines::CurveProperty::PROPPANT_EMBEDMENT] = "<html>lb / ft";
propertyToUnitMapping[RiaDefines::CurveProperty::SPURT_LOSS] = "<html>gal / 100ft&#178;</html>";
propertyToUnitMapping[RiaDefines::CurveProperty::FLUID_LOSS_COEFFICIENT] = "<html>ft / &radic;min</html>";
propertyToUnitMapping[RiaDefines::CurveProperty::THERMAL_EXPANSION_COEFFICIENT] = "<html>1 / &deg;C</html>";
propertyToUnitMapping[RiaDefines::CurveProperty::TEMPERATURE] = "<html>&deg;C</html>";
propertyToUnitMapping[RiaDefines::CurveProperty::STRESS] = "Psi";
propertyToUnitMapping[RiaDefines::CurveProperty::INITIAL_STRESS] = "Psi";
propertyToUnitMapping[RiaDefines::CurveProperty::STRESS_GRADIENT] = "Psi / ft";
propertyToUnitMapping[RiaDefines::CurveProperty::PRESSURE] = "Bar";
propertyToUnitMapping[RiaDefines::CurveProperty::INITIAL_PRESSURE] = "Bar";
auto hit = propertyToUnitMapping.find( curveProperty );
if ( hit != propertyToUnitMapping.end() )
return hit->second;
else
return " ";
}

View File

@ -190,6 +190,8 @@ public:
QString pressureDate() const;
QString unitForProperty( RiaDefines::CurveProperty curveProperty ) const;
protected:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,