rename XFactory.Regs to XFactory.Generators.

This commit is contained in:
2026-05-23 21:23:06 +08:00
parent 8b285cc863
commit 058003f395
155 changed files with 16416 additions and 1261 deletions
@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Class McAbcCyclicPathSyntax | HiAPI-C# 2025 ">
<meta name="description" content="Resolve modular rotary axes to the shortest cyclic path relative to the previous node. Uses to determine which axes within need cyclic resolution. Falls back to hardcoded A/B/C if no is available. Must be placed after in .">
<meta name="description" content="Resolve modular rotary axes to the shortest cyclic path relative to the previous node. Uses to determine which axes within need cyclic resolution. Falls back to hardcoded A/B/C if no is available. Must be placed after in . Two stages, mirroring : Root MachineCoordinateState — anchored at the previous block&#39;s modal rotary state..[*] — sequential walk through items, anchoring item 0 at the previous block&#39;s modal state and item i &amp;gt; 0 at item i-1&#39;s post-cycle value (per-axis chain). Items without a rotary MachineCoordinateState are skipped. The items pass enables rotary motion (e.g. G28 ABC intermediate / home stages) to surface as motion segments rather than a single root-MC stamp.">
<link rel="icon" href="../img/HiAPI.favicon.ico">
<link rel="stylesheet" href="../public/docfx.min.css">
<link rel="stylesheet" href="../public/main.css">
@@ -102,6 +102,18 @@ Uses <a class="xref" href="Hi.NcParsers.Dependencys.IMachineAxisConfig.html#Hi_N
within <a class="xref" href="Hi.NcParsers.Keywords.IMachineCoordinateStateDef.html#Hi_NcParsers_Keywords_IMachineCoordinateStateDef_MachineCoordinateState">MachineCoordinateState</a> need cyclic resolution.
Falls back to hardcoded A/B/C if no <a class="xref" href="Hi.NcParsers.Dependencys.IMachineAxisConfig.html">IMachineAxisConfig</a> is available.
Must be placed after <a class="xref" href="Hi.NcParsers.LogicSyntaxs.ProgramXyzSyntax.html">ProgramXyzSyntax</a> in <a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_NcSyntaxList">NcSyntaxList</a>.</p>
<p>
Two stages, mirroring <a class="xref" href="Hi.NcParsers.LogicSyntaxs.McXyzSyntax.html">McXyzSyntax</a>:
<ol><li>Root <code>MachineCoordinateState</code> — anchored at the previous
block's modal rotary state.</li><li><a class="xref" href="Hi.NcParsers.Keywords.CompoundMotion.html">CompoundMotion</a>.<a class="xref" href="Hi.NcParsers.Keywords.CompoundMotion.html#Hi_NcParsers_Keywords_CompoundMotion_ItemsKey">ItemsKey</a>[*]
— sequential walk through items, anchoring item 0 at the previous
block's modal state and item <code>i &gt; 0</code> at item <code>i-1</code>'s
post-cycle value (per-axis chain). Items without a rotary
<code>MachineCoordinateState</code> are skipped.</li></ol>
The items pass enables rotary motion (e.g. G28 ABC intermediate /
home stages) to surface as motion <a class="xref" href="Hi.Numerical.Acts.IAct.html">IAct</a>
segments rather than a single root-MC stamp.
</div>
<div class="markdown conceptual"></div>
@@ -183,6 +195,73 @@ Must be placed after <a class="xref" href="Hi.NcParsers.LogicSyntaxs.ProgramXyzS
</dd></dl>
<h2 id="Hi_NcParsers_LogicSyntaxs_McAbcCyclicPathSyntax_examples">Examples</h2>
<p>Cases below run with no <a class="xref" href="Hi.NcParsers.Dependencys.IMachineAxisConfig.html">IMachineAxisConfig</a> on the dep
list, so the syntax uses the A/B/C fallback (a configuration
warning is emitted but does not affect the JSON). The syntax is
the tail-pass rotary-wrap centraliser — upstream rotary writers
(<a class="xref" href="Hi.NcParsers.LogicSyntaxs.McAbcSyntax.html">McAbcSyntax</a>, G28, G53.1, ...) store raw degrees and
let this pass resolve to the shortest cyclic path.</p>
<p>
Current B is within ±180° of the previous B — no wrap needed; the
value is rewritten in place but equals the input:
</p>
#Previous:
<pre><code class="lang-csharp">{ "MachineCoordinateState": { "B": 0 } }</code></pre>
#BeforeBuild:
<pre><code class="lang-csharp">{ "MachineCoordinateState": { "B": 10 } }</code></pre>
#AfterBuild:
<pre><code class="lang-csharp">{ "MachineCoordinateState": { "B": 10 } }</code></pre>
Current B is 270° but previous B is 0° — the shortest path is the
other way around, so the value is rewritten as -90° (mathematically
equivalent, geometrically the same orientation, but signalling the
shorter rotation to a downstream motion consumer). 270/0 round-trips
through <code>ToRad</code><code>Cycle</code><code>ToDeg</code> with no rounding
noise (1.5π → -0.5π → -90 exactly); other angle pairs (e.g.
350° → -10°) emit a trailing ULP-scale drift instead:
#Previous:
<pre><code class="lang-csharp">{ "MachineCoordinateState": { "B": 0 } }</code></pre>
#BeforeBuild:
<pre><code class="lang-csharp">{ "MachineCoordinateState": { "B": 270 } }</code></pre>
#AfterBuild:
<pre><code class="lang-csharp">{ "MachineCoordinateState": { "B": -90 } }</code></pre>
First block of the stream (no <code>#Previous:</code>) — no anchor to
resolve against, so the syntax early-returns and the raw value is
preserved verbatim:
#BeforeBuild:
<pre><code class="lang-csharp">{ "MachineCoordinateState": { "B": 350 } }</code></pre>
#AfterBuild:
<pre><code class="lang-csharp">{ "MachineCoordinateState": { "B": 350 } }</code></pre>
<p>
<code>CompoundMotion.Items</code> walk — two items chain: item 0 cycles
against the previous block's modal B = 0° (270° → -90°), and item 1
cycles against item 0's post-cycle -90° (170° → -190°, since the
shorter path from -90° to 170° wraps backward through -180°). If
item 1 had used the previous-block anchor instead of the chained
anchor, 170° would have stayed at 170° (already in the ±180° window
around 0°), so the test discriminates between chain and no-chain:
</p>
#Previous:
<pre><code class="lang-csharp">{ "MachineCoordinateState": { "B": 0 } }</code></pre>
#BeforeBuild:
<pre><code class="lang-csharp">{
"CompoundMotion": {
"Items": [
{ "MachineCoordinateState": { "B": 270 } },
{ "MachineCoordinateState": { "B": 170 } }
]
}
}</code></pre>
#AfterBuild:
<pre><code class="lang-csharp">{
"CompoundMotion": {
"Items": [
{ "MachineCoordinateState": { "B": -90 } },
{ "MachineCoordinateState": { "B": -190 } }
]
}
}</code></pre>