#1560 Ensure eclipse case and well path uses same unit system when exporting

This commit is contained in:
Bjørnar Grip Fjær 2017-06-08 12:59:12 +02:00
parent af95dacf03
commit 2833da34a1

View File

@ -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);