ResInsight/ApplicationLibCode/ProjectDataModel/RimMockModelSettings.cpp

78 lines
3.2 KiB
C++
Raw Normal View History

2013-10-28 04:30:58 -05:00
/////////////////////////////////////////////////////////////////////////////////
//
2014-09-24 00:14:52 -05:00
// Copyright (C) Statoil ASA
// Copyright (C) Ceetron Solutions AS
//
2013-10-28 04:30:58 -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.
//
2013-10-28 04:30:58 -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>
2013-10-28 04:30:58 -05:00
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimMockModelSettings.h"
CAF_PDM_SOURCE_INIT( RimMockModelSettings, "MockModelSettings" );
2013-10-28 04:30:58 -05:00
//--------------------------------------------------------------------------------------------------
///
2013-10-28 04:30:58 -05:00
//--------------------------------------------------------------------------------------------------
RimMockModelSettings::RimMockModelSettings()
{
CAF_PDM_InitObject( "Mock Model Settings" );
2013-10-28 04:30:58 -05:00
CAF_PDM_InitField( &cellCountX, "CellCountX", quint64( 100 ), "Cell Count X" );
CAF_PDM_InitField( &cellCountY, "CellCountY", quint64( 100 ), "Cell Count Y" );
CAF_PDM_InitField( &cellCountZ, "CellCountZ", quint64( 10 ), "Cell Count Z" );
2013-10-28 04:30:58 -05:00
CAF_PDM_InitFieldNoDefault( &totalCellCount, "TotalCellCount", "Total Cell Count" );
totalCellCount.uiCapability()->setUiReadOnly( true );
2013-10-28 04:30:58 -05:00
CAF_PDM_InitField( &resultCount, "ResultCount", quint64( 3 ), "Result Count" );
CAF_PDM_InitField( &timeStepCount, "TimeStepCount", quint64( 10 ), "Time Step Count" );
2013-10-28 04:30:58 -05:00
}
//--------------------------------------------------------------------------------------------------
///
2013-10-28 04:30:58 -05:00
//--------------------------------------------------------------------------------------------------
RimMockModelSettings::~RimMockModelSettings()
{
}
2013-10-28 04:30:58 -05:00
//--------------------------------------------------------------------------------------------------
///
2013-10-28 04:30:58 -05:00
//--------------------------------------------------------------------------------------------------
void RimMockModelSettings::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
2013-10-28 04:30:58 -05:00
{
totalCellCount = cellCountX * cellCountY * cellCountZ;
caf::PdmUiFieldHandle* uiFieldHandle = totalCellCount.uiCapability();
if ( uiFieldHandle )
{
uiFieldHandle->updateConnectedEditors();
}
2013-10-28 04:30:58 -05:00
}
//--------------------------------------------------------------------------------------------------
///
2013-10-28 04:30:58 -05:00
//--------------------------------------------------------------------------------------------------
void RimMockModelSettings::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
2013-10-28 04:30:58 -05:00
{
caf::PdmUiGroup* gridSizeGroup = uiOrdering.addNewGroup( "Grid size" );
gridSizeGroup->add( &cellCountX );
gridSizeGroup->add( &cellCountY );
gridSizeGroup->add( &cellCountZ );
gridSizeGroup->add( &totalCellCount );
caf::PdmUiGroup* resultGroup = uiOrdering.addNewGroup( "Results" );
resultGroup->add( &resultCount );
resultGroup->add( &timeStepCount );
2013-10-28 04:30:58 -05:00
}