2017-09-25 14:37:41 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2017- Statoil ASA
|
|
|
|
|
//
|
|
|
|
|
// 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.
|
|
|
|
|
//
|
|
|
|
|
// 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.
|
|
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "RifSummaryReaderInterface.h"
|
|
|
|
|
|
|
|
|
|
#include <map>
|
2017-10-13 16:55:04 +02:00
|
|
|
#include <memory>
|
2017-09-25 14:37:41 +02:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
class QString;
|
|
|
|
|
|
2017-09-27 10:19:24 +02:00
|
|
|
class RifColumnBasedUserDataParser;
|
2017-09-25 14:37:41 +02:00
|
|
|
class RifEclipseSummaryAddress;
|
2017-11-06 13:07:38 +01:00
|
|
|
class TableData;
|
2017-09-25 14:37:41 +02:00
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//==================================================================================================
|
2017-09-27 10:19:24 +02:00
|
|
|
class RifColumnBasedUserData : public RifSummaryReaderInterface
|
2017-09-25 14:37:41 +02:00
|
|
|
{
|
|
|
|
|
public:
|
2017-09-27 10:19:24 +02:00
|
|
|
RifColumnBasedUserData();
|
2018-10-18 19:45:57 +02:00
|
|
|
~RifColumnBasedUserData() override;
|
2017-09-25 14:37:41 +02:00
|
|
|
|
2017-11-03 08:11:27 +01:00
|
|
|
bool parse(const QString& data, QString* errorText = nullptr);
|
2017-09-25 14:37:41 +02:00
|
|
|
|
2018-10-18 19:45:57 +02:00
|
|
|
const std::vector<time_t>& timeSteps(const RifEclipseSummaryAddress& resultAddress) const override;
|
2017-09-25 14:37:41 +02:00
|
|
|
|
2018-10-18 19:45:57 +02:00
|
|
|
bool values(const RifEclipseSummaryAddress& resultAddress,
|
2017-09-25 14:37:41 +02:00
|
|
|
std::vector<double>* values) const override;
|
|
|
|
|
|
|
|
|
|
std::string unitName(const RifEclipseSummaryAddress& resultAddress) const override;
|
|
|
|
|
|
2017-11-02 19:00:27 +01:00
|
|
|
private:
|
2017-11-06 13:07:38 +01:00
|
|
|
void buildTimeStepsAndMappings();
|
|
|
|
|
static std::vector<time_t> createTimeSteps(const TableData& table);
|
2017-11-02 19:00:27 +01:00
|
|
|
|
2017-09-25 14:37:41 +02:00
|
|
|
private:
|
2017-09-27 10:19:24 +02:00
|
|
|
std::unique_ptr<RifColumnBasedUserDataParser> m_parser;
|
2017-10-13 16:54:04 +02:00
|
|
|
std::vector< std::vector<time_t> > m_timeSteps;
|
2017-09-25 14:37:41 +02:00
|
|
|
|
|
|
|
|
std::map<RifEclipseSummaryAddress, size_t > m_mapFromAddressToTimeStepIndex;
|
|
|
|
|
std::map<RifEclipseSummaryAddress, std::pair<size_t, size_t> > m_mapFromAddressToResultIndex;
|
|
|
|
|
};
|