tune
This commit is contained in:
+7
-4
@@ -152,11 +152,12 @@ execute NC files, and properly manage project resources using
|
||||
|
||||
<h2 id="Sample_Machining_DemoUseMachiningProject_remarks">Remarks</h2>
|
||||
<div class="markdown level0 remarks"><h3 id="source-code">Source Code</h3>
|
||||
<pre><code class="lang-csharp" name="SampleCode">using System;
|
||||
<pre><code class="lang-csharp" name="SampleCode">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
|
||||
{
|
||||
@@ -184,6 +185,8 @@ namespace Sample.Machining
|
||||
|
||||
#region EventHandling
|
||||
Console.WriteLine($"Set message event.");
|
||||
|
||||
using StreamWriter writer = new StreamWriter("msg.txt");
|
||||
//show message if something abnormal.
|
||||
machiningProject.SessionMessageHost.CollectionItemAdded += pack =>
|
||||
{
|
||||
@@ -192,7 +195,7 @@ namespace Sample.Machining
|
||||
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.");
|
||||
|
||||
Reference in New Issue
Block a user