2016-05-04 07:11:04 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2016-05-04 07:11:04 -05: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 03:40:57 -05:00
|
|
|
//
|
2016-05-04 07:11:04 -05: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 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2016-05-04 07:11:04 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#pragma once
|
|
|
|
|
2017-09-13 09:30:55 -05:00
|
|
|
#include <map>
|
2018-07-09 05:46:20 -05:00
|
|
|
#include <set>
|
2019-09-06 03:40:57 -05:00
|
|
|
#include <string>
|
2018-05-28 04:20:20 -05:00
|
|
|
#include <vector>
|
2016-05-04 07:11:04 -05:00
|
|
|
|
2023-08-21 00:12:08 -05:00
|
|
|
#include "RifEclipseSummaryAddressDefines.h"
|
|
|
|
using namespace RifEclipseSummaryAddressDefines;
|
|
|
|
|
2018-04-09 03:08:50 -05:00
|
|
|
class QTextStream;
|
2019-08-09 06:15:32 -05:00
|
|
|
class QString;
|
2018-06-07 03:02:54 -05:00
|
|
|
|
2016-05-04 07:11:04 -05:00
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
|
|
|
class RifEclipseSummaryAddress
|
|
|
|
{
|
|
|
|
public:
|
2023-01-30 07:53:07 -06:00
|
|
|
RifEclipseSummaryAddress();
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2023-09-18 02:28:29 -05:00
|
|
|
RifEclipseSummaryAddress( SummaryCategory category,
|
2022-05-06 09:34:37 -05:00
|
|
|
const std::string& vectorName,
|
2023-08-21 00:12:08 -05:00
|
|
|
int regionNumber,
|
|
|
|
int regionNumber2,
|
2022-04-07 14:06:40 -05:00
|
|
|
const std::string& groupName,
|
2023-08-14 04:18:10 -05:00
|
|
|
const std::string& networkName,
|
2019-09-06 03:40:57 -05:00
|
|
|
const std::string& wellName,
|
2023-08-21 00:12:08 -05:00
|
|
|
int wellSegmentNumber,
|
2019-09-06 03:40:57 -05:00
|
|
|
const std::string& lgrName,
|
2023-08-21 00:12:08 -05:00
|
|
|
int cellI,
|
|
|
|
int cellJ,
|
|
|
|
int cellK,
|
|
|
|
int aquiferNumber,
|
2019-12-09 02:21:06 -06:00
|
|
|
bool isErrorResult,
|
2023-08-21 00:12:08 -05:00
|
|
|
int id );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2023-09-18 02:28:29 -05:00
|
|
|
RifEclipseSummaryAddress( SummaryCategory category, std::map<SummaryIdentifierType, std::string>& identifiers );
|
2016-06-09 03:55:48 -05:00
|
|
|
|
|
|
|
// Static specialized creation methods
|
2016-05-04 07:11:04 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static RifEclipseSummaryAddress fromEclipseTextAddress( const std::string& textAddress );
|
2021-09-13 04:37:55 -05:00
|
|
|
static RifEclipseSummaryAddress fromEclipseTextAddressParseErrorTokens( const std::string& textAddress );
|
|
|
|
|
2023-02-26 01:08:06 -06:00
|
|
|
static RifEclipseSummaryAddress fieldAddress( const std::string& vectorName, int calculationId = -1 );
|
2023-02-26 03:48:40 -06:00
|
|
|
static RifEclipseSummaryAddress aquiferAddress( const std::string& vectorName, int aquiferNumber, int calculationId = -1 );
|
2023-08-14 04:18:10 -05:00
|
|
|
static RifEclipseSummaryAddress networkAddress( const std::string& vectorName, const std::string& networkName, int calculationId = -1 );
|
2023-02-26 01:08:06 -06:00
|
|
|
static RifEclipseSummaryAddress miscAddress( const std::string& vectorName, int calculationId = -1 );
|
|
|
|
static RifEclipseSummaryAddress regionAddress( const std::string& vectorName, int regionNumber, int calculationId = -1 );
|
2019-09-06 03:40:57 -05:00
|
|
|
static RifEclipseSummaryAddress
|
2023-04-13 00:05:53 -05:00
|
|
|
regionToRegionAddress( const std::string& vectorName, int regionNumber, int region2Number, int calculationId = -1 );
|
2023-02-26 03:48:40 -06:00
|
|
|
static RifEclipseSummaryAddress groupAddress( const std::string& vectorName, const std::string& groupName, int calculationId = -1 );
|
|
|
|
static RifEclipseSummaryAddress wellAddress( const std::string& vectorName, const std::string& wellName, int calculationId = -1 );
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static RifEclipseSummaryAddress
|
2023-02-26 03:48:40 -06:00
|
|
|
wellCompletionAddress( const std::string& vectorName, const std::string& wellName, int i, int j, int k, int calculationId = -1 );
|
2023-02-26 01:08:06 -06:00
|
|
|
static RifEclipseSummaryAddress
|
2023-04-13 00:05:53 -05:00
|
|
|
wellLgrAddress( const std::string& vectorName, const std::string& lgrName, const std::string& wellName, int calculationId = -1 );
|
2022-05-06 09:34:37 -05:00
|
|
|
static RifEclipseSummaryAddress wellCompletionLgrAddress( const std::string& vectorName,
|
2019-11-04 07:35:41 -06:00
|
|
|
const std::string& lgrName,
|
|
|
|
const std::string& wellName,
|
|
|
|
int i,
|
|
|
|
int j,
|
2023-02-26 01:08:06 -06:00
|
|
|
int k,
|
|
|
|
int calculationId = -1 );
|
2019-09-06 03:40:57 -05:00
|
|
|
static RifEclipseSummaryAddress
|
2023-04-13 00:05:53 -05:00
|
|
|
wellSegmentAddress( const std::string& vectorName, const std::string& wellName, int segmentNumber, int calculationId = -1 );
|
2023-02-26 03:48:40 -06:00
|
|
|
static RifEclipseSummaryAddress blockAddress( const std::string& vectorName, int i, int j, int k, int calculationId = -1 );
|
|
|
|
static RifEclipseSummaryAddress
|
2023-04-13 00:05:53 -05:00
|
|
|
blockLgrAddress( const std::string& vectorName, const std::string& lgrName, int i, int j, int k, int calculationId = -1 );
|
2023-03-15 07:39:57 -05:00
|
|
|
static RifEclipseSummaryAddress importedAddress( const std::string& vectorName, int calculationId = -1 );
|
2023-02-26 03:48:40 -06:00
|
|
|
static RifEclipseSummaryAddress ensembleStatisticsAddress( const std::string& vectorName, const std::string& datavectorName );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2023-09-18 02:25:00 -05:00
|
|
|
// Special address when time is used as x-axis
|
|
|
|
static RifEclipseSummaryAddress timeAddress();
|
|
|
|
|
2020-12-07 09:48:25 -06:00
|
|
|
static std::string generateStringFromAddresses( const std::vector<RifEclipseSummaryAddress>& addressVector,
|
|
|
|
const std::string jointString = "; " );
|
|
|
|
|
2023-09-18 02:28:29 -05:00
|
|
|
static bool isDependentOnWellName( RifEclipseSummaryAddressDefines::SummaryCategory category );
|
2018-11-22 08:24:14 -06:00
|
|
|
|
2016-06-09 03:55:48 -05:00
|
|
|
// Access methods
|
2016-05-04 07:11:04 -05:00
|
|
|
|
2023-09-18 02:28:29 -05:00
|
|
|
SummaryCategory category() const;
|
|
|
|
std::string vectorName() const;
|
|
|
|
bool isHistoryVector() const;
|
2020-02-12 04:13:38 -06:00
|
|
|
|
2023-08-21 00:12:08 -05:00
|
|
|
int regionNumber() const;
|
|
|
|
int regionNumber2() const;
|
2020-02-12 04:13:38 -06:00
|
|
|
|
2023-08-21 00:12:08 -05:00
|
|
|
std::string groupName() const;
|
|
|
|
std::string networkName() const;
|
|
|
|
std::string wellName() const;
|
|
|
|
int wellSegmentNumber() const;
|
|
|
|
std::string lgrName() const;
|
|
|
|
int cellI() const;
|
|
|
|
int cellJ() const;
|
|
|
|
int cellK() const;
|
|
|
|
int aquiferNumber() const;
|
|
|
|
int id() const;
|
|
|
|
std::string blockAsString() const;
|
2016-05-04 07:11:04 -05:00
|
|
|
|
2023-08-21 00:12:08 -05:00
|
|
|
std::string ensembleStatisticsVectorName() const;
|
2018-06-12 07:22:32 -05:00
|
|
|
|
2023-12-01 04:24:58 -06:00
|
|
|
std::string toEclipseTextAddress() const;
|
|
|
|
|
2016-06-09 03:55:48 -05:00
|
|
|
// Derived properties
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
std::string uiText() const;
|
2020-02-25 08:56:08 -06:00
|
|
|
std::string itemUiText() const;
|
2023-08-21 00:12:08 -05:00
|
|
|
std::string addressComponentUiText( SummaryIdentifierType itemTypeInput ) const;
|
2019-09-06 03:40:57 -05:00
|
|
|
bool isUiTextMatchingFilterText( const QString& filterString ) const;
|
2016-05-04 07:11:04 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
bool isValid() const;
|
2023-08-21 00:12:08 -05:00
|
|
|
void setVectorName( const std::string& vectorName );
|
|
|
|
void setWellName( const std::string& wellName );
|
|
|
|
void setGroupName( const std::string& groupName );
|
|
|
|
void setNetworkName( const std::string& networkName );
|
|
|
|
void setRegion( int region );
|
|
|
|
void setRegion2( int region2 );
|
|
|
|
void setAquiferNumber( int aquiferNumber );
|
2019-09-06 03:40:57 -05:00
|
|
|
void setCellIjk( const std::string& uiText );
|
2023-08-21 00:12:08 -05:00
|
|
|
void setWellSegmentNumber( int segment );
|
2017-10-03 15:05:33 -05:00
|
|
|
|
2023-08-21 00:12:08 -05:00
|
|
|
void setAsErrorResult();
|
|
|
|
bool isErrorResult() const;
|
2019-12-09 02:21:06 -06:00
|
|
|
|
2023-08-21 00:12:08 -05:00
|
|
|
void setId( int id );
|
2019-12-09 02:21:06 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
bool hasAccumulatedData() const;
|
2016-06-07 08:12:14 -05:00
|
|
|
|
2022-05-06 09:34:37 -05:00
|
|
|
static std::string baseVectorName( const std::string& vectorName );
|
2020-10-01 08:48:53 -05:00
|
|
|
|
2023-01-30 07:53:07 -06:00
|
|
|
auto operator<=>( const RifEclipseSummaryAddress& rhs ) const = default;
|
|
|
|
|
2023-02-26 01:08:06 -06:00
|
|
|
bool isCalculated() const;
|
2023-09-18 02:25:00 -05:00
|
|
|
bool isTime() const;
|
2023-02-26 01:08:06 -06:00
|
|
|
|
2023-08-21 00:12:08 -05:00
|
|
|
std::string formatUiTextRegionToRegion() const;
|
|
|
|
static std::pair<int, int> regionToRegionPairFromUiText( const std::string& s );
|
2023-02-26 01:08:06 -06:00
|
|
|
|
2018-07-09 05:46:20 -05:00
|
|
|
private:
|
2021-09-13 04:37:55 -05:00
|
|
|
static RifEclipseSummaryAddress fromTokens( const std::vector<std::string>& tokens );
|
|
|
|
|
2023-08-21 00:12:08 -05:00
|
|
|
bool isValidEclipseCategory() const;
|
|
|
|
static std::tuple<int, int, int> ijkTupleFromUiText( const std::string& s );
|
|
|
|
void setCellIjk( std::tuple<int, int, int> ijk );
|
|
|
|
void setCellIjk( int i, int j, int k );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2023-01-30 07:53:07 -06:00
|
|
|
private:
|
|
|
|
// The ordering the variables are defined in defines how the objects get sorted. Members defined first will be
|
|
|
|
// evaluated first. This concept is used by <=> operator.
|
|
|
|
|
2023-09-18 02:28:29 -05:00
|
|
|
SummaryCategory m_category;
|
|
|
|
std::string m_vectorName;
|
|
|
|
std::string m_name;
|
|
|
|
std::string m_lgrName;
|
|
|
|
int m_number0;
|
|
|
|
int m_number1;
|
|
|
|
int m_number2;
|
|
|
|
bool m_isErrorResult;
|
|
|
|
int m_id;
|
2016-05-04 07:11:04 -05:00
|
|
|
};
|
2016-06-09 03:55:48 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
QTextStream& operator<<( QTextStream& str, const RifEclipseSummaryAddress& sobj );
|
|
|
|
QTextStream& operator>>( QTextStream& str, RifEclipseSummaryAddress& sobj );
|