refactor(Sample): adapt demos for SessionStepBuilt rename and ILogger injection
Made-with: Cursor
This commit is contained in:
parent
dd4c3ef28f
commit
6139c84ff9
@ -1,4 +1,5 @@
|
||||
using Hi.HiNcKits;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
|
||||
namespace Sample
|
||||
|
||||
@ -14,6 +14,7 @@ using Hi.NcMech.Holders;
|
||||
using Hi.Machining;
|
||||
using Hi.HiNcKits;
|
||||
using Hi.Milling.MillingTools;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Sample.Machining;
|
||||
|
||||
|
||||
@ -17,6 +17,7 @@ using Hi.MachiningProcs;
|
||||
using System.IO;
|
||||
using Hi.HiNcKits;
|
||||
using Hi.Milling.MillingTools;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Sample.Machining;
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
using Hi.Common.Messages;
|
||||
using Hi.HiNcKits;
|
||||
using Hi.MachiningProcs;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
@ -49,10 +50,10 @@ public static class DemoUseMachiningProject
|
||||
};
|
||||
Console.WriteLine($"Set machining step event.");
|
||||
//show MRR.
|
||||
localProjectService.RuntimeApi.MachiningStepBuilt += (preStep, curStep) =>
|
||||
localProjectService.RuntimeApi.SessionStepBuilt += (preStep, curStep) =>
|
||||
{
|
||||
var sourceCommand = curStep.SourceCommand;
|
||||
var indexedFileLine=sourceCommand?.GetSentence()?.IndexedFileLine;
|
||||
var indexedFileLine=sourceCommand?.GetSentence()?.FirstIndexedFileLine;
|
||||
if (curStep.Mrr_mm3ds > 500) //show only the step that contains large MRR.
|
||||
Console.WriteLine($"MRR = {curStep.Mrr_mm3ds} At \"{indexedFileLine?.FilePath}\" (Line {indexedFileLine?.GetLineNo()}) \"{indexedFileLine?.Line}\"");
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user