fix SoftNcRunner GM code normalization.

This commit is contained in:
2026-05-16 18:08:13 +08:00
parent e026da61b3
commit 8b285cc863
765 changed files with 18689 additions and 9785 deletions
@@ -304,7 +304,7 @@
</table>
<hr>
<h2 id="registering-custom-step-variables">Registering Custom Step Variables</h2>
<p>Beyond default properties, you can register custom step variables using <a class="xref" href="../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_RegisterStepVariable_">RegisterStepVariable</a>:</p>
<p>Beyond default properties, you can register custom step variables using <a class="xref" href="../../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_RegisterStepVariable_">RegisterStepVariable</a>:</p>
<pre><code class="lang-csharp">RegisterStepVariable(
&quot;ChipVolume&quot;, // key
&quot;Chip Volume&quot;, // display name
@@ -323,7 +323,7 @@ PlayNcFile(&quot;NC/file1.nc&quot;);
<li><strong>formatString</strong>: .NET numeric format string (can be null)</li>
<li><strong>variableFunction</strong>: Lambda that computes the value from a step (can be null)</li>
</ul>
<p>Registered variables appear in the UI and in output files from <a class="xref" href="../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_WriteStepFiles_">WriteStepFiles</a>.</p>
<p>Registered variables appear in the UI and in output files from <a class="xref" href="../../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_WriteStepFiles_">WriteStepFiles</a>.</p>
<h3 id="indexer-access">Indexer Access</h3>
<p>Use the <a class="xref" href="../../api/Hi.MachiningSteps.MachiningStep.html#Hi_MachiningSteps_MachiningStep_Item_System_String_">this[string]</a> indexer to read/write custom data on a step:</p>
<pre><code class="lang-csharp">SessionStepBuilt += (preStep, curStep) =&gt; {
@@ -334,7 +334,7 @@ PlayNcFile(&quot;NC/file1.nc&quot;);
<hr>
<h2 id="accessing-step-data">Accessing Step Data</h2>
<h3 id="getmillingstep">GetMillingStep</h3>
<p><a class="xref" href="../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_GetMillingStep_">GetMillingStep</a> retrieves a step by index:</p>
<p><a class="xref" href="../../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_GetMillingStep_">GetMillingStep</a> retrieves a step by index:</p>
<pre><code class="lang-csharp">var step = GetMillingStep(100);
if (step != null)
{
@@ -342,7 +342,7 @@ if (step != null)
}
</code></pre>
<h3 id="stepcount">StepCount</h3>
<p><a class="xref" href="../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_StepCount">StepCount</a> returns the total number of steps:</p>
<p><a class="xref" href="../../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_StepCount">StepCount</a> returns the total number of steps:</p>
<pre><code class="lang-csharp">Message($&quot;Total steps: {StepCount}&quot;);
</code></pre>
<h3 id="iterating-all-steps">Iterating All Steps</h3>
@@ -354,16 +354,16 @@ if (step != null)
</code></pre>
<hr>
<h2 id="step-output-files">Step Output Files</h2>
<p>Steps can be exported to CSV using <a class="xref" href="../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_WriteStepFiles_">WriteStepFiles</a>:</p>
<p>Steps can be exported to CSV using <a class="xref" href="../../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_WriteStepFiles_">WriteStepFiles</a>:</p>
<pre><code class="lang-csharp">WriteStepFiles(&quot;Output/[NcName].step.csv&quot;);
</code></pre>
<p>The CSV contains all default properties plus any registered custom variables. The file can be read back with <a class="xref" href="../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_PlayCsvFile_">PlayCsvFile</a>.</p>
<p>For waveform-level data (sub-step time resolution), use <a class="xref" href="../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_WriteShotFiles_">WriteShotFiles</a>:</p>
<p>The CSV contains all default properties plus any registered custom variables. The file can be read back with <a class="xref" href="../../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_PlayCsvFile_">PlayCsvFile</a>.</p>
<p>For waveform-level data (sub-step time resolution), use <a class="xref" href="../../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_WriteShotFiles_">WriteShotFiles</a>:</p>
<pre><code class="lang-csharp">WriteShotFiles(&quot;Output/[NcName].shot.csv&quot;, 1); // 1 ms time resolution
</code></pre>
<hr>
<h2 id="dynamically-registered-variables-training">Dynamically Registered Variables (Training)</h2>
<p>After executing <a class="xref" href="../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_TrainMillingPara_">TrainMillingPara</a> or <a class="xref" href="../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_ReTrainMillingPara_">ReTrainMillingPara</a>, two additional step variables are automatically registered for steps within the training region:</p>
<p>After executing <a class="xref" href="../../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_TrainMillingPara_">TrainMillingPara</a> or <a class="xref" href="../../api/Hi.MachiningProcs.SessionShell.html#Hi_MachiningProcs_SessionShell_ReTrainMillingPara_">ReTrainMillingPara</a>, two additional step variables are automatically registered for steps within the training region:</p>
<table>
<thead>
<tr>
@@ -387,7 +387,7 @@ if (step != null)
<ul>
<li><a href="step-intro.html">Simulation Step</a> — concept definition</li>
<li><a href="step-output.html">Simulation Step Output</a> — complete field reference</li>
<li><a class="xref" href="runtime-api.html">Glossary: RuntimeApi Quick-Reference</a>RuntimeApi quick-reference</li>
<li><a class="xref" href="session-shell.html">Glossary: SessionShell Quick-Reference</a>SessionShell quick-reference</li>
<li><a class="xref" href="../../workflows/basic-simulation.html">Workflow: Basic Machining Simulation</a> — simulation workflow producing steps</li>
<li><a class="xref" href="../../workflows/force-training.html">Workflow: Milling Force Parameter Training</a> — training workflow that adds step variables</li>
</ul>