Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiMacroStabilityInwards/WtiMacroStabilityInwardsKernelWrapper.cs =================================================================== diff -u -r1965 -r1967 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiMacroStabilityInwards/WtiMacroStabilityInwardsKernelWrapper.cs (.../WtiMacroStabilityInwardsKernelWrapper.cs) (revision 1965) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiMacroStabilityInwards/WtiMacroStabilityInwardsKernelWrapper.cs (.../WtiMacroStabilityInwardsKernelWrapper.cs) (revision 1967) @@ -213,7 +213,6 @@ { ThrowWhenWtiMacroStabilityCalculatorNull(wtiMacroStabilityCalculator); macroStabilityOutput.CalculationResult = CalculationResult.NoRun; - messages = new List(); macroStabilityOutput.StabilityOutputItems = new List(); //this must be code when prepare is done @@ -234,28 +233,49 @@ if (tmpPresumeRunSucceeds) { //presume run succeeded - macroStabilityOutput.CalculationResult = CalculationResult.Succeeded; - ParseRunResult("", macroStabilityOutput, messages); + WtiMacroStabilityOutputItem macroStabilityOutputItem; + ParseRunResult("", out macroStabilityOutputItem, out messages); + macroStabilityOutput.CalculationResult = macroStabilityOutputItem.CalculationResult; + macroStabilityOutput.StabilityOutputItems.Add(macroStabilityOutputItem); } else { //presume run failed macroStabilityOutput.CalculationResult = CalculationResult.UnexpectedError; + messages = new List(); messages.Add(new LogMessage(LogMessageType.Error, null, "run failed")); } // end of temporary test code } - private void ParseRunResult(string xmlRunResult, WtiMacroStabilityOutput macroStabilityOutput, List messages) + internal void ParseRunResult(string xmlRunResult, out WtiMacroStabilityOutputItem macroStabilityOutputItem, out List messages) { + messages = new List(); // ToDo MWDAM-1357: Parse the xml from the kernel, fill results and add message with type Error, Info or Warning - var macroStabilityOutputItem = new WtiMacroStabilityOutputItem(); + macroStabilityOutputItem = new WtiMacroStabilityOutputItem(); // start of temporary test code - macroStabilityOutputItem.SafetyFactor = 1.357; + if (tmpPresumeRunSucceeds) + { + //presume run succeeded + macroStabilityOutputItem.StabilityModelType = MStabModelType.UpliftVan; + macroStabilityOutputItem.SafetyFactor = 1.357; // presume SafetyFactor in xml output is 1.357 + macroStabilityOutputItem.CalculationResult = CalculationResult.Succeeded; // presume Succeeded in xml output is true + //presume there are no messages in xml output, but there might be info or warning messages + } + else + { + // ToDo MWDAM-1357: get an example of output that has a failed run with error messages + //presume run failed + macroStabilityOutputItem.StabilityModelType = MStabModelType.UpliftVan; + macroStabilityOutputItem.SafetyFactor = -1; // presume SafetyFactor in xml output is NaN. Set to -1? + macroStabilityOutputItem.CalculationResult = CalculationResult.RunFailed; // presume Succeeded in xml output is false + //when run failed there are probably also error messages in the xml output + messages.Add(new LogMessage(LogMessageType.Error, null, "Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index")); + messages.Add(new LogMessage(LogMessageType.Error, null, "Fatale fout in Uplift-Van berekening")); + } // end of temporary test code - macroStabilityOutput.StabilityOutputItems.Add(macroStabilityOutputItem); } ///