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.
|
|
|
|
//
|
|
|
|
// 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 "RimMockModelSettings.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CAF_PDM_SOURCE_INIT(RimMockModelSettings, "MockModelSettings");
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimMockModelSettings::RimMockModelSettings()
|
|
|
|
{
|
|
|
|
CAF_PDM_InitObject("Mock Model Settings", "", "", "");
|
|
|
|
|
|
|
|
CAF_PDM_InitField(&cellCountX, "CellCountX", quint64(100), "Cell Count X", "", "", "");
|
|
|
|
CAF_PDM_InitField(&cellCountY, "CellCountY", quint64(100), "Cell Count Y", "", "", "");
|
2013-10-28 06:05:06 -05:00
|
|
|
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", "", "", "");
|
2015-08-05 06:27:36 -05:00
|
|
|
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", "", "", "");
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimMockModelSettings::~RimMockModelSettings()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimMockModelSettings::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
|
|
|
{
|
|
|
|
totalCellCount = cellCountX * cellCountY * cellCountZ;
|
2015-07-31 11:58:23 -05:00
|
|
|
|
2015-10-23 08:46:25 -05:00
|
|
|
caf::PdmUiFieldHandle* uiFieldHandle = totalCellCount.uiCapability();
|
2015-07-31 11:58:23 -05:00
|
|
|
if (uiFieldHandle)
|
|
|
|
{
|
|
|
|
uiFieldHandle->updateConnectedEditors();
|
|
|
|
}
|
2013-10-28 04:30:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimMockModelSettings::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
|
|
|
{
|
|
|
|
caf::PdmUiGroup* gridSizeGroup = uiOrdering.addNewGroup("Grid size");
|
|
|
|
gridSizeGroup->add(&cellCountX);
|
|
|
|
gridSizeGroup->add(&cellCountY);
|
|
|
|
gridSizeGroup->add(&cellCountZ);
|
|
|
|
gridSizeGroup->add(&totalCellCount);
|
2013-10-28 06:05:06 -05:00
|
|
|
|
|
|
|
caf::PdmUiGroup* resultGroup = uiOrdering.addNewGroup("Results");
|
|
|
|
resultGroup->add(&resultCount);
|
|
|
|
resultGroup->add(&timeStepCount);
|
2013-10-28 04:30:58 -05:00
|
|
|
}
|