2017-07-26 09:41:17 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017 Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2017-07-26 09:41:17 -05:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2017-07-26 09:41:17 -05:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2017-07-26 09:41:17 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
2017-07-31 02:24:09 -05:00
|
|
|
|
2017-07-26 09:41:17 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "cafAppEnum.h"
|
2020-03-04 03:12:59 -06:00
|
|
|
#include "cafPdmScriptIOMessages.h"
|
2017-07-26 09:41:17 -05:00
|
|
|
|
2017-07-28 05:54:21 -05:00
|
|
|
#include <map>
|
2018-02-05 01:47:10 -06:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class RicfCommandObject;
|
2017-07-28 05:54:21 -05:00
|
|
|
|
2017-07-31 02:24:09 -05:00
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
2017-07-26 09:41:17 -05:00
|
|
|
class RicfCommandFileExecutor
|
|
|
|
{
|
|
|
|
public:
|
2020-04-24 01:22:32 -05:00
|
|
|
enum class ExportType
|
2019-09-06 03:40:57 -05:00
|
|
|
{
|
2017-07-26 09:41:17 -05:00
|
|
|
COMPLETIONS,
|
|
|
|
SNAPSHOTS,
|
|
|
|
PROPERTIES,
|
2018-09-25 02:09:13 -05:00
|
|
|
STATISTICS,
|
2018-10-04 06:50:29 -05:00
|
|
|
WELLPATHS,
|
2018-10-22 02:31:25 -05:00
|
|
|
CELLS,
|
|
|
|
LGRS
|
2017-07-26 09:41:17 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef caf::AppEnum<ExportType> ExportTypeEnum;
|
|
|
|
|
|
|
|
public:
|
|
|
|
RicfCommandFileExecutor();
|
|
|
|
~RicfCommandFileExecutor();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void executeCommands( QTextStream& stream );
|
2019-11-03 05:19:24 -06:00
|
|
|
void setExportPath( ExportType type, const QString& path );
|
2019-09-06 03:40:57 -05:00
|
|
|
QString getExportPath( ExportType type ) const;
|
|
|
|
void setLastProjectPath( const QString& path );
|
2017-07-28 04:28:55 -05:00
|
|
|
QString getLastProjectPath() const;
|
2017-07-26 09:41:17 -05:00
|
|
|
|
|
|
|
static RicfCommandFileExecutor* instance();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static std::vector<RicfCommandObject*>
|
|
|
|
prepareFileCommandsForExecution( const std::vector<RicfCommandObject*>& commandsReadFromFile );
|
2018-02-05 01:47:10 -06:00
|
|
|
|
2017-07-26 09:41:17 -05:00
|
|
|
private:
|
2019-09-06 03:40:57 -05:00
|
|
|
void clearCachedData();
|
2018-10-04 03:40:48 -05:00
|
|
|
|
2017-07-26 09:41:17 -05:00
|
|
|
std::map<ExportType, QString> m_exportPaths;
|
2017-07-28 04:28:55 -05:00
|
|
|
QString m_lastProjectPath;
|
2021-03-02 02:25:53 -06:00
|
|
|
bool m_exportDataSourceAsComment;
|
2017-07-26 09:41:17 -05:00
|
|
|
};
|