#1839 Observed Data : Move summary files into summary folder

This commit is contained in:
Magne Sjaastad
2017-09-22 10:31:16 +02:00
parent 8f158510f9
commit 363224e39a
9 changed files with 10 additions and 7 deletions

View File

@@ -22,6 +22,9 @@ ${CEE_CURRENT_LIST_DIR}RimSummaryPlot.h
${CEE_CURRENT_LIST_DIR}RimSummaryPlotCollection.h
${CEE_CURRENT_LIST_DIR}RimSummaryTimeAxisProperties.h
${CEE_CURRENT_LIST_DIR}RimSummaryYAxisProperties.h
${CEE_CURRENT_LIST_DIR}RimObservedData.h
${CEE_CURRENT_LIST_DIR}RimObservedDataCollection.h
${CEE_CURRENT_LIST_DIR}RimSummaryObservedDataFile.h
)
set (SOURCE_GROUP_SOURCE_FILES
@@ -42,6 +45,9 @@ ${CEE_CURRENT_LIST_DIR}RimSummaryPlot.cpp
${CEE_CURRENT_LIST_DIR}RimSummaryPlotCollection.cpp
${CEE_CURRENT_LIST_DIR}RimSummaryTimeAxisProperties.cpp
${CEE_CURRENT_LIST_DIR}RimSummaryYAxisProperties.cpp
${CEE_CURRENT_LIST_DIR}RimObservedData.cpp
${CEE_CURRENT_LIST_DIR}RimObservedDataCollection.cpp
${CEE_CURRENT_LIST_DIR}RimSummaryObservedDataFile.cpp
)
list(APPEND CODE_HEADER_FILES

View File

@@ -0,0 +1,79 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimObservedData::createSummaryReaderInterface()
{
throw std::logic_error("The method or operation is not implemented.");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifSummaryReaderInterface* RimObservedData::summaryReader()
{
throw std::logic_error("The method or operation is not implemented.");
return nullptr;
}

View File

@@ -0,0 +1,52 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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;
virtual void createSummaryReaderInterface() override;
virtual RifSummaryReaderInterface* summaryReader() override;
private:
caf::PdmField<caf::AppEnum<RifEclipseSummaryAddress::SummaryVarCategory> > m_summaryCategory;
caf::PdmField<QString> m_identifierName;
};

View File

@@ -0,0 +1,89 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "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->createSummaryReaderInterface();
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;
}

View 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;
};

View File

@@ -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();
}

View File

@@ -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);
};