ResInsight/ApplicationLibCode/FileInterface/RifSummaryCaseRestartSelector.h
Kristian Bendiksen ff209ad7c2
Refactor ensemble import dialog
* #9773 Refactor ensemble import dialog.
* #9773 Add support for ensemble import of StimPlan/Reveal summary data.
* #9773 Add method for finding min and max time steps.
* #9773 Add option for resampling to hour intervals.
* #9773 Add option for resampling to minute intervals.
* #9773 Ensemble statistics: determine sub-sampling period dynamically.
* Use RiaWeightedMeanCalculator for curve resampling.
* Add HOUR and MINUTE to date time app enum.
* #9773 Generate better ensembles for StimPlan summaries.
* #9773 Fix parameters.txt lookup for StimPlan summaries
* Refactor: Improve interface of RicImportSummaryCasesFreature::createSummaryCasesFromFiles

Co-authored-by: Magne Sjaastad <magne.sjaastad@ceetronsolutions.com>
2023-04-20 10:16:43 +02:00

114 lines
4.4 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// 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
#include "RiaSummaryDefines.h"
#include "RicSummaryCaseRestartDialog.h"
#include <QString>
#include <QStringList>
#include <string>
#include <vector>
class RifSummaryCaseFileImportInfo;
class RifSummaryCaseFileResultInfo;
//==================================================================================================
//
//
//==================================================================================================
class RifSummaryCaseRestartSelector
{
public:
RifSummaryCaseRestartSelector();
~RifSummaryCaseRestartSelector();
void determineFilesToImportFromSummaryFiles( const QStringList& initialSummaryFiles );
void determineFilesToImportFromGridFiles( const QStringList& initialGridFiles );
void showDialog( bool show );
void setEnsembleOrGroupMode( bool eogMode );
std::vector<RifSummaryCaseFileResultInfo> summaryFileInfos() const;
QStringList gridCaseFiles() const;
bool foundErrors() const;
QString createCombinedErrorMessage() const;
static QString getSummaryFileFromGridFile( const QString& gridFile );
private:
void determineFilesToImport( const std::vector<RifSummaryCaseFileImportInfo>& initialFiles );
void determineFilesToImportByAskingUser( const std::vector<RifSummaryCaseFileImportInfo>& initialFiles, bool enableApplyToAllField );
void determineFilesToImportUsingPrefs( const std::vector<RifSummaryCaseFileImportInfo>& initialFiles );
bool m_showDialog;
bool m_ensembleOrGroupMode;
std::vector<RifSummaryCaseFileResultInfo> m_summaryFileInfos;
QStringList m_gridFiles;
QStringList m_summaryFileErrors;
};
//==================================================================================================
///
//==================================================================================================
class RifSummaryCaseFileImportInfo
{
public:
RifSummaryCaseFileImportInfo( const QString& summaryFileName,
const QString& gridFileName,
RiaDefines::FileType fileType = RiaDefines::FileType::SMSPEC );
const QString& summaryFileName() const;
const QString& gridFileName() const;
bool failOnSummaryFileError() const;
void setFailOnSummaryFileError( bool failOnSummaryFileImportError );
RiaDefines::FileType fileType() const;
private:
QString m_summaryFileName;
QString m_gridFileName;
bool m_failOnSummaryFileImportError;
RiaDefines::FileType m_fileType;
};
//==================================================================================================
///
//==================================================================================================
class RifSummaryCaseFileResultInfo
{
public:
RifSummaryCaseFileResultInfo( const QString& summaryFileName,
bool includeRestartFiles,
RiaDefines::FileType fileType = RiaDefines::FileType::SMSPEC );
const QString& summaryFileName() const;
bool includeRestartFiles() const;
RiaDefines::FileType fileType() const;
bool operator<( const RifSummaryCaseFileResultInfo& other ) const;
bool operator==( const RifSummaryCaseFileResultInfo& other ) const;
private:
QString m_summaryFileName;
bool m_includeRestartFiles;
RiaDefines::FileType m_fileType;
};