Skip to content

Commit

Permalink
#1028 Flow Diag Solution object. #1029 Flow Diag Result type in Resul…
Browse files Browse the repository at this point in the history
…t Definition along with some refactoring.
  • Loading branch information
JacobStoren committed Dec 14, 2016
1 parent cd6ee64 commit 8f65bd3
Show file tree
Hide file tree
Showing 9 changed files with 458 additions and 85 deletions.
2 changes: 2 additions & 0 deletions ApplicationCode/ProjectDataModel/CMakeLists_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ ${CEE_CURRENT_LIST_DIR}RimFault.h
${CEE_CURRENT_LIST_DIR}RimFaultCollection.h
${CEE_CURRENT_LIST_DIR}RimFormationNames.h
${CEE_CURRENT_LIST_DIR}RimFormationNamesCollection.h
${CEE_CURRENT_LIST_DIR}RimFlowDiagSolution.h
${CEE_CURRENT_LIST_DIR}RimMockModelSettings.h
${CEE_CURRENT_LIST_DIR}RimTernaryLegendConfig.h
${CEE_CURRENT_LIST_DIR}RimEclipseFaultColors.h
Expand Down Expand Up @@ -128,6 +129,7 @@ ${CEE_CURRENT_LIST_DIR}RimFault.cpp
${CEE_CURRENT_LIST_DIR}RimFaultCollection.cpp
${CEE_CURRENT_LIST_DIR}RimFormationNames.cpp
${CEE_CURRENT_LIST_DIR}RimFormationNamesCollection.cpp
${CEE_CURRENT_LIST_DIR}RimFlowDiagSolution.cpp
${CEE_CURRENT_LIST_DIR}RimMockModelSettings.cpp
${CEE_CURRENT_LIST_DIR}RimTernaryLegendConfig.cpp
${CEE_CURRENT_LIST_DIR}RimEclipseFaultColors.cpp
Expand Down
1 change: 1 addition & 0 deletions ApplicationCode/ProjectDataModel/RimDefines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ namespace caf
addItem(RimDefines::GENERATED, "GENERATED", "Generated");
addItem(RimDefines::INPUT_PROPERTY, "INPUT_PROPERTY", "Input Property");
addItem(RimDefines::FORMATION_NAMES, "FORMATION_NAMES", "Formation Names");
addItem(RimDefines::FLOW_DIAGNOSTICS, "FLOW_DIAGNOSTICS", "Flow Diagnostics");
setDefault(RimDefines::DYNAMIC_NATIVE);
}

Expand Down
1 change: 1 addition & 0 deletions ApplicationCode/ProjectDataModel/RimDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class RimDefines
GENERATED,
INPUT_PROPERTY,
FORMATION_NAMES,
FLOW_DIAGNOSTICS,
REMOVED
};

Expand Down
21 changes: 21 additions & 0 deletions ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "RimProject.h"
#include "RimReservoirCellResultsStorage.h"
#include "RimTools.h"
#include "RimFlowDiagSolution.h"

#include "cafPdmSettings.h"
#include "cafPdmUiPropertyViewDialog.h"
Expand All @@ -55,6 +56,11 @@ RimEclipseResultCase::RimEclipseResultCase()
CAF_PDM_InitField(&caseFileName, "CaseFileName", QString(), "Case file name", "", "" ,"");
caseFileName.uiCapability()->setUiReadOnly(true);

CAF_PDM_InitFieldNoDefault (&m_flowDiagSolutions, "FlowDiagSolutions", "Flow Diagnostics Solutions", "", "", "");

// TODO: Create a solution by default only when flux data is available
m_flowDiagSolutions.push_back( new RimFlowDiagSolution());

// Obsolete, unused field
CAF_PDM_InitField(&caseDirectory, "CaseFolder", QString(), "Directory", "", "" ,"");
caseDirectory.xmlCapability()->setIOWritable(false);
Expand Down Expand Up @@ -298,6 +304,7 @@ cvf::ref<RifReaderInterface> RimEclipseResultCase::createMockModel(QString model
RimEclipseResultCase::~RimEclipseResultCase()
{
reservoirViews.deleteAllChildObjects();
m_flowDiagSolutions.deleteAllChildObjects();
}

//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -336,6 +343,20 @@ void RimEclipseResultCase::updateFilePathsFromProjectPath(const QString& newProj
}


//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimFlowDiagSolution*> RimEclipseResultCase::flowDiagSolutions()
{
std::vector<RimFlowDiagSolution*> flowSols;
for ( const caf::PdmPointer<RimFlowDiagSolution>& fsol: m_flowDiagSolutions )
{
flowSols.push_back(fsol.p());
}

return flowSols;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions ApplicationCode/ProjectDataModel/RimEclipseResultCase.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

class RifReaderInterface;
class RigMainGrid;
class RimFlowDiagSolution;

//==================================================================================================
//
Expand All @@ -50,6 +51,7 @@ class RimEclipseResultCase : public RimEclipseCase
virtual QString gridFileName() const { return caseFileName();}
virtual void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath);

std::vector<RimFlowDiagSolution*> flowDiagSolutions();
private:
cvf::ref<RifReaderInterface> createMockModel(QString modelName);

Expand All @@ -59,6 +61,8 @@ class RimEclipseResultCase : public RimEclipseCase

// Fields:
caf::PdmField<QString> caseFileName;
caf::PdmChildArrayField<RimFlowDiagSolution*> m_flowDiagSolutions;


// Obsolete field
caf::PdmField<QString> caseDirectory;
Expand Down
Loading

0 comments on commit 8f65bd3

Please sign in to comment.