#4877 Detect correct accumulation type for statistics curves

This commit is contained in:
Magne Sjaastad 2019-10-18 14:22:15 +02:00
parent 4dcdc2a1ee
commit 1cab88e9c5
2 changed files with 13 additions and 5 deletions

View File

@ -784,7 +784,14 @@ bool RifEclipseSummaryAddress::hasAccumulatedData() const
{ {
if ( !isValidEclipseCategory() ) return false; if ( !isValidEclipseCategory() ) return false;
QString qBaseName = QString::fromStdString( baseQuantityName( quantityName() ) ); QString quantityForInspection = QString::fromStdString( quantityName() );
if ( category() == SUMMARY_ENSEMBLE_STATISTICS )
{
// Remove statistics text prefix
quantityForInspection = quantityForInspection.mid( quantityForInspection.indexOf( ":" ) + 1 );
}
QString qBaseName = baseQuantityName( quantityForInspection );
return qBaseName.endsWith( "T" ) || qBaseName.endsWith( "TH" ); return qBaseName.endsWith( "T" ) || qBaseName.endsWith( "TH" );
} }
@ -809,6 +816,7 @@ bool RifEclipseSummaryAddress::isValidEclipseCategory() const
case SUMMARY_WELL_SEGMENT: case SUMMARY_WELL_SEGMENT:
case SUMMARY_BLOCK: case SUMMARY_BLOCK:
case SUMMARY_BLOCK_LGR: case SUMMARY_BLOCK_LGR:
case SUMMARY_ENSEMBLE_STATISTICS:
return true; return true;
} }
return false; return false;
@ -817,13 +825,13 @@ bool RifEclipseSummaryAddress::isValidEclipseCategory() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::string RifEclipseSummaryAddress::baseQuantityName( const std::string& quantityName ) QString RifEclipseSummaryAddress::baseQuantityName( const QString& quantityName )
{ {
QString qBaseName = QString::fromStdString( quantityName ); QString qBaseName = quantityName;
if ( qBaseName.size() == 8 ) qBaseName.chop( 3 ); if ( qBaseName.size() == 8 ) qBaseName.chop( 3 );
while ( qBaseName.endsWith( "_" ) ) while ( qBaseName.endsWith( "_" ) )
qBaseName.chop( 1 ); qBaseName.chop( 1 );
return qBaseName.toStdString(); return qBaseName;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -252,7 +252,7 @@ public:
private: private:
bool isValidEclipseCategory() const; bool isValidEclipseCategory() const;
static std::string baseQuantityName( const std::string& quantityName ); static QString baseQuantityName( const QString& quantityName );
static std::tuple<int32_t, int32_t, int32_t> ijkTupleFromUiText( const std::string& s ); static std::tuple<int32_t, int32_t, int32_t> ijkTupleFromUiText( const std::string& s );
std::string formatUiTextRegionToRegion() const; std::string formatUiTextRegionToRegion() const;
std::pair<int16_t, int16_t> regionToRegionPairFromUiText( const std::string& s ); std::pair<int16_t, int16_t> regionToRegionPairFromUiText( const std::string& s );