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
@@ -148,7 +148,7 @@ Class DemoMillingByCutterLocation
<h2 id="Sample_Machining_DemoMillingByCutterLocation_remarks">Remarks</h2>
<div class="markdown level0 remarks"><h3 id="source-code">Source Code</h3>
<pre><code class="lang-csharp" name="SampleCode">using Hi.Common;
<pre><code class="lang-csharp" name="SampleCode">using Hi.Common.Messages;
using Hi.Disp;
using Hi.Geom;
using Hi.Geom.Resolution;
@@ -157,6 +157,7 @@ using Hi.MachiningProcs;
using Hi.Numerical.Acts;
using Hi.WpfPlus.Disp;
using HiMachining.Milling;
using Microsoft.Extensions.Logging;
using System;
using System.IO;
using System.Threading.Tasks;
@@ -184,7 +185,8 @@ namespace Sample.Machining
new Cylindroid(new PairZr(-h, 18), new PairZr(0, 18))
.GenStl(new PolarResolution2d(1, MathUtil.ToRad(15))).WriteBin(stlFile_CylinderR18);
LocalApp.AppBegin();
using var loggerFactory = Microsoft.Extensions.Logging.LoggerFactory.Create(b =&gt; b.AddConsole());
LocalApp.AppBegin(loggerFactory.CreateLogger(&quot;Hi.Sample.Wpf&quot;));
LocalProjectService localProjectService = new LocalProjectService();
@@ -202,8 +204,8 @@ namespace Sample.Machining
localProjectService.ClStrip.IsShowDot = true;
double resolution_mm = 0.5;
var projectDir = Path.GetDirectoryName(projectPath);
localProjectService.Workpiece.InitGeom = new StlFile(stlFile_CylinderR20, projectDir);
localProjectService.Workpiece.IdealGeom = new StlFile(stlFile_CylinderR19, projectDir);
localProjectService.WorkpieceService.InitGeom = new StlFile(stlFile_CylinderR20, projectDir);
localProjectService.WorkpieceService.IdealGeom = new StlFile(stlFile_CylinderR19, projectDir);
localProjectService.Workpiece.InitResolution = resolution_mm;
RuntimeApi runtimeApi = localProjectService.RuntimeApi;
@@ -236,7 +238,7 @@ namespace Sample.Machining
{
RunSession(projectService, resolution_mm);
Console.WriteLine($&quot;task done.&quot;);
}).ShowIfCatched(null);
}).CatchExceptions(ex =&gt; Console.WriteLine(ex));
#region Create and Run WPF Application
Application app = new Application
@@ -284,7 +286,7 @@ namespace Sample.Machining
}
static bool IsDifferenceAceptable(LocalProjectService localProjectService, double diffLimit)
{
foreach (var attachment in localProjectService.Workpiece.DiffAttachmentBag)
foreach (var attachment in localProjectService.WorkpieceService.DiffAttachmentBag)
{
if (double.IsNaN(attachment.Diff) || Math.Abs(attachment.Diff) &gt; diffLimit)
{