mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1560 Ensure eclipse case and well path uses same unit system when exporting
This commit is contained in:
parent
af95dacf03
commit
2833da34a1
@ -152,6 +152,28 @@ void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
bool unitSystemMismatch = false;
|
||||||
|
for (const RimWellPath* wellPath : wellPaths)
|
||||||
|
{
|
||||||
|
if (wellPath->unitSystem() == RimUnitSystem::UNITS_FIELD && exportSettings.caseToApply->eclipseCaseData()->unitsType() != RigEclipseCaseData::UNITS_FIELD)
|
||||||
|
{
|
||||||
|
unitSystemMismatch = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (wellPath->unitSystem() == RimUnitSystem::UNITS_METRIC && exportSettings.caseToApply->eclipseCaseData()->unitsType() != RigEclipseCaseData::UNITS_METRIC)
|
||||||
|
{
|
||||||
|
unitSystemMismatch = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (unitSystemMismatch)
|
||||||
|
{
|
||||||
|
RiaLogging::error("Well path unit systems must match unit system of chosen eclipse case.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QTextStream stream(&exportFile);
|
QTextStream stream(&exportFile);
|
||||||
RifEclipseDataTableFormatter formatter(stream);
|
RifEclipseDataTableFormatter formatter(stream);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user