mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
#2135 Rewrote obfuscated less operator and sort OBSERVED PLT sources first
This commit is contained in:
@@ -124,6 +124,43 @@ QTextStream& operator >> (QTextStream& str, RifWellRftAddress& source)
|
|||||||
return str;
|
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() != nullptr && addr2.wellLogFile() != nullptr ? addr1.wellLogFile()->fileName() < addr2.wellLogFile()->fileName() :
|
||||||
addr1.wellLogFile() < addr2.wellLogFile());
|
addr1.wellLogFile() < addr2.wellLogFile());
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
@@ -44,9 +44,9 @@ public:
|
|||||||
enum SourceType
|
enum SourceType
|
||||||
{
|
{
|
||||||
NONE,
|
NONE,
|
||||||
|
OBSERVED,
|
||||||
RFT,
|
RFT,
|
||||||
GRID,
|
GRID
|
||||||
OBSERVED
|
|
||||||
};
|
};
|
||||||
|
|
||||||
RifWellRftAddress();
|
RifWellRftAddress();
|
||||||
|
|||||||
Reference in New Issue
Block a user