2017-09-25 07:37:41 -05: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 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
|
|
|
|
2017-11-03 02:11:27 -05:00
|
|
|
bool parse(const QString& data, QString* errorText = nullptr);
|
2017-09-25 07:37:41 -05:00
|
|
|
|
2018-10-18 12:45:57 -05:00
|
|
|
const std::vector<time_t>& timeSteps(const RifEclipseSummaryAddress& resultAddress) const override;
|
2017-09-25 07:37:41 -05:00
|
|
|
|
2018-10-18 12:45:57 -05:00
|
|
|
bool values(const RifEclipseSummaryAddress& resultAddress,
|
2017-09-25 07:37:41 -05:00
|
|
|
std::vector<double>* values) const override;
|
|
|
|
|
|
|
|
std::string unitName(const RifEclipseSummaryAddress& resultAddress) const override;
|
|
|
|
|
2017-11-02 13:00:27 -05:00
|
|
|
private:
|
2017-11-06 06:07:38 -06: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:
|
2017-09-27 03:19:24 -05:00
|
|
|
std::unique_ptr<RifColumnBasedUserDataParser> m_parser;
|
2017-10-13 09:54:04 -05:00
|
|
|
std::vector< std::vector<time_t> > m_timeSteps;
|
2017-09-25 07:37:41 -05:00
|
|
|
|
|
|
|
std::map<RifEclipseSummaryAddress, size_t > m_mapFromAddressToTimeStepIndex;
|
|
|
|
std::map<RifEclipseSummaryAddress, std::pair<size_t, size_t> > m_mapFromAddressToResultIndex;
|
|
|
|
};
|