Fixed an assert and wrong behavior:

When selecting a result field "heading", after selecting one of its components.
This commit is contained in:
Jacob Støren 2015-06-29 12:17:30 +02:00
parent 948f4d5d58
commit 00f8743cef

View File

@ -89,7 +89,9 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::findOrLoadScalarResult(in
// We need to read the data as bulk fields, and populate the correct scalar caches
std::vector< RigFemResultAddress> resultAddressOfComponents = this->getResAddrToComponentsToRead(resVarAddr);
//
if (resultAddressOfComponents.size())
{
std::vector<RigFemScalarResultFrames*> resultsForEachComponent;
for (size_t cIdx = 0; cIdx < resultAddressOfComponents.size(); ++cIdx)
{
@ -131,6 +133,7 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::findOrLoadScalarResult(in
// Now fetch the particular component requested, which should now exist and be read.
frames = m_femPartResults[partIndex]->findScalarResult(resVarAddr);
}
if (!frames)
{
@ -456,10 +459,13 @@ std::vector< RigFemResultAddress> RigFemPartResultsCollection::getResAddrToCompo
if (fcIt != fieldAndComponentNames.end())
{
std::vector<std::string> compNames = fcIt->second;
if (resVarAddr.componentName != "") // If we did not request a particular component, do not add the components
{
for (size_t cIdx = 0; cIdx < compNames.size(); ++cIdx)
{
resAddressToComponents.push_back(RigFemResultAddress(resVarAddr.resultPosType, resVarAddr.fieldName, compNames[cIdx]));
}
}
if (compNames.size() == 0) // This is a scalar field. Add one component named ""
{