2013-02-21 08:37:51 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-23 08:04:57 -05:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2013-02-21 08:37:51 -06:00
|
|
|
//
|
|
|
|
// 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 "RimCaseCollection.h"
|
|
|
|
|
2015-05-15 02:16:33 -05:00
|
|
|
#include "RimEclipseCase.h"
|
2013-03-19 06:47:38 -05:00
|
|
|
#include "RimIdenticalGridCaseGroup.h"
|
2013-02-21 08:37:51 -06:00
|
|
|
|
2013-05-06 03:55:00 -05:00
|
|
|
|
2013-02-21 08:37:51 -06:00
|
|
|
CAF_PDM_SOURCE_INIT(RimCaseCollection, "RimCaseCollection");
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimCaseCollection::RimCaseCollection()
|
|
|
|
{
|
|
|
|
CAF_PDM_InitObject("Derived Statistics", "", "", "");
|
|
|
|
|
2015-08-12 03:26:49 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&reservoirs, "Reservoirs", "Reservoirs ChildArrayField", "", "", "");
|
|
|
|
reservoirs.uiCapability()->setUiHidden(true);
|
2013-02-21 08:37:51 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimCaseCollection::~RimCaseCollection()
|
|
|
|
{
|
2013-03-07 02:21:29 -06:00
|
|
|
reservoirs.deleteAllChildObjects();
|
2013-02-21 08:37:51 -06:00
|
|
|
}
|
2013-03-19 06:47:38 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimIdenticalGridCaseGroup* RimCaseCollection::parentCaseGroup()
|
|
|
|
{
|
2015-08-05 07:55:16 -05:00
|
|
|
return dynamic_cast<RimIdenticalGridCaseGroup*>(this->parentField()->ownerObject());
|
2013-03-19 06:47:38 -05:00
|
|
|
}
|
2013-04-12 05:03:04 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-05-15 01:40:27 -05:00
|
|
|
RimEclipseCase* RimCaseCollection::findByDescription(const QString& caseDescription) const
|
2013-04-12 05:03:04 -05:00
|
|
|
{
|
|
|
|
for (size_t i = 0; i < reservoirs.size(); i++)
|
|
|
|
{
|
|
|
|
if (caseDescription == reservoirs[i]->caseUserDescription())
|
|
|
|
{
|
|
|
|
return reservoirs[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-18 11:56:43 -06:00
|
|
|
return nullptr;
|
2013-04-12 05:03:04 -05:00
|
|
|
}
|