mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6579: Make elastic property scaling checkable and add auto-name.
This commit is contained in:
parent
34c1ac35e5
commit
c16348eaaa
@ -48,7 +48,7 @@ RimElasticProperties::RimElasticProperties()
|
||||
m_propertiesTable.uiCapability()->setUiReadOnly( true );
|
||||
m_propertiesTable.xmlCapability()->disableIO();
|
||||
|
||||
CAF_PDM_InitScriptableField( &m_showScaledProperties, "ShowScaledProperties", true, "ShowScaledProperties", "", "", "" );
|
||||
CAF_PDM_InitScriptableField( &m_showScaledProperties, "ShowScaledProperties", true, "Show Scaled Properties", "", "", "" );
|
||||
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_scalings, "PropertyScalingCollection", "PropertyScalingCollection", "", "", "" );
|
||||
m_scalings.uiCapability()->setUiHidden( true );
|
||||
|
@ -47,6 +47,8 @@ RimElasticPropertyScaling::RimElasticPropertyScaling()
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_property, "Property", "Property", "", "", "" );
|
||||
CAF_PDM_InitScriptableField( &m_scale, "Scale", 1.0, "Scale", "", "", "" );
|
||||
|
||||
nameField()->uiCapability()->setUiReadOnly( true );
|
||||
|
||||
setUiName( "Property Scaling" );
|
||||
setDeletable( true );
|
||||
}
|
||||
@ -113,6 +115,7 @@ void RimElasticPropertyScaling::fieldChangedByUi( const caf::PdmFieldHandle* cha
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
{
|
||||
updateAutoName();
|
||||
changed.send();
|
||||
}
|
||||
|
||||
@ -140,12 +143,23 @@ RigEclipseCaseData* RimElasticPropertyScaling::getEclipseCaseData()
|
||||
return eclipseCase->eclipseCaseData();
|
||||
}
|
||||
|
||||
void RimElasticPropertyScaling::updateAutoName()
|
||||
{
|
||||
QString name = QString( "%1/%2 - %3: %4" )
|
||||
.arg( m_formation )
|
||||
.arg( m_facies )
|
||||
.arg( caf::AppEnum<RiaDefines::CurveProperty>::uiText( m_property() ) )
|
||||
.arg( m_scale );
|
||||
setName( name );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimElasticPropertyScaling::setFormation( const QString& formation )
|
||||
{
|
||||
m_formation = formation;
|
||||
updateAutoName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -154,6 +168,7 @@ void RimElasticPropertyScaling::setFormation( const QString& formation )
|
||||
void RimElasticPropertyScaling::setFacies( const QString& facies )
|
||||
{
|
||||
m_facies = facies;
|
||||
updateAutoName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -162,6 +177,7 @@ void RimElasticPropertyScaling::setFacies( const QString& facies )
|
||||
void RimElasticPropertyScaling::setScale( double scale )
|
||||
{
|
||||
m_scale = scale;
|
||||
updateAutoName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -170,6 +186,7 @@ void RimElasticPropertyScaling::setScale( double scale )
|
||||
void RimElasticPropertyScaling::setProperty( RiaDefines::CurveProperty property )
|
||||
{
|
||||
m_property = property;
|
||||
updateAutoName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -23,6 +23,8 @@
|
||||
|
||||
#include "RiaFractureModelDefines.h"
|
||||
|
||||
#include "RimCheckableNamedObject.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
class RimEclipseCase;
|
||||
@ -31,7 +33,7 @@ class RigEclipseCaseData;
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimElasticPropertyScaling : public caf::PdmObject
|
||||
class RimElasticPropertyScaling : public RimCheckableNamedObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
@ -60,6 +62,8 @@ private:
|
||||
caf::PdmField<caf::AppEnum<RiaDefines::CurveProperty>> m_property;
|
||||
caf::PdmField<double> m_scale;
|
||||
|
||||
void updateAutoName();
|
||||
|
||||
public:
|
||||
void setFormation( const QString& formation );
|
||||
void setFacies( const QString& facies );
|
||||
|
@ -100,7 +100,8 @@ double RimElasticPropertyScalingCollection::getScaling( const QString&
|
||||
{
|
||||
for ( const RimElasticPropertyScaling* scaling : m_elasticPropertyScalings )
|
||||
{
|
||||
if ( scaling->property() == property && scaling->formation() == formationName && scaling->facies() == faciesName )
|
||||
if ( scaling->property() == property && scaling->formation() == formationName &&
|
||||
scaling->facies() == faciesName && scaling->isChecked() )
|
||||
{
|
||||
return scaling->scale();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user