Added function used to filter out per cell results by result name

This commit is contained in:
Magne Sjaastad 2014-08-19 13:56:17 +02:00
parent eb96c5a7ed
commit 72daff665d
5 changed files with 29 additions and 17 deletions

View File

@ -149,7 +149,7 @@ QList<caf::PdmOptionItemInfo> RimCellEdgeResultSlot::calculateValueOptions(const
int i;
for (i = 0; i < varList.size(); ++i)
{
if (varList[i].compare(RimDefines::combinedTransmissibilityResultName(), Qt::CaseInsensitive) == 0) continue;
if (RimDefines::isPerCellFaceResult(varList[i])) continue;
size_t cubeFaceIdx;
for (cubeFaceIdx = 0; cubeFaceIdx < EdgeFaceEnum::size(); ++cubeFaceIdx)
@ -220,7 +220,7 @@ QStringList RimCellEdgeResultSlot::findResultVariableNames()
int i;
for (i = 0; i < varList.size(); ++i)
{
if (varList[i].compare(RimDefines::combinedTransmissibilityResultName(), Qt::CaseInsensitive) == 0) continue;
if (RimDefines::isPerCellFaceResult(varList[i])) continue;
if (varList[i].contains(resultVariable))
{

View File

@ -133,15 +133,7 @@ QList<caf::PdmOptionItemInfo> RimCellPropertyFilter::calculateValueOptions(const
{
QString text = optionItems[i].optionUiText;
if (text.compare(RimDefines::ternarySaturationResultName(), Qt::CaseInsensitive) == 0)
{
indicesToRemove.push_back(i);
}
else if (text.compare(RimDefines::combinedMultResultName(), Qt::CaseInsensitive) == 0)
{
indicesToRemove.push_back(i);
}
else if (text.compare(RimDefines::combinedTransmissibilityResultName(), Qt::CaseInsensitive) == 0)
if (RimDefines::isPerCellFaceResult(text))
{
indicesToRemove.push_back(i);
}

View File

@ -46,3 +46,24 @@ namespace caf
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimDefines::isPerCellFaceResult(const QString& resultName)
{
if (resultName.compare(RimDefines::combinedTransmissibilityResultName(), Qt::CaseInsensitive) == 0)
{
return true;
}
else if (resultName.compare(RimDefines::combinedMultResultName(), Qt::CaseInsensitive) == 0)
{
return true;
}
else if (resultName.compare(RimDefines::ternarySaturationResultName(), Qt::CaseInsensitive) == 0)
{
return true;
}
return false;
}

View File

@ -39,6 +39,8 @@ public:
FRACTURE_MODEL
};
static bool isPerCellFaceResult(const QString& resultName);
static QString undefinedResultName() { return "None"; }
static QString undefinedGridFaultName() { return "Undefined grid faults"; }
static QString combinedTransmissibilityResultName() { return "TRANSXYZ"; }

View File

@ -143,13 +143,10 @@ QList<caf::PdmOptionItemInfo> RimResultDefinition::calculateValueOptions(const c
QList<caf::PdmOptionItemInfo> optionList;
for (int i = 0; i < varList.size(); ++i)
{
if (varList[i].compare(RimDefines::combinedTransmissibilityResultName(), Qt::CaseInsensitive) == 0)
if (RimDefines::isPerCellFaceResult(varList[i]))
{
optionList.push_front(caf::PdmOptionItemInfo(RimDefines::combinedTransmissibilityResultName(), RimDefines::combinedTransmissibilityResultName()));
}
else if (varList[i].compare(RimDefines::combinedMultResultName(), Qt::CaseInsensitive) == 0)
{
optionList.push_front(caf::PdmOptionItemInfo(RimDefines::combinedMultResultName(), RimDefines::combinedMultResultName()));
// Move combined per cell face results to top of list
optionList.push_front(caf::PdmOptionItemInfo(varList[i], varList[i]));
}
else
{