ResInsight/ApplicationLibCode/Commands/WellPathCommands/RicWellPathsUnitSystemSettingsUi.cpp

50 lines
2.2 KiB
C++
Raw Normal View History

2017-06-07 04:57:25 -05:00
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017- Statoil ASA
//
2017-06-07 04:57:25 -05: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.
//
2017-06-07 04:57:25 -05: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.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
2017-06-07 04:57:25 -05:00
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicWellPathsUnitSystemSettingsUi.h"
CAF_PDM_SOURCE_INIT( RicWellPathsUnitSystemSettingsUi, "RicWellPathsUnitSystemSettingsUi" );
2017-06-07 04:57:25 -05:00
//--------------------------------------------------------------------------------------------------
///
2017-06-07 04:57:25 -05:00
//--------------------------------------------------------------------------------------------------
RicWellPathsUnitSystemSettingsUi::RicWellPathsUnitSystemSettingsUi()
{
CAF_PDM_InitObject( "RimWellPathsUnitSystemSettings" );
2017-06-07 04:57:25 -05:00
CAF_PDM_InitFieldNoDefault( &unitSystem, "UnitSystem", "Unit System" );
2017-06-07 04:57:25 -05:00
}
//--------------------------------------------------------------------------------------------------
///
2017-06-07 04:57:25 -05:00
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RicWellPathsUnitSystemSettingsUi::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
2017-06-07 04:57:25 -05:00
{
QList<caf::PdmOptionItemInfo> options;
if ( fieldNeedingOptions == &unitSystem )
2017-06-07 04:57:25 -05:00
{
options.push_back(
caf::PdmOptionItemInfo( caf::AppEnum<RiaDefines::EclipseUnitSystem>::uiText( RiaDefines::EclipseUnitSystem::UNITS_METRIC ),
RiaDefines::EclipseUnitSystem::UNITS_METRIC ) );
options.push_back(
caf::PdmOptionItemInfo( caf::AppEnum<RiaDefines::EclipseUnitSystem>::uiText( RiaDefines::EclipseUnitSystem::UNITS_FIELD ),
RiaDefines::EclipseUnitSystem::UNITS_FIELD ) );
2017-06-07 04:57:25 -05:00
}
return options;
}