Index: DamClients/DamLive/trunk/src/Deltares.Dam.Application.Live/DamEngineRunner.cs =================================================================== diff -u -r1656 -r1666 --- DamClients/DamLive/trunk/src/Deltares.Dam.Application.Live/DamEngineRunner.cs (.../DamEngineRunner.cs) (revision 1656) +++ DamClients/DamLive/trunk/src/Deltares.Dam.Application.Live/DamEngineRunner.cs (.../DamEngineRunner.cs) (revision 1666) @@ -12,6 +12,7 @@ using Deltares.DamEngine.Interface; using Deltares.DamEngine.Io; using Deltares.DamEngine.Io.XmlInput; +using Deltares.DamEngine.Io.XmlOutput; using Deltares.Standard.Application; using Deltares.Standard.Language; using Deltares.Standard.Logging; @@ -187,28 +188,46 @@ try { Input input = FillXmlInputFromDamUi.CreateInput(DamProjectData); -//#if DEBUG +#if DEBUG const string inputFilename = "InputFile.xml"; DamXmlSerialization.SaveInputAsXmlFile(inputFilename, input); -//#endif +#endif string inputXml = DamXmlSerialization.SaveInputAsXmlString(input); var damEngineInterface = new EngineInterface(inputXml); string validationMessages = damEngineInterface.Validate(); // now the validation messages should be deserialized. If any, they should be passed on to the Validator - // and checked for errors. IF errors are found, then no calculation. When no messages or only warnings then + // and checked for errors. If errors are found, then no calculation. When no messages or only warnings then // do calculate. For now, just check length if (string.IsNullOrEmpty(validationMessages)) { string outputXml = damEngineInterface.Run(); var output = DamXmlSerialization.LoadOutputFromXmlString(outputXml); FillDamUiFromXmlOutput.AddOutputToDamProjectData(DamProjectData, output); -//#if DEBUG +#if DEBUG const string outputFilename = "OutputFile.xml"; DamXmlSerialization.SaveOutputAsXmlFile(outputFilename, output); -//#endif - +#endif + foreach (var calculationMessage in output.Results.CalculationMessages) + { + switch (calculationMessage.MessageType) + { + case MessageMessageType.Info: + Logger.LogInfo(calculationMessage.Message1); + break; + case MessageMessageType.Warning: + Logger.LogWarning(calculationMessage.Message1); + break; + case MessageMessageType.Error: + Logger.LogError(calculationMessage.Message1); + break; + } + } } + else + { + // Todo: handle validation messages + } } catch (Exception e) {