2017-09-14 07:34:12 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-09-15 06:18:06 -05:00
|
|
|
|
2017-09-14 07:34:12 -05:00
|
|
|
#include "RimObservedDataCollection.h"
|
2017-09-14 08:44:01 -05:00
|
|
|
#include "RimObservedData.h"
|
2017-09-18 03:44:28 -05:00
|
|
|
#include "RimSummaryObservedDataFile.h"
|
2017-09-14 08:44:01 -05:00
|
|
|
|
|
|
|
CAF_PDM_SOURCE_INIT(RimObservedDataCollection, "ObservedDataCollection");
|
2017-09-14 07:34:12 -05:00
|
|
|
|
2017-09-14 08:59:33 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-09-14 07:34:12 -05:00
|
|
|
RimObservedDataCollection::RimObservedDataCollection()
|
|
|
|
{
|
2017-09-14 08:44:01 -05:00
|
|
|
CAF_PDM_InitObject("Observed Data", ":/Folder.png", "", "");
|
|
|
|
|
2017-09-15 06:18:06 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_observedDataArray, "ObservedDataArray", "", "", "", "");
|
2017-09-14 08:44:01 -05:00
|
|
|
|
2017-09-15 06:18:06 -05:00
|
|
|
m_observedDataArray.uiCapability()->setUiHidden(true);
|
2017-09-14 07:34:12 -05:00
|
|
|
}
|
|
|
|
|
2017-09-14 08:59:33 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-09-14 07:34:12 -05:00
|
|
|
RimObservedDataCollection::~RimObservedDataCollection()
|
|
|
|
{
|
2017-09-15 06:18:06 -05:00
|
|
|
m_observedDataArray.deleteAllChildObjects();
|
2017-09-18 03:44:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
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);
|
2017-09-22 02:11:39 -05:00
|
|
|
newObservedData->createSummaryReaderInterface();
|
2017-09-18 03:44:28 -05:00
|
|
|
newObservedData->updateOptionSensitivity();
|
|
|
|
|
2017-09-18 07:16:35 -05:00
|
|
|
this->updateConnectedEditors();
|
|
|
|
|
2017-09-18 03:44:28 -05:00
|
|
|
return newObservedData;
|
|
|
|
}
|
2017-09-18 13:27:20 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-09-22 07:26:54 -05:00
|
|
|
std::vector<RimSummaryCase*> RimObservedDataCollection::allObservedData()
|
2017-09-18 13:27:20 -05:00
|
|
|
{
|
2017-09-22 07:26:54 -05:00
|
|
|
std::vector<RimSummaryCase*> allObservedData;
|
2017-09-18 13:27:20 -05:00
|
|
|
|
|
|
|
allObservedData.insert(allObservedData.begin(), m_observedDataArray.begin(), m_observedDataArray.end());
|
|
|
|
|
|
|
|
return allObservedData;
|
|
|
|
}
|