2012-05-18 02:45:23 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
|
|
|
|
//
|
|
|
|
// 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
|
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>
|
|
|
|
|
|
|
|
class RIProcess;
|
2013-03-22 09:43:42 -05:00
|
|
|
class RigCaseData;
|
|
|
|
class RimCase;
|
2012-05-18 02:45:23 -05:00
|
|
|
class Drawable;
|
|
|
|
class RiaSocketServer;
|
2013-03-22 09:50:44 -05:00
|
|
|
class RiaPreferences;
|
2013-05-06 03:55:00 -05:00
|
|
|
class RimReservoirView;
|
|
|
|
class RimProject;
|
2013-09-12 01:11:56 -05:00
|
|
|
class RimCommandObject;
|
2013-12-04 05:04:42 -06:00
|
|
|
class RiaProjectModifier;
|
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,
|
|
|
|
NAVIGATION_POLICY_CAD
|
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
bool parseArguments();
|
|
|
|
|
2013-09-27 03:04:10 -05:00
|
|
|
void executeRegressionTests(const QString& regressionTestPath);
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
void setActiveReservoirView(RimReservoirView*);
|
|
|
|
RimReservoirView* activeReservoirView();
|
|
|
|
const RimReservoirView* activeReservoirView() const;
|
|
|
|
|
2013-09-07 03:27:22 -05:00
|
|
|
void scheduleDisplayModelUpdateAndRedraw(RimReservoirView* resViewToUpdate);
|
|
|
|
|
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
|
|
|
|
2012-10-23 02:59:57 -05:00
|
|
|
QString defaultFileDialogDirectory(const QString& dialogName);
|
|
|
|
void setDefaultFileDialogDirectory(const QString& dialogName, const QString& defaultDirectory);
|
|
|
|
|
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
|
|
|
|
|
|
|
QString currentProjectFileName() 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();
|
|
|
|
bool closeProject(bool askToSaveIfDirty);
|
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);
|
|
|
|
|
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();
|
2014-07-31 03:05:16 -05:00
|
|
|
void readFieldsFromApplicationStore(caf::PdmObject* object, const QString context = "");
|
|
|
|
void writeFieldsToApplicationStore(const caf::PdmObject* object, const QString context = "");
|
2012-05-18 02:45:23 -05:00
|
|
|
void applyPreferences();
|
|
|
|
|
2013-04-19 01:02:36 -05:00
|
|
|
cvf::Font* standardFont();
|
|
|
|
|
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();
|
|
|
|
|
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();
|
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:
|
2013-04-19 01:02:36 -05:00
|
|
|
caf::PdmPointer<RimReservoirView> m_activeReservoirView;
|
|
|
|
caf::PdmPointer<RimProject> m_project;
|
|
|
|
|
2013-09-07 03:27:22 -05:00
|
|
|
std::vector<caf::PdmPointer<RimReservoirView> > m_resViewsToUpdate;
|
|
|
|
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;
|
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
|
|
|
|
|
|
|
std::list<RimCommandObject*> m_commandQueue;
|
2013-09-13 02:23:33 -05:00
|
|
|
QMutex m_commandQueueLock;
|
2013-12-19 03:45:15 -06:00
|
|
|
|
|
|
|
QString m_helpText;
|
2012-05-18 02:45:23 -05:00
|
|
|
};
|