2019-01-31 02:02:09 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2019- Equinor 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
|
|
|
|
|
2019-03-28 04:17:34 -05:00
|
|
|
#include "RiaDefines.h"
|
|
|
|
|
2019-01-31 02:02:09 -06:00
|
|
|
#include "cafCmdFeature.h"
|
|
|
|
|
2019-05-06 03:36:05 -05:00
|
|
|
#include <QStringList>
|
|
|
|
|
2021-09-27 05:14:06 -05:00
|
|
|
#include <memory>
|
2019-01-31 02:02:09 -06:00
|
|
|
#include <vector>
|
|
|
|
|
2021-09-27 05:14:06 -05:00
|
|
|
class RifReaderSettings;
|
|
|
|
|
2019-01-31 02:02:09 -06:00
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
|
|
|
class RicImportGeneralDataFeature : public caf::CmdFeature
|
|
|
|
{
|
|
|
|
CAF_CMD_HEADER_INIT;
|
|
|
|
|
2019-03-28 04:17:34 -05:00
|
|
|
public:
|
2019-05-06 03:36:05 -05:00
|
|
|
struct OpenCaseResults
|
|
|
|
{
|
|
|
|
QStringList eclipseCaseFiles;
|
|
|
|
QStringList eclipseInputFiles;
|
|
|
|
QStringList eclipseSummaryFiles;
|
2022-12-19 08:28:26 -06:00
|
|
|
QStringList roffFiles;
|
2019-05-06 03:36:05 -05:00
|
|
|
|
2021-09-23 07:19:55 -05:00
|
|
|
std::vector<int> createdCaseIds;
|
|
|
|
|
2019-05-06 03:36:05 -05:00
|
|
|
operator bool() const
|
|
|
|
{
|
2023-02-26 03:48:40 -06:00
|
|
|
return !( eclipseCaseFiles.empty() && eclipseInputFiles.empty() && eclipseSummaryFiles.empty() && roffFiles.empty() );
|
2019-05-06 03:36:05 -05:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2021-09-27 05:14:06 -05:00
|
|
|
static OpenCaseResults openEclipseFilesFromFileNames( const QStringList& fileNames,
|
|
|
|
bool doCreateDefaultPlot,
|
|
|
|
bool createDefaultView,
|
|
|
|
std::shared_ptr<RifReaderSettings> readerSettings = nullptr );
|
|
|
|
static QStringList fileNamesFromCaseNames( const QStringList& caseNames );
|
|
|
|
static QStringList getEclipseFileNamesWithDialog( RiaDefines::ImportFileType fileTypes );
|
2019-03-28 04:17:34 -05:00
|
|
|
|
2022-12-21 07:53:52 -06:00
|
|
|
static QString getFilePattern( const std::vector<RiaDefines::ImportFileType>& fileTypes, bool allowWildcard );
|
|
|
|
|
2019-01-31 02:02:09 -06:00
|
|
|
protected:
|
|
|
|
bool isCommandEnabled() override;
|
2019-09-06 03:40:57 -05:00
|
|
|
void onActionTriggered( bool isChecked ) override;
|
|
|
|
void setupActionLook( QAction* actionToSetup ) override;
|
2019-03-28 04:17:34 -05:00
|
|
|
|
2022-12-21 07:53:52 -06:00
|
|
|
static QString getFilePattern( RiaDefines::ImportFileType fileType );
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static void openFileDialog( RiaDefines::ImportFileType fileTypes );
|
2019-03-28 04:17:34 -05:00
|
|
|
|
2021-09-27 05:14:06 -05:00
|
|
|
static bool openEclipseCaseFromFileNames( const QStringList& fileNames,
|
|
|
|
bool createDefaultView,
|
|
|
|
std::vector<int>& createdCaseIds,
|
|
|
|
std::shared_ptr<RifReaderSettings> readerSettings );
|
2023-04-21 03:34:29 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static bool openSummaryCaseFromFileNames( const QStringList& fileNames, bool doCreateDefaultPlot = true );
|
2023-04-19 08:52:57 -05:00
|
|
|
|
2023-04-21 03:34:29 -05:00
|
|
|
static bool openEclipseInputFilesFromFileNames( const QStringList& fileNames, bool createDefaultView, std::vector<int>& createdCaseIds );
|
|
|
|
static bool openGrdeclCasesFromFileNames( const QStringList& fileNames, bool createDefaultView, std::vector<int>& createdCaseIds );
|
|
|
|
static bool
|
|
|
|
openGrdeclCaseAndPropertiesFromFileNames( const QStringList& fileNames, bool createDefaultView, std::vector<int>& createdCaseIds );
|
|
|
|
|
2023-04-19 08:52:57 -05:00
|
|
|
static bool openRoffFilesFromFileNames( const QStringList& fileNames, bool createDefaultView, std::vector<int>& createdCaseIds );
|
|
|
|
static bool openRoffCasesFromFileNames( const QStringList& fileNames, bool createDefaultView, std::vector<int>& createdCaseIds );
|
|
|
|
static bool openRoffCaseAndPropertiesFromFileNames( const QStringList& fileNames, bool createDefaultView, std::vector<int>& createdCaseIds );
|
2019-01-31 02:02:09 -06:00
|
|
|
};
|