From 519c519d8721ba96e2af8082789e4f16721f7264 Mon Sep 17 00:00:00 2001 From: iamboss Date: Fri, 3 Oct 2025 16:54:26 +0800 Subject: [PATCH] rename HiNC webapi to webservice. --- Machining/DemoUseMachiningProject.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Machining/DemoUseMachiningProject.cs b/Machining/DemoUseMachiningProject.cs index 22593a2..5fbbfd7 100644 --- a/Machining/DemoUseMachiningProject.cs +++ b/Machining/DemoUseMachiningProject.cs @@ -1,8 +1,9 @@ -using System; +using Hi.Common.FileLines; using Hi.Common.Messages; -using Hi.MachiningProcs; -using Hi.Common.FileLines; using Hi.HiNcKits; +using Hi.MachiningProcs; +using System; +using System.IO; namespace Sample.Machining { @@ -30,15 +31,17 @@ namespace Sample.Machining #region EventHandling Console.WriteLine($"Set message event."); - //show message if something abnormal. - machiningProject.SessionMessageHost.CollectionItemAdded += pack => + + using StreamWriter writer = new StreamWriter("msg.txt"); + //show message if something abnormal. + machiningProject.SessionMessageHost.CollectionItemAdded += pack => { if (pack.Tags.Contains(MessageFlag.Warning.ToString()) || pack.Tags.Contains(MessageFlag.Error.ToString()) || pack.Tags.Contains(MessageFlag.Exception.ToString())) { var sourceCommand = pack.SourceCommand; - Console.WriteLine($"{pack.Message} At \"{sourceCommand?.FilePath}\" (Line {sourceCommand?.GetLineNo()}) \"{sourceCommand?.Line}\""); + writer.WriteLine($"{pack.Message} At \"{sourceCommand?.FilePath}\" (Line {sourceCommand?.GetLineNo()}) \"{sourceCommand?.Line}\""); } }; Console.WriteLine($"Set machining step event.");