mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge fixes related to #1901 Perforation COMPDAT export errors
This commit is contained in:
@@ -90,6 +90,9 @@ ${CEE_CURRENT_LIST_DIR}RimGeometrySelectionItem.h
|
||||
${CEE_CURRENT_LIST_DIR}RimEclipseGeometrySelectionItem.h
|
||||
${CEE_CURRENT_LIST_DIR}RimDialogData.h
|
||||
${CEE_CURRENT_LIST_DIR}RimTimeStepFilter.h
|
||||
${CEE_CURRENT_LIST_DIR}RimObservedData.h
|
||||
${CEE_CURRENT_LIST_DIR}RimObservedDataCollection.h
|
||||
${CEE_CURRENT_LIST_DIR}RimSummaryObservedDataFile.h
|
||||
)
|
||||
|
||||
if (RESINSIGHT_ENABLE_PROTOTYPE_FEATURE_FRACTURES)
|
||||
@@ -185,6 +188,9 @@ ${CEE_CURRENT_LIST_DIR}RimGeometrySelectionItem.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimEclipseGeometrySelectionItem.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimDialogData.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimTimeStepFilter.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimObservedData.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimObservedDataCollection.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimSummaryObservedDataFile.cpp
|
||||
)
|
||||
|
||||
if (RESINSIGHT_ENABLE_PROTOTYPE_FEATURE_FRACTURES)
|
||||
|
||||
@@ -35,9 +35,9 @@
|
||||
#include "RimEclipseWell.h"
|
||||
#include "RimEclipseWellCollection.h"
|
||||
#include "RimFault.h"
|
||||
#include "RimFlowCharacteristicsPlot.h"
|
||||
#include "RimFlowDiagSolution.h"
|
||||
#include "RimFlowPlotCollection.h"
|
||||
#include "RimFlowCharacteristicsPlot.h"
|
||||
#include "RimFormationNames.h"
|
||||
#include "RimFormationNamesCollection.h"
|
||||
#include "RimGeoMechCase.h"
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "RimIntersection.h"
|
||||
#include "RimIntersectionBox.h"
|
||||
#include "RimIntersectionCollection.h"
|
||||
#include "RimObservedData.h"
|
||||
#include "RimScriptCollection.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
@@ -322,7 +323,10 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
}
|
||||
else if (dynamic_cast<RimSummaryCase*>(uiItem))
|
||||
{
|
||||
commandIds << "RicNewSummaryPlotFeature";
|
||||
if (!dynamic_cast<RimObservedData*>(uiItem))
|
||||
{
|
||||
commandIds << "RicNewSummaryPlotFeature";
|
||||
}
|
||||
}
|
||||
else if (dynamic_cast<RimWellLogFileChannel*>(uiItem))
|
||||
{
|
||||
@@ -445,14 +449,16 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
commandIds << "RicFlyToObjectFeature";
|
||||
commandIds << "RicExportCarfin";
|
||||
|
||||
commandIds << "RicImportObservedDataFeature";
|
||||
commandIds << "RicPasteSummaryCaseFeature";
|
||||
commandIds << "RicReloadSummaryCaseFeature";
|
||||
commandIds << "RicCreateSummaryCaseCollectionFeature";
|
||||
commandIds << "Separator";
|
||||
commandIds << "RicCutReferencesToClipboardFeature";
|
||||
commandIds << "Separator";
|
||||
commandIds << "RicCloseSummaryCaseFeature";
|
||||
commandIds << "RicCloseSummaryCaseInCollectionFeature";
|
||||
commandIds << "RicDeleteSummaryCaseCollectionFeature";
|
||||
commandIds << "RicCutReferencesToClipboardFeature";
|
||||
|
||||
// Fracture commands
|
||||
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES
|
||||
|
||||
61
ApplicationCode/ProjectDataModel/RimObservedData.cpp
Normal file
61
ApplicationCode/ProjectDataModel/RimObservedData.cpp
Normal file
@@ -0,0 +1,61 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- Statoil ASA
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimObservedData.h"
|
||||
#include "RimTools.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimObservedData, "ObservedData");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimObservedData::RimObservedData()
|
||||
{
|
||||
m_isObservedData = true;
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_summaryCategory, "SummaryType", "Summary Type", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_identifierName, "IdentifierName", "Identifier Name", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimObservedData::summaryHeaderFilename() const
|
||||
{
|
||||
return m_summaryHeaderFilename();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimObservedData::caseName()
|
||||
{
|
||||
QFileInfo caseFileName(this->summaryHeaderFilename());
|
||||
|
||||
return caseFileName.completeBaseName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimObservedData::updateFilePathsFromProjectPath(const QString & newProjectPath, const QString & oldProjectPath)
|
||||
{
|
||||
m_summaryHeaderFilename = RimTools::relocateFile(m_summaryHeaderFilename(), newProjectPath, oldProjectPath, nullptr, nullptr);
|
||||
}
|
||||
46
ApplicationCode/ProjectDataModel/RimObservedData.h
Normal file
46
ApplicationCode/ProjectDataModel/RimObservedData.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- Statoil ASA
|
||||
//
|
||||
// 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
|
||||
|
||||
#include "RimSummaryCase.h"
|
||||
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cvfObject.h"
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
class RimObservedData : public RimSummaryCase
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
RimObservedData();
|
||||
|
||||
virtual QString summaryHeaderFilename() const override;
|
||||
virtual QString caseName() override;
|
||||
virtual void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath) override;
|
||||
|
||||
private:
|
||||
caf::PdmField<caf::AppEnum<RifEclipseSummaryAddress::SummaryVarCategory> > m_summaryCategory;
|
||||
caf::PdmField<QString> m_identifierName;
|
||||
};
|
||||
@@ -0,0 +1,90 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- Statoil ASA
|
||||
//
|
||||
// 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
|
||||
|
||||
#include "RimObservedDataCollection.h"
|
||||
#include "RimObservedData.h"
|
||||
#include "RimSummaryObservedDataFile.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimObservedDataCollection, "ObservedDataCollection");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimObservedDataCollection::RimObservedDataCollection()
|
||||
{
|
||||
CAF_PDM_InitObject("Observed Data", ":/Folder.png", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_observedDataArray, "ObservedDataArray", "", "", "", "");
|
||||
|
||||
m_observedDataArray.uiCapability()->setUiHidden(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimObservedDataCollection::~RimObservedDataCollection()
|
||||
{
|
||||
m_observedDataArray.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimObservedDataCollection::removeObservedData(RimObservedData* observedData)
|
||||
{
|
||||
m_observedDataArray.removeChildObject(observedData);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimObservedDataCollection::addObservedData(RimObservedData* observedData)
|
||||
{
|
||||
m_observedDataArray.push_back(observedData);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryObservedDataFile* RimObservedDataCollection::createAndAddObservedDataFromFileName(const QString& fileName)
|
||||
{
|
||||
RimSummaryObservedDataFile* newObservedData = new RimSummaryObservedDataFile();
|
||||
|
||||
this->m_observedDataArray.push_back(newObservedData);
|
||||
newObservedData->setSummaryHeaderFilename(fileName);
|
||||
newObservedData->updateOptionSensitivity();
|
||||
|
||||
this->updateConnectedEditors();
|
||||
|
||||
return newObservedData;
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimObservedData*> RimObservedDataCollection::allObservedData()
|
||||
{
|
||||
std::vector<RimObservedData*> allObservedData;
|
||||
|
||||
allObservedData.insert(allObservedData.begin(), m_observedDataArray.begin(), m_observedDataArray.end());
|
||||
|
||||
return allObservedData;
|
||||
}
|
||||
45
ApplicationCode/ProjectDataModel/RimObservedDataCollection.h
Normal file
45
ApplicationCode/ProjectDataModel/RimObservedDataCollection.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- Statoil ASA
|
||||
//
|
||||
// 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
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
|
||||
class RimObservedData;
|
||||
class RimSummaryObservedDataFile;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RimObservedDataCollection : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimObservedDataCollection();
|
||||
virtual ~RimObservedDataCollection();
|
||||
|
||||
void removeObservedData(RimObservedData* observedData);
|
||||
void addObservedData(RimObservedData* observedData);
|
||||
RimSummaryObservedDataFile* createAndAddObservedDataFromFileName(const QString& fileName);
|
||||
std::vector<RimObservedData*> allObservedData();
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RimObservedData*> m_observedDataArray;
|
||||
};
|
||||
@@ -28,6 +28,9 @@
|
||||
#endif // USE_PROTOTYPE_FEATURE_FRACTURES
|
||||
|
||||
#include "RimGeoMechModels.h"
|
||||
#include "RimObservedData.h"
|
||||
#include "RimObservedDataCollection.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
@@ -50,6 +53,7 @@ RimOilField::RimOilField(void)
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&summaryCaseMainCollection,"SummaryCaseCollection","Summary Cases",":/GridModels.png","","");
|
||||
CAF_PDM_InitFieldNoDefault(&formationNamesCollection,"FormationNamesCollection","Formations","","","");
|
||||
CAF_PDM_InitFieldNoDefault(&observedDataCollection, "ObservedDataCollection", "Observed data", ":/Cases16x16.png", "", "");
|
||||
|
||||
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES
|
||||
fractureDefinitionCollection = new RimFractureTemplateCollection();
|
||||
@@ -58,6 +62,7 @@ RimOilField::RimOilField(void)
|
||||
analysisModels = new RimEclipseCaseCollection();
|
||||
wellPathCollection = new RimWellPathCollection();
|
||||
summaryCaseMainCollection = new RimSummaryCaseMainCollection();
|
||||
observedDataCollection = new RimObservedDataCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -75,5 +80,74 @@ RimOilField::~RimOilField(void)
|
||||
if (analysisModels()) delete analysisModels();
|
||||
if (summaryCaseMainCollection()) delete summaryCaseMainCollection();
|
||||
if (formationNamesCollection()) delete formationNamesCollection();
|
||||
if (observedDataCollection()) delete observedDataCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimOilField::uniqueShortNameForCase(RimSummaryCase* summaryCase)
|
||||
{
|
||||
std::set<QString> allAutoShortNames;
|
||||
|
||||
std::vector<RimSummaryCase*> allCases = summaryCaseMainCollection->allSummaryCases();
|
||||
std::vector<RimObservedData*> observedDataCases = observedDataCollection->allObservedData();
|
||||
|
||||
for (RimObservedData* observedData : observedDataCases)
|
||||
{
|
||||
allCases.push_back(dynamic_cast<RimSummaryCase*>(observedData));
|
||||
}
|
||||
|
||||
for (RimSummaryCase* sumCase : allCases)
|
||||
{
|
||||
if (sumCase && sumCase != summaryCase)
|
||||
{
|
||||
allAutoShortNames.insert(sumCase->shortName());
|
||||
}
|
||||
}
|
||||
|
||||
bool foundUnique = false;
|
||||
|
||||
QString caseName = summaryCase->caseName();
|
||||
QString shortName;
|
||||
|
||||
if (caseName.size() > 2)
|
||||
{
|
||||
QString candidate;
|
||||
candidate += caseName[0];
|
||||
|
||||
for (int i = 1; i < caseName.size(); ++i)
|
||||
{
|
||||
if (allAutoShortNames.count(candidate + caseName[i]) == 0)
|
||||
{
|
||||
shortName = candidate + caseName[i];
|
||||
foundUnique = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
shortName = caseName.left(2);
|
||||
if (allAutoShortNames.count(shortName) == 0)
|
||||
{
|
||||
foundUnique = true;
|
||||
}
|
||||
}
|
||||
|
||||
QString candidate = shortName;
|
||||
int autoNumber = 0;
|
||||
|
||||
while (!foundUnique)
|
||||
{
|
||||
candidate = shortName + QString::number(autoNumber++);
|
||||
if (allAutoShortNames.count(candidate) == 0)
|
||||
{
|
||||
shortName = candidate;
|
||||
foundUnique = true;
|
||||
}
|
||||
}
|
||||
|
||||
return shortName;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,11 +26,13 @@
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
class RimEclipseCaseCollection;
|
||||
class RimGeoMechModels;
|
||||
class RimWellPathCollection;
|
||||
class RimFractureTemplateCollection;
|
||||
class RimSummaryCaseMainCollection;
|
||||
class RimFormationNamesCollection;
|
||||
class RimFractureTemplateCollection;
|
||||
class RimGeoMechModels;
|
||||
class RimObservedDataCollection;
|
||||
class RimSummaryCase;
|
||||
class RimSummaryCaseMainCollection;
|
||||
class RimWellPathCollection;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -44,11 +46,14 @@ public:
|
||||
RimOilField(void);
|
||||
virtual ~RimOilField(void);
|
||||
|
||||
QString uniqueShortNameForCase(RimSummaryCase* summaryCase);
|
||||
|
||||
caf::PdmChildField<RimEclipseCaseCollection*> analysisModels;
|
||||
caf::PdmChildField<RimGeoMechModels*> geoMechModels;
|
||||
caf::PdmChildField<RimWellPathCollection*> wellPathCollection;
|
||||
caf::PdmChildField<RimFractureTemplateCollection*> fractureDefinitionCollection;
|
||||
caf::PdmChildField<RimSummaryCaseMainCollection*> summaryCaseMainCollection;
|
||||
caf::PdmChildField<RimObservedDataCollection*> observedDataCollection;
|
||||
caf::PdmChildField<RimFormationNamesCollection*> formationNamesCollection;
|
||||
|
||||
};
|
||||
|
||||
@@ -272,6 +272,14 @@ bool RimPlotCurve::isCurveVisible() const
|
||||
return m_showCurve;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCurve::setCurveVisiblity(bool visible)
|
||||
{
|
||||
m_showCurve = visible;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -472,6 +480,18 @@ void RimPlotCurve::setLineThickness(int thickness)
|
||||
m_curveThickness = thickness;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCurve::resetAppearance()
|
||||
{
|
||||
setColor(cvf::Color3f(cvf::Color3::BLACK));
|
||||
setLineThickness(2);
|
||||
setLineStyle(STYLE_SOLID);
|
||||
setSymbol(SYMBOL_NONE);
|
||||
setSymbolSkipDinstance(10);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -80,9 +80,10 @@ public:
|
||||
void setSymbol(PointSymbolEnum symbolStyle);
|
||||
void setSymbolSkipDinstance(float distance);
|
||||
void setLineThickness(int thickness);
|
||||
|
||||
void resetAppearance();
|
||||
bool isCurveVisible() const;
|
||||
|
||||
void setCurveVisiblity(bool visible);
|
||||
|
||||
void updateCurveName();
|
||||
QString curveName() const { return m_curveName; }
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "RimIdenticalGridCaseGroup.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimMultiSnapshotDefinition.h"
|
||||
#include "RimObservedDataCollection.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimScriptCollection.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
@@ -548,6 +549,24 @@ void RimProject::allSummaryCases(std::vector<RimSummaryCase*>& sumCases)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimProject::allObservedData(std::vector<RimObservedData*>& observedData)
|
||||
{
|
||||
for (RimOilField* oilField : oilFields)
|
||||
{
|
||||
if (!oilField) continue;
|
||||
RimObservedDataCollection* observedDataCollection = oilField->observedDataCollection();
|
||||
if (observedDataCollection)
|
||||
{
|
||||
observedData.clear();
|
||||
std::vector<RimObservedData*> allObservedData = observedDataCollection->allObservedData();
|
||||
observedData.insert(observedData.end(), allObservedData.begin(), allObservedData.end());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -630,6 +649,18 @@ void RimProject::createDisplayModelAndRedrawAllViews()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimProject::allOilFields(std::vector<RimOilField*>& oilFields)
|
||||
{
|
||||
oilFields.clear();
|
||||
for (const auto& oilField : this->oilFields)
|
||||
{
|
||||
oilFields.push_back(oilField);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Currently there will be only one oil field in Resinsight, so return hardcoded first oil field
|
||||
/// from the RimOilField collection.
|
||||
@@ -855,7 +886,14 @@ void RimProject::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QS
|
||||
RimOilField* oilField = activeOilField();
|
||||
if (oilField)
|
||||
{
|
||||
if (oilField->summaryCaseMainCollection()) uiTreeOrdering.add(oilField->summaryCaseMainCollection());
|
||||
if (oilField->summaryCaseMainCollection())
|
||||
{
|
||||
uiTreeOrdering.add( oilField->summaryCaseMainCollection() );
|
||||
}
|
||||
if (oilField->observedDataCollection())
|
||||
{
|
||||
uiTreeOrdering.add( oilField->observedDataCollection() );
|
||||
}
|
||||
}
|
||||
|
||||
if (mainPlotCollection)
|
||||
|
||||
@@ -38,7 +38,8 @@ class RimDialogData;
|
||||
class RimEclipseCase;
|
||||
class RimIdenticalGridCaseGroup;
|
||||
class RimMainPlotCollection;
|
||||
class RimMultiSnapshotDefinition;
|
||||
class RimMultiSnapshotDefinition;
|
||||
class RimObservedData;
|
||||
class RimOilField;
|
||||
class RimScriptCollection;
|
||||
class RimSummaryCase;
|
||||
@@ -94,6 +95,7 @@ public:
|
||||
|
||||
void allCases(std::vector<RimCase*>& cases);
|
||||
void allSummaryCases(std::vector<RimSummaryCase*>& sumCases);
|
||||
void allObservedData(std::vector<RimObservedData*>& observedData);
|
||||
void allNotLinkedViews(std::vector<RimView*>& views);
|
||||
void allVisibleViews(std::vector<RimView*>& views);
|
||||
|
||||
@@ -101,8 +103,9 @@ public:
|
||||
|
||||
void computeUtmAreaOfInterest();
|
||||
|
||||
RimOilField* activeOilField();
|
||||
const RimOilField* activeOilField() const;
|
||||
void allOilFields(std::vector<RimOilField*>& oilFields);
|
||||
RimOilField* activeOilField();
|
||||
const RimOilField* activeOilField() const;
|
||||
|
||||
void actionsBasedOnSelection(QMenu& contextMenu);
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- Statoil ASA
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimSummaryObservedDataFile.h"
|
||||
|
||||
#include "RigObservedData.h"
|
||||
#include "RimTools.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimSummaryObservedDataFile, "SummaryObservedDataFile");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryObservedDataFile::RimSummaryObservedDataFile()
|
||||
{
|
||||
CAF_PDM_InitObject("Observed data file", ":/Default.png", "", "");
|
||||
m_summaryHeaderFilename.uiCapability()->setUiName("File");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryObservedDataFile::~RimSummaryObservedDataFile()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryObservedDataFile::setSummaryHeaderFilename(const QString& fileName)
|
||||
{
|
||||
m_summaryHeaderFilename = fileName;
|
||||
|
||||
this->updateAutoShortName();
|
||||
this->updateTreeItemName();
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- Statoil ASA
|
||||
//
|
||||
// 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
|
||||
|
||||
#include "RimObservedData.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cvfObject.h"
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
class RimSummaryObservedDataFile : public RimObservedData
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
RimSummaryObservedDataFile();
|
||||
virtual ~RimSummaryObservedDataFile();
|
||||
|
||||
void setSummaryHeaderFilename(const QString& fileName);
|
||||
};
|
||||
@@ -19,13 +19,15 @@
|
||||
#include "RimSummaryCase.h"
|
||||
|
||||
#include "RigSummaryCaseData.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
|
||||
CAF_PDM_ABSTRACT_SOURCE_INIT(RimSummaryCase,"SummaryCase");
|
||||
|
||||
@@ -41,6 +43,8 @@ RimSummaryCase::RimSummaryCase()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_summaryHeaderFilename, "SummaryHeaderFilename", "Summary Header File", "", "", "");
|
||||
m_summaryHeaderFilename.uiCapability()->setUiReadOnly(true);
|
||||
|
||||
m_isObservedData = false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -78,6 +82,14 @@ RigSummaryCaseData* RimSummaryCase::caseData()
|
||||
return m_summaryCaseData.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryCase::isObservedData()
|
||||
{
|
||||
return m_isObservedData;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -147,16 +159,16 @@ void RimSummaryCase::updateAutoShortName()
|
||||
{
|
||||
if(m_useAutoShortName)
|
||||
{
|
||||
RimSummaryCaseMainCollection* summaryCaseMainCollection = NULL;
|
||||
this->firstAncestorOrThisOfType(summaryCaseMainCollection);
|
||||
CVF_ASSERT(summaryCaseMainCollection);
|
||||
RimOilField* oilField = NULL;
|
||||
this->firstAncestorOrThisOfType(oilField);
|
||||
CVF_ASSERT(oilField);
|
||||
|
||||
m_shortName = summaryCaseMainCollection->uniqueShortNameForCase(this);
|
||||
updateTreeItemName();
|
||||
m_shortName = oilField->uniqueShortNameForCase(this);
|
||||
}
|
||||
else if (m_shortName() == QString("Display Name"))
|
||||
{
|
||||
m_shortName = caseName();
|
||||
updateTreeItemName();
|
||||
}
|
||||
|
||||
updateTreeItemName();
|
||||
}
|
||||
|
||||
@@ -51,14 +51,16 @@ public:
|
||||
|
||||
virtual void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath) = 0;
|
||||
|
||||
bool isObservedData();
|
||||
|
||||
protected:
|
||||
void updateTreeItemName();
|
||||
|
||||
caf::PdmField<QString> m_shortName;
|
||||
caf::PdmField<bool> m_useAutoShortName;
|
||||
caf::PdmField<QString> m_summaryHeaderFilename;
|
||||
|
||||
cvf::ref<RigSummaryCaseData> m_summaryCaseData;
|
||||
caf::PdmField<QString> m_shortName;
|
||||
caf::PdmField<bool> m_useAutoShortName;
|
||||
caf::PdmField<QString> m_summaryHeaderFilename;
|
||||
cvf::ref<RigSummaryCaseData> m_summaryCaseData;
|
||||
bool m_isObservedData;
|
||||
|
||||
private:
|
||||
// Overridden PDM methods
|
||||
|
||||
@@ -35,7 +35,8 @@ public:
|
||||
void removeCase(RimSummaryCase* summaryCase);
|
||||
void addCase(RimSummaryCase* summaryCase);
|
||||
|
||||
std::vector<RimSummaryCase*> allSummaryCases();
|
||||
std::vector<RimSummaryCase*> allSummaryCases();
|
||||
QString name() const { return m_name; }
|
||||
|
||||
private:
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
||||
|
||||
@@ -225,6 +225,32 @@ std::vector<RimSummaryCase*> RimSummaryCaseMainCollection::allSummaryCases()
|
||||
return cases;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCase*> RimSummaryCaseMainCollection::topLevelSummaryCases() const
|
||||
{
|
||||
std::vector<RimSummaryCase*> cases;
|
||||
for (const auto& sumCase : m_cases)
|
||||
{
|
||||
cases.push_back(sumCase);
|
||||
}
|
||||
return cases;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCaseCollection*> RimSummaryCaseMainCollection::summaryCaseCollections() const
|
||||
{
|
||||
std::vector<RimSummaryCaseCollection*> summaryCaseCollections;
|
||||
for (const auto& caseColl : m_caseCollections)
|
||||
{
|
||||
summaryCaseCollections.push_back(caseColl);
|
||||
}
|
||||
return summaryCaseCollections;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -39,8 +39,10 @@ public:
|
||||
RimSummaryCase* summaryCase(size_t idx);
|
||||
size_t summaryCaseCount() const;
|
||||
|
||||
std::vector<RimSummaryCase*> allSummaryCases();
|
||||
|
||||
std::vector<RimSummaryCase*> allSummaryCases();
|
||||
std::vector<RimSummaryCase*> topLevelSummaryCases() const;
|
||||
std::vector<RimSummaryCaseCollection*> summaryCaseCollections() const;
|
||||
|
||||
void createSummaryCasesFromRelevantEclipseResultCases();
|
||||
RimSummaryCase* createAndAddSummaryCaseFromEclipseResultCase(RimEclipseResultCase* eclResCase);
|
||||
RimSummaryCase* createAndAddSummaryCaseFromFileName(const QString& fileName);
|
||||
|
||||
@@ -201,7 +201,7 @@ void RimSummaryCurve::setSummaryCase(RimSummaryCase* sumCase)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCase* RimSummaryCurve::summaryCase()
|
||||
RimSummaryCase* RimSummaryCurve::summaryCase() const
|
||||
{
|
||||
return m_summaryCase();
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
virtual ~RimSummaryCurve();
|
||||
|
||||
void setSummaryCase(RimSummaryCase* sumCase);
|
||||
RimSummaryCase* summaryCase();
|
||||
RimSummaryCase* summaryCase() const;
|
||||
|
||||
RifEclipseSummaryAddress summaryAddress();
|
||||
void setSummaryAddress(const RifEclipseSummaryAddress& address);
|
||||
|
||||
@@ -176,6 +176,14 @@ void RimSummaryCurveCollection::deleteCurvesAssosiatedWithCase(RimSummaryCase* s
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurveCollection::deleteAllCurves()
|
||||
{
|
||||
m_curves.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
|
||||
std::vector<RimSummaryCurve*> curves();
|
||||
void deleteCurvesAssosiatedWithCase(RimSummaryCase* summaryCase);
|
||||
|
||||
void deleteAllCurves();
|
||||
void updateCaseNameHasChanged();
|
||||
|
||||
private:
|
||||
|
||||
@@ -453,21 +453,23 @@ QString RimSummaryPlot::asciiDataForPlotExport() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCurve*> RimSummaryPlot::summaryCurves() const
|
||||
{
|
||||
std::vector<RimSummaryCurve*> curves;
|
||||
curves.reserve(m_summaryCurves.size());
|
||||
for (const auto& curve : m_summaryCurveCollection->curves())
|
||||
{
|
||||
curves.push_back(curve);
|
||||
}
|
||||
return curves;
|
||||
return m_summaryCurveCollection->curves();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::deleteAllCurves()
|
||||
void RimSummaryPlot::deleteAllSummaryCurves()
|
||||
{
|
||||
m_summaryCurveCollection->curves().clear();
|
||||
m_summaryCurveCollection->deleteAllCurves();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCurveCollection* RimSummaryPlot::summaryCurveCollection() const
|
||||
{
|
||||
return m_summaryCurveCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -100,8 +100,8 @@ public:
|
||||
QString asciiDataForPlotExport() const;
|
||||
|
||||
std::vector<RimSummaryCurve*> summaryCurves() const;
|
||||
void deleteAllCurves();
|
||||
|
||||
void deleteAllSummaryCurves();
|
||||
RimSummaryCurveCollection* summaryCurveCollection() const;
|
||||
// RimViewWindow overrides
|
||||
public:
|
||||
virtual QWidget* createViewWidget(QWidget* mainWindowParent) override;
|
||||
|
||||
@@ -130,3 +130,17 @@ void RimSummaryPlotCollection::updateSummaryNameHasChanged()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotCollection::summaryPlotItemInfos(QList<caf::PdmOptionItemInfo>* optionInfos) const
|
||||
{
|
||||
for (RimSummaryPlot* plot : summaryPlots())
|
||||
{
|
||||
QIcon icon = plot->uiCapability()->uiIcon();
|
||||
QString displayName = plot->description();
|
||||
|
||||
optionInfos->push_back(caf::PdmOptionItemInfo(displayName, plot, false, icon));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,9 @@ public:
|
||||
caf::PdmChildArrayField<RimSummaryPlot*> summaryPlots;
|
||||
|
||||
void updateSummaryNameHasChanged();
|
||||
|
||||
void summaryPlotItemInfos(QList<caf::PdmOptionItemInfo>* optionInfos) const;
|
||||
|
||||
private:
|
||||
RifReaderEclipseSummary* createSummaryFileReader(const QString& eclipseCaseFilePathBasename);
|
||||
RifReaderEclipseSummary* getOrCreateSummaryFileReader(const QString& eclipseCaseFilePathBasename);
|
||||
|
||||
Reference in New Issue
Block a user