mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-10 15:36:09 -06:00
Added mock model settings
This commit is contained in:
parent
19ff7075d3
commit
03516a8336
@ -46,6 +46,7 @@ ${CEE_CURRENT_LIST_DIR}RimCommandObject.h
|
|||||||
${CEE_CURRENT_LIST_DIR}RimTools.h
|
${CEE_CURRENT_LIST_DIR}RimTools.h
|
||||||
${CEE_CURRENT_LIST_DIR}RimFault.h
|
${CEE_CURRENT_LIST_DIR}RimFault.h
|
||||||
${CEE_CURRENT_LIST_DIR}RimFaultCollection.h
|
${CEE_CURRENT_LIST_DIR}RimFaultCollection.h
|
||||||
|
${CEE_CURRENT_LIST_DIR}RimMockModelSettings.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set (SOURCE_GROUP_SOURCE_FILES
|
set (SOURCE_GROUP_SOURCE_FILES
|
||||||
@ -90,6 +91,7 @@ ${CEE_CURRENT_LIST_DIR}RimCommandObject.cpp
|
|||||||
${CEE_CURRENT_LIST_DIR}RimTools.cpp
|
${CEE_CURRENT_LIST_DIR}RimTools.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RimFault.cpp
|
${CEE_CURRENT_LIST_DIR}RimFault.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RimFaultCollection.cpp
|
${CEE_CURRENT_LIST_DIR}RimFaultCollection.cpp
|
||||||
|
${CEE_CURRENT_LIST_DIR}RimMockModelSettings.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CODE_HEADER_FILES
|
list(APPEND CODE_HEADER_FILES
|
||||||
|
73
ApplicationCode/ProjectDataModel/RimMockModelSettings.cpp
Normal file
73
ApplicationCode/ProjectDataModel/RimMockModelSettings.cpp
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
|
||||||
|
//
|
||||||
|
// 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 "RiaStdInclude.h"
|
||||||
|
|
||||||
|
|
||||||
|
#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", "", "", "");
|
||||||
|
CAF_PDM_InitField(&cellCountZ, "CellCountZ", quint64(100), "Cell Count Z", "", "", "");
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault(&totalCellCount, "TotalCellCount", "Total Cell Count", "", "", "");
|
||||||
|
totalCellCount.setUiReadOnly(true);
|
||||||
|
|
||||||
|
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;
|
||||||
|
totalCellCount.updateConnectedEditors();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
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);
|
||||||
|
}
|
52
ApplicationCode/ProjectDataModel/RimMockModelSettings.h
Normal file
52
ApplicationCode/ProjectDataModel/RimMockModelSettings.h
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
|
||||||
|
//
|
||||||
|
// 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.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "cafPdmField.h"
|
||||||
|
#include "cafPdmObject.h"
|
||||||
|
#include "cafPdmPointer.h"
|
||||||
|
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RimMockModelSettings : public caf::PdmObject
|
||||||
|
{
|
||||||
|
CAF_PDM_HEADER_INIT;
|
||||||
|
public:
|
||||||
|
|
||||||
|
RimMockModelSettings();
|
||||||
|
virtual ~RimMockModelSettings();
|
||||||
|
|
||||||
|
caf::PdmField<quint64> cellCountX;
|
||||||
|
caf::PdmField<quint64> cellCountY;
|
||||||
|
caf::PdmField<quint64> cellCountZ;
|
||||||
|
|
||||||
|
caf::PdmField<quint64> totalCellCount;
|
||||||
|
|
||||||
|
caf::PdmField<quint64> resultCount;
|
||||||
|
caf::PdmField<quint64> timeStepCount;
|
||||||
|
|
||||||
|
|
||||||
|
virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue );
|
||||||
|
|
||||||
|
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
|
||||||
|
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user