fix SoftNcRunner GM code normalization.

This commit is contained in:
2026-05-06 13:21:19 +08:00
parent 0fe9497552
commit 2f57932000
1238 changed files with 69405 additions and 22511 deletions
@@ -156,6 +156,7 @@ execute NC files, and properly manage project resources using
using Hi.Common.Messages;
using Hi.HiNcKits;
using Hi.MachiningProcs;
using Microsoft.Extensions.Logging;
using System;
using System.IO;
@@ -175,7 +176,8 @@ public static class DemoUseMachiningProject
{
static void Main()
{
LocalApp.AppBegin();
using var loggerFactory = Microsoft.Extensions.Logging.LoggerFactory.Create(b => b.AddConsole());
LocalApp.AppBegin(loggerFactory.CreateLogger("Hi.Sample"));
LocalProjectService localProjectService = new LocalProjectService();
#region ProjectLoading
@@ -202,10 +204,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}\"");
};