Merge branch 'dev' into pre-proto

This commit is contained in:
Magne Sjaastad
2017-06-08 14:09:03 +02:00
80 changed files with 913 additions and 521 deletions

View File

@@ -8,6 +8,8 @@ set (SOURCE_GROUP_HEADER_FILES
${CEE_CURRENT_LIST_DIR}RicWellPathDeleteFeature.h
${CEE_CURRENT_LIST_DIR}RicWellPathsImportFileFeature.h
${CEE_CURRENT_LIST_DIR}RicWellPathsImportSsihubFeature.h
${CEE_CURRENT_LIST_DIR}RicWellPathsUnitSystemSettingsImpl.h
${CEE_CURRENT_LIST_DIR}RicWellPathsUnitSystemSettingsUi.h
${CEE_CURRENT_LIST_DIR}RicWellPathViewerEventHandler.h
)
@@ -15,6 +17,8 @@ set (SOURCE_GROUP_SOURCE_FILES
${CEE_CURRENT_LIST_DIR}RicWellPathDeleteFeature.cpp
${CEE_CURRENT_LIST_DIR}RicWellPathsImportFileFeature.cpp
${CEE_CURRENT_LIST_DIR}RicWellPathsImportSsihubFeature.cpp
${CEE_CURRENT_LIST_DIR}RicWellPathsUnitSystemSettingsImpl.cpp
${CEE_CURRENT_LIST_DIR}RicWellPathsUnitSystemSettingsUi.cpp
${CEE_CURRENT_LIST_DIR}RicWellPathViewerEventHandler.cpp
)

View File

@@ -0,0 +1,45 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017- Statoil ASA
//
// 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 "RicWellPathsUnitSystemSettingsImpl.h"
#include "RicWellPathsUnitSystemSettingsUi.h"
#include "RiuMainWindow.h"
#include "cafPdmUiPropertyViewDialog.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem(RimWellPath * wellPath)
{
if (wellPath->unitSystem() != RimUnitSystem::UNITS_UNKNOWN)
{
return true;
}
RicWellPathsUnitSystemSettingsUi settings;
caf::PdmUiPropertyViewDialog propertyDialog(RiuMainWindow::instance(), &settings, "Select Unit System for Well Path", "");
if (propertyDialog.exec() == QDialog::Accepted)
{
wellPath->setUnitSystem(settings.unitSystem());
return true;
}
return false;
}

View File

@@ -0,0 +1,32 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017- Statoil ASA
//
// 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 "RimUnitSystem.h"
#include "RimWellPath.h"
//==================================================================================================
///
///
//==================================================================================================
class RicWellPathsUnitSystemSettingsImpl
{
public:
static bool ensureHasUnitSystem(RimWellPath* wellPath);
};

View File

@@ -0,0 +1,45 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017- Statoil ASA
//
// 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 "RicWellPathsUnitSystemSettingsUi.h"
CAF_PDM_SOURCE_INIT(RicWellPathsUnitSystemSettingsUi, "RicWellPathsUnitSystemSettingsUi");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicWellPathsUnitSystemSettingsUi::RicWellPathsUnitSystemSettingsUi()
{
CAF_PDM_InitObject("RimWellPathsUnitSystemSettings", "", "", "");
CAF_PDM_InitFieldNoDefault(&unitSystem, "UnitSystem", "Unit System", "", "", "");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RicWellPathsUnitSystemSettingsUi::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly)
{
QList<caf::PdmOptionItemInfo> options;
if (fieldNeedingOptions == &unitSystem)
{
options.push_back(caf::PdmOptionItemInfo(RimUnitSystem::UnitSystemType::uiText(RimUnitSystem::UNITS_METRIC), RimUnitSystem::UNITS_METRIC));
options.push_back(caf::PdmOptionItemInfo(RimUnitSystem::UnitSystemType::uiText(RimUnitSystem::UNITS_FIELD), RimUnitSystem::UNITS_FIELD));
}
return options;
}

View File

@@ -0,0 +1,41 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017- Statoil ASA
//
// 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 "RimUnitSystem.h"
#include "cafPdmObject.h"
#include "cafPdmField.h"
//==================================================================================================
///
///
//==================================================================================================
class RicWellPathsUnitSystemSettingsUi : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RicWellPathsUnitSystemSettingsUi();
caf::PdmField<RimUnitSystem::UnitSystemType> unitSystem;
protected:
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
};