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 ProgramEndCleanSyntax | HiAPI-C# 2025 ">
<meta name="description" content="Clears the per-block Vars.Volatile dictionary on blocks that triggered program end (M02 / M30, identified by the section written by ). Real Fanuc clears non-retained common variables (#100-#499) on program end + reset; this syntax models that behaviour at the simulator level. The clear happens on the same block that carried M02/M30 — the next block&#39;s carry then sees an empty dictionary on the predecessor and starts fresh. Pipeline placement: must run after both (which writes the section this syntax checks) and (so the carry has already happened on this block; this syntax overwrites the result). Retained common variables (#500-#999, owned by ) are untouched — they survive program end on real hardware (NV-RAM). Local variables (#1-#33, scope: macro call frame) are also untouched here; their lifecycle belongs to G65/G66/M99 push/pop, not program end.">
<meta name="description" content="Clears the per-block Vars.Volatile dictionary on blocks that triggered program end (M02 / M30, identified by the section written by ). Real Fanuc clears non-retained common variables (#100-#499) on program end + reset; this syntax models that behaviour at the simulator level. The clear happens on the same block that carried M02/M30 — the next block&#39;s carry then sees an empty dictionary on the predecessor and starts fresh. Pipeline placement: must run after both (which writes the section this syntax checks) and (so the carry has already happened on this block; this syntax overwrites the result). Retained common variables (#500-#999, owned by ) are untouched — they survive program end on real hardware (NV-RAM). Local variables (#1-#33, scope: macro call frame) are also untouched here; their lifecycle belongs to G65/G66/M99 push/pop, not program end. Also clears any active on the same edge: a G66 modal that was still active when M02/M30 hit is implicitly cancelled, matching real Fanuc reset behaviour. The section is overwritten with a G67-shaped cancel marker so the carry mechanism in sees the boundary and does not propagate the modal past the program-end edge.">
<link rel="icon" href="../img/HiAPI.favicon.ico">
<link rel="stylesheet" href="../public/docfx.min.css">
<link rel="stylesheet" href="../public/main.css">
@@ -121,6 +121,15 @@ Local variables (<code>#1-#33</code>, scope: macro call frame) are also
untouched here; their lifecycle belongs to G65/G66/M99 push/pop, not
program end.
</p>
<p>
Also clears any active <a class="xref" href="Hi.NcParsers.Keywords.FanucModalMacro.html">FanucModalMacro</a> on the same
edge: a G66 modal that was still active when M02/M30 hit is
implicitly cancelled, matching real Fanuc reset behaviour. The
section is overwritten with a <code>G67</code>-shaped cancel marker so
the carry mechanism in
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucModalMacroSyntax.html">FanucModalMacroSyntax</a> sees the boundary
and does not propagate the modal past the program-end edge.
</p>
</div>
<div class="markdown conceptual"></div>
@@ -202,6 +211,44 @@ program end.
</dd></dl>
<h2 id="Hi_NcParsers_LogicSyntaxs_ProgramEndCleanSyntax_examples">Examples</h2>
<p>M30 with a populated <code>Vars.Volatile</code> — the dictionary is wiped
to an empty <code>JsonObject</code> in place (assignment, not removal, so
downstream snapshots can distinguish &ldquo;cleared on program end&rdquo; from
&ldquo;block never had volatile data&rdquo;):
#BeforeBuild:</p>
<pre><code class="lang-csharp">{
"ProgramEnd": { "Term": "M30" },
"Vars": { "Volatile": { "#100": 1.5, "#101": 2.5 } }
}</code></pre>
<p>#AfterBuild:</p>
<pre><code class="lang-csharp">{
"ProgramEnd": { "Term": "M30" },
"Vars": { "Volatile": {} }
}</code></pre>
<p>M02 with an active G66 <a class="xref" href="Hi.NcParsers.Keywords.FanucModalMacro.html">FanucModalMacro</a> and no
pre-existing <code>Vars</code> — the modal is overwritten with a
<code>G67</code>-shaped cancel marker (P/L dropped), and a fresh
<code>Vars.Volatile</code> dictionary is created:
#BeforeBuild:</p>
<pre><code class="lang-csharp">{
"ProgramEnd": { "Term": "M02" },
"FanucModalMacro": { "Term": "G66", "P": 1234, "L": 1 }
}</code></pre>
<p>#AfterBuild:</p>
<pre><code class="lang-csharp">{
"ProgramEnd": { "Term": "M02" },
"FanucModalMacro": { "Term": "G67" },
"Vars": { "Volatile": {} }
}</code></pre>
<p>No <code>ProgramEnd</code> on the block (regular machining line) — the
guard rejects the block; <code>Vars.Volatile</code> is left intact for
downstream blocks to inherit via carry:
#BeforeBuild:</p>
<pre><code class="lang-csharp">{ "Vars": { "Volatile": { "#100": 1.5 } } }</code></pre>
<p>#AfterBuild:</p>
<pre><code class="lang-csharp">{ "Vars": { "Volatile": { "#100": 1.5 } } }</code></pre>
@@ -311,7 +358,7 @@ program end.
</h3>
<div class="markdown level1 summary"><p>XML element name for <a class="xref" href="Hi.Common.XmlUtils.XFactory.html#Hi_Common_XmlUtils_XFactory_Regs">Regs</a> registration.</p>
<div class="markdown level1 summary"><p>XML element name for <a class="xref" href="Hi.Common.XmlUtils.XFactory.html#Hi_Common_XmlUtils_XFactory_Generators">Generators</a> registration.</p>
</div>
<div class="markdown level1 conceptual"></div>