#3827 Fishbone Laterals : Whole well is exported instead of lateral only

This commit is contained in:
Magne Sjaastad 2018-12-05 12:47:07 +01:00
parent 2e8c2e28a8
commit 33a8f773ae
3 changed files with 44 additions and 19 deletions

View File

@ -101,7 +101,7 @@ void RicExportFishbonesLateralsFeature::onActionTriggered(bool isChecked)
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);
EXP::writeWellPathGeometryToStream(*stream, wellPath, lateralName, mdStepSize);
EXP::writeWellPathGeometryToStream(*stream, &geometry, lateralName, mdStepSize, false, 0.0, false);
}
}
}

View File

@ -75,6 +75,33 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream(QTextStrea
auto wellPathGeom = wellPath->wellPathGeometry();
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 endMd = wellPathGeom->measureDepths().back();
@ -88,17 +115,6 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream(QTextStrea
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;
auto numberFormat = RifEclipseOutputTableDoubleFormatting(RIF_FLOAT, 2);
@ -122,7 +138,7 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream(QTextStrea
formatter.add(pt.x());
formatter.add(pt.y());
formatter.add(tvd);
formatter.add(currMd + rkb);
formatter.add(currMd + rkbOffset);
formatter.rowCompleted("");
}
formatter.tableCompleted("", false);

View File

@ -51,12 +51,21 @@ class RicExportSelectedWellPathsFeature : public caf::CmdFeature
static RicExportWellPathsUi* openDialog();
static QFilePtr openFileForExport(const QString& folderName, const QString& fileName);
static QTextStreamPtr createOutputFileStream(QFile& file);
static void writeWellPathGeometryToStream(QTextStream& stream,
const RimWellPath* wellPath,
const QString& exportName,
double mdStepSize,
bool writeProjectInfo = true);
static void writeWellPathGeometryToStream(QTextStream& stream,
const RigWellPath* wellPath,
const QString& exportName,
double mdStepSize,
bool useMdRkb,
double rkbOffset,
bool writeProjectInfo);
private:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;