2012-05-18 02:45:23 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-23 08:04:57 -05:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2012-05-18 02:45:23 -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.
|
|
|
|
//
|
|
|
|
// 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-06-28 03:58:22 -05:00
|
|
|
|
2013-05-06 03:55:00 -05:00
|
|
|
#include <QApplication>
|
2012-05-18 02:45:23 -05:00
|
|
|
#include <QProcess>
|
2013-09-13 02:23:33 -05:00
|
|
|
#include <QMutex>
|
|
|
|
|
2013-05-06 03:55:00 -05:00
|
|
|
#include "cafPdmObject.h"
|
|
|
|
#include "cafPdmField.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
#include "cvfBase.h"
|
|
|
|
#include "cvfObject.h"
|
2013-05-06 03:55:00 -05:00
|
|
|
#include "cvfFont.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
#include <iostream>
|
2016-10-05 01:23:07 -05:00
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
class QAction;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2016-06-28 03:58:22 -05:00
|
|
|
class Drawable;
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
class RIProcess;
|
2016-06-28 03:58:22 -05:00
|
|
|
|
|
|
|
class RiaPreferences;
|
|
|
|
class RiaProjectModifier;
|
|
|
|
class RiaSocketServer;
|
|
|
|
|
2017-01-10 02:51:39 -06:00
|
|
|
class RigEclipseCaseData;
|
2016-06-28 03:58:22 -05:00
|
|
|
|
|
|
|
class RimCommandObject;
|
2015-05-15 01:40:27 -05:00
|
|
|
class RimEclipseCase;
|
2015-05-21 03:05:33 -05:00
|
|
|
class RimEclipseView;
|
2018-01-15 07:52:22 -06:00
|
|
|
class RimGridView;
|
2013-05-06 03:55:00 -05:00
|
|
|
class RimProject;
|
2016-06-28 03:58:22 -05:00
|
|
|
class RimSummaryPlot;
|
2018-01-09 03:11:28 -06:00
|
|
|
class Rim3dView;
|
2016-08-31 10:34:31 -05:00
|
|
|
class RimViewWindow;
|
2015-09-10 01:14:28 -05:00
|
|
|
class RimWellLogPlot;
|
2017-01-13 06:32:02 -06:00
|
|
|
class RimWellAllocationPlot;
|
2016-06-28 03:58:22 -05:00
|
|
|
|
2017-01-17 06:06:57 -06:00
|
|
|
class RiuMainWindowBase;
|
2018-04-26 23:28:08 -05:00
|
|
|
class RiuPlotMainWindow;
|
2016-10-05 01:23:07 -05:00
|
|
|
class RiuRecentFileActionProvider;
|
2017-08-29 02:38:41 -05:00
|
|
|
class RiaArgumentParser;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
namespace caf
|
|
|
|
{
|
|
|
|
class UiProcess;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
2013-03-22 09:50:44 -05:00
|
|
|
class RiaApplication : public QApplication
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum RINavigationPolicy
|
|
|
|
{
|
|
|
|
NAVIGATION_POLICY_CEETRON,
|
2015-07-02 05:31:35 -05:00
|
|
|
NAVIGATION_POLICY_CAD,
|
|
|
|
NAVIGATION_POLICY_GEOQUEST,
|
|
|
|
NAVIGATION_POLICY_RMS
|
2012-05-18 02:45:23 -05:00
|
|
|
};
|
|
|
|
|
2017-07-28 04:28:55 -05:00
|
|
|
enum ProjectLoadAction
|
|
|
|
{
|
|
|
|
PLA_NONE = 0,
|
|
|
|
PLA_CALCULATE_STATISTICS = 1
|
|
|
|
};
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
public:
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication(int& argc, char** argv);
|
|
|
|
~RiaApplication();
|
2018-03-08 03:10:15 -06:00
|
|
|
|
2018-03-12 05:12:39 -05:00
|
|
|
static RiaApplication* instance();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2018-03-08 03:10:15 -06:00
|
|
|
int parseArgumentsAndRunUnitTestsIfRequested();
|
|
|
|
bool parseArguments();
|
2013-09-27 03:04:10 -05:00
|
|
|
|
2018-03-08 03:10:15 -06:00
|
|
|
void setActiveReservoirView(Rim3dView*);
|
2018-03-12 05:12:39 -05:00
|
|
|
Rim3dView* activeReservoirView();
|
|
|
|
const Rim3dView* activeReservoirView() const;
|
|
|
|
RimGridView* activeGridView();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2018-03-08 03:10:15 -06:00
|
|
|
RimViewWindow* activePlotWindow() const;
|
2017-01-13 06:32:02 -06:00
|
|
|
|
2018-03-12 05:12:39 -05:00
|
|
|
RimProject* project();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
void createMockModel();
|
|
|
|
void createResultsMockModel();
|
|
|
|
void createLargeResultsMockModel();
|
2013-10-28 04:32:24 -05:00
|
|
|
void createMockModelCustomized();
|
2012-06-26 09:10:41 -05:00
|
|
|
void createInputMockModel();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2016-09-21 02:46:17 -05:00
|
|
|
QString lastUsedDialogDirectory(const QString& dialogName);
|
|
|
|
QString lastUsedDialogDirectoryWithFallback(const QString& dialogName, const QString& fallbackDirectory);
|
|
|
|
void setLastUsedDialogDirectory(const QString& dialogName, const QString& directory);
|
2012-10-23 02:59:57 -05:00
|
|
|
|
2016-10-05 03:42:08 -05:00
|
|
|
bool openFile(const QString& fileName);
|
2012-06-26 09:10:41 -05:00
|
|
|
|
2018-06-11 06:47:21 -05:00
|
|
|
bool openOdbCaseFromFile(const QString& fileName, bool applyTimeStepFilter = false);
|
2015-04-20 02:02:33 -05:00
|
|
|
|
2016-09-21 02:46:17 -05:00
|
|
|
QString currentProjectPath() const;
|
2013-12-04 05:04:42 -06:00
|
|
|
QString createAbsolutePathFromProjectRelativePath(QString projectRelativePath);
|
|
|
|
bool loadProject(const QString& projectFileName);
|
2017-07-28 04:28:55 -05:00
|
|
|
bool loadProject(const QString& projectFileName, ProjectLoadAction loadAction, RiaProjectModifier* projectModifier);
|
2012-05-18 02:45:23 -05:00
|
|
|
bool saveProject();
|
|
|
|
bool saveProjectAs(const QString& fileName);
|
|
|
|
bool saveProjectPromptForFileName();
|
2017-04-20 01:07:47 -05:00
|
|
|
static bool hasValidProjectFileExtension(const QString& fileName);
|
|
|
|
|
|
|
|
bool askUserToSaveModifiedProject();
|
2016-10-04 04:02:56 -05:00
|
|
|
void closeProject();
|
2017-04-20 01:07:47 -05:00
|
|
|
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
Known problems:
- Well paths are not shown in some types of reservoir views, for instance reservoir views showing well pipes. Will look into this later.
p4#: 21658
2013-05-16 07:10:22 -05:00
|
|
|
void addWellPathsToModel(QList<QString> wellPathFilePaths);
|
2017-11-24 03:01:05 -06:00
|
|
|
void addWellPathFormationsToModel(QList<QString> wellPathFilePaths);
|
2015-09-14 09:33:28 -05:00
|
|
|
void addWellLogsToModel(const QList<QString>& wellLogFilePaths);
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
Known problems:
- Well paths are not shown in some types of reservoir views, for instance reservoir views showing well pipes. Will look into this later.
p4#: 21658
2013-05-16 07:10:22 -05:00
|
|
|
|
2013-12-04 05:04:42 -06:00
|
|
|
void runMultiCaseSnapshots(const QString& templateProjectFileName, std::vector<QString> gridFileNames, const QString& snapshotFolderName);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
void processNonGuiEvents();
|
|
|
|
|
2013-12-04 05:04:42 -06:00
|
|
|
static const char* getVersionStringApp(bool includeCrtInfo);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
void setUseShaders(bool enable);
|
|
|
|
bool useShaders() const;
|
|
|
|
|
|
|
|
void setShowPerformanceInfo(bool enable);
|
|
|
|
bool showPerformanceInfo() const;
|
|
|
|
|
|
|
|
RINavigationPolicy navigationPolicy() const;
|
2013-04-24 00:35:31 -05:00
|
|
|
QString scriptDirectories() const;
|
2012-05-18 02:45:23 -05:00
|
|
|
QString scriptEditorPath() const;
|
2014-07-22 05:11:48 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
QString octavePath() const;
|
2014-07-22 05:11:48 -05:00
|
|
|
QStringList octaveArguments() const;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
bool launchProcess(const QString& program, const QStringList& arguments);
|
2013-05-27 08:38:03 -05:00
|
|
|
bool launchProcessForMultipleCases(const QString& program, const QStringList& arguments, const std::vector<int>& caseIds);
|
2012-08-31 12:12:47 -05:00
|
|
|
void terminateProcess();
|
2017-07-31 04:10:22 -05:00
|
|
|
void waitForProcess() const;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-19 01:02:36 -05:00
|
|
|
RiaPreferences* preferences();
|
2012-05-18 02:45:23 -05:00
|
|
|
void applyPreferences();
|
|
|
|
|
2013-04-19 01:02:36 -05:00
|
|
|
cvf::Font* standardFont();
|
2016-08-09 06:09:08 -05:00
|
|
|
cvf::Font* customFont();
|
2013-04-19 01:02:36 -05:00
|
|
|
|
2013-08-08 04:09:18 -05:00
|
|
|
QString commandLineParameterHelp() const;
|
|
|
|
void showFormattedTextInMessageBox(const QString& text);
|
|
|
|
|
2013-09-08 03:53:25 -05:00
|
|
|
void setCacheDataObject(const QString& key, const QVariant& dataObject);
|
|
|
|
QVariant cacheDataObject(const QString& key) const;
|
|
|
|
|
2013-09-12 01:11:56 -05:00
|
|
|
void addCommandObject(RimCommandObject* commandObject);
|
|
|
|
void executeCommandObjects();
|
|
|
|
|
2015-12-03 03:33:38 -06:00
|
|
|
int launchUnitTests();
|
|
|
|
int launchUnitTestsWithConsole();
|
2015-10-05 09:09:51 -05:00
|
|
|
|
2018-06-29 04:36:50 -05:00
|
|
|
RiuPlotMainWindow* getOrCreateMainPlotWindow();
|
2018-04-26 23:28:08 -05:00
|
|
|
RiuPlotMainWindow* getOrCreateAndShowMainPlotWindow();
|
|
|
|
RiuPlotMainWindow* mainPlotWindow();
|
2017-01-17 06:06:57 -06:00
|
|
|
RiuMainWindowBase* mainWindowByID(int mainWindowID);
|
2016-06-27 04:07:01 -05:00
|
|
|
|
2016-08-31 10:34:31 -05:00
|
|
|
static RimViewWindow* activeViewWindow();
|
|
|
|
|
2017-04-25 08:01:31 -05:00
|
|
|
bool isMain3dWindowVisible() const;
|
|
|
|
bool isMainPlotWindowVisible() const;
|
|
|
|
|
2016-10-04 02:29:45 -05:00
|
|
|
bool tryCloseMainWindow();
|
|
|
|
bool tryClosePlotWindow();
|
|
|
|
|
2016-10-05 01:23:07 -05:00
|
|
|
void addToRecentFiles(const QString& fileName);
|
|
|
|
std::vector<QAction*> recentFileActions() const;
|
|
|
|
|
2017-07-26 09:57:43 -05:00
|
|
|
void setStartDir(const QString& startDir);
|
2013-12-04 05:04:42 -06:00
|
|
|
|
2017-07-28 04:28:55 -05:00
|
|
|
static std::vector<QString> readFileListFromTextFile(QString listFileName);
|
2013-12-04 05:04:42 -06:00
|
|
|
|
2018-03-12 05:12:39 -05:00
|
|
|
void waitUntilCommandObjectsHasBeenProcessed();
|
2018-05-16 01:35:11 -05:00
|
|
|
void saveWinGeoAndDockToolBarLayout();
|
2016-10-05 03:04:41 -05:00
|
|
|
|
2018-03-08 03:10:15 -06:00
|
|
|
private:
|
2013-12-04 05:04:42 -06:00
|
|
|
void onProjectOpenedOrClosed();
|
|
|
|
void setWindowCaptionFromAppState();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2016-06-27 04:07:01 -05:00
|
|
|
void createMainPlotWindow();
|
|
|
|
void deleteMainPlotWindow();
|
2016-10-05 03:04:41 -05:00
|
|
|
|
|
|
|
void loadAndUpdatePlotData();
|
2017-04-20 04:02:05 -05:00
|
|
|
|
|
|
|
void storeTreeViewState();
|
2016-06-27 04:07:01 -05:00
|
|
|
|
2018-01-12 04:31:01 -06:00
|
|
|
friend RiaArgumentParser;
|
2017-08-29 02:38:41 -05:00
|
|
|
void setHelpText(const QString& helpText);
|
|
|
|
|
2018-05-03 02:53:54 -05:00
|
|
|
virtual bool notify(QObject *, QEvent *) override;
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
private slots:
|
2018-03-12 05:12:39 -05:00
|
|
|
void slotWorkerProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
2016-12-22 01:44:36 -06:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
private:
|
2018-03-12 05:12:39 -05:00
|
|
|
caf::PdmPointer<Rim3dView> m_activeReservoirView;
|
2013-04-19 01:02:36 -05:00
|
|
|
caf::PdmPointer<RimProject> m_project;
|
|
|
|
|
|
|
|
RiaSocketServer* m_socketServer;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-19 01:02:36 -05:00
|
|
|
caf::UiProcess* m_workerProcess;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-05-27 08:38:03 -05:00
|
|
|
// Execute for all settings
|
|
|
|
std::list<int> m_currentCaseIds;
|
|
|
|
QString m_currentProgram;
|
|
|
|
QStringList m_currentArguments;
|
|
|
|
|
2013-04-19 01:02:36 -05:00
|
|
|
RiaPreferences* m_preferences;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-19 01:02:36 -05:00
|
|
|
std::map<QString, QString> m_fileDialogDefaultDirectories;
|
|
|
|
QString m_startupDefaultDirectory;
|
2012-10-23 02:59:57 -05:00
|
|
|
|
2013-04-19 01:02:36 -05:00
|
|
|
cvf::ref<cvf::Font> m_standardFont;
|
2016-08-09 06:09:08 -05:00
|
|
|
cvf::ref<cvf::Font> m_customFont;
|
2013-09-08 03:53:25 -05:00
|
|
|
|
|
|
|
QMap<QString, QVariant> m_sessionCache; // Session cache used to store username/passwords per session
|
2013-09-12 01:11:56 -05:00
|
|
|
|
2015-06-26 06:44:16 -05:00
|
|
|
std::list<RimCommandObject*> m_commandQueue;
|
|
|
|
QMutex m_commandQueueLock;
|
2013-12-19 03:45:15 -06:00
|
|
|
|
2015-06-26 06:44:16 -05:00
|
|
|
QString m_helpText;
|
2016-06-27 04:07:01 -05:00
|
|
|
|
2017-07-31 04:10:22 -05:00
|
|
|
bool m_runningWorkerProcess;
|
|
|
|
|
2018-04-26 23:28:08 -05:00
|
|
|
RiuPlotMainWindow* m_mainPlotWindow;
|
2016-10-05 01:23:07 -05:00
|
|
|
|
|
|
|
std::unique_ptr<RiuRecentFileActionProvider> m_recentFileActionProvider;
|
2012-05-18 02:45:23 -05:00
|
|
|
};
|