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-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;
|
|
|
|
|
2013-03-22 09:43:42 -05:00
|
|
|
class RigCaseData;
|
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;
|
2013-05-06 03:55:00 -05:00
|
|
|
class RimProject;
|
2016-06-28 03:58:22 -05:00
|
|
|
class RimSummaryPlot;
|
|
|
|
class RimView;
|
2016-08-31 10:34:31 -05:00
|
|
|
class RimViewWindow;
|
2015-09-10 01:14:28 -05:00
|
|
|
class RimWellLogPlot;
|
2016-06-28 03:58:22 -05:00
|
|
|
|
2016-06-27 04:07:01 -05:00
|
|
|
class RiuMainPlotWindow;
|
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
|
|
|
};
|
|
|
|
|
|
|
|
public:
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication(int& argc, char** argv);
|
|
|
|
~RiaApplication();
|
|
|
|
static RiaApplication* instance();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2015-12-03 03:33:38 -06:00
|
|
|
int parseArgumentsAndRunUnitTestsIfRequested();
|
2012-05-18 02:45:23 -05:00
|
|
|
bool parseArguments();
|
|
|
|
|
2013-09-27 03:04:10 -05:00
|
|
|
void executeRegressionTests(const QString& regressionTestPath);
|
|
|
|
|
2015-05-08 07:13:26 -05:00
|
|
|
void setActiveReservoirView(RimView*);
|
|
|
|
RimView* activeReservoirView();
|
|
|
|
const RimView* activeReservoirView() const;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2015-09-10 01:14:28 -05:00
|
|
|
void setActiveWellLogPlot(RimWellLogPlot*);
|
|
|
|
RimWellLogPlot* activeWellLogPlot();
|
|
|
|
|
2016-06-28 03:58:22 -05:00
|
|
|
void setActiveSummaryPlot(RimSummaryPlot*);
|
|
|
|
RimSummaryPlot* activeSummaryPlot();
|
|
|
|
|
2015-04-30 03:34:15 -05:00
|
|
|
void scheduleDisplayModelUpdateAndRedraw(RimView* resViewToUpdate);
|
2013-09-07 03:27:22 -05:00
|
|
|
|
2013-05-06 03:55:00 -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
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
bool openEclipseCaseFromFile(const QString& fileName);
|
2012-06-26 09:10:41 -05:00
|
|
|
bool openEclipseCase(const QString& caseName, const QString& caseFileName);
|
2013-02-27 08:27:33 -06:00
|
|
|
bool addEclipseCases(const QStringList& fileNames);
|
2013-10-08 07:28:01 -05:00
|
|
|
bool openInputEclipseCaseFromFileNames(const QStringList& fileNames);
|
2012-06-26 09:10:41 -05:00
|
|
|
|
2015-04-20 02:02:33 -05:00
|
|
|
bool openOdbCaseFromFile(const QString& fileName);
|
|
|
|
|
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);
|
2012-05-18 02:45:23 -05:00
|
|
|
bool saveProject();
|
|
|
|
bool saveProjectAs(const QString& fileName);
|
|
|
|
bool saveProjectPromptForFileName();
|
2016-10-04 04:02:56 -05:00
|
|
|
void closeProject();
|
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);
|
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-02-06 04:43:26 -06:00
|
|
|
void copySnapshotToClipboard();
|
|
|
|
void saveSnapshotPromtpForFilename();
|
|
|
|
void saveSnapshotAs(const QString& fileName);
|
2013-02-08 10:04:35 -06:00
|
|
|
void saveSnapshotForAllViews(const QString& snapshotFolderName);
|
2013-12-04 05:04:42 -06:00
|
|
|
void runMultiCaseSnapshots(const QString& templateProjectFileName, std::vector<QString> gridFileNames, const QString& snapshotFolderName);
|
2013-02-08 10:04:35 -06:00
|
|
|
void runRegressionTest(const QString& testRootPath);
|
|
|
|
void updateRegressionTest(const QString& testRootPath );
|
2014-01-23 06:17:49 -06:00
|
|
|
void regressionTestConfigureProject();
|
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();
|
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-06-26 06:44:16 -05:00
|
|
|
bool isRunningRegressionTests() const;
|
|
|
|
|
2015-12-03 03:33:38 -06:00
|
|
|
int launchUnitTests();
|
|
|
|
int launchUnitTestsWithConsole();
|
2015-10-05 09:09:51 -05:00
|
|
|
|
2016-06-27 07:00:19 -05:00
|
|
|
RiuMainPlotWindow* getOrCreateAndShowMainPlotWindow();
|
2016-06-27 04:07:01 -05:00
|
|
|
RiuMainPlotWindow* mainPlotWindow();
|
|
|
|
|
2016-08-31 10:34:31 -05:00
|
|
|
static RimViewWindow* activeViewWindow();
|
|
|
|
|
2016-10-04 02:29:45 -05:00
|
|
|
bool tryCloseMainWindow();
|
|
|
|
bool tryClosePlotWindow();
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
private:
|
2013-12-04 05:04:42 -06:00
|
|
|
enum ProjectLoadAction
|
|
|
|
{
|
|
|
|
PLA_NONE = 0,
|
|
|
|
PLA_CALCULATE_STATISTICS = 1
|
|
|
|
};
|
|
|
|
|
|
|
|
bool loadProject(const QString& projectFileName, ProjectLoadAction loadAction, RiaProjectModifier* projectModifier);
|
|
|
|
void onProjectOpenedOrClosed();
|
|
|
|
std::vector<QString> readFileListFromTextFile(QString listFileName);
|
|
|
|
void setWindowCaptionFromAppState();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-12-04 05:04:42 -06:00
|
|
|
QImage grabFrameBufferImage();
|
2015-10-23 07:13:14 -05:00
|
|
|
void clearViewsScheduledForUpdate();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2016-06-27 04:07:01 -05:00
|
|
|
void createMainPlotWindow();
|
|
|
|
void deleteMainPlotWindow();
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
private slots:
|
|
|
|
void slotWorkerProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
2013-02-08 10:04:35 -06:00
|
|
|
|
2013-09-07 03:27:22 -05:00
|
|
|
void slotUpdateScheduledDisplayModels();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
private:
|
2015-05-08 07:13:26 -05:00
|
|
|
caf::PdmPointer<RimView> m_activeReservoirView;
|
2015-09-10 01:14:28 -05:00
|
|
|
caf::PdmPointer<RimWellLogPlot> m_activeWellLogPlot;
|
2016-06-28 03:58:22 -05:00
|
|
|
caf::PdmPointer<RimSummaryPlot> m_activeSummaryPlot;
|
2015-09-10 01:14:28 -05:00
|
|
|
|
2013-04-19 01:02:36 -05:00
|
|
|
caf::PdmPointer<RimProject> m_project;
|
|
|
|
|
2015-04-30 03:34:15 -05:00
|
|
|
std::vector<caf::PdmPointer<RimView> > m_resViewsToUpdate;
|
2013-09-07 03:27:22 -05:00
|
|
|
QTimer* m_resViewUpdateTimer;
|
|
|
|
|
2013-04-19 01:02:36 -05:00
|
|
|
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;
|
|
|
|
bool m_runningRegressionTests;
|
2016-06-27 04:07:01 -05:00
|
|
|
|
|
|
|
RiuMainPlotWindow* m_mainPlotWindow;
|
2012-05-18 02:45:23 -05:00
|
|
|
};
|