mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-23 23:13:39 -06:00
#3827 Fishbone Laterals : Whole well is exported instead of lateral only
This commit is contained in:
parent
2e8c2e28a8
commit
33a8f773ae
@ -101,7 +101,7 @@ void RicExportFishbonesLateralsFeature::onActionTriggered(bool isChecked)
|
|||||||
QString subIndexText = QString("%1").arg(sub.subIndex, 2, 10, QChar('0'));
|
QString subIndexText = QString("%1").arg(sub.subIndex, 2, 10, QChar('0'));
|
||||||
QString lateralName = QString("%1_%2_Sub%3_Lat%4").arg(wellPath->name()).arg(fishboneName).arg(subIndexText).arg(lateralIndex);
|
QString lateralName = QString("%1_%2_Sub%3_Lat%4").arg(wellPath->name()).arg(fishboneName).arg(subIndexText).arg(lateralIndex);
|
||||||
|
|
||||||
EXP::writeWellPathGeometryToStream(*stream, wellPath, lateralName, mdStepSize);
|
EXP::writeWellPathGeometryToStream(*stream, &geometry, lateralName, mdStepSize, false, 0.0, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,6 +75,33 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream(QTextStrea
|
|||||||
auto wellPathGeom = wellPath->wellPathGeometry();
|
auto wellPathGeom = wellPath->wellPathGeometry();
|
||||||
if (!wellPathGeom) return;
|
if (!wellPathGeom) return;
|
||||||
|
|
||||||
|
bool useMdRkb = false;
|
||||||
|
double rkb = 0.0;
|
||||||
|
{
|
||||||
|
const RimModeledWellPath* modeledWellPath = dynamic_cast<const RimModeledWellPath*>(wellPath);
|
||||||
|
if (modeledWellPath)
|
||||||
|
{
|
||||||
|
useMdRkb = true;
|
||||||
|
rkb = modeledWellPath->geometryDefinition()->mdrkbAtFirstTarget();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
writeWellPathGeometryToStream(stream, wellPathGeom, exportName, mdStepSize, useMdRkb, rkb, writeProjectInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream(QTextStream& stream,
|
||||||
|
const RigWellPath* wellPathGeom,
|
||||||
|
const QString& exportName,
|
||||||
|
double mdStepSize,
|
||||||
|
bool useMdRkb,
|
||||||
|
double rkbOffset,
|
||||||
|
bool writeProjectInfo)
|
||||||
|
{
|
||||||
|
if (!wellPathGeom) return;
|
||||||
|
|
||||||
double currMd = wellPathGeom->measureDepths().front() - mdStepSize;
|
double currMd = wellPathGeom->measureDepths().front() - mdStepSize;
|
||||||
double endMd = wellPathGeom->measureDepths().back();
|
double endMd = wellPathGeom->measureDepths().back();
|
||||||
|
|
||||||
@ -88,27 +115,16 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream(QTextStrea
|
|||||||
stream << endl;
|
stream << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool useMdRkb = false;
|
|
||||||
double rkb = 0.0;
|
|
||||||
{
|
|
||||||
const RimModeledWellPath* modeledWellPath = dynamic_cast<const RimModeledWellPath*>(wellPath);
|
|
||||||
if (modeledWellPath)
|
|
||||||
{
|
|
||||||
useMdRkb = true;
|
|
||||||
rkb = modeledWellPath->geometryDefinition()->mdrkbAtFirstTarget();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stream << "WELLNAME: '" << caf::Utils::makeValidFileBasename(exportName) << "'" << endl;
|
stream << "WELLNAME: '" << caf::Utils::makeValidFileBasename(exportName) << "'" << endl;
|
||||||
|
|
||||||
auto numberFormat = RifEclipseOutputTableDoubleFormatting(RIF_FLOAT, 2);
|
auto numberFormat = RifEclipseOutputTableDoubleFormatting(RIF_FLOAT, 2);
|
||||||
formatter.header(
|
formatter.header(
|
||||||
{
|
{
|
||||||
{"X", numberFormat, RIGHT},
|
{"X", numberFormat, RIGHT},
|
||||||
{"Y", numberFormat, RIGHT},
|
{"Y", numberFormat, RIGHT},
|
||||||
{"TVDMSL", numberFormat, RIGHT},
|
{"TVDMSL", numberFormat, RIGHT},
|
||||||
{useMdRkb ? "MDRKB" : "MDMSL", numberFormat, RIGHT}
|
{useMdRkb ? "MDRKB" : "MDMSL", numberFormat, RIGHT}
|
||||||
});
|
});
|
||||||
|
|
||||||
while (currMd < endMd)
|
while (currMd < endMd)
|
||||||
{
|
{
|
||||||
@ -122,7 +138,7 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream(QTextStrea
|
|||||||
formatter.add(pt.x());
|
formatter.add(pt.x());
|
||||||
formatter.add(pt.y());
|
formatter.add(pt.y());
|
||||||
formatter.add(tvd);
|
formatter.add(tvd);
|
||||||
formatter.add(currMd + rkb);
|
formatter.add(currMd + rkbOffset);
|
||||||
formatter.rowCompleted("");
|
formatter.rowCompleted("");
|
||||||
}
|
}
|
||||||
formatter.tableCompleted("", false);
|
formatter.tableCompleted("", false);
|
||||||
|
@ -51,12 +51,21 @@ class RicExportSelectedWellPathsFeature : public caf::CmdFeature
|
|||||||
static RicExportWellPathsUi* openDialog();
|
static RicExportWellPathsUi* openDialog();
|
||||||
static QFilePtr openFileForExport(const QString& folderName, const QString& fileName);
|
static QFilePtr openFileForExport(const QString& folderName, const QString& fileName);
|
||||||
static QTextStreamPtr createOutputFileStream(QFile& file);
|
static QTextStreamPtr createOutputFileStream(QFile& file);
|
||||||
|
|
||||||
static void writeWellPathGeometryToStream(QTextStream& stream,
|
static void writeWellPathGeometryToStream(QTextStream& stream,
|
||||||
const RimWellPath* wellPath,
|
const RimWellPath* wellPath,
|
||||||
const QString& exportName,
|
const QString& exportName,
|
||||||
double mdStepSize,
|
double mdStepSize,
|
||||||
bool writeProjectInfo = true);
|
bool writeProjectInfo = true);
|
||||||
|
|
||||||
|
static void writeWellPathGeometryToStream(QTextStream& stream,
|
||||||
|
const RigWellPath* wellPath,
|
||||||
|
const QString& exportName,
|
||||||
|
double mdStepSize,
|
||||||
|
bool useMdRkb,
|
||||||
|
double rkbOffset,
|
||||||
|
bool writeProjectInfo);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool isCommandEnabled() override;
|
bool isCommandEnabled() override;
|
||||||
void onActionTriggered( bool isChecked ) override;
|
void onActionTriggered( bool isChecked ) override;
|
||||||
|
Loading…
Reference in New Issue
Block a user