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
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2013-02-21 08:37:51 -06:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2013-02-21 08:37:51 -06:00
|
|
|
// 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
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_SOURCE_INIT( RimCaseCollection, "RimCaseCollection" );
|
2013-02-21 08:37:51 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-02-21 08:37:51 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimCaseCollection::RimCaseCollection()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitObject( "Derived Statistics", "", "", "" );
|
2013-02-21 08:37:51 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &reservoirs, "Reservoirs", "Reservoirs ChildArrayField", "", "", "" );
|
|
|
|
reservoirs.uiCapability()->setUiHidden( true );
|
2013-02-21 08:37:51 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
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
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-03-19 06:47:38 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimIdenticalGridCaseGroup* RimCaseCollection::parentCaseGroup()
|
|
|
|
{
|
2019-09-06 03:40:57 -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
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-04-12 05:03:04 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
RimEclipseCase* RimCaseCollection::findByDescription( const QString& caseDescription ) const
|
2013-04-12 05:03:04 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t i = 0; i < reservoirs.size(); i++ )
|
2013-04-12 05:03:04 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( caseDescription == reservoirs[i]->caseUserDescription() )
|
2013-04-12 05:03:04 -05:00
|
|
|
{
|
|
|
|
return reservoirs[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-18 11:56:43 -06:00
|
|
|
return nullptr;
|
2013-04-12 05:03:04 -05:00
|
|
|
}
|