mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3299 Compdat export. WELSPEC fixes
This commit is contained in:
parent
64c3fbd59a
commit
9a94fc2cde
@ -1082,11 +1082,11 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWelspecsToFile(RimEclipse
|
|||||||
|
|
||||||
formatter
|
formatter
|
||||||
.add(completions->wellNameForExport())
|
.add(completions->wellNameForExport())
|
||||||
.add(completions->wellGroupName())
|
.add(completions->wellGroupNameForExport())
|
||||||
.addOneBasedCellIndex(ijIntersection.x())
|
.addOneBasedCellIndex(ijIntersection.x())
|
||||||
.addOneBasedCellIndex(ijIntersection.y())
|
.addOneBasedCellIndex(ijIntersection.y())
|
||||||
.add(completions->referenceDepth())
|
.add(completions->referenceDepthForExport())
|
||||||
.add(completions->wellTypeName())
|
.add(completions->wellTypeNameForExport())
|
||||||
.rowCompleted();
|
.rowCompleted();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1147,12 +1147,12 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWelspeclToFile(RimEclipse
|
|||||||
|
|
||||||
formatter
|
formatter
|
||||||
.add(completions->wellNameForExport())
|
.add(completions->wellNameForExport())
|
||||||
.add(completions->wellGroupName())
|
.add(completions->wellGroupNameForExport())
|
||||||
.add(lgrName)
|
.add(lgrName)
|
||||||
.addOneBasedCellIndex(ijIntersection.x())
|
.addOneBasedCellIndex(ijIntersection.x())
|
||||||
.addOneBasedCellIndex(ijIntersection.y())
|
.addOneBasedCellIndex(ijIntersection.y())
|
||||||
.add(completions->referenceDepth())
|
.add(completions->referenceDepthForExport())
|
||||||
.add(completions->wellTypeName())
|
.add(completions->wellTypeNameForExport())
|
||||||
.rowCompleted();
|
.rowCompleted();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#include "RimWellPathCompletions.h"
|
#include "RimWellPathCompletions.h"
|
||||||
|
|
||||||
|
#include "RiaStdStringTools.h"
|
||||||
|
|
||||||
#include "RimFishbonesCollection.h"
|
#include "RimFishbonesCollection.h"
|
||||||
#include "RimFishboneWellPathCollection.h"
|
#include "RimFishboneWellPathCollection.h"
|
||||||
#include "RimPerforationCollection.h"
|
#include "RimPerforationCollection.h"
|
||||||
@ -27,6 +29,13 @@
|
|||||||
|
|
||||||
#include "cafPdmUiTreeOrdering.h"
|
#include "cafPdmUiTreeOrdering.h"
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
/// Internal constants
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
#define DOUBLE_INF std::numeric_limits<double>::infinity()
|
||||||
|
|
||||||
|
|
||||||
namespace caf {
|
namespace caf {
|
||||||
|
|
||||||
@ -98,7 +107,8 @@ RimPerforationCollection* RimWellPathCompletions::perforationCollection() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellPathCompletions::setWellNameForExport(const QString& name)
|
void RimWellPathCompletions::setWellNameForExport(const QString& name)
|
||||||
{
|
{
|
||||||
m_wellNameForExport = name;
|
auto n = name;
|
||||||
|
m_wellNameForExport = n.remove(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -106,31 +116,43 @@ void RimWellPathCompletions::setWellNameForExport(const QString& name)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QString RimWellPathCompletions::wellNameForExport() const
|
QString RimWellPathCompletions::wellNameForExport() const
|
||||||
{
|
{
|
||||||
return m_wellNameForExport();
|
return formatStringForExport(m_wellNameForExport());
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QString RimWellPathCompletions::wellGroupName() const
|
QString RimWellPathCompletions::wellGroupNameForExport() const
|
||||||
{
|
{
|
||||||
return m_wellGroupName;
|
return formatStringForExport(m_wellGroupName, "1*");
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QString RimWellPathCompletions::referenceDepth() const
|
QString RimWellPathCompletions::referenceDepthForExport() const
|
||||||
{
|
{
|
||||||
return m_referenceDepth;
|
std::string refDepth = m_referenceDepth.v().toStdString();
|
||||||
|
if (RiaStdStringTools::isNumber(refDepth, '.'))
|
||||||
|
{
|
||||||
|
return m_referenceDepth.v();
|
||||||
|
}
|
||||||
|
return "1*";
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QString RimWellPathCompletions::wellTypeName() const
|
QString RimWellPathCompletions::wellTypeNameForExport() const
|
||||||
{
|
{
|
||||||
return WellTypeEnum(m_wellType).uiText();
|
switch (m_wellType.v())
|
||||||
|
{
|
||||||
|
case OIL: return "OIL";
|
||||||
|
case GAS: return "GAS";
|
||||||
|
case WATER: return "WATER";
|
||||||
|
case LIQUID: return "LIQ";
|
||||||
|
}
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -190,3 +212,37 @@ void RimWellPathCompletions::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTree
|
|||||||
uiTreeOrdering.add(&m_fractureCollection);
|
uiTreeOrdering.add(&m_fractureCollection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellPathCompletions::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||||
|
{
|
||||||
|
if (changedField == &m_referenceDepth)
|
||||||
|
{
|
||||||
|
if (!RiaStdStringTools::isNumber(m_referenceDepth.v().toStdString(), '.'))
|
||||||
|
{
|
||||||
|
if (!RiaStdStringTools::isNumber(m_referenceDepth.v().toStdString(), ','))
|
||||||
|
{
|
||||||
|
// Remove invalid input text
|
||||||
|
m_referenceDepth = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Wrong decimal sign entered, replace , by .
|
||||||
|
auto text = m_referenceDepth.v();
|
||||||
|
m_referenceDepth = text.replace(',', '.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RimWellPathCompletions::formatStringForExport(const QString& text, const QString& defaultValue) const
|
||||||
|
{
|
||||||
|
if (text.isEmpty()) return defaultValue;
|
||||||
|
if (text.contains(' ')) return QString("'%1'").arg(text);
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
@ -47,15 +47,19 @@ public:
|
|||||||
|
|
||||||
void setWellNameForExport(const QString& name);
|
void setWellNameForExport(const QString& name);
|
||||||
QString wellNameForExport() const;
|
QString wellNameForExport() const;
|
||||||
QString wellGroupName() const;
|
QString wellGroupNameForExport() const;
|
||||||
QString referenceDepth() const;
|
QString referenceDepthForExport() const;
|
||||||
QString wellTypeName() const;
|
QString wellTypeNameForExport() const;
|
||||||
bool hasCompletions() const;
|
bool hasCompletions() const;
|
||||||
|
|
||||||
void setUnitSystemSpecificDefaults();
|
void setUnitSystemSpecificDefaults();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override;
|
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override;
|
||||||
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString formatStringForExport(const QString& text, const QString& defaultText = "") const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmChildField<RimFishbonesCollection*> m_fishbonesCollection;
|
caf::PdmChildField<RimFishbonesCollection*> m_fishbonesCollection;
|
||||||
|
Loading…
Reference in New Issue
Block a user