mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1462 Create generic select file and eclipse case to export model
This commit is contained in:
parent
acb050e9fb
commit
9bf361ed64
@ -7,6 +7,7 @@ endif()
|
|||||||
set (SOURCE_GROUP_HEADER_FILES
|
set (SOURCE_GROUP_HEADER_FILES
|
||||||
${CEE_CURRENT_LIST_DIR}RimEclipseCaseCollection.h
|
${CEE_CURRENT_LIST_DIR}RimEclipseCaseCollection.h
|
||||||
${CEE_CURRENT_LIST_DIR}RimCaseCollection.h
|
${CEE_CURRENT_LIST_DIR}RimCaseCollection.h
|
||||||
|
${CEE_CURRENT_LIST_DIR}RimCaseAndFileExportSettings.h
|
||||||
${CEE_CURRENT_LIST_DIR}RimCellFilter.h
|
${CEE_CURRENT_LIST_DIR}RimCellFilter.h
|
||||||
${CEE_CURRENT_LIST_DIR}RimEclipsePropertyFilter.h
|
${CEE_CURRENT_LIST_DIR}RimEclipsePropertyFilter.h
|
||||||
${CEE_CURRENT_LIST_DIR}RimPropertyFilterCollection.h
|
${CEE_CURRENT_LIST_DIR}RimPropertyFilterCollection.h
|
||||||
@ -99,6 +100,7 @@ ${CEE_CURRENT_LIST_DIR}RimEclipseGeometrySelectionItem.h
|
|||||||
set (SOURCE_GROUP_SOURCE_FILES
|
set (SOURCE_GROUP_SOURCE_FILES
|
||||||
${CEE_CURRENT_LIST_DIR}RimEclipseCaseCollection.cpp
|
${CEE_CURRENT_LIST_DIR}RimEclipseCaseCollection.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RimCaseCollection.cpp
|
${CEE_CURRENT_LIST_DIR}RimCaseCollection.cpp
|
||||||
|
${CEE_CURRENT_LIST_DIR}RimCaseAndFileExportSettings.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RimCellFilter.cpp
|
${CEE_CURRENT_LIST_DIR}RimCellFilter.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RimEclipsePropertyFilter.cpp
|
${CEE_CURRENT_LIST_DIR}RimEclipsePropertyFilter.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RimPropertyFilterCollection.cpp
|
${CEE_CURRENT_LIST_DIR}RimPropertyFilterCollection.cpp
|
||||||
|
@ -0,0 +1,69 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2017- Statoil ASA
|
||||||
|
// Copyright (C) 2017- Ceetron Solutions 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 "RimCaseAndFileExportSettings.h"
|
||||||
|
|
||||||
|
#include "RimTools.h"
|
||||||
|
|
||||||
|
#include "cafPdmUiFilePathEditor.h"
|
||||||
|
|
||||||
|
CAF_PDM_SOURCE_INIT(RimCaseAndFileExportSettings, "RimCaseAndFileExportSettings");
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimCaseAndFileExportSettings::RimCaseAndFileExportSettings()
|
||||||
|
{
|
||||||
|
CAF_PDM_InitObject("RimCaseAndFileExportSettings", "", "", "");
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault(&fileName, "Filename", "Export filename", "", "", "");
|
||||||
|
fileName.uiCapability()->setUiEditorTypeName(caf::PdmUiFilePathEditor::uiEditorTypeName());
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault(&caseToApply, "CaseToApply", "Case to Apply", "", "", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QList<caf::PdmOptionItemInfo> RimCaseAndFileExportSettings::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly)
|
||||||
|
{
|
||||||
|
QList<caf::PdmOptionItemInfo> options;
|
||||||
|
|
||||||
|
if (fieldNeedingOptions == &caseToApply)
|
||||||
|
{
|
||||||
|
RimTools::caseOptionItems(&options);
|
||||||
|
}
|
||||||
|
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimCaseAndFileExportSettings::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute)
|
||||||
|
{
|
||||||
|
if (field == &fileName)
|
||||||
|
{
|
||||||
|
caf::PdmUiFilePathEditorAttribute* myAttr = static_cast<caf::PdmUiFilePathEditorAttribute*>(attribute);
|
||||||
|
if (myAttr)
|
||||||
|
{
|
||||||
|
myAttr->m_selectSaveFileName = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2017- Statoil ASA
|
||||||
|
// Copyright (C) 2017- Ceetron Solutions 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 "RimEclipseCase.h"
|
||||||
|
|
||||||
|
#include "cafPdmObject.h"
|
||||||
|
#include "cafPdmField.h"
|
||||||
|
#include "cafPdmPtrField.h"
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RimCaseAndFileExportSettings : public caf::PdmObject
|
||||||
|
{
|
||||||
|
CAF_PDM_HEADER_INIT;
|
||||||
|
public:
|
||||||
|
|
||||||
|
RimCaseAndFileExportSettings();
|
||||||
|
|
||||||
|
caf::PdmField<QString> fileName;
|
||||||
|
caf::PdmPtrField<RimEclipseCase*> caseToApply;
|
||||||
|
|
||||||
|
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||||
|
protected:
|
||||||
|
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user