2017-09-25 07:37:41 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017- Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2017-09-25 07:37:41 -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
|
|
|
//
|
2017-09-25 07:37:41 -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>
|
2017-09-25 07:37:41 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "RifSummaryReaderInterface.h"
|
|
|
|
|
|
|
|
#include <map>
|
2017-10-13 09:55:04 -05:00
|
|
|
#include <memory>
|
2017-09-25 07:37:41 -05:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class QString;
|
|
|
|
|
2017-09-27 03:19:24 -05:00
|
|
|
class RifColumnBasedUserDataParser;
|
2017-09-25 07:37:41 -05:00
|
|
|
class RifEclipseSummaryAddress;
|
2017-11-06 06:07:38 -06:00
|
|
|
class TableData;
|
2017-09-25 07:37:41 -05:00
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
2017-09-27 03:19:24 -05:00
|
|
|
class RifColumnBasedUserData : public RifSummaryReaderInterface
|
2017-09-25 07:37:41 -05:00
|
|
|
{
|
|
|
|
public:
|
2017-09-27 03:19:24 -05:00
|
|
|
RifColumnBasedUserData();
|
2018-10-18 12:45:57 -05:00
|
|
|
~RifColumnBasedUserData() override;
|
2017-09-25 07:37:41 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
bool parse( const QString& data, QString* errorText = nullptr );
|
2017-09-25 07:37:41 -05:00
|
|
|
|
2023-02-13 05:40:08 -06:00
|
|
|
std::vector<time_t> timeSteps( const RifEclipseSummaryAddress& resultAddress ) const override;
|
2017-09-25 07:37:41 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
bool values( const RifEclipseSummaryAddress& resultAddress, std::vector<double>* values ) const override;
|
2017-09-25 07:37:41 -05:00
|
|
|
|
2021-01-21 05:58:46 -06:00
|
|
|
std::string unitName( const RifEclipseSummaryAddress& resultAddress ) const override;
|
|
|
|
RiaDefines::EclipseUnitSystem unitSystem() const override;
|
2017-09-25 07:37:41 -05:00
|
|
|
|
2017-11-02 13:00:27 -05:00
|
|
|
private:
|
2019-09-06 03:40:57 -05:00
|
|
|
void buildTimeStepsAndMappings();
|
|
|
|
static std::vector<time_t> createTimeSteps( const TableData& table );
|
2017-11-02 13:00:27 -05:00
|
|
|
|
2017-09-25 07:37:41 -05:00
|
|
|
private:
|
2019-09-06 03:40:57 -05:00
|
|
|
std::unique_ptr<RifColumnBasedUserDataParser> m_parser;
|
|
|
|
std::vector<std::vector<time_t>> m_timeSteps;
|
2017-09-25 07:37:41 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
std::map<RifEclipseSummaryAddress, size_t> m_mapFromAddressToTimeStepIndex;
|
|
|
|
std::map<RifEclipseSummaryAddress, std::pair<size_t, size_t>> m_mapFromAddressToResultIndex;
|
2017-09-25 07:37:41 -05:00
|
|
|
};
|