9498 Add parsing of network name

Use merged commit
This commit is contained in:
Magne Sjaastad
2023-08-14 11:18:10 +02:00
parent 7a6569066c
commit 0bada502fb
33 changed files with 302 additions and 156 deletions

View File

@@ -117,6 +117,18 @@ bool RimDataSourceSteppingTools::updateAddressIfMatching( const QVariant&
return true;
}
}
else if ( category == RifEclipseSummaryAddress::SUMMARY_NETWORK )
{
std::string oldString = oldValue.toString().toStdString();
std::string newString = newValue.toString().toStdString();
if ( adr->networkName() == oldString )
{
adr->setNetworkName( newString );
return true;
}
}
else if ( category == RifEclipseSummaryAddress::SUMMARY_WELL )
{
std::string oldString = oldValue.toString().toStdString();

View File

@@ -148,8 +148,7 @@ double RimSimWellInViewTools::extractValueForTimeStep( RifSummaryReaderInterface
return 0.0;
}
RifEclipseSummaryAddress
addr( RifEclipseSummaryAddress::SUMMARY_WELL, vectorName, -1, -1, "", wellName.toStdString(), -1, "", -1, -1, -1, -1, false, -1 );
auto addr = RifEclipseSummaryAddress::wellAddress( vectorName, wellName.toStdString(), -1 );
if ( !summaryReader->hasAddress( addr ) )
{

View File

@@ -519,7 +519,15 @@ std::vector<RimSummaryCalculationAddress>
}
else if ( category == RifEclipseSummaryAddress::SUMMARY_NETWORK )
{
addresses.push_back( RimSummaryCalculationAddress( RifEclipseSummaryAddress::networkAddress( name, m_id ) ) );
std::set<std::string> uniqueNames;
std::for_each( allResultAddresses.begin(),
allResultAddresses.end(),
[&]( const auto& addr ) { uniqueNames.insert( addr.networkName() ); } );
for ( auto networkName : uniqueNames )
{
addresses.push_back( RimSummaryCalculationAddress( RifEclipseSummaryAddress::networkAddress( name, networkName, m_id ) ) );
}
}
else if ( category == RifEclipseSummaryAddress::SUMMARY_WELL )
{
@@ -600,7 +608,7 @@ RimSummaryCalculationAddress RimSummaryCalculation::singleAddressesForCategory(
}
else if ( category == RifEclipseSummaryAddress::SUMMARY_NETWORK )
{
return RifEclipseSummaryAddress::networkAddress( name, m_id );
return RifEclipseSummaryAddress::networkAddress( name, address.networkName(), m_id );
}
else if ( category == RifEclipseSummaryAddress::SUMMARY_WELL )
{

View File

@@ -76,6 +76,14 @@ bool RimMultiSummaryPlotNameHelper::isGroupNameInTitle() const
return std::any_of( m_nameHelpers.begin(), m_nameHelpers.end(), []( auto nameHelper ) { return nameHelper->isGroupNameInTitle(); } );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimMultiSummaryPlotNameHelper::isNetworkInTitle() const
{
return std::any_of( m_nameHelpers.begin(), m_nameHelpers.end(), []( auto nameHelper ) { return nameHelper->isNetworkInTitle(); } );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -184,6 +192,19 @@ std::string RimMultiSummaryPlotNameHelper::titleGroupName() const
return "";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::string RimMultiSummaryPlotNameHelper::titleNetwork() const
{
for ( auto nameHelper : m_nameHelpers )
{
if ( nameHelper->isNetworkInTitle() ) return nameHelper->titleNetwork();
}
return "";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -33,6 +33,7 @@ public:
bool isPlotDisplayingSingleVectorName() const override;
bool isWellNameInTitle() const override;
bool isGroupNameInTitle() const override;
bool isNetworkInTitle() const override;
bool isRegionInTitle() const override;
bool isCaseInTitle() const override;
bool isBlockInTitle() const override;
@@ -45,6 +46,7 @@ public:
std::string titleVectorName() const override;
std::string titleWellName() const override;
std::string titleGroupName() const override;
std::string titleNetwork() const override;
std::string titleRegion() const override;
std::string titleBlock() const override;
std::string titleSegment() const override;

View File

@@ -68,6 +68,7 @@ RimSummaryAddress::RimSummaryAddress()
CAF_PDM_InitFieldNoDefault( &m_regionNumber, "SummaryRegion", "Region" );
CAF_PDM_InitFieldNoDefault( &m_regionNumber2, "SummaryRegion2", "Region2" );
CAF_PDM_InitFieldNoDefault( &m_groupName, "SummaryWellGroup", "Group" );
CAF_PDM_InitFieldNoDefault( &m_networkName, "SummaryNetworkGroup", "Network" );
CAF_PDM_InitFieldNoDefault( &m_wellName, "SummaryWell", "Well" );
CAF_PDM_InitFieldNoDefault( &m_wellSegmentNumber, "SummaryWellSegment", "Well Segment" );
CAF_PDM_InitFieldNoDefault( &m_lgrName, "SummaryLgr", "Grid" );
@@ -123,6 +124,7 @@ void RimSummaryAddress::setAddress( const RifEclipseSummaryAddress& addr )
m_regionNumber = addr.regionNumber();
m_regionNumber2 = addr.regionNumber2();
m_groupName = addr.groupName().c_str();
m_networkName = addr.networkName().c_str();
m_wellName = addr.wellName().c_str();
m_wellSegmentNumber = addr.wellSegmentNumber();
m_lgrName = addr.lgrName().c_str();
@@ -148,6 +150,7 @@ RifEclipseSummaryAddress RimSummaryAddress::address() const
m_regionNumber(),
m_regionNumber2(),
m_groupName().toStdString(),
m_networkName().toStdString(),
m_wellName().toStdString(),
m_wellSegmentNumber(),
m_lgrName().toStdString(),
@@ -190,6 +193,7 @@ QString RimSummaryAddress::keywordForCategory( RifEclipseSummaryAddress::Summary
if ( category == RifEclipseSummaryAddress::SUMMARY_WELL ) return m_wellName.keyword();
if ( category == RifEclipseSummaryAddress::SUMMARY_GROUP ) return m_groupName.keyword();
if ( category == RifEclipseSummaryAddress::SUMMARY_REGION ) return m_regionNumber.keyword();
if ( category == RifEclipseSummaryAddress::SUMMARY_NETWORK ) return m_networkName.keyword();
return {};
}

View File

@@ -58,8 +58,6 @@ public:
QString quantityName() const;
void ensureCalculationIdIsAssigned();
RiaDefines::PhaseType addressPhaseType() const;
QString keywordForCategory( RifEclipseSummaryAddress::SummaryVarCategory category ) const;
@@ -76,6 +74,7 @@ private:
caf::PdmField<int> m_regionNumber;
caf::PdmField<int> m_regionNumber2;
caf::PdmField<QString> m_groupName;
caf::PdmField<QString> m_networkName;
caf::PdmField<QString> m_wellName;
caf::PdmField<int> m_wellSegmentNumber;
caf::PdmField<QString> m_lgrName;

View File

@@ -39,6 +39,7 @@ void caf::AppEnum<RimSummaryAddressCollection::CollectionContentType>::setUp()
addItem( CollectionContentType::WELL_FOLDER, "WELL_FOLDER", RiaDefines::summaryWell() );
addItem( CollectionContentType::GROUP_FOLDER, "GROUP_FOLDER", RiaDefines::summaryWellGroup() );
addItem( CollectionContentType::REGION_FOLDER, "REGION_FOLDER", RiaDefines::summaryRegion() );
addItem( CollectionContentType::NETWORK_FOLDER, "NETWORK_FOLDER", RiaDefines::summaryNetwork() );
addItem( CollectionContentType::BLOCK, "BLOCK", RiaDefines::summaryBlock() );
addItem( CollectionContentType::SUMMARY_CASE, "SUMMARY_CASE", "Summary Case" );
addItem( CollectionContentType::AQUIFER, "AQUIFER", RiaDefines::summaryAquifer() );
@@ -168,7 +169,7 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::set<RifEclip
auto* groups = getOrCreateSubfolder( CollectionContentType::GROUP_FOLDER );
auto* wells = getOrCreateSubfolder( CollectionContentType::WELL_FOLDER );
auto* aquifer = getOrCreateSubfolder( CollectionContentType::AQUIFER );
auto* network = getOrCreateSubfolder( CollectionContentType::NETWORK );
auto* networks = getOrCreateSubfolder( CollectionContentType::NETWORK_FOLDER );
auto* misc = getOrCreateSubfolder( CollectionContentType::MISC );
auto* regions = getOrCreateSubfolder( CollectionContentType::REGION_FOLDER );
auto* region2region = getOrCreateSubfolder( CollectionContentType::REGION_2_REGION );
@@ -192,6 +193,7 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::set<RifEclip
if ( a.regionNumber() != b.regionNumber() ) return a.regionNumber() < b.regionNumber();
if ( a.regionNumber2() != b.regionNumber2() ) return a.regionNumber2() < b.regionNumber2();
if ( a.groupName() != b.groupName() ) return a.groupName() < b.groupName();
if ( a.networkName() != b.networkName() ) return a.networkName() < b.networkName();
if ( a.lgrName() != b.lgrName() ) return a.lgrName() < b.lgrName();
if ( a.cellK() != b.cellK() ) return a.cellK() < b.cellK();
if ( a.cellJ() != b.cellJ() ) return a.cellJ() < b.cellJ();
@@ -217,7 +219,7 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::set<RifEclip
break;
case RifEclipseSummaryAddress::SummaryVarCategory::SUMMARY_NETWORK:
network->addAddress( address, caseId, ensembleId );
networks->addToSubfolder( QString::fromStdString( address.networkName() ), CollectionContentType::NETWORK, address, caseId, ensembleId );
break;
case RifEclipseSummaryAddress::SummaryVarCategory::SUMMARY_MISC:
@@ -356,7 +358,8 @@ bool RimSummaryAddressCollection::canBeDragged() const
bool ok = m_subfolders.empty();
ok = ok && ( m_contentType == CollectionContentType::WELL || m_contentType == CollectionContentType::GROUP ||
m_contentType == CollectionContentType::REGION || m_contentType == CollectionContentType::WELL_SEGMENT );
m_contentType == CollectionContentType::NETWORK || m_contentType == CollectionContentType::REGION ||
m_contentType == CollectionContentType::WELL_SEGMENT );
return ok || isFolder();
}
@@ -424,7 +427,7 @@ bool RimSummaryAddressCollection::isEnsemble() const
bool RimSummaryAddressCollection::isFolder() const
{
return contentType() == CollectionContentType::WELL_FOLDER || contentType() == CollectionContentType::GROUP_FOLDER ||
contentType() == CollectionContentType::REGION_FOLDER;
contentType() == CollectionContentType::NETWORK_FOLDER || contentType() == CollectionContentType::REGION_FOLDER;
}
//--------------------------------------------------------------------------------------------------
@@ -472,6 +475,8 @@ QString RimSummaryAddressCollection::iconResourceText() const
return ":/summary/components/images/well.svg";
case RimSummaryAddressCollection::CollectionContentType::GROUP_FOLDER:
return ":/summary/components/images/group.svg";
case RimSummaryAddressCollection::CollectionContentType::NETWORK_FOLDER:
return ":/summary/components/images/network.svg";
case RimSummaryAddressCollection::CollectionContentType::REGION_FOLDER:
return ":/summary/components/images/region.svg";
case RimSummaryAddressCollection::CollectionContentType::BLOCK:

View File

@@ -44,6 +44,7 @@ public:
WELL_FOLDER,
GROUP_FOLDER,
REGION_FOLDER,
NETWORK_FOLDER,
BLOCK,
SUMMARY_CASE,
AQUIFER,

View File

@@ -310,6 +310,16 @@ void RimSummaryCurveAutoName::appendAddressDetails( std::string&
}
}
break;
case RifEclipseSummaryAddress::SUMMARY_NETWORK:
{
bool skipSubString = nameHelper && nameHelper->isNetworkInTitle();
if ( !skipSubString )
{
if ( !text.empty() ) text += ":";
text += summaryAddress.networkName();
}
}
break;
case RifEclipseSummaryAddress::SUMMARY_WELL:
{
appendWellName( text, summaryAddress, nameHelper );

View File

@@ -32,6 +32,7 @@ void AppEnum<RimSummaryDataSourceStepping::SourceSteppingDimension>::setUp()
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::VECTOR, "VECTOR", "Vector" );
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::WELL, "WELL", RiaDefines::summaryWell() );
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::GROUP, "GROUP", RiaDefines::summaryWellGroup() );
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::NETWORK, "NETWORK", RiaDefines::summaryNetwork() );
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::REGION, "REGION", RiaDefines::summaryRegion() );
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::BLOCK, "BLOCK", RiaDefines::summaryBlock() );
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::AQUIFER, "AQUIFER", RiaDefines::summaryAquifer() );

View File

@@ -39,6 +39,7 @@ public:
ENSEMBLE,
WELL,
GROUP,
NETWORK,
REGION,
VECTOR,
BLOCK,

View File

@@ -832,6 +832,10 @@ void RimSummaryMultiPlot::setDefaultRangeAggregationSteppingDimension()
{
stepDimension = RimSummaryDataSourceStepping::SourceSteppingDimension::GROUP;
}
else if ( analyzer.networkNames().size() == 1 )
{
stepDimension = RimSummaryDataSourceStepping::SourceSteppingDimension::NETWORK;
}
else if ( analyzer.regionNumbers().size() == 1 )
{
stepDimension = RimSummaryDataSourceStepping::SourceSteppingDimension::REGION;

View File

@@ -50,6 +50,13 @@ QString RimSummaryNameHelper::aggregatedPlotTitle( const RimSummaryNameHelper& o
title += QString::fromStdString( groupName );
}
auto networkName = titleNetwork();
if ( !other.isNetworkInTitle() && !networkName.empty() )
{
if ( !title.isEmpty() ) title += ", ";
title += QString::fromStdString( networkName );
}
auto region = titleRegion();
if ( !other.isRegionInTitle() && !region.empty() )
{

View File

@@ -41,6 +41,7 @@ public:
virtual bool isPlotDisplayingSingleVectorName() const = 0;
virtual bool isWellNameInTitle() const = 0;
virtual bool isGroupNameInTitle() const = 0;
virtual bool isNetworkInTitle() const = 0;
virtual bool isRegionInTitle() const = 0;
virtual bool isCaseInTitle() const = 0;
virtual bool isBlockInTitle() const = 0;
@@ -53,6 +54,7 @@ public:
virtual std::string titleVectorName() const = 0;
virtual std::string titleWellName() const = 0;
virtual std::string titleGroupName() const = 0;
virtual std::string titleNetwork() const = 0;
virtual std::string titleRegion() const = 0;
virtual std::string titleBlock() const = 0;
virtual std::string titleSegment() const = 0;

View File

@@ -2325,6 +2325,13 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleAddressCollectionDrop( RimSummar
curveAdr.setGroupName( droppedName );
newCurveDef.setSummaryAddress( curveAdr );
}
else if ( ( curveAdr.category() == RifEclipseSummaryAddress::SUMMARY_NETWORK ) &&
( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::NETWORK ) )
{
objectIdentifierString = curveAdr.networkName();
curveAdr.setNetworkName( droppedName );
newCurveDef.setSummaryAddress( curveAdr );
}
else if ( ( curveAdr.category() == RifEclipseSummaryAddress::SUMMARY_REGION ) &&
( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::REGION ) )
{

View File

@@ -135,6 +135,14 @@ bool RimSummaryPlotNameHelper::isGroupNameInTitle() const
return !m_titleGroupName.empty();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimSummaryPlotNameHelper::isNetworkInTitle() const
{
return !m_titleNetwork.empty();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -215,6 +223,14 @@ std::string RimSummaryPlotNameHelper::titleGroupName() const
return m_titleGroupName;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::string RimSummaryPlotNameHelper::titleNetwork() const
{
return m_titleNetwork;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -255,6 +271,7 @@ void RimSummaryPlotNameHelper::clearTitleSubStrings()
m_titleQuantity.clear();
m_titleWellName.clear();
m_titleGroupName.clear();
m_titleNetwork.clear();
m_titleRegion.clear();
m_titleBlock.clear();
m_titleSegment.clear();
@@ -272,6 +289,7 @@ void RimSummaryPlotNameHelper::extractPlotTitleSubStrings()
auto wellNames = m_analyzer->wellNames();
auto groupNames = m_analyzer->groupNames();
auto networks = m_analyzer->networkNames();
auto regions = m_analyzer->regionNumbers();
auto blocks = m_analyzer->blocks();
auto categories = m_analyzer->categories();
@@ -306,6 +324,11 @@ void RimSummaryPlotNameHelper::extractPlotTitleSubStrings()
m_titleGroupName = *( groupNames.begin() );
}
if ( networks.size() == 1 )
{
m_titleNetwork = *( networks.begin() );
}
if ( regions.size() == 1 )
{
m_titleRegion = std::to_string( *( regions.begin() ) );

View File

@@ -54,6 +54,7 @@ public:
bool isPlotDisplayingSingleVectorName() const override;
bool isWellNameInTitle() const override;
bool isGroupNameInTitle() const override;
bool isNetworkInTitle() const override;
bool isRegionInTitle() const override;
bool isCaseInTitle() const override;
bool isBlockInTitle() const override;
@@ -66,6 +67,7 @@ public:
std::string titleVectorName() const override;
std::string titleWellName() const override;
std::string titleGroupName() const override;
std::string titleNetwork() const override;
std::string titleRegion() const override;
std::string titleBlock() const override;
std::string titleSegment() const override;
@@ -87,6 +89,7 @@ private:
std::string m_titleQuantity;
std::string m_titleWellName;
std::string m_titleGroupName;
std::string m_titleNetwork;
std::string m_titleRegion;
std::string m_titleBlock;
std::string m_titleSegment;

View File

@@ -72,6 +72,7 @@ RimSummaryPlotSourceStepping::RimSummaryPlotSourceStepping()
CAF_PDM_InitFieldNoDefault( &m_wellName, "WellName", "Well Name" );
CAF_PDM_InitFieldNoDefault( &m_groupName, "GroupName", "Group Name" );
CAF_PDM_InitFieldNoDefault( &m_networkName, "NetworkName", "Network Name" );
CAF_PDM_InitFieldNoDefault( &m_region, "Region", "Region" );
CAF_PDM_InitFieldNoDefault( &m_vectorName, "VectorName", "Vector" );
@@ -267,6 +268,10 @@ QList<caf::PdmOptionItemInfo> RimSummaryPlotSourceStepping::calculateValueOption
{
category = RifEclipseSummaryAddress::SUMMARY_GROUP;
}
else if ( fieldNeedingOptions == &m_networkName )
{
category = RifEclipseSummaryAddress::SUMMARY_NETWORK;
}
else if ( fieldNeedingOptions == &m_cellBlock )
{
category = RifEclipseSummaryAddress::SUMMARY_BLOCK;
@@ -390,6 +395,7 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
m_wellName.uiCapability()->updateConnectedEditors();
m_groupName.uiCapability()->updateConnectedEditors();
m_networkName.uiCapability()->updateConnectedEditors();
m_region.uiCapability()->updateConnectedEditors();
m_vectorName.uiCapability()->updateConnectedEditors();
}
@@ -413,6 +419,7 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
m_wellName.uiCapability()->updateConnectedEditors();
m_groupName.uiCapability()->updateConnectedEditors();
m_networkName.uiCapability()->updateConnectedEditors();
m_region.uiCapability()->updateConnectedEditors();
m_vectorName.uiCapability()->updateConnectedEditors();
}
@@ -449,6 +456,10 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
{
summaryCategoryToModify = RifEclipseSummaryAddress::SUMMARY_GROUP;
}
else if ( changedField == &m_networkName )
{
summaryCategoryToModify = RifEclipseSummaryAddress::SUMMARY_NETWORK;
}
else if ( changedField == &m_cellBlock )
{
summaryCategoryToModify = RifEclipseSummaryAddress::SUMMARY_BLOCK;
@@ -565,6 +576,9 @@ caf::PdmValueField* RimSummaryPlotSourceStepping::fieldToModify()
case RimSummaryDataSourceStepping::SourceSteppingDimension::GROUP:
return &m_groupName;
case RimSummaryDataSourceStepping::SourceSteppingDimension::NETWORK:
return &m_networkName;
case RimSummaryDataSourceStepping::SourceSteppingDimension::REGION:
return &m_region;
@@ -773,6 +787,14 @@ std::vector<caf::PdmFieldHandle*> RimSummaryPlotSourceStepping::activeFieldsForD
fieldsCommonForAllCurves.push_back( &m_groupName );
}
if ( analyzer.networkNames().size() == 1 )
{
QString txt = QString::fromStdString( *( analyzer.networkNames().begin() ) );
m_networkName = txt;
fieldsCommonForAllCurves.push_back( &m_networkName );
}
if ( analyzer.regionNumbers().size() == 1 )
{
m_region = *( analyzer.regionNumbers().begin() );
@@ -978,65 +1000,55 @@ RifEclipseSummaryAddress RimSummaryPlotSourceStepping::stepAddress( RifEclipseSu
RiaSummaryAddressAnalyzer analyzer;
analyzer.appendAddresses( addresses );
// Find the iterator to the string in the list of strings
auto getIdIterator = [direction]( const std::vector<QString>& ids, const QString& searchString ) -> decltype( ids.begin() )
{
auto found = std::find( ids.begin(), ids.end(), searchString );
if ( found != ids.end() )
{
if ( direction > 0 )
++found;
else if ( found != ids.begin() )
--found;
}
return found;
};
switch ( m_stepDimension() )
{
case RimSummaryDataSourceStepping::SourceSteppingDimension::WELL:
{
auto ids = analyzer.identifierTexts( RifEclipseSummaryAddress::SUMMARY_WELL, "" );
auto& curName = addr.wellName();
auto found = std::find( ids.begin(), ids.end(), QString::fromStdString( curName ) );
if ( found != ids.end() )
{
if ( direction > 0 )
{
found++;
}
else
{
if ( found != ids.begin() ) found--;
}
if ( found != ids.end() ) addr.setWellName( ( *found ).toStdString() );
}
auto ids = analyzer.identifierTexts( RifEclipseSummaryAddress::SUMMARY_WELL, "" );
auto searchString = QString::fromStdString( addr.wellName() );
auto found = getIdIterator( ids, searchString );
if ( found != ids.end() ) addr.setWellName( ( *found ).toStdString() );
}
break;
case RimSummaryDataSourceStepping::SourceSteppingDimension::GROUP:
{
auto ids = analyzer.identifierTexts( RifEclipseSummaryAddress::SUMMARY_GROUP, "" );
auto& curName = addr.groupName();
auto found = std::find( ids.begin(), ids.end(), QString::fromStdString( curName ) );
if ( found != ids.end() )
{
if ( direction > 0 )
{
found++;
}
else
{
if ( found != ids.begin() ) found--;
}
if ( found != ids.end() ) addr.setGroupName( ( *found ).toStdString() );
}
auto ids = analyzer.identifierTexts( RifEclipseSummaryAddress::SUMMARY_GROUP, "" );
auto searchString = QString::fromStdString( addr.groupName() );
auto found = getIdIterator( ids, searchString );
if ( found != ids.end() ) addr.setGroupName( ( *found ).toStdString() );
}
break;
case RimSummaryDataSourceStepping::SourceSteppingDimension::NETWORK:
{
auto ids = analyzer.identifierTexts( RifEclipseSummaryAddress::SUMMARY_NETWORK, "" );
auto searchString = QString::fromStdString( addr.networkName() );
auto found = getIdIterator( ids, searchString );
if ( found != ids.end() ) addr.setNetworkName( ( *found ).toStdString() );
}
break;
case RimSummaryDataSourceStepping::SourceSteppingDimension::REGION:
{
auto ids = analyzer.identifierTexts( RifEclipseSummaryAddress::SUMMARY_REGION, "" );
QString curRegion = QString::number( addr.regionNumber() );
auto found = std::find( ids.begin(), ids.end(), curRegion );
if ( found != ids.end() )
{
if ( direction > 0 )
{
found++;
}
else
{
if ( found != ids.begin() ) found--;
}
if ( found != ids.end() ) addr.setRegion( ( *found ).toInt() );
}
auto ids = analyzer.identifierTexts( RifEclipseSummaryAddress::SUMMARY_REGION, "" );
auto searchString = QString::number( addr.regionNumber() );
auto found = getIdIterator( ids, searchString );
if ( found != ids.end() ) addr.setRegion( ( *found ).toInt() );
}
break;
@@ -1044,69 +1056,33 @@ RifEclipseSummaryAddress RimSummaryPlotSourceStepping::stepAddress( RifEclipseSu
{
auto options = optionsForQuantity( addresses );
std::vector<QString> values;
std::vector<QString> ids;
for ( auto it = options.begin(); it != options.end(); it++ )
{
values.push_back( it->second );
ids.push_back( it->second );
}
QString qName = QString::fromStdString( addr.vectorName() );
auto found = std::find( values.begin(), values.end(), qName );
if ( found != values.end() )
{
if ( direction > 0 )
{
found++;
}
else
{
if ( found != values.begin() ) found--;
}
if ( found != values.end() ) addr.setVectorName( ( *found ).toStdString() );
}
auto searchString = QString::fromStdString( addr.vectorName() );
auto found = getIdIterator( ids, searchString );
if ( found != ids.end() ) addr.setVectorName( ( *found ).toStdString() );
}
break;
case RimSummaryDataSourceStepping::SourceSteppingDimension::BLOCK:
{
auto ids = analyzer.identifierTexts( RifEclipseSummaryAddress::SUMMARY_BLOCK, "" );
auto curName = addr.blockAsString();
auto found = std::find( ids.begin(), ids.end(), QString::fromStdString( curName ) );
if ( found != ids.end() )
{
if ( direction > 0 )
{
found++;
}
else
{
if ( found != ids.begin() ) found--;
}
if ( found != ids.end() )
{
addr.setCellIjk( ( *found ).toStdString() );
}
}
auto ids = analyzer.identifierTexts( RifEclipseSummaryAddress::SUMMARY_BLOCK, "" );
auto searchString = QString::fromStdString( addr.blockAsString() );
auto found = getIdIterator( ids, searchString );
if ( found != ids.end() ) addr.setCellIjk( ( *found ).toStdString() );
}
break;
case RimSummaryDataSourceStepping::SourceSteppingDimension::AQUIFER:
{
auto ids = analyzer.identifierTexts( RifEclipseSummaryAddress::SUMMARY_AQUIFER, "" );
QString curAq = QString::number( addr.aquiferNumber() );
auto found = std::find( ids.begin(), ids.end(), curAq );
if ( found != ids.end() )
{
if ( direction > 0 )
{
found++;
}
else
{
if ( found != ids.begin() ) found--;
}
if ( found != ids.end() ) addr.setAquiferNumber( ( *found ).toInt() );
}
auto ids = analyzer.identifierTexts( RifEclipseSummaryAddress::SUMMARY_AQUIFER, "" );
auto searchString = QString::number( addr.aquiferNumber() );
auto found = getIdIterator( ids, searchString );
if ( found != ids.end() ) addr.setAquiferNumber( ( *found ).toInt() );
}
break;
@@ -1139,6 +1115,10 @@ void RimSummaryPlotSourceStepping::syncWithStepper( RimSummaryPlotSourceStepping
m_groupName = other->m_groupName();
break;
case RimSummaryDataSourceStepping::SourceSteppingDimension::NETWORK:
m_networkName = other->m_networkName();
break;
case RimSummaryDataSourceStepping::SourceSteppingDimension::REGION:
m_region = other->m_region();
break;
@@ -1181,6 +1161,10 @@ void RimSummaryPlotSourceStepping::setStep( QString stepIdentifier )
m_groupName.setValueWithFieldChanged( stepIdentifier );
break;
case RimSummaryDataSourceStepping::SourceSteppingDimension::NETWORK:
m_networkName.setValueWithFieldChanged( stepIdentifier );
break;
case RimSummaryDataSourceStepping::SourceSteppingDimension::VECTOR:
m_vectorName.setValueWithFieldChanged( stepIdentifier );
break;
@@ -1426,6 +1410,7 @@ std::vector<RimPlot*> RimSummaryPlotSourceStepping::plotsMatchingStepSettings( s
int ensembleIdToMatch = -1;
std::string wellNameToMatch;
std::string groupNameToMatch;
std::string networkToMatch;
int regionToMatch = -1;
std::string vectorToMatch;
std::string blockToMatch;
@@ -1449,6 +1434,10 @@ std::vector<RimPlot*> RimSummaryPlotSourceStepping::plotsMatchingStepSettings( s
groupNameToMatch = m_groupName().toStdString();
break;
case RimSummaryDataSourceStepping::SourceSteppingDimension::NETWORK:
networkToMatch = m_networkName().toStdString();
break;
case RimSummaryDataSourceStepping::SourceSteppingDimension::REGION:
regionToMatch = m_region();
break;
@@ -1507,6 +1496,10 @@ std::vector<RimPlot*> RimSummaryPlotSourceStepping::plotsMatchingStepSettings( s
{
isMatching = true;
}
else if ( !networkToMatch.empty() && a.networkName() == networkToMatch )
{
isMatching = true;
}
else if ( regionToMatch != -1 && a.regionNumber() == regionToMatch )
{
isMatching = true;

View File

@@ -118,6 +118,7 @@ private:
caf::PdmField<QString> m_wellName;
caf::PdmField<QString> m_groupName;
caf::PdmField<QString> m_networkName;
caf::PdmField<int> m_region;
caf::PdmField<QString> m_vectorName;
caf::PdmField<QString> m_placeholderForLabel;