mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5125 Well measurements : Select all wells by default
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimWellMeasurementInView.h"
|
||||
|
||||
#include "Rim3dView.h"
|
||||
@@ -205,13 +206,13 @@ QList<caf::PdmOptionItemInfo>
|
||||
|
||||
// Find wells with a given measurement.
|
||||
std::set<QString> wellsWithMeasurementKind;
|
||||
for ( auto well : wellPathCollection->wellPaths )
|
||||
for ( const auto& well : wellPathCollection->wellPaths )
|
||||
{
|
||||
if ( hasMeasurementKindForWell( well, wellPathCollection, measurements, m_measurementKind ) )
|
||||
wellsWithMeasurementKind.insert( well->name() );
|
||||
}
|
||||
|
||||
for ( auto wellName : wellsWithMeasurementKind )
|
||||
for ( const auto& wellName : wellsWithMeasurementKind )
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo( wellName, wellName ) );
|
||||
}
|
||||
@@ -252,3 +253,28 @@ bool RimWellMeasurementInView::isWellChecked( const QString& wellName ) const
|
||||
{
|
||||
return std::find( m_wells.v().begin(), m_wells.v().end(), wellName ) != m_wells.v().end();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellMeasurementInView::setAllWellsSelected()
|
||||
{
|
||||
RimWellPathCollection* wellPathCollection = RimTools::wellPathCollection();
|
||||
if ( wellPathCollection )
|
||||
{
|
||||
std::vector<RimWellMeasurement*> measurements = wellPathCollection->measurementCollection()->measurements();
|
||||
|
||||
// Find wells with a given measurement.
|
||||
std::set<QString> wellsWithMeasurementKind;
|
||||
for ( const auto& well : wellPathCollection->wellPaths )
|
||||
{
|
||||
if ( hasMeasurementKindForWell( well, wellPathCollection, measurements, m_measurementKind ) )
|
||||
wellsWithMeasurementKind.insert( well->name() );
|
||||
}
|
||||
|
||||
for ( const auto& wellName : wellsWithMeasurementKind )
|
||||
{
|
||||
m_wells.v().push_back( wellName );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ public:
|
||||
QString measurementKind() const;
|
||||
void setMeasurementKind( const QString& measurementKind );
|
||||
bool isWellChecked( const QString& wellName ) const;
|
||||
void setAllWellsSelected();
|
||||
|
||||
void updateLegendRangesTextAndVisibility( RiuViewer* nativeOrOverrideViewer, bool isUsingOverrideViewer );
|
||||
|
||||
@@ -55,8 +56,9 @@ protected:
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue ) override;
|
||||
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly );
|
||||
bool* useOptionsOnly ) override;
|
||||
|
||||
bool updateLegendData();
|
||||
static bool hasMeasurementKindForWell( const RimWellPath* wellPath,
|
||||
|
||||
@@ -48,6 +48,8 @@ RimWellMeasurementInViewCollection::RimWellMeasurementInViewCollection()
|
||||
CAF_PDM_InitFieldNoDefault( &m_measurementsInView, "MeasurementKinds", "Measurement Kinds", "", "", "" );
|
||||
m_measurementsInView.uiCapability()->setUiHidden( true );
|
||||
|
||||
m_isChecked = false;
|
||||
|
||||
this->setName( "Well Measurements" );
|
||||
}
|
||||
|
||||
@@ -132,6 +134,8 @@ void RimWellMeasurementInViewCollection::syncWithChangesInWellMeasurementCollect
|
||||
RimWellMeasurementInView* measurementInView = new RimWellMeasurementInView;
|
||||
measurementInView->setName( kind );
|
||||
measurementInView->setMeasurementKind( kind );
|
||||
measurementInView->setAllWellsSelected();
|
||||
|
||||
m_measurementsInView.push_back( measurementInView );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user