2016-05-31 13:42:27 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2016- 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 "cafPdmChildArrayField.h"
|
|
|
|
|
#include "cafPdmObject.h"
|
|
|
|
|
|
2017-09-07 12:01:40 +02:00
|
|
|
#include <vector>
|
2018-06-25 15:14:47 +02:00
|
|
|
#include <functional>
|
2017-09-07 12:01:40 +02:00
|
|
|
|
2018-05-15 15:43:04 +02:00
|
|
|
class RimGridSummaryCase;
|
2016-05-31 13:42:27 +02:00
|
|
|
class RimSummaryCase;
|
|
|
|
|
class RimEclipseResultCase;
|
2017-09-07 12:01:40 +02:00
|
|
|
class RimSummaryCaseCollection;
|
2018-04-25 08:57:00 +02:00
|
|
|
class RifSummaryCaseFileResultInfo;
|
2016-05-31 13:42:27 +02:00
|
|
|
|
2017-09-11 10:44:55 +02:00
|
|
|
//==================================================================================================
|
|
|
|
|
///
|
|
|
|
|
//==================================================================================================
|
2017-09-06 16:32:46 +02:00
|
|
|
class RimSummaryCaseMainCollection : public caf::PdmObject
|
2016-05-31 13:42:27 +02:00
|
|
|
{
|
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
|
public:
|
2017-09-06 16:32:46 +02:00
|
|
|
RimSummaryCaseMainCollection();
|
2018-10-18 19:45:57 +02:00
|
|
|
~RimSummaryCaseMainCollection() override;
|
2016-05-31 13:42:27 +02:00
|
|
|
|
2016-08-05 11:05:58 +02:00
|
|
|
RimSummaryCase* summaryCase(size_t idx);
|
2017-09-08 15:26:13 +02:00
|
|
|
size_t summaryCaseCount() const;
|
2017-09-07 12:01:40 +02:00
|
|
|
|
2017-10-26 08:21:19 +02:00
|
|
|
std::vector<RimSummaryCase*> allSummaryCases() const;
|
2017-09-18 14:49:31 +02:00
|
|
|
std::vector<RimSummaryCase*> topLevelSummaryCases() const;
|
|
|
|
|
std::vector<RimSummaryCaseCollection*> summaryCaseCollections() const;
|
|
|
|
|
|
2018-05-03 13:35:40 +02:00
|
|
|
std::vector<RimSummaryCase*> createSummaryCasesFromFileInfos(const std::vector<RifSummaryCaseFileResultInfo>& summaryHeaderFileInfos, bool showProgress = false);
|
2018-04-13 11:11:05 +02:00
|
|
|
|
2018-09-17 10:34:01 +02:00
|
|
|
RimSummaryCase* findSummaryCaseFromEclipseResultCase(const RimEclipseResultCase* eclResCase) const;
|
2016-11-07 15:57:21 +01:00
|
|
|
RimSummaryCase* findSummaryCaseFromFileName(const QString& fileName) const;
|
2018-05-15 15:43:04 +02:00
|
|
|
void convertGridSummaryCasesToFileSummaryCases(RimGridSummaryCase* gridSummaryCase);
|
2018-04-13 11:11:05 +02:00
|
|
|
|
2018-04-19 13:38:07 +02:00
|
|
|
void addCases(const std::vector<RimSummaryCase*> cases);
|
2017-09-11 10:44:55 +02:00
|
|
|
void addCase(RimSummaryCase* summaryCase);
|
2017-09-08 15:26:13 +02:00
|
|
|
void removeCase(RimSummaryCase* summaryCase);
|
2016-11-07 15:57:21 +01:00
|
|
|
|
2018-06-25 15:14:47 +02:00
|
|
|
RimSummaryCaseCollection* addCaseCollection(std::vector<RimSummaryCase*> summaryCases,
|
|
|
|
|
const QString& coolectionName,
|
|
|
|
|
bool isEnsemble,
|
|
|
|
|
std::function<RimSummaryCaseCollection* ()> allocator = defaultAllocator);
|
2017-09-08 15:26:13 +02:00
|
|
|
void removeCaseCollection(RimSummaryCaseCollection* caseCollection);
|
2016-05-31 13:42:27 +02:00
|
|
|
|
2016-08-05 11:05:58 +02:00
|
|
|
void loadAllSummaryCaseData();
|
2016-05-31 13:42:27 +02:00
|
|
|
|
2016-08-05 11:05:58 +02:00
|
|
|
QString uniqueShortNameForCase(RimSummaryCase* summaryCase);
|
2016-07-06 13:35:24 +02:00
|
|
|
|
2017-05-03 12:31:45 +02:00
|
|
|
void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath);
|
|
|
|
|
|
2018-05-07 13:14:43 +02:00
|
|
|
private:
|
|
|
|
|
static void loadSummaryCaseData(std::vector<RimSummaryCase*> summaryCases);
|
2018-06-25 15:14:47 +02:00
|
|
|
static RimSummaryCaseCollection* defaultAllocator();
|
2018-05-07 13:14:43 +02:00
|
|
|
|
2016-05-31 13:42:27 +02:00
|
|
|
private:
|
|
|
|
|
caf::PdmChildArrayField<RimSummaryCase*> m_cases;
|
2017-09-07 12:01:40 +02:00
|
|
|
caf::PdmChildArrayField<RimSummaryCaseCollection*> m_caseCollections;
|
2016-05-31 13:42:27 +02:00
|
|
|
};
|