#5110 Show only relevant well measurements in WBS track.

This commit is contained in:
Kristian Bendiksen 2019-12-03 12:23:51 +01:00
parent 0e4f9fe114
commit 12abf6494f
5 changed files with 18 additions and 36 deletions

View File

@ -40,6 +40,8 @@
#include "RimWellLogPlotCollection.h"
#include "RimWellLogTrack.h"
#include "RimWellLogWbsCurve.h"
#include "RimWellMeasurement.h"
#include "RimWellMeasurementCurve.h"
#include "RimWellPath.h"
#include "RicWellLogTools.h"
@ -322,11 +324,12 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore
curve->setSmoothingThreshold( 0.002 );
}
std::vector<QString> measurementNames;
measurementNames.push_back( "XLOT" );
for ( size_t i = 0; i < measurementNames.size(); i++ )
for ( QString measurementKind : RimWellMeasurement::measurementKindsForWellBoreStability() )
{
RicWellLogTools::addWellMeasurementCurve( stabilityCurvesTrack, wellPath, measurementNames[i] );
RimWellMeasurementCurve* curve = RicWellLogTools::addWellMeasurementCurve( stabilityCurvesTrack,
wellPath,
measurementKind );
curve->loadDataAndUpdate( false );
}
stabilityCurvesTrack->setAutoScaleXEnabled( true );

View File

@ -205,3 +205,9 @@ bool RimWellMeasurement::kindHasValue( const QString& measurementKind )
<< "CORE";
return !valueLessKind.contains( measurementKind );
}
std::vector<QString> RimWellMeasurement::measurementKindsForWellBoreStability()
{
std::vector<QString> wbsMeasurementKinds = {"XLOT", "LOT", "FIT"};
return wbsMeasurementKinds;
}

View File

@ -55,8 +55,9 @@ public:
QString remark() const;
void setRemark( const QString& remark );
static bool kindHasValue( const QString& measurementKind );
static cvf::Color3f mapToColor( const QString& measurementKind );
static bool kindHasValue( const QString& measurementKind );
static cvf::Color3f mapToColor( const QString& measurementKind );
static std::vector<QString> measurementKindsForWellBoreStability();
private:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,

View File

@ -59,6 +59,7 @@ RimWellMeasurementCurve::RimWellMeasurementCurve()
CAF_PDM_InitFieldNoDefault( &m_measurementKind, "CurveMeasurementKind", "Measurement Kind", "", "", "" );
m_measurementKind.uiCapability()->setUiTreeChildrenHidden( true );
m_measurementKind.uiCapability()->setUiHidden( true );
m_wellPath = nullptr;
}
@ -219,7 +220,6 @@ void RimWellMeasurementCurve::defineUiOrdering( QString uiConfigName, caf::PdmUi
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Curve Data" );
curveDataGroup->add( &m_wellPath );
curveDataGroup->add( &m_measurementKind );
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup( "Appearance" );
RimPlotCurve::appearanceUiOrdering( *appearanceGroup );
@ -268,32 +268,9 @@ QList<caf::PdmOptionItemInfo>
}
}
if ( fieldNeedingOptions == &m_measurementKind )
{
if ( m_wellPath() )
{
// TODO: take all options from somewhere and filter based on
// what the current well path has set.
options.push_back( caf::PdmOptionItemInfo( "XLOT", "XLOT" ) );
options.push_back( caf::PdmOptionItemInfo( "LOT", "LOT" ) );
options.push_back( caf::PdmOptionItemInfo( "FIT", "FIT" ) );
options.push_back( caf::PdmOptionItemInfo( "DP", "DP" ) );
}
}
return options;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellMeasurementCurve::initAfterRead()
{
if ( !m_wellPath ) return;
// TODO: do something here?
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -301,11 +278,7 @@ QString RimWellMeasurementCurve::createCurveAutoName()
{
if ( m_wellPath )
{
QStringList name;
name.push_back( wellName() );
name.push_back( measurementKind() );
return name.join( ", " );
return measurementKind();
}
return "Empty curve";

View File

@ -63,7 +63,6 @@ protected:
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly ) override;
void initAfterRead() override;
RiuQwtSymbol::PointSymbolEnum getSymbolForMeasurementKind( const QString& measurementKind );
cvf::Color3f getColorForMeasurementKind( const QString& measurementKind );