2017-05-16 02:43:41 -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-05-30 07:37:51 -05:00
# include "RicExportCompletionDataSettingsUi.h"
2017-05-16 02:43:41 -05:00
2017-06-14 08:30:50 -05:00
namespace caf
{
template < >
void RicExportCompletionDataSettingsUi : : ExportSplitType : : setUp ( )
{
addItem ( RicExportCompletionDataSettingsUi : : UNIFIED_FILE , " UNIFIED_FILE " , " Unified File " ) ;
addItem ( RicExportCompletionDataSettingsUi : : SPLIT_ON_WELL , " SPLIT_ON_WELL " , " Split on Well " ) ;
addItem ( RicExportCompletionDataSettingsUi : : SPLIT_ON_WELL_AND_COMPLETION_TYPE , " SPLIT_ON_WELL_AND_COMPLETION_TYPE " , " Split on Well and Completion Type " ) ;
setDefault ( RicExportCompletionDataSettingsUi : : UNIFIED_FILE ) ;
}
2017-06-15 04:37:00 -05:00
template < >
void RicExportCompletionDataSettingsUi : : WellSelectionType : : setUp ( )
{
addItem ( RicExportCompletionDataSettingsUi : : ALL_WELLS , " ALL_WELLS " , " All Wells " ) ;
addItem ( RicExportCompletionDataSettingsUi : : CHECKED_WELLS , " CHECKED_WELLS " , " Checked Wells " ) ;
setDefault ( RicExportCompletionDataSettingsUi : : ALL_WELLS ) ;
}
2017-06-21 03:58:02 -05:00
template < >
void RicExportCompletionDataSettingsUi : : CompdatExportType : : setUp ( )
{
2017-06-21 08:54:18 -05:00
addItem ( RicExportCompletionDataSettingsUi : : TRANSMISSIBILITIES , " TRANSMISSIBILITIES " , " Calculated Transmissibilities " ) ;
addItem ( RicExportCompletionDataSettingsUi : : WPIMULT_AND_DEFAULT_CONNECTION_FACTORS , " WPIMULT_AND_DEFAULT_CONNECTION_FACTORS " , " Default Connection Factors and WPIMULT " ) ;
2017-06-21 03:58:02 -05:00
setDefault ( RicExportCompletionDataSettingsUi : : TRANSMISSIBILITIES ) ;
}
2017-06-14 08:30:50 -05:00
}
2017-05-30 07:37:51 -05:00
CAF_PDM_SOURCE_INIT ( RicExportCompletionDataSettingsUi , " RicExportCompletionDataSettingsUi " ) ;
2017-05-16 02:43:41 -05:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
2017-05-30 07:37:51 -05:00
RicExportCompletionDataSettingsUi : : RicExportCompletionDataSettingsUi ( )
2017-05-16 02:43:41 -05:00
{
CAF_PDM_InitObject ( " RimExportCompletionDataSettings " , " " , " " , " " ) ;
2017-06-14 08:30:50 -05:00
CAF_PDM_InitFieldNoDefault ( & fileSplit , " FileSplit " , " File Split " , " " , " " , " " ) ;
2017-06-15 04:37:00 -05:00
CAF_PDM_InitFieldNoDefault ( & wellSelection , " WellSelection " , " Well Selection " , " " , " " , " " ) ;
2017-06-21 08:54:18 -05:00
CAF_PDM_InitFieldNoDefault ( & compdatExport , " compdatExport " , " Export " , " " , " " , " " ) ;
2017-06-14 08:30:50 -05:00
2017-05-30 08:42:05 -05:00
CAF_PDM_InitField ( & timeStep , " TimeStepIndex " , 0 , " Time Step " , " " , " " , " " ) ;
2017-05-29 06:13:25 -05:00
CAF_PDM_InitField ( & includePerforations , " IncludePerforations " , true , " Include Perforations " , " " , " " , " " ) ;
CAF_PDM_InitField ( & includeFishbones , " IncludeFishbones " , true , " Include Fishbones " , " " , " " , " " ) ;
2017-06-21 08:54:18 -05:00
CAF_PDM_InitField ( & excludeMainBoreForFishbones , " ExcludeMainBoreForFishbones " , false , " Exclude Main Bore Transmissibility For Fishbones " , " " , " " , " " ) ;
2017-05-30 08:42:05 -05:00
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList < caf : : PdmOptionItemInfo > RicExportCompletionDataSettingsUi : : calculateValueOptions ( const caf : : PdmFieldHandle * fieldNeedingOptions , bool * useOptionsOnly )
{
QList < caf : : PdmOptionItemInfo > options ;
if ( fieldNeedingOptions = = & timeStep )
{
QStringList timeStepNames ;
if ( caseToApply )
{
timeStepNames = caseToApply - > timeStepStrings ( ) ;
}
for ( int i = 0 ; i < timeStepNames . size ( ) ; i + + )
{
options . push_back ( caf : : PdmOptionItemInfo ( timeStepNames [ i ] , i ) ) ;
}
}
else
{
options = RicCaseAndFileExportSettingsUi : : calculateValueOptions ( fieldNeedingOptions , useOptionsOnly ) ;
}
return options ;
2017-05-16 02:43:41 -05:00
}
2017-06-21 03:58:02 -05:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportCompletionDataSettingsUi : : defineUiOrdering ( QString uiConfigName , caf : : PdmUiOrdering & uiOrdering )
{
2017-06-21 08:54:18 -05:00
caf : : PdmUiGroup * generalExportSettings = uiOrdering . addNewGroup ( " General Export Settings " ) ;
generalExportSettings - > add ( & folder ) ;
generalExportSettings - > add ( & caseToApply ) ;
generalExportSettings - > add ( & timeStep ) ;
generalExportSettings - > add ( & compdatExport ) ;
generalExportSettings - > add ( & wellSelection ) ;
generalExportSettings - > add ( & fileSplit ) ;
caf : : PdmUiGroup * fishboneGroup = uiOrdering . addNewGroup ( " Export of Fishbone Completions " ) ;
fishboneGroup - > add ( & includeFishbones ) ;
fishboneGroup - > add ( & excludeMainBoreForFishbones ) ;
caf : : PdmUiGroup * perfIntervalGroup = uiOrdering . addNewGroup ( " Export of Perforation Completions " ) ;
perfIntervalGroup - > add ( & includePerforations ) ;
2017-06-21 03:58:02 -05:00
}