Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityInwards/MacroStabilityInwardsKernelWrapper.cs =================================================================== diff -u -r1983 -r1985 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityInwards/MacroStabilityInwardsKernelWrapper.cs (.../MacroStabilityInwardsKernelWrapper.cs) (revision 1983) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityInwards/MacroStabilityInwardsKernelWrapper.cs (.../MacroStabilityInwardsKernelWrapper.cs) (revision 1985) @@ -27,15 +27,18 @@ using Deltares.DamEngine.Calculators.KernelWrappers.Common; using Deltares.DamEngine.Calculators.KernelWrappers.DamMacroStabilityCommon; using Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; +using Deltares.DamEngine.Calculators.KernelWrappers.MacroStabilityCommon.MacroStabilityIo; using Deltares.DamEngine.Calculators.Properties; using Deltares.DamEngine.Data.Design; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.General.Results; using Deltares.DamEngine.Data.Geometry; using Deltares.DamEngine.Data.Geotechnics; using Deltares.DamEngine.Data.Standard.Calculation; -using Deltares.DamEngine.Data.Standard.Logging; +using Deltares.MacroStability.Standard; using Deltares.WTIStability.Calculation.Wrapper; +using LogMessage = Deltares.DamEngine.Data.Standard.Logging.LogMessage; +using LogMessageType = Deltares.DamEngine.Data.Standard.Logging.LogMessageType; namespace Deltares.DamEngine.Calculators.KernelWrappers.MacroStabilityInwards { @@ -53,8 +56,8 @@ public FailureMechanismParametersMStab FailureMechanismParametersMStab { get; set; } //ToDo MWDAM-? Use same as for DGeoStability or create new one? public bool tmpPresumePrepareSucceeds; //ToDo MWDAM-1356 - public bool tmpPresumeInputValid; //ToDo MWDAM-1367 - public bool tmpPresumeRunSucceeds; //ToDo MWDAM-1356, MWDAM-1367, MWDAM-1357 + public bool tmpPresumeInputValid; //ToDo MWDAM-1356 + public bool tmpPresumeRunSucceeds; //ToDo MWDAM-1356, MWDAM-1357 /// /// Prepares the specified dam kernel input. @@ -169,27 +172,26 @@ internal void ParseValidationResult(string xmlValidationResult, out List messages) { messages = new List(); - // ToDo MWDAM-1367: Parse the xml from the kernel and add message with type Error, Info or Warning - // start of temporary test code - if (tmpPresumeInputValid) + var validationResults = WtiDeserializer.DeserializeValidation(xmlValidationResult); + foreach (var result in validationResults) { - // only an info/warning message, presumed input valid for test - messages.Add(new LogMessage() + messages.Add(new LogMessage { - Message = "test info message", - MessageType = LogMessageType.Info + Message = result.Text, + MessageType = ConvertValidationResultTypeToLogMessageType(result.MessageType) }); } - else + } + + internal static LogMessageType ConvertValidationResultTypeToLogMessageType(ValidationResultType messageType) + { + var translationTable = new Dictionary() { - // add an error message, presumed input not valid for test - messages.Add(new LogMessage() - { - Message = "test error message", - MessageType = LogMessageType.Error - }); - } - // end of temporary test code. next code must be enough, presumed that the kernel does all the validation + {ValidationResultType.Info, LogMessageType.Info}, + {ValidationResultType.Warning, LogMessageType.Warning}, + {ValidationResultType.Error, LogMessageType.Error} + }; + return translationTable[messageType]; } /// @@ -208,7 +210,6 @@ PerformStabilityCalculation(out messages, macroStabilityOutput, macroStabilityInput); } - private void PerformStabilityCalculation(out List messages, MacroStabilityOutput macroStabilityOutput, MacroStabilityInput macroStabilityInput) {