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
@@ -193,33 +193,6 @@ Compare to <a class="xref" href="Hi.MachiningProcs.MachiningProject.html">Machin
</h2>
<a id="Hi_MachiningProcs_LocalProjectService__ctor_" data-uid="Hi.MachiningProcs.LocalProjectService.#ctor*"></a>
<h3 id="Hi_MachiningProcs_LocalProjectService__ctor" data-uid="Hi.MachiningProcs.LocalProjectService.#ctor">
LocalProjectService()
</h3>
<div class="markdown level1 summary"><p>Ctor.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public LocalProjectService()</code></pre>
</div>
<a id="Hi_MachiningProcs_LocalProjectService__ctor_" data-uid="Hi.MachiningProcs.LocalProjectService.#ctor*"></a>
<h3 id="Hi_MachiningProcs_LocalProjectService__ctor_Hi_HiNcKits_UserService_Microsoft_Extensions_Logging_ILogger_Hi_MachiningProcs_LocalProjectService__" data-uid="Hi.MachiningProcs.LocalProjectService.#ctor(Hi.HiNcKits.UserService,Microsoft.Extensions.Logging.ILogger{Hi.MachiningProcs.LocalProjectService})">
@@ -256,10 +229,75 @@ Compare to <a class="xref" href="Hi.MachiningProcs.MachiningProject.html">Machin
<a id="Hi_MachiningProcs_LocalProjectService__ctor_" data-uid="Hi.MachiningProcs.LocalProjectService.#ctor*"></a>
<h3 id="Hi_MachiningProcs_LocalProjectService__ctor_Microsoft_Extensions_Logging_ILogger_Hi_MachiningProcs_LocalProjectService__" data-uid="Hi.MachiningProcs.LocalProjectService.#ctor(Microsoft.Extensions.Logging.ILogger{Hi.MachiningProcs.LocalProjectService})">
LocalProjectService(ILogger&lt;LocalProjectService&gt;)
</h3>
<div class="markdown level1 summary"><p>Ctor.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public LocalProjectService(ILogger&lt;LocalProjectService&gt; logger = null)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>logger</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger-1">ILogger</a>&lt;<a class="xref" href="Hi.MachiningProcs.LocalProjectService.html">LocalProjectService</a>&gt;</dt>
<dd><p>Optional logger instance.</p>
</dd>
</dl>
<h2 class="section" id="properties">Properties
</h2>
<a id="Hi_MachiningProcs_LocalProjectService_ActiveNcRunner_" data-uid="Hi.MachiningProcs.LocalProjectService.ActiveNcRunner*"></a>
<h3 id="Hi_MachiningProcs_LocalProjectService_ActiveNcRunner" data-uid="Hi.MachiningProcs.LocalProjectService.ActiveNcRunner">
ActiveNcRunner
</h3>
<div class="markdown level1 summary"><p>Gets the active NC runner based on <a class="xref" href="Hi.MachiningProcs.LocalProjectService.html#Hi_MachiningProcs_LocalProjectService_EnableSoftNcRunner">EnableSoftNcRunner</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public IControlRunner ActiveNcRunner { get; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.Numerical.IControlRunner.html">IControlRunner</a></dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_LocalProjectService_BoundSelectorHost_" data-uid="Hi.MachiningProcs.LocalProjectService.BoundSelectorHost*"></a>
<h3 id="Hi_MachiningProcs_LocalProjectService_BoundSelectorHost" data-uid="Hi.MachiningProcs.LocalProjectService.BoundSelectorHost">
@@ -421,6 +459,40 @@ When set to true, initializes collision detection mechanism.</p>
<a id="Hi_MachiningProcs_LocalProjectService_EnableSoftNcRunner_" data-uid="Hi.MachiningProcs.LocalProjectService.EnableSoftNcRunner*"></a>
<h3 id="Hi_MachiningProcs_LocalProjectService_EnableSoftNcRunner" data-uid="Hi.MachiningProcs.LocalProjectService.EnableSoftNcRunner">
EnableSoftNcRunner
</h3>
<div class="markdown level1 summary"><p>Workaround flag to switch between <a class="xref" href="Hi.NcParsers.SoftNcRunner.html">SoftNcRunner</a> and <a class="xref" href="Hi.Numerical.FilePlayers.HardNcRunner.html">HardNcRunner</a>.
When true and <a class="xref" href="Hi.MachiningProcs.MachiningProject.html#Hi_MachiningProcs_MachiningProject_SoftNcRunner">SoftNcRunner</a> is available, uses <a class="xref" href="Hi.NcParsers.SoftNcRunner.html">SoftNcRunner</a>.
Will be removed when <a class="xref" href="Hi.Numerical.FilePlayers.HardNcRunner.html">HardNcRunner</a> is fully replaced.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public bool EnableSoftNcRunner { get; set; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_LocalProjectService_EnableStrokeLimitCheck_" data-uid="Hi.MachiningProcs.LocalProjectService.EnableStrokeLimitCheck*"></a>
<h3 id="Hi_MachiningProcs_LocalProjectService_EnableStrokeLimitCheck" data-uid="Hi.MachiningProcs.LocalProjectService.EnableStrokeLimitCheck">
@@ -1007,7 +1079,7 @@ Updates related components when changed.</p>
</h3>
<div class="markdown level1 summary"><p>Gets the NC runner responsible for executing NC programs.</p>
<div class="markdown level1 summary"><p>Gets the legacy NC runner.</p>
</div>
<div class="markdown level1 conceptual"></div>
@@ -1289,6 +1361,38 @@ Ensures proper initialization of workpiece properties.</p>
<a id="Hi_MachiningProcs_LocalProjectService_WorkpieceService_" data-uid="Hi.MachiningProcs.LocalProjectService.WorkpieceService*"></a>
<h3 id="Hi_MachiningProcs_LocalProjectService_WorkpieceService" data-uid="Hi.MachiningProcs.LocalProjectService.WorkpieceService">
WorkpieceService
</h3>
<div class="markdown level1 summary"><p>Gets the workpiece runtime service.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public WorkpieceService WorkpieceService { get; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.NcMech.Workpieces.WorkpieceService.html">WorkpieceService</a></dt>
<dd></dd>
</dl>
<h2 class="section" id="methods">Methods
</h2>
@@ -1784,6 +1888,45 @@ Clear the state from previous session (if existed).</p>
<a id="Hi_MachiningProcs_LocalProjectService_PowerReset_" data-uid="Hi.MachiningProcs.LocalProjectService.PowerReset*"></a>
<h3 id="Hi_MachiningProcs_LocalProjectService_PowerReset" data-uid="Hi.MachiningProcs.LocalProjectService.PowerReset">
PowerReset()
</h3>
<div class="markdown level1 summary"><p>Performs a controller power reset, modelling a power-off / power-on cycle:</p>
<ul><li>Every <a class="xref" href="Hi.NcParsers.Dependencys.IPowerResettable.html">IPowerResettable</a> dependency clears its volatile
subset. Persistent dependency state (controller parameters,
Fanuc <code>#500-#999</code>, etc.) is left intact.</li><li>The active <a class="xref" href="Hi.MachiningProcs.LocalProjectService.html#Hi_MachiningProcs_LocalProjectService_MachiningSession">MachiningSession</a>'s
<a class="xref" href="Hi.MachiningProcs.NcRunnerSessionState.html">NcRunnerSessionState</a> is reset so the per-layer
<code>SyntaxPiece</code> dataflow — including <code>Vars.Volatile</code>, modal
carries, and the init seed — is dropped. The next
<a class="xref" href="Hi.Numerical.IControlRunner.html#Hi_Numerical_IControlRunner_RunControlLines_System_String_System_Collections_Generic_IEnumerable_System_String__Hi_MachiningProcs_MachiningSession_Hi_MachiningProcs_SessionProgress_System_Threading_CancellationToken_">RunControlLines(string, IEnumerable&lt;string&gt;, MachiningSession, SessionProgress, CancellationToken)</a> call re-initialises
everything from scratch.</li></ul>
Without the second step, calling <code>PowerReset</code> while a project is
loaded would leave volatile commons alive across the supposed power
cycle (they live in the SyntaxPiece JSON dataflow rather than in any
<a class="xref" href="Hi.NcParsers.Dependencys.IPowerResettable.html">IPowerResettable</a> dependency).
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void PowerReset()</code></pre>
</div>
<a id="Hi_MachiningProcs_LocalProjectService_ProcAct_" data-uid="Hi.MachiningProcs.LocalProjectService.ProcAct*"></a>
<h3 id="Hi_MachiningProcs_LocalProjectService_ProcAct_Hi_Numerical_Acts_IAct_Hi_NcParsers_IGetSentence_System_Nullable_System_Threading_CancellationToken__" data-uid="Hi.MachiningProcs.LocalProjectService.ProcAct(Hi.Numerical.Acts.IAct,Hi.NcParsers.IGetSentence,System.Nullable{System.Threading.CancellationToken})">
@@ -2074,6 +2217,33 @@ Clear the state from previous session (if existed).</p>
<a id="Hi_MachiningProcs_LocalProjectService_RunToLineEnd_" data-uid="Hi.MachiningProcs.LocalProjectService.RunToLineEnd*"></a>
<h3 id="Hi_MachiningProcs_LocalProjectService_RunToLineEnd" data-uid="Hi.MachiningProcs.LocalProjectService.RunToLineEnd">
RunToLineEnd()
</h3>
<div class="markdown level1 summary"><p>Advances the player by one NC/CSV line and pauses.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void RunToLineEnd()</code></pre>
</div>
<a id="Hi_MachiningProcs_LocalProjectService_SaveAsProject_" data-uid="Hi.MachiningProcs.LocalProjectService.SaveAsProject*"></a>
<h3 id="Hi_MachiningProcs_LocalProjectService_SaveAsProject_System_String_" data-uid="Hi.MachiningProcs.LocalProjectService.SaveAsProject(System.String)">
@@ -2398,17 +2568,17 @@ The previous step is null if no previous step exists.</p>
<h3 id="Hi_MachiningProcs_LocalProjectService_OnRanNcBlock" data-uid="Hi.MachiningProcs.LocalProjectService.OnRanNcBlock">
OnRanNcBlock
<h3 id="Hi_MachiningProcs_LocalProjectService_OnNcFileRan" data-uid="Hi.MachiningProcs.LocalProjectService.OnNcFileRan">
OnNcFileRan
</h3>
<div class="markdown level1 summary"><p>Event triggered after an NC block is executed.</p>
<div class="markdown level1 summary"><p>Event triggered after an NC file is executed.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public event Action OnRanNcBlock</code></pre>
<pre><code class="lang-csharp hljs">public event Action OnNcFileRan</code></pre>
</div>
@@ -2429,6 +2599,68 @@ The previous step is null if no previous step exists.</p>
<h3 id="Hi_MachiningProcs_LocalProjectService_OnSourcedActEntry" data-uid="Hi.MachiningProcs.LocalProjectService.OnSourcedActEntry">
OnSourcedActEntry
</h3>
<div class="markdown level1 summary"><p>App-lifetime event triggered for each <a class="xref" href="Hi.Numerical.SourcedActEntry.html">SourcedActEntry</a> produced during NC/CSV execution.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public event Action&lt;SourcedActEntry&gt; OnSourcedActEntry</code></pre>
</div>
<h4 class="section">Event Type</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action-1">Action</a>&lt;<a class="xref" href="Hi.Numerical.SourcedActEntry.html">SourcedActEntry</a>&gt;</dt>
<dd></dd>
</dl>
<h3 id="Hi_MachiningProcs_LocalProjectService_OnSyntaxPieceRan" data-uid="Hi.MachiningProcs.LocalProjectService.OnSyntaxPieceRan">
OnSyntaxPieceRan
</h3>
<div class="markdown level1 summary"><p>Raised after each <a class="xref" href="Hi.NcParsers.Syntaxs.SyntaxPiece.html">SyntaxPiece</a> has been run during NC execution (app lifetime).</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public event Action&lt;SyntaxPiece&gt; OnSyntaxPieceRan</code></pre>
</div>
<h4 class="section">Event Type</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action-1">Action</a>&lt;<a class="xref" href="Hi.NcParsers.Syntaxs.SyntaxPiece.html">SyntaxPiece</a>&gt;</dt>
<dd></dd>
</dl>
<h3 id="Hi_MachiningProcs_LocalProjectService_OnUpdatedInspectingQuantityFunc" data-uid="Hi.MachiningProcs.LocalProjectService.OnUpdatedInspectingQuantityFunc">
OnUpdatedInspectingQuantityFunc