Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityInwards/MacroStabilityInwardsKernelWrapper.cs =================================================================== diff -u -r6483 -r6492 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityInwards/MacroStabilityInwardsKernelWrapper.cs (.../MacroStabilityInwardsKernelWrapper.cs) (revision 6483) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityInwards/MacroStabilityInwardsKernelWrapper.cs (.../MacroStabilityInwardsKernelWrapper.cs) (revision 6492) @@ -292,41 +292,30 @@ } // Now add the overall result for Bishop/UpliftVan only if both results are available. - if (macroStabilityOutput.StabilityOutputItems.Count == 2) - //if (designResults.Count == 2) + if (macroStabilityOutput!.StabilityOutputItems.Count == 2) { - //#Bka There is only one result at the moment and thats the resulting one, this is a hack for now as Tom did not fill both results yet - int index = 0; - //#Bka Some tests already have properly filled results, then do not add next. Can be removed when outpout is Ok - if (designResults.Count == 1) + int index; + // Add worst result from Bishop/UpliftVan, but only if both succeeded. + if (designResults[0].CalculationResult == CalculationResult.Succeeded && + designResults[1].CalculationResult == CalculationResult.Succeeded) { - AddDesignResult(damKernelInput, designScenario, designResults, macroStabilityOutputItem, macroStabilityOutput); + index = designResults[0].StabilityDesignResults.SafetyFactor <= designResults[1].StabilityDesignResults.SafetyFactor ? 0 : 1; } + else if (designResults[0].CalculationResult != CalculationResult.Succeeded) + { + // There is no reason why Bishop should not have succeeded. Therefore, no end results can be given + index = 0; + } + else if (designResults[1].CalculationResult == CalculationResult.NoRun) + { + // No uplift therefore no UpliftVan calculation was made. Present Bishop result. + index = 0; + } else { - index = designResults[0].StabilityDesignResults.SafetyFactor <= designResults[1].StabilityDesignResults.SafetyFactor ? 0 : 1; + // UpliftVan calculation failed. No end results can be given + index = 1; } - // add worst result from Bishop/UpliftVan, but only if both succeeded. - // if (designResults[0].CalculationResult == CalculationResult.Succeeded && - // designResults[1].CalculationResult == CalculationResult.Succeeded) - // { - // index = designResults[0].StabilityDesignResults.SafetyFactor <= designResults[1].StabilityDesignResults.SafetyFactor ? 0 : 1; - // } - // else if (designResults[0].CalculationResult != CalculationResult.Succeeded) - // { - // // There is no reason why Bishop should not have succeeded therefore no end results can be given - // index = 0; - // } - // else if (designResults[1].CalculationResult == CalculationResult.NoRun) - // { - // // No uplift therefore no UpliftVan calculation was made. Present Bishop result. - // index = 0; - // } - // else - // { - // // UpliftVan calculation failed. No end results can be given - // index = 1; - // } macroStabilityOutputItem = ProperMacroStabilityResultsItem(macroStabilityOutput, index); DesignResult overallResult = MacroStabilityCommonHelper.NewDesignResult(damKernelInput, designScenario);