2017-10-16 15:13:31 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2017- Statoil ASA
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2017-10-16 15:13:31 +02:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2017-10-16 15:13:31 +02:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2017-10-16 15:13:31 +02:00
|
|
|
// for more details.B
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2023-08-21 07:12:08 +02:00
|
|
|
#include "RifEclipseSummaryAddressDefines.h"
|
2018-08-30 11:17:37 +02:00
|
|
|
|
2017-10-24 14:19:36 +02:00
|
|
|
#include <string>
|
2021-09-12 12:48:28 +02:00
|
|
|
#include <unordered_map>
|
2017-10-16 15:13:31 +02:00
|
|
|
|
2017-10-24 14:19:36 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2017-10-24 14:19:36 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-10-18 14:28:02 +02:00
|
|
|
class RiuSummaryQuantityNameInfoProvider
|
2017-10-16 15:13:31 +02:00
|
|
|
{
|
|
|
|
|
public:
|
2019-10-18 14:28:02 +02:00
|
|
|
static RiuSummaryQuantityNameInfoProvider* instance();
|
2017-10-16 15:13:31 +02:00
|
|
|
|
2023-09-18 09:28:29 +02:00
|
|
|
RifEclipseSummaryAddressDefines::SummaryCategory identifyCategory( const std::string& vectorName );
|
2022-06-03 13:54:15 +02:00
|
|
|
|
2022-05-06 16:34:37 +02:00
|
|
|
std::string longNameFromVectorName( const std::string& vectorName, bool returnVectorNameIfNotFound = false ) const;
|
2017-10-16 15:13:31 +02:00
|
|
|
|
2024-10-13 13:28:28 +02:00
|
|
|
void setQuantityInfos( const std::unordered_map<std::string, std::pair<std::string, std::string>>& infos );
|
|
|
|
|
|
2017-10-16 15:13:31 +02:00
|
|
|
private:
|
2019-10-18 14:28:02 +02:00
|
|
|
class RiuSummaryQuantityInfo
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
RiuSummaryQuantityInfo()
|
2023-09-18 09:28:29 +02:00
|
|
|
: category( RifEclipseSummaryAddressDefines::SummaryCategory::SUMMARY_INVALID )
|
2019-10-18 14:28:02 +02:00
|
|
|
{
|
|
|
|
|
}
|
2023-09-18 09:28:29 +02:00
|
|
|
RiuSummaryQuantityInfo( RifEclipseSummaryAddressDefines::SummaryCategory category, const std::string& longName )
|
2019-10-18 14:28:02 +02:00
|
|
|
: category( category )
|
|
|
|
|
, longName( longName )
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-18 09:28:29 +02:00
|
|
|
RifEclipseSummaryAddressDefines::SummaryCategory category;
|
2023-09-18 07:29:37 +00:00
|
|
|
std::string longName;
|
2019-10-18 14:28:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
RiuSummaryQuantityNameInfoProvider();
|
2017-10-16 15:13:31 +02:00
|
|
|
|
2023-09-18 07:29:37 +00:00
|
|
|
RiuSummaryQuantityInfo quantityInfo( const std::string& vectorName, bool exactMatch = false ) const;
|
2023-09-18 09:28:29 +02:00
|
|
|
RifEclipseSummaryAddressDefines::SummaryCategory categoryFromVectorName( const std::string& vectorName, bool exactMatch = false ) const;
|
2019-10-18 14:28:02 +02:00
|
|
|
|
2024-10-13 13:28:28 +02:00
|
|
|
static std::string stringFromEnum( RifEclipseSummaryAddressDefines::SummaryCategory category );
|
|
|
|
|
static RifEclipseSummaryAddressDefines::SummaryCategory enumFromString( const std::string& category );
|
2020-10-02 18:25:53 +02:00
|
|
|
|
2017-10-16 15:13:31 +02:00
|
|
|
private:
|
2021-09-12 12:48:28 +02:00
|
|
|
std::unordered_map<std::string, RiuSummaryQuantityInfo> m_summaryToDescMap;
|
2017-10-16 15:13:31 +02:00
|
|
|
};
|