mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5837 Well Measurements : Allow modification of kind
This commit is contained in:
@@ -59,7 +59,6 @@ RimWellMeasurementCurve::RimWellMeasurementCurve()
|
|||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &m_measurementKind, "CurveMeasurementKind", "Measurement Kind", "", "", "" );
|
CAF_PDM_InitFieldNoDefault( &m_measurementKind, "CurveMeasurementKind", "Measurement Kind", "", "", "" );
|
||||||
m_measurementKind.uiCapability()->setUiTreeChildrenHidden( true );
|
m_measurementKind.uiCapability()->setUiTreeChildrenHidden( true );
|
||||||
m_measurementKind.uiCapability()->setUiHidden( true );
|
|
||||||
|
|
||||||
m_wellPath = nullptr;
|
m_wellPath = nullptr;
|
||||||
}
|
}
|
||||||
@@ -75,10 +74,6 @@ RimWellMeasurementCurve::~RimWellMeasurementCurve()
|
|||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellMeasurementCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
void RimWellMeasurementCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||||
{
|
|
||||||
this->RimPlotCurve::updateCurvePresentation( updateParentPlot );
|
|
||||||
|
|
||||||
if ( isCurveVisible() )
|
|
||||||
{
|
{
|
||||||
RimWellLogPlot* wellLogPlot;
|
RimWellLogPlot* wellLogPlot;
|
||||||
firstAncestorOrThisOfType( wellLogPlot );
|
firstAncestorOrThisOfType( wellLogPlot );
|
||||||
@@ -169,6 +164,8 @@ void RimWellMeasurementCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
m_qwtPlotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() );
|
m_qwtPlotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->RimPlotCurve::updateCurvePresentation( updateParentPlot );
|
||||||
|
|
||||||
if ( updateParentPlot )
|
if ( updateParentPlot )
|
||||||
{
|
{
|
||||||
updateZoomInParentPlot();
|
updateZoomInParentPlot();
|
||||||
@@ -179,7 +176,6 @@ void RimWellMeasurementCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
m_parentQwtPlot->replot();
|
m_parentQwtPlot->replot();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
@@ -210,6 +206,7 @@ void RimWellMeasurementCurve::fieldChangedByUi( const caf::PdmFieldHandle* chang
|
|||||||
{
|
{
|
||||||
this->loadDataAndUpdate( true );
|
this->loadDataAndUpdate( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_parentQwtPlot ) m_parentQwtPlot->replot();
|
if ( m_parentQwtPlot ) m_parentQwtPlot->replot();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,6 +219,7 @@ void RimWellMeasurementCurve::defineUiOrdering( QString uiConfigName, caf::PdmUi
|
|||||||
|
|
||||||
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Curve Data" );
|
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Curve Data" );
|
||||||
curveDataGroup->add( &m_wellPath );
|
curveDataGroup->add( &m_wellPath );
|
||||||
|
curveDataGroup->add( &m_measurementKind );
|
||||||
|
|
||||||
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup( "Appearance" );
|
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup( "Appearance" );
|
||||||
RimPlotCurve::appearanceUiOrdering( *appearanceGroup );
|
RimPlotCurve::appearanceUiOrdering( *appearanceGroup );
|
||||||
@@ -254,6 +252,33 @@ QList<caf::PdmOptionItemInfo>
|
|||||||
{
|
{
|
||||||
RimTools::wellPathOptionItems( &options );
|
RimTools::wellPathOptionItems( &options );
|
||||||
}
|
}
|
||||||
|
else if ( fieldNeedingOptions == &m_measurementKind )
|
||||||
|
{
|
||||||
|
RimWellPathCollection* wellPathCollection = nullptr;
|
||||||
|
if ( m_wellPath )
|
||||||
|
{
|
||||||
|
m_wellPath->firstAncestorOrThisOfTypeAsserted( wellPathCollection );
|
||||||
|
}
|
||||||
|
|
||||||
|
std::set<QString> names;
|
||||||
|
|
||||||
|
if ( wellPathCollection )
|
||||||
|
{
|
||||||
|
const RimWellMeasurementCollection* measurementCollection = wellPathCollection->measurementCollection();
|
||||||
|
for ( RimWellMeasurement* measurement : measurementCollection->measurements() )
|
||||||
|
{
|
||||||
|
if ( measurement->wellName() == m_wellPath->name() )
|
||||||
|
{
|
||||||
|
names.insert( measurement->kind() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( const auto& kind : names )
|
||||||
|
{
|
||||||
|
options.push_back( caf::PdmOptionItemInfo( kind, kind ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user