mirror of
https://github.com/OPM/ResInsight.git
synced 2024-12-28 01:41:42 -06:00
9498 Add parsing of network name
Use merged commit
This commit is contained in:
parent
7a6569066c
commit
0bada502fb
@ -132,6 +132,14 @@ std::set<std::string> RiaSummaryAddressAnalyzer::groupNames() const
|
||||
return keysInMap( m_groupNames );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<std::string> RiaSummaryAddressAnalyzer::networkNames() const
|
||||
{
|
||||
return keysInMap( m_networkNames );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -207,6 +215,7 @@ std::vector<std::vector<RifEclipseSummaryAddress>> RiaSummaryAddressAnalyzer::ad
|
||||
{
|
||||
auto wellAdr = valuesInMap( m_wellNames );
|
||||
auto groupAdr = valuesInMap( m_groupNames );
|
||||
auto networkAdr = valuesInMap( m_networkNames );
|
||||
auto regionAdr = valuesInMap( m_regionNumbers );
|
||||
auto blockAdr = valuesInMap( m_blocks );
|
||||
auto aquiferAdr = valuesInMap( m_aquifers );
|
||||
@ -214,6 +223,7 @@ std::vector<std::vector<RifEclipseSummaryAddress>> RiaSummaryAddressAnalyzer::ad
|
||||
std::vector<std::vector<RifEclipseSummaryAddress>> groupedByObject;
|
||||
groupedByObject.insert( groupedByObject.end(), wellAdr.begin(), wellAdr.end() );
|
||||
groupedByObject.insert( groupedByObject.end(), groupAdr.begin(), groupAdr.end() );
|
||||
groupedByObject.insert( groupedByObject.end(), networkAdr.begin(), networkAdr.end() );
|
||||
groupedByObject.insert( groupedByObject.end(), regionAdr.begin(), regionAdr.end() );
|
||||
groupedByObject.insert( groupedByObject.end(), blockAdr.begin(), blockAdr.end() );
|
||||
groupedByObject.insert( groupedByObject.end(), aquiferAdr.begin(), aquiferAdr.end() );
|
||||
@ -255,6 +265,14 @@ std::vector<QString> RiaSummaryAddressAnalyzer::identifierTexts( RifEclipseSumma
|
||||
identifierStrings.push_back( QString::fromStdString( key ) );
|
||||
}
|
||||
}
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_NETWORK )
|
||||
{
|
||||
auto keys = keysInMap( m_networkNames );
|
||||
for ( const auto& key : keys )
|
||||
{
|
||||
identifierStrings.push_back( QString::fromStdString( key ) );
|
||||
}
|
||||
}
|
||||
else if ( category == RifEclipseSummaryAddress::SUMMARY_BLOCK )
|
||||
{
|
||||
auto keys = keysInMap( m_blocks );
|
||||
@ -345,6 +363,7 @@ void RiaSummaryAddressAnalyzer::clear()
|
||||
m_quantities.clear();
|
||||
m_wellNames.clear();
|
||||
m_groupNames.clear();
|
||||
m_networkNames.clear();
|
||||
m_regionNumbers.clear();
|
||||
m_categories.clear();
|
||||
m_wellCompletions.clear();
|
||||
@ -425,6 +444,11 @@ void RiaSummaryAddressAnalyzer::analyzeSingleAddress( const RifEclipseSummaryAdd
|
||||
m_groupNames.insert( { address.groupName(), address } );
|
||||
}
|
||||
|
||||
if ( !address.networkName().empty() )
|
||||
{
|
||||
m_networkNames.insert( { address.networkName(), address } );
|
||||
}
|
||||
|
||||
if ( address.regionNumber() != -1 )
|
||||
{
|
||||
m_regionNumbers.insert( { address.regionNumber(), address } );
|
||||
|
@ -52,6 +52,7 @@ public:
|
||||
|
||||
std::set<std::string> wellNames() const;
|
||||
std::set<std::string> groupNames() const;
|
||||
std::set<std::string> networkNames() const;
|
||||
std::set<int> regionNumbers() const;
|
||||
|
||||
std::set<std::string> wellCompletions( const std::string& wellName ) const;
|
||||
@ -94,6 +95,7 @@ private:
|
||||
std::vector<RifEclipseSummaryAddress> m_otherCategory;
|
||||
std::multimap<std::string, RifEclipseSummaryAddress> m_wellNames;
|
||||
std::multimap<std::string, RifEclipseSummaryAddress> m_groupNames;
|
||||
std::multimap<std::string, RifEclipseSummaryAddress> m_networkNames;
|
||||
std::multimap<int, RifEclipseSummaryAddress> m_regionNumbers;
|
||||
std::set<std::pair<std::string, std::string>> m_wellCompletions;
|
||||
std::set<std::pair<std::string, int>> m_wellSegmentNumbers;
|
||||
|
@ -249,20 +249,7 @@ RimSummaryCurve* RicPlotProductionRateFeature::addSummaryCurve( RimSummaryPlot*
|
||||
CVF_ASSERT( summaryCase );
|
||||
CVF_ASSERT( well );
|
||||
|
||||
RifEclipseSummaryAddress addr( RifEclipseSummaryAddress::SUMMARY_WELL,
|
||||
vectorName.toStdString(),
|
||||
-1,
|
||||
-1,
|
||||
"",
|
||||
well->name().toStdString(),
|
||||
-1,
|
||||
"",
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
false,
|
||||
-1 );
|
||||
RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::wellAddress( vectorName.toStdString(), well->name().toStdString(), -1 );
|
||||
|
||||
if ( !summaryCase->summaryReader()->hasAddress( addr ) )
|
||||
{
|
||||
|
@ -112,6 +112,7 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode( const ecl::smspec_node& ertSu
|
||||
int regionNumber( -1 );
|
||||
int regionNumber2( -1 );
|
||||
std::string groupName;
|
||||
std::string networkName;
|
||||
std::string wellName;
|
||||
int wellSegmentNumber( -1 );
|
||||
std::string lgrName;
|
||||
@ -240,6 +241,7 @@ RifEclipseSummaryAddress addressFromErtSmSpecNode( const ecl::smspec_node& ertSu
|
||||
regionNumber,
|
||||
regionNumber2,
|
||||
groupName,
|
||||
networkName,
|
||||
wellName,
|
||||
wellSegmentNumber,
|
||||
lgrName,
|
||||
|
@ -58,6 +58,9 @@ RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryVarCategory category,
|
||||
case SUMMARY_GROUP:
|
||||
m_groupName = identifiers[INPUT_GROUP_NAME];
|
||||
break;
|
||||
case SUMMARY_NETWORK:
|
||||
m_networkName = identifiers[INPUT_NETWORK_NAME];
|
||||
break;
|
||||
case SUMMARY_WELL:
|
||||
m_wellName = identifiers[INPUT_WELL_NAME];
|
||||
break;
|
||||
@ -114,6 +117,7 @@ RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryVarCategory category,
|
||||
int16_t regionNumber,
|
||||
int16_t regionNumber2,
|
||||
const std::string& groupName,
|
||||
const std::string& networkName,
|
||||
const std::string& wellName,
|
||||
int16_t wellSegmentNumber,
|
||||
const std::string& lgrName,
|
||||
@ -128,6 +132,7 @@ RifEclipseSummaryAddress::RifEclipseSummaryAddress( SummaryVarCategory category,
|
||||
, m_regionNumber( regionNumber )
|
||||
, m_regionNumber2( regionNumber2 )
|
||||
, m_groupName( groupName )
|
||||
, m_networkName( networkName )
|
||||
, m_wellName( wellName )
|
||||
, m_wellSegmentNumber( wellSegmentNumber )
|
||||
, m_lgrName( lgrName )
|
||||
@ -229,11 +234,13 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::aquiferAddress( const std::st
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RifEclipseSummaryAddress::networkAddress( const std::string& vectorName, int calculationId )
|
||||
RifEclipseSummaryAddress
|
||||
RifEclipseSummaryAddress::networkAddress( const std::string& vectorName, const std::string& networkName, int calculationId )
|
||||
{
|
||||
RifEclipseSummaryAddress addr;
|
||||
addr.m_variableCategory = SUMMARY_NETWORK;
|
||||
addr.m_vectorName = vectorName;
|
||||
addr.m_networkName = networkName;
|
||||
addr.m_id = calculationId;
|
||||
return addr;
|
||||
}
|
||||
@ -537,6 +544,11 @@ std::string RifEclipseSummaryAddress::itemUiText() const
|
||||
text += groupName();
|
||||
}
|
||||
break;
|
||||
case SUMMARY_NETWORK:
|
||||
{
|
||||
text += networkName();
|
||||
}
|
||||
break;
|
||||
case SUMMARY_WELL:
|
||||
{
|
||||
text += wellName();
|
||||
@ -608,6 +620,8 @@ std::string RifEclipseSummaryAddress::addressComponentUiText( RifEclipseSummaryA
|
||||
return wellName();
|
||||
case INPUT_GROUP_NAME:
|
||||
return groupName();
|
||||
case INPUT_NETWORK_NAME:
|
||||
return networkName();
|
||||
case INPUT_CELL_IJK:
|
||||
return blockAsString();
|
||||
case INPUT_LGR_NAME:
|
||||
@ -795,7 +809,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector
|
||||
break;
|
||||
|
||||
case SUMMARY_NETWORK:
|
||||
return networkAddress( vectorName );
|
||||
return networkAddress( vectorName, token1 );
|
||||
break;
|
||||
|
||||
case SUMMARY_MISC:
|
||||
@ -854,8 +868,8 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector
|
||||
case SUMMARY_WELL_COMPLETION_LGR:
|
||||
if ( tokens.size() > 2 )
|
||||
{
|
||||
auto token3 = tokens[3];
|
||||
auto ijk = RiaStdStringTools::splitString( token3, ',' );
|
||||
const auto& token3 = tokens[3];
|
||||
const auto ijk = RiaStdStringTools::splitString( token3, ',' );
|
||||
if ( ijk.size() == 3 )
|
||||
{
|
||||
RiaStdStringTools::toInt( ijk[0], intValue0 );
|
||||
@ -913,7 +927,7 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromTokens( const std::vector
|
||||
break;
|
||||
}
|
||||
|
||||
return RifEclipseSummaryAddress();
|
||||
return {};
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -65,6 +65,7 @@ public:
|
||||
INPUT_REGION_2_REGION,
|
||||
INPUT_WELL_NAME,
|
||||
INPUT_GROUP_NAME,
|
||||
INPUT_NETWORK_NAME,
|
||||
INPUT_CELL_IJK,
|
||||
INPUT_LGR_NAME,
|
||||
INPUT_SEGMENT_NUMBER,
|
||||
@ -81,6 +82,7 @@ public:
|
||||
int16_t regionNumber,
|
||||
int16_t regionNumber2,
|
||||
const std::string& groupName,
|
||||
const std::string& networkName,
|
||||
const std::string& wellName,
|
||||
int16_t wellSegmentNumber,
|
||||
const std::string& lgrName,
|
||||
@ -100,7 +102,7 @@ public:
|
||||
|
||||
static RifEclipseSummaryAddress fieldAddress( const std::string& vectorName, int calculationId = -1 );
|
||||
static RifEclipseSummaryAddress aquiferAddress( const std::string& vectorName, int aquiferNumber, int calculationId = -1 );
|
||||
static RifEclipseSummaryAddress networkAddress( const std::string& vectorName, int calculationId = -1 );
|
||||
static RifEclipseSummaryAddress networkAddress( const std::string& vectorName, const std::string& networkName, int calculationId = -1 );
|
||||
static RifEclipseSummaryAddress miscAddress( const std::string& vectorName, int calculationId = -1 );
|
||||
static RifEclipseSummaryAddress regionAddress( const std::string& vectorName, int regionNumber, int calculationId = -1 );
|
||||
static RifEclipseSummaryAddress
|
||||
@ -142,6 +144,7 @@ public:
|
||||
int regionNumber2() const { return m_regionNumber2; }
|
||||
|
||||
const std::string& groupName() const { return m_groupName; }
|
||||
const std::string& networkName() const { return m_networkName; }
|
||||
const std::string& wellName() const { return m_wellName; }
|
||||
int wellSegmentNumber() const { return m_wellSegmentNumber; }
|
||||
const std::string& lgrName() const { return m_lgrName; }
|
||||
@ -165,6 +168,7 @@ public:
|
||||
void setVectorName( const std::string& vectorName ) { m_vectorName = vectorName; }
|
||||
void setWellName( const std::string& wellName ) { m_wellName = wellName; }
|
||||
void setGroupName( const std::string& groupName ) { m_groupName = groupName; }
|
||||
void setNetworkName( const std::string& networkName ) { m_networkName = networkName; }
|
||||
void setRegion( int region ) { m_regionNumber = (int16_t)region; }
|
||||
void setRegion2( int region2 ) { m_regionNumber2 = (int16_t)region2; }
|
||||
void setAquiferNumber( int aquiferNumber ) { m_aquiferNumber = (int16_t)aquiferNumber; }
|
||||
@ -201,6 +205,7 @@ private:
|
||||
std::string m_vectorName;
|
||||
std::string m_wellName;
|
||||
std::string m_groupName;
|
||||
std::string m_networkName;
|
||||
std::string m_lgrName;
|
||||
int32_t m_cellK;
|
||||
int32_t m_cellJ;
|
||||
|
@ -173,18 +173,19 @@ RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress( con
|
||||
return RifEclipseSummaryAddress::importedAddress( quantityName );
|
||||
}
|
||||
|
||||
int regionNumber = -1;
|
||||
int regionNumber2 = -1;
|
||||
std::string groupName = "";
|
||||
std::string wellName = "";
|
||||
int regionNumber = -1;
|
||||
int regionNumber2 = -1;
|
||||
std::string groupName;
|
||||
std::string networkName;
|
||||
std::string wellName;
|
||||
int wellSegmentNumber = -1;
|
||||
std::string lgrName = "";
|
||||
int cellI = -1;
|
||||
int cellJ = -1;
|
||||
int cellK = -1;
|
||||
int aquiferNumber = -1;
|
||||
bool isErrorResult = false;
|
||||
int id = -1;
|
||||
std::string lgrName;
|
||||
int cellI = -1;
|
||||
int cellJ = -1;
|
||||
int cellK = -1;
|
||||
int aquiferNumber = -1;
|
||||
bool isErrorResult = false;
|
||||
int id = -1;
|
||||
|
||||
switch ( category )
|
||||
{
|
||||
@ -285,6 +286,7 @@ RifEclipseSummaryAddress RifEclipseUserDataKeywordTools::makeAndFillAddress( con
|
||||
regionNumber,
|
||||
regionNumber2,
|
||||
groupName,
|
||||
networkName,
|
||||
wellName,
|
||||
wellSegmentNumber,
|
||||
lgrName,
|
||||
|
@ -160,21 +160,7 @@ bool RifKeywordVectorUserData::parse( const QString& data, const QString& custom
|
||||
wellName = customWellName;
|
||||
}
|
||||
|
||||
RifEclipseSummaryAddress addr( RifEclipseSummaryAddress::SUMMARY_WELL,
|
||||
vectorText.toStdString(),
|
||||
-1,
|
||||
-1,
|
||||
"",
|
||||
wellName.toStdString(),
|
||||
-1,
|
||||
"",
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
false,
|
||||
-1 );
|
||||
|
||||
auto addr = RifEclipseSummaryAddress::wellAddress( vectorText.toStdString(), wellName.toStdString(), -1 );
|
||||
m_allResultAddresses.insert( addr );
|
||||
|
||||
m_mapFromAddressToTimeIndex[addr] = timeStepIndexIterator->second;
|
||||
|
@ -162,6 +162,7 @@ RifEclipseSummaryAddress RifReaderObservedData::address( const QString&
|
||||
int regionNumber( -1 );
|
||||
int regionNumber2( -1 );
|
||||
std::string groupName;
|
||||
std::string networkName;
|
||||
std::string wellName;
|
||||
int wellSegmentNumber( -1 );
|
||||
std::string lgrName;
|
||||
@ -192,6 +193,7 @@ RifEclipseSummaryAddress RifReaderObservedData::address( const QString&
|
||||
regionNumber,
|
||||
regionNumber2,
|
||||
groupName,
|
||||
networkName,
|
||||
wellName,
|
||||
wellSegmentNumber,
|
||||
lgrName,
|
||||
|
@ -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();
|
||||
|
@ -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 ) )
|
||||
{
|
||||
|
@ -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 )
|
||||
{
|
||||
|
@ -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 "";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -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;
|
||||
|
@ -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 {};
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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:
|
||||
|
@ -44,6 +44,7 @@ public:
|
||||
WELL_FOLDER,
|
||||
GROUP_FOLDER,
|
||||
REGION_FOLDER,
|
||||
NETWORK_FOLDER,
|
||||
BLOCK,
|
||||
SUMMARY_CASE,
|
||||
AQUIFER,
|
||||
|
@ -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 );
|
||||
|
@ -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() );
|
||||
|
@ -39,6 +39,7 @@ public:
|
||||
ENSEMBLE,
|
||||
WELL,
|
||||
GROUP,
|
||||
NETWORK,
|
||||
REGION,
|
||||
VECTOR,
|
||||
BLOCK,
|
||||
|
@ -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;
|
||||
|
@ -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() )
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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 ) )
|
||||
{
|
||||
|
@ -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() ) );
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -612,7 +612,7 @@ TEST( RifColumnBasedRsmspecParserTest, TestTableValues )
|
||||
RifColumnBasedUserData userData;
|
||||
userData.parse( data );
|
||||
|
||||
RifEclipseSummaryAddress adr( RifEclipseSummaryAddress::SUMMARY_WELL, "WOPR", -1, -1, "", "P-15P", -1, "", -1, -1, -1, -1, false, -1 );
|
||||
auto adr = RifEclipseSummaryAddress::wellAddress( "WOPR", "P-15P", -1 );
|
||||
|
||||
QDateTime firstTimeStep = RiaQDateTimeTools::addDays( RiaQDateTimeTools::epoch(), 1.0 );
|
||||
auto timeSteps = userData.timeSteps( adr );
|
||||
|
@ -48,6 +48,19 @@ TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_Network )
|
||||
EXPECT_FALSE( addr.isErrorResult() );
|
||||
}
|
||||
|
||||
TEST( RifEclipseSummaryAddressTest, TestEclipseAddressParsing_Network_name )
|
||||
{
|
||||
std::string addrString = "NETW:MYNAME";
|
||||
|
||||
RifEclipseSummaryAddress addr = RifEclipseSummaryAddress::fromEclipseTextAddressParseErrorTokens( addrString );
|
||||
|
||||
EXPECT_TRUE( addr.isValid() );
|
||||
EXPECT_EQ( RifEclipseSummaryAddress::SUMMARY_NETWORK, addr.category() );
|
||||
EXPECT_EQ( "NETW", addr.vectorName() );
|
||||
EXPECT_EQ( "MYNAME", addr.networkName() );
|
||||
EXPECT_FALSE( addr.isErrorResult() );
|
||||
}
|
||||
|
||||
TEST( RifEclipseSummaryAddressTest, DISABLED_TestEclipseAddressParsing_Misc )
|
||||
{
|
||||
std::string addrString = "CPU";
|
||||
|
@ -102,7 +102,8 @@ RiuSummaryVectorSelectionUi::RiuSummaryVectorSelectionUi()
|
||||
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ),
|
||||
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } },
|
||||
{ RifEclipseSummaryAddress::SUMMARY_NETWORK,
|
||||
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ),
|
||||
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_NETWORK_NAME ),
|
||||
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ),
|
||||
new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } },
|
||||
{ RifEclipseSummaryAddress::SUMMARY_MISC,
|
||||
{ new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ),
|
||||
@ -179,10 +180,11 @@ RiuSummaryVectorSelectionUi::RiuSummaryVectorSelectionUi()
|
||||
"AquifierCalculationIds",
|
||||
"Calculation Ids" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_NETWORK][0]->pdmField(),
|
||||
CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_NETWORK][0]->pdmField(), "NetworkNames", "Networks" );
|
||||
CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_NETWORK][1]->pdmField(),
|
||||
"NetworkVectors",
|
||||
"Network Vectors" );
|
||||
CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_NETWORK][1]->pdmField(),
|
||||
CAF_PDM_InitFieldNoDefault( m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_NETWORK][2]->pdmField(),
|
||||
"NetworkCalculationIds",
|
||||
"Calculation Ids" );
|
||||
|
||||
@ -885,7 +887,12 @@ void RiuSummaryVectorSelectionUi::defineUiOrdering( QString uiConfigName, caf::P
|
||||
}
|
||||
else if ( sumCategory == RifEclipseSummaryAddress::SUMMARY_NETWORK )
|
||||
{
|
||||
summaryiesField = m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_NETWORK][0]->pdmField();
|
||||
{
|
||||
caf::PdmUiGroup* myGroup = uiOrdering.addNewGroup( RiaDefines::summaryNetwork() + "s" );
|
||||
myGroup->add( m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_NETWORK][0]->pdmField() );
|
||||
}
|
||||
|
||||
summaryiesField = m_identifierFieldsMap[RifEclipseSummaryAddress::SUMMARY_NETWORK][1]->pdmField();
|
||||
}
|
||||
else if ( sumCategory == RifEclipseSummaryAddress::SUMMARY_MISC )
|
||||
{
|
||||
|
@ -103,7 +103,6 @@ private:
|
||||
bool isObservedData( const RimSummaryCase* sumCase ) const;
|
||||
|
||||
std::vector<SummarySource*> selectedSummarySources() const;
|
||||
static RimSummaryCase* calculatedSummaryCase();
|
||||
|
||||
void appendOptionItemsForSources( QList<caf::PdmOptionItemInfo>& options ) const;
|
||||
void appendOptionItemsForCategories( QList<caf::PdmOptionItemInfo>& options ) const;
|
||||
|
Loading…
Reference in New Issue
Block a user