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
@@ -99,23 +99,12 @@ Classes
<dd><p>Depth-First Sequential Syntaxes management.
It saves space by save the LazyLinkedLists from each syntax to only one LazyLinkedLists in <a class="xref" href="Hi.NcParsers.SoftNcRunner.html">SoftNcRunner</a> to get better performance.
If the <a class="xref" href="Hi.NcParsers.Syntaxs.INcSyntax.html">INcSyntax</a> only edit the current node itself, those self-editing <a class="xref" href="Hi.NcParsers.Syntaxs.INcSyntax.html">INcSyntax</a> without looks-forward is suitable to put into the <a class="xref" href="Hi.NcParsers.Syntaxs.BundleSyntax.html">BundleSyntax</a>.</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.Syntaxs.CleanupSyntax.html">CleanupSyntax</a></dt>
<dd><p>Removes indicated JSON keys from <a class="xref" href="Hi.NcParsers.Syntaxs.SyntaxPiece.html#Hi_NcParsers_Syntaxs_SyntaxPiece_JsonObject">JsonObject</a>
after upstream syntaxes have consumed them.
Useful for cleaning up runtime-derived intermediate data
(e.g., <a class="xref" href="Hi.NcParsers.Keywords.ITransformationDef.html#Hi_NcParsers_Keywords_ITransformationDef_ProgramToMcTransform">ProgramToMcTransform</a>)
that should not persist in the final output.</p>
<p>
Place at the end of the syntax list, after all consumers have read the keys.
</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.Syntaxs.FanucSyntaxUtil.html">FanucSyntaxUtil</a></dt>
<dd></dd>
<dd><p>Pre-built <a class="xref" href="Hi.NcParsers.ParsingSyntaxs.ParameterizedFlagSyntax.html">ParameterizedFlagSyntax</a> / flag patterns for Fanuc-style NC text.</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.Syntaxs.GenericSyntaxKit.html">GenericSyntaxKit</a></dt>
@@ -125,7 +114,8 @@ Contains syntax definitions for common G codes used across multiple NC systems.<
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.Syntaxs.HeidenhainSyntaxUtil.html">HeidenhainSyntaxUtil</a></dt>
<dd></dd>
<dd><p>Pre-built parsing syntax fragments for Heidenhain-style programs (Q variables, FMAX/FAUTO, etc.).</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.Syntaxs.MazakSyntaxUtil.html">MazakSyntaxUtil</a></dt>
@@ -134,15 +124,26 @@ Contains syntax definitions for common G codes used across multiple NC systems.<
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.Syntaxs.NcSyntaxUtil.html">NcSyntaxUtil</a></dt>
<dd></dd>
<dd><p>JSON serialization settings and grab/set helpers for NC block <a class="xref" href="Hi.NcParsers.Syntaxs.SyntaxPiece.html#Hi_NcParsers_Syntaxs_SyntaxPiece_JsonObject">JsonObject</a> trees.</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.Syntaxs.SiemensSyntaxUtil.html">SiemensSyntaxUtil</a></dt>
<dd></dd>
<dd><p>Pre-built parsing syntax fragments for Siemens-style programs (R parameters, TRAORI, etc.).</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.Syntaxs.SyntaxPiece.html">SyntaxPiece</a></dt>
<dd></dd>
<dd><p>One NC block's source line paired with its parsed JSON payload during soft-NC processing.</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.Syntaxs.SyntaxStageKeys.html">SyntaxStageKeys</a></dt>
<dd><p>Shared JSON key constants written by post-Logic and Inspection stage
syntaxes. Central registry so the string literals do not drift across
syntax files; readers of cache dumps can reference these constants
directly rather than hard-coding the raw strings.</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.Syntaxs.SyntecSyntaxUtil.html">SyntecSyntaxUtil</a></dt>
@@ -156,9 +157,21 @@ Contains syntax definitions for common G codes used across multiple NC systems.<
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html">TransformationUtil</a></dt>
<dd><p>Utilities for the <a class="xref" href="Hi.NcParsers.Keywords.ITransformationDef.html#Hi_NcParsers_Keywords_ITransformationDef_ProgramToMcTransform">ProgramToMcTransform</a> chain.
Each entry has &ldquo;Source&rdquo; (string) and &ldquo;Mat4d&rdquo; (16-element JsonArray).
<a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_AddOrReplaceTransform_System_Text_Json_Nodes_JsonObject_System_String_Hi_Geom_Mat4d_">AddOrReplaceTransform(JsonObject, string, Mat4d)</a> inserts or replaces an entry by source name.
<a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_GetComposedTransform_System_Text_Json_Nodes_JsonObject_">GetComposedTransform(JsonObject)</a> composes all entries into a single Mat4d.</p>
Each entry is <code>{Source, Kind, Mat4d}</code>; entries are composed in order
with pure matrix multiplication (<a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_GetComposedTransform_System_Text_Json_Nodes_JsonObject_">GetComposedTransform(JsonObject)</a>).</p>
<p>
<a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_KindKey">KindKey</a> partitions the entries by contour validity:
<ul><li><a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_KindStatic">KindStatic</a> — the matrix is valid across the whole
block, applicable to any interpolated point along the contour.</li><li><a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_KindDynamic">KindDynamic</a> — the matrix is a block-endpoint snapshot
of a rotary-state-dependent transform (RTCP rotary-dynamic). Composing it
produces a correct endpoint MC, but interpolated points along the contour
must be derived per-step by motion semantics
(<a class="xref" href="Hi.NcParsers.Semantics.ClLinearMotionSemantic.html">ClLinearMotionSemantic</a>); do not apply it to
interpolated ProgramXyz.</li></ul>
Both kinds carry a real Mat4d so composition stays a pure matrix product —
no entry has a missing matrix. Use <a class="xref" href="Hi.NcParsers.Syntaxs.TransformationUtil.html#Hi_NcParsers_Syntaxs_TransformationUtil_HasDynamicEntry_System_Text_Json_Nodes_JsonObject_">HasDynamicEntry(JsonObject)</a> to detect
the dynamic-rotary state without consulting a sibling section flag.
</dd>
</dl>
<h3 id="interfaces">