Skip to content

Commit

Permalink
Merge dev into master as release v2016.11 (pull request #1008)
Browse files Browse the repository at this point in the history
Release v2016.11
  • Loading branch information
JacobStoren authored Nov 29, 2016
2 parents a61a3b3 + 1a636a8 commit 6e2a87c
Show file tree
Hide file tree
Showing 6,661 changed files with 284,730 additions and 124,810 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
789 changes: 600 additions & 189 deletions ApplicationCode/Application/RiaApplication.cpp

Large diffs are not rendered by default.

66 changes: 52 additions & 14 deletions ApplicationCode/Application/RiaApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
/////////////////////////////////////////////////////////////////////////////////

#pragma once

#include <QApplication>
#include <QProcess>
#include <QMutex>
Expand All @@ -30,20 +31,32 @@
#include "cvfFont.h"

#include <iostream>
#include <memory>

class QAction;

class Drawable;

class RIProcess;

class RiaPreferences;
class RiaProjectModifier;
class RiaSocketServer;

class RigCaseData;

class RimCommandObject;
class RimEclipseCase;
class Drawable;
class RiaSocketServer;
class RiaPreferences;
class RimEclipseView;
class RimView;
class RimProject;
class RimCommandObject;
class RiaProjectModifier;
class RimSummaryPlot;
class RimView;
class RimViewWindow;
class RimWellLogPlot;

class RiuMainPlotWindow;
class RiuRecentFileActionProvider;

namespace caf
{
class UiProcess;
Expand Down Expand Up @@ -84,6 +97,9 @@ class RiaApplication : public QApplication
void setActiveWellLogPlot(RimWellLogPlot*);
RimWellLogPlot* activeWellLogPlot();

void setActiveSummaryPlot(RimSummaryPlot*);
RimSummaryPlot* activeSummaryPlot();

void scheduleDisplayModelUpdateAndRedraw(RimView* resViewToUpdate);

RimProject* project();
Expand All @@ -94,29 +110,28 @@ class RiaApplication : public QApplication
void createMockModelCustomized();
void createInputMockModel();

QString defaultFileDialogDirectory(const QString& dialogName);
void setDefaultFileDialogDirectory(const QString& dialogName, const QString& defaultDirectory);
QString lastUsedDialogDirectory(const QString& dialogName);
QString lastUsedDialogDirectoryWithFallback(const QString& dialogName, const QString& fallbackDirectory);
void setLastUsedDialogDirectory(const QString& dialogName, const QString& directory);

bool openFile(const QString& fileName);
bool openEclipseCaseFromFile(const QString& fileName);
bool openEclipseCase(const QString& caseName, const QString& caseFileName);
bool addEclipseCases(const QStringList& fileNames);
bool openInputEclipseCaseFromFileNames(const QStringList& fileNames);

bool openOdbCaseFromFile(const QString& fileName);

QString currentProjectFileName() const;
QString currentProjectPath() const;
QString createAbsolutePathFromProjectRelativePath(QString projectRelativePath);
bool loadProject(const QString& projectFileName);
bool saveProject();
bool saveProjectAs(const QString& fileName);
bool saveProjectPromptForFileName();
bool closeProject(bool askToSaveIfDirty);
void closeProject();
void addWellPathsToModel(QList<QString> wellPathFilePaths);
void addWellLogsToModel(const QList<QString>& wellLogFilePaths);

void copySnapshotToClipboard();
void saveSnapshotPromtpForFilename();
void saveSnapshotAs(const QString& fileName);
void saveSnapshotForAllViews(const QString& snapshotFolderName);
void runMultiCaseSnapshots(const QString& templateProjectFileName, std::vector<QString> gridFileNames, const QString& snapshotFolderName);
void runRegressionTest(const QString& testRootPath);
Expand Down Expand Up @@ -148,6 +163,7 @@ class RiaApplication : public QApplication
void applyPreferences();

cvf::Font* standardFont();
cvf::Font* customFont();

QString commandLineParameterHelp() const;
void showFormattedTextInMessageBox(const QString& text);
Expand All @@ -163,6 +179,17 @@ class RiaApplication : public QApplication
int launchUnitTests();
int launchUnitTestsWithConsole();

RiuMainPlotWindow* getOrCreateAndShowMainPlotWindow();
RiuMainPlotWindow* mainPlotWindow();

static RimViewWindow* activeViewWindow();

bool tryCloseMainWindow();
bool tryClosePlotWindow();

void addToRecentFiles(const QString& fileName);
std::vector<QAction*> recentFileActions() const;

private:
enum ProjectLoadAction
{
Expand All @@ -171,13 +198,18 @@ class RiaApplication : public QApplication
};

bool loadProject(const QString& projectFileName, ProjectLoadAction loadAction, RiaProjectModifier* projectModifier);

void onProjectOpenedOrClosed();
std::vector<QString> readFileListFromTextFile(QString listFileName);
void setWindowCaptionFromAppState();

QImage grabFrameBufferImage();
void clearViewsScheduledForUpdate();

void createMainPlotWindow();
void deleteMainPlotWindow();

void loadAndUpdatePlotData();

private slots:
void slotWorkerProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);

Expand All @@ -186,6 +218,7 @@ private slots:
private:
caf::PdmPointer<RimView> m_activeReservoirView;
caf::PdmPointer<RimWellLogPlot> m_activeWellLogPlot;
caf::PdmPointer<RimSummaryPlot> m_activeSummaryPlot;

caf::PdmPointer<RimProject> m_project;

Expand All @@ -207,6 +240,7 @@ private slots:
QString m_startupDefaultDirectory;

cvf::ref<cvf::Font> m_standardFont;
cvf::ref<cvf::Font> m_customFont;

QMap<QString, QVariant> m_sessionCache; // Session cache used to store username/passwords per session

Expand All @@ -215,4 +249,8 @@ private slots:

QString m_helpText;
bool m_runningRegressionTests;

RiuMainPlotWindow* m_mainPlotWindow;

std::unique_ptr<RiuRecentFileActionProvider> m_recentFileActionProvider;
};
128 changes: 89 additions & 39 deletions ApplicationCode/Application/RiaPreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ RiaPreferences::RiaPreferences(void)

CAF_PDM_InitField(&defaultViewerBackgroundColor, "defaultViewerBackgroundColor", cvf::Color3f(0.69f, 0.77f, 0.87f), "Viewer background", "", "The viewer background color for new views", "");

CAF_PDM_InitField(&defaultScaleFactorZ, "defaultScaleFactorZ", 5, "Z scale factor", "", "", "");
CAF_PDM_InitField(&defaultScaleFactorZ, "defaultScaleFactorZ", 5, "Default Z scale factor", "", "", "");
CAF_PDM_InitField(&fontSizeInScene, "fontSizeInScene", QString("8"), "Font size", "", "", "");

CAF_PDM_InitField(&showLasCurveWithoutTvdWarning, "showLasCurveWithoutTvdWarning", true, "Show LAS curve without TVD warning", "", "", "");
showLasCurveWithoutTvdWarning.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);

Expand All @@ -81,8 +83,17 @@ RiaPreferences::RiaPreferences(void)
CAF_PDM_InitField(&loadAndShowSoil, "loadAndShowSoil", true, "Load and show SOIL", "", "", "");
loadAndShowSoil.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);

readerSettings = new RifReaderSettings;
CAF_PDM_InitFieldNoDefault(&readerSettings, "readerSettings", "Reader settings", "", "", "");
readerSettings = new RifReaderSettings;

CAF_PDM_InitField(&autoCreatePlotsOnImport, "AutoCreatePlotsOnImport", true, "Create Summary Plots When Importing Eclipse Case", "", "", "");
autoCreatePlotsOnImport.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);

CAF_PDM_InitField(&defaultCurveFilter, "DefaultCurveFilter", QString("F*PT"), "Default Vector Selection Filter", "", "", "");

m_tabNames << "General";
m_tabNames << "Octave";
m_tabNames << "Summary";
}

//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -115,7 +126,8 @@ void RiaPreferences::defineEditorAttribute(const caf::PdmFieldHandle* field, QSt
field == &useShaders ||
field == &showHud ||
field == &appendClassNameToUiText ||
field == &showLasCurveWithoutTvdWarning )
field == &showLasCurveWithoutTvdWarning ||
field == &autoCreatePlotsOnImport)
{
caf::PdmUiCheckBoxEditorAttribute* myAttr = static_cast<caf::PdmUiCheckBoxEditorAttribute*>(attribute);
if (myAttr)
Expand All @@ -130,51 +142,89 @@ void RiaPreferences::defineEditorAttribute(const caf::PdmFieldHandle* field, QSt
//--------------------------------------------------------------------------------------------------
void RiaPreferences::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
uiOrdering.add(&navigationPolicy);

caf::PdmUiGroup* scriptGroup = uiOrdering.addNewGroup("Script configuration");
scriptGroup->add(&scriptDirectories);
scriptGroup->add(&scriptEditorExecutable);

caf::PdmUiGroup* octaveGroup = uiOrdering.addNewGroup("Octave");
octaveGroup->add(&octaveExecutable);
octaveGroup->add(&octaveShowHeaderInfoWhenExecutingScripts);

caf::PdmUiGroup* defaultSettingsGroup = uiOrdering.addNewGroup("Default settings");
defaultSettingsGroup->add(&defaultScaleFactorZ);
defaultSettingsGroup->add(&defaultViewerBackgroundColor);
defaultSettingsGroup->add(&defaultGridLines);
defaultSettingsGroup->add(&defaultGridLineColors);
defaultSettingsGroup->add(&defaultFaultGridLineColors);
defaultSettingsGroup->add(&defaultWellLabelColor);
defaultSettingsGroup->add(&showLasCurveWithoutTvdWarning);

caf::PdmUiGroup* autoComputeGroup = uiOrdering.addNewGroup("Behavior when loading new case");
autoComputeGroup->add(&autocomputeDepthRelatedProperties);
autoComputeGroup->add(&loadAndShowSoil);
if (uiConfigName == m_tabNames[0])
{
caf::PdmUiGroup* defaultSettingsGroup = uiOrdering.addNewGroup("Default settings");
defaultSettingsGroup->add(&defaultViewerBackgroundColor);
defaultSettingsGroup->add(&defaultGridLines);
defaultSettingsGroup->add(&defaultGridLineColors);
defaultSettingsGroup->add(&defaultFaultGridLineColors);
defaultSettingsGroup->add(&defaultWellLabelColor);
defaultSettingsGroup->add(&fontSizeInScene);

caf::PdmUiGroup* viewsGroup = uiOrdering.addNewGroup("3D views");
viewsGroup->add(&navigationPolicy);
viewsGroup->add(&useShaders);
viewsGroup->add(&showHud);

caf::PdmUiGroup* newCaseBehaviourGroup = uiOrdering.addNewGroup("Behavior when loading new case");
newCaseBehaviourGroup->add(&defaultScaleFactorZ);
newCaseBehaviourGroup->add(&autocomputeDepthRelatedProperties);
newCaseBehaviourGroup->add(&loadAndShowSoil);
newCaseBehaviourGroup->add(&showLasCurveWithoutTvdWarning);

caf::PdmUiGroup* readerSettingsGroup = uiOrdering.addNewGroup("Reader settings");
std::vector<caf::PdmFieldHandle*> readerSettingsFields;
readerSettings->fields(readerSettingsFields);
for (size_t i = 0; i < readerSettingsFields.size(); i++)
std::vector<caf::PdmFieldHandle*> readerSettingsFields;
readerSettings->fields(readerSettingsFields);
for (size_t i = 0; i < readerSettingsFields.size(); i++)
{
newCaseBehaviourGroup->add(readerSettingsFields[i]);
}

caf::PdmUiGroup* ssihubGroup = uiOrdering.addNewGroup("SSIHUB");
ssihubGroup->add(&ssihubAddress);

uiOrdering.add(&appendClassNameToUiText);
}
else if (uiConfigName == m_tabNames[1])
{
readerSettingsGroup->add(readerSettingsFields[i]);
caf::PdmUiGroup* octaveGroup = uiOrdering.addNewGroup("Octave");
octaveGroup->add(&octaveExecutable);
octaveGroup->add(&octaveShowHeaderInfoWhenExecutingScripts);

caf::PdmUiGroup* scriptGroup = uiOrdering.addNewGroup("Script files");
scriptGroup->add(&scriptDirectories);
scriptGroup->add(&scriptEditorExecutable);
}
else if (uiConfigName == m_tabNames[2])
{
uiOrdering.add(&autoCreatePlotsOnImport);
uiOrdering.add(&defaultCurveFilter);
}

uiOrdering.setForgetRemainingFields(true);
}

//--------------------------------------------------------------------------------------------------
/// This function is called as part of the regression test system to make sure the configuration
/// for regression tests is consistent
///
//--------------------------------------------------------------------------------------------------
void RiaPreferences::configureForRegressionTests()
QList<caf::PdmOptionItemInfo> RiaPreferences::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
{
useShaders = true;
showHud = false;
QList<caf::PdmOptionItemInfo> options;
*useOptionsOnly = true;

autocomputeDepthRelatedProperties = true;
loadAndShowSoil = true;
if (&fontSizeInScene == fieldNeedingOptions)
{
QStringList fontSizes;
fontSizes << "8";
fontSizes << "12";
fontSizes << "16";
fontSizes << "24";
fontSizes << "32";

for (int oIdx = 0; oIdx < fontSizes.size(); ++oIdx)
{
options.push_back(caf::PdmOptionItemInfo(fontSizes[oIdx], fontSizes[oIdx]));
}
}

CVF_ASSERT(readerSettings);
readerSettings->importFaults = false;
return options;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QStringList RiaPreferences::tabNames()
{
return m_tabNames;
}

17 changes: 13 additions & 4 deletions ApplicationCode/Application/RiaPreferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class RiaPreferences : public caf::PdmObject
RiaPreferences(void);
virtual ~RiaPreferences(void);

void configureForRegressionTests();
QStringList tabNames();

public: // Pdm Fields
caf::PdmField<caf::AppEnum< RiaApplication::RINavigationPolicy > > navigationPolicy;
Expand All @@ -60,7 +60,7 @@ class RiaPreferences : public caf::PdmObject
caf::PdmField<cvf::Color3f> defaultViewerBackgroundColor;
caf::PdmField<cvf::Color3f> defaultWellLabelColor;
caf::PdmField<bool> showLasCurveWithoutTvdWarning;

caf::PdmField<QString> fontSizeInScene;

caf::PdmField<bool> useShaders;
caf::PdmField<bool> showHud;
Expand All @@ -73,8 +73,17 @@ class RiaPreferences : public caf::PdmObject

caf::PdmChildField<RifReaderSettings*> readerSettings;

// Summary

caf::PdmField<bool> autoCreatePlotsOnImport;
caf::PdmField<QString> defaultCurveFilter;


protected:
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute);
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute);
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);

virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) ;
private:
QStringList m_tabNames;
};
Loading

0 comments on commit 6e2a87c

Please sign in to comment.