2016-04-12 04:32:28 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 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
|
|
|
|
|
2016-05-04 07:11:04 -05:00
|
|
|
#include "RifEclipseSummaryAddress.h"
|
2017-09-15 07:26:06 -05:00
|
|
|
#include "RifSummaryReaderInterface.h"
|
2016-05-04 07:11:04 -05:00
|
|
|
|
2018-03-15 08:23:48 -05:00
|
|
|
#include <QString>
|
|
|
|
|
2016-04-12 04:32:28 -05:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2016-06-21 08:56:09 -05:00
|
|
|
#include <map>
|
2016-04-12 04:32:28 -05:00
|
|
|
|
2018-02-02 07:17:10 -06:00
|
|
|
class QStringList;
|
2016-04-12 04:32:28 -05:00
|
|
|
|
2018-03-15 08:23:48 -05:00
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
|
|
|
class RifRestartFileInfo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
RifRestartFileInfo() : startDate(0), endDate(0) {}
|
2018-04-13 08:44:28 -05:00
|
|
|
RifRestartFileInfo(const QString& _fileName, time_t _startDate, time_t _endDate) :
|
|
|
|
fileName(_fileName), startDate(_startDate), endDate(_endDate) {}
|
2018-03-21 08:47:07 -05:00
|
|
|
bool valid() { return !fileName.isEmpty(); }
|
2018-03-15 08:23:48 -05:00
|
|
|
|
|
|
|
QString fileName;
|
|
|
|
time_t startDate;
|
|
|
|
time_t endDate;
|
|
|
|
};
|
|
|
|
|
2016-04-12 04:32:28 -05:00
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
2017-09-15 07:26:06 -05:00
|
|
|
class RifReaderEclipseSummary : public RifSummaryReaderInterface
|
2016-04-12 04:32:28 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
RifReaderEclipseSummary();
|
|
|
|
~RifReaderEclipseSummary();
|
|
|
|
|
2018-03-15 08:23:48 -05:00
|
|
|
bool open(const QString& headerFileName, bool includeRestartFiles);
|
|
|
|
|
|
|
|
std::vector<RifRestartFileInfo> getRestartFiles(const QString& headerFileName);
|
2018-03-20 07:28:06 -05:00
|
|
|
RifRestartFileInfo getFileInfo(const QString& headerFileName);
|
2016-04-12 04:32:28 -05:00
|
|
|
|
2017-09-22 02:41:33 -05:00
|
|
|
virtual const std::vector<time_t>& timeSteps(const RifEclipseSummaryAddress& resultAddress) const override;
|
2016-04-12 04:32:28 -05:00
|
|
|
|
2017-09-22 07:59:47 -05:00
|
|
|
virtual bool values(const RifEclipseSummaryAddress& resultAddress, std::vector<double>* values) const override;
|
|
|
|
virtual std::string unitName(const RifEclipseSummaryAddress& resultAddress) const override;
|
2016-04-12 04:32:28 -05:00
|
|
|
|
|
|
|
private:
|
2017-09-22 02:41:33 -05:00
|
|
|
int timeStepCount() const;
|
2017-09-22 07:59:47 -05:00
|
|
|
int indexFromAddress(const RifEclipseSummaryAddress& resultAddress) const;
|
2017-09-22 02:41:33 -05:00
|
|
|
void buildMetaData();
|
2018-03-15 08:23:48 -05:00
|
|
|
RifRestartFileInfo getRestartFile(const QString& headerFileName);
|
2016-04-12 04:32:28 -05:00
|
|
|
|
|
|
|
private:
|
2016-05-31 06:37:50 -05:00
|
|
|
// Taken from ecl_sum.h
|
2016-06-09 03:55:48 -05:00
|
|
|
typedef struct ecl_sum_struct ecl_sum_type;
|
|
|
|
typedef struct ecl_smspec_struct ecl_smspec_type;
|
|
|
|
|
2017-02-16 04:09:21 -06:00
|
|
|
ecl_sum_type* m_ecl_sum;
|
|
|
|
const ecl_smspec_type * m_ecl_SmSpec;
|
2016-11-22 04:13:34 -06:00
|
|
|
std::vector<time_t> m_timeSteps;
|
2017-09-21 05:20:09 -05:00
|
|
|
|
|
|
|
std::map<RifEclipseSummaryAddress, int> m_resultAddressToErtNodeIdx;
|
2016-04-12 04:32:28 -05:00
|
|
|
};
|
2016-05-31 06:37:50 -05:00
|
|
|
|