rename HiNC webapi to webservice.

This commit is contained in:
iamboss 2025-10-03 16:54:26 +08:00
parent 103092e10b
commit 519c519d87

View File

@ -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.");