mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2135 Rewrote obfuscated less operator and sort OBSERVED PLT sources first
This commit is contained in:
parent
5efd60c227
commit
cc4041b09b
@ -124,6 +124,43 @@ QTextStream& operator >> (QTextStream& str, RifWellRftAddress& source)
|
||||
return str;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// This sort order controls the plot order in PLT plot. (Layer-wise)
|
||||
/// Observed data is supposed to be the bottom layers (first)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool operator<(const RifWellRftAddress& addr1, const RifWellRftAddress& addr2)
|
||||
{
|
||||
if ( addr1.m_sourceType != addr2.m_sourceType )
|
||||
{
|
||||
return addr1.m_sourceType < addr2.m_sourceType;
|
||||
}
|
||||
|
||||
if ( addr1.m_sourceType == RifWellRftAddress::NONE ) return false; //
|
||||
|
||||
if (addr1.m_sourceType == RifWellRftAddress::OBSERVED)
|
||||
{
|
||||
if(addr1.wellLogFile() && addr2.wellLogFile())
|
||||
{
|
||||
return addr1.wellLogFile()->fileName() < addr2.wellLogFile()->fileName();
|
||||
}
|
||||
else
|
||||
{
|
||||
return addr1.wellLogFile() < addr2.wellLogFile();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( addr1.eclCase() && addr2.eclCase() )
|
||||
{
|
||||
return addr1.eclCase()->caseId() < addr2.eclCase()->caseId();
|
||||
}
|
||||
else
|
||||
{
|
||||
return addr1.eclCase() < addr2.eclCase();
|
||||
}
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -135,3 +172,4 @@ bool operator<(const RifWellRftAddress& addr1, const RifWellRftAddress& addr2)
|
||||
addr1.wellLogFile() != nullptr && addr2.wellLogFile() != nullptr ? addr1.wellLogFile()->fileName() < addr2.wellLogFile()->fileName() :
|
||||
addr1.wellLogFile() < addr2.wellLogFile());
|
||||
}
|
||||
#endif
|
@ -44,9 +44,9 @@ public:
|
||||
enum SourceType
|
||||
{
|
||||
NONE,
|
||||
OBSERVED,
|
||||
RFT,
|
||||
GRID,
|
||||
OBSERVED
|
||||
GRID
|
||||
};
|
||||
|
||||
RifWellRftAddress();
|
||||
|
Loading…
Reference in New Issue
Block a user