This repository has been archived on 2026-10-11. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
HiNC-2025-win-desktop-Deploy/App/wwwroot/HiAPI-docsite/api/Hi.MachiningProcs.MachiningSession.html
T

2105 lines
75 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Class MachiningSession | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Class MachiningSession | HiAPI-C# 2025 ">
<meta name="description" content="Represents a machining session that manages the execution and optimization of machining operations. Provides functionality for controlling the machining process, handling optimization options, and managing session state. Implements to clean up on session end.">
<link rel="icon" href="../img/HiAPI.favicon.ico">
<link rel="stylesheet" href="../public/docfx.min.css">
<link rel="stylesheet" href="../public/main.css">
<meta name="docfx:navrel" content="../toc.html">
<meta name="docfx:tocrel" content="toc.html">
<meta name="docfx:rel" content="../">
<meta name="loc:inThisArticle" content="In this article">
<meta name="loc:searchResultsCount" content="{count} results for &quot;{query}&quot;">
<meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
<meta name="loc:tocFilter" content="Filter by title">
<meta name="loc:nextArticle" content="Next">
<meta name="loc:prevArticle" content="Previous">
<meta name="loc:themeLight" content="Light">
<meta name="loc:themeDark" content="Dark">
<meta name="loc:themeAuto" content="Auto">
<meta name="loc:changeTheme" content="Change theme">
<meta name="loc:copy" content="Copy">
<meta name="loc:downloadPdf" content="Download PDF">
<script type="module" src="./../public/docfx.min.js"></script>
<script>
const theme = localStorage.getItem('theme') || 'auto'
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
</script>
</head>
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
<header class="bg-body border-bottom">
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
<div class="container-xxl flex-nowrap">
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../img/HiAPI.logo.png" alt="">
</a>
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
<i class="bi bi-three-dots"></i>
</button>
<div class="collapse navbar-collapse" id="navpanel">
<div id="navbar">
<form class="search" role="search" id="search">
<i class="bi bi-search"></i>
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
</form>
</div>
</div>
</div>
</nav>
</header>
<main class="container-xxl">
<div class="toc-offcanvas">
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<nav class="toc" id="toc"></nav>
</div>
</div>
</div>
<div class="content">
<div class="actionbar">
<button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
<i class="bi bi-list"></i>
</button>
<nav id="breadcrumb"></nav>
</div>
<article data-uid="Hi.MachiningProcs.MachiningSession">
<h1 id="Hi_MachiningProcs_MachiningSession" data-uid="Hi.MachiningProcs.MachiningSession" class="text-break">
Class MachiningSession
</h1>
<div class="facts text-secondary">
<dl><dt>Namespace</dt><dd><a class="xref" href="Hi.html">Hi</a>.<a class="xref" href="Hi.MachiningProcs.html">MachiningProcs</a></dd></dl>
<dl><dt>Assembly</dt><dd>HiMech.dll</dd></dl>
</div>
<div class="markdown summary"><p>Represents a machining session that manages the execution and optimization of machining operations.
Provides functionality for controlling the machining process, handling optimization options,
and managing session state. Implements <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a> to clean up
<a class="xref" href="Hi.MachiningProcs.MachiningSession.html#Hi_MachiningProcs_MachiningSession_SessionWriters">SessionWriters</a> on session end.</p>
</div>
<div class="markdown conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public class MachiningSession : IDisposable</code></pre>
</div>
<dl class="typelist inheritance">
<dt>Inheritance</dt>
<dd>
<div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
<div><span class="xref">MachiningSession</span></div>
</dd>
</dl>
<dl class="typelist implements">
<dt>Implements</dt>
<dd>
<div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
</dd>
</dl>
<dl class="typelist inheritedMembers">
<dt>Inherited Members</dt>
<dd>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object)</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>
</div>
</dd></dl>
<dl class="typelist extensionMethods">
<dt>Extension Methods</dt>
<dd>
<div>
<a class="xref" href="Hi.Common.DuplicateUtil.html#Hi_Common_DuplicateUtil_TryDuplicate__1___0_System_Object___">DuplicateUtil.TryDuplicate&lt;TSelf&gt;(TSelf, params object[])</a>
</div>
<div>
<a class="xref" href="Hi.Common.InvokeUtil.html#Hi_Common_InvokeUtil_SelfInvoke__1___0_System_Action___0__">InvokeUtil.SelfInvoke&lt;TSrc&gt;(TSrc, Action&lt;TSrc&gt;)</a>
</div>
<div>
<a class="xref" href="Hi.Common.InvokeUtil.html#Hi_Common_InvokeUtil_SelfInvoke__2___0_System_Func___0___1__">InvokeUtil.SelfInvoke&lt;TSrc, TDst&gt;(TSrc, Func&lt;TSrc, TDst&gt;)</a>
</div>
<div>
<a class="xref" href="Hi.Coloring.ColorUtil.html#Hi_Coloring_ColorUtil_GetGloomyColor_System_Object_System_Double_System_Double_">ColorUtil.GetGloomyColor(object, double, double)</a>
</div>
<div>
<a class="xref" href="Hi.Common.NameUtil.html#Hi_Common_NameUtil_GetSelectionName_System_Object_">NameUtil.GetSelectionName(object)</a>
</div>
<div>
<a class="xref" href="Hi.Common.StringUtil.html#Hi_Common_StringUtil_GetPropertyStringIfToStringNotOverloaded_System_Object_System_Boolean_System_Boolean_">StringUtil.GetPropertyStringIfToStringNotOverloaded(object, bool, bool)</a>
</div>
<div>
<a class="xref" href="Hi.Parallels.LockUtil.html#Hi_Parallels_LockUtil_Lock_System_Object_">LockUtil.Lock(object)</a>
</div>
</dd></dl>
<h2 class="section" id="constructors">Constructors
</h2>
<a id="Hi_MachiningProcs_MachiningSession__ctor_" data-uid="Hi.MachiningProcs.MachiningSession.#ctor*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession__ctor_Hi_MachiningSteps_IMachiningService_" data-uid="Hi.MachiningProcs.MachiningSession.#ctor(Hi.MachiningSteps.IMachiningService)">
MachiningSession(IMachiningService)
</h3>
<div class="markdown level1 summary"><p>Creates a machining session bound to its hosting <a class="xref" href="Hi.MachiningSteps.IMachiningService.html">IMachiningService</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public MachiningSession(IMachiningService host)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>host</code> <a class="xref" href="Hi.MachiningSteps.IMachiningService.html">IMachiningService</a></dt>
<dd></dd>
</dl>
<h2 class="section" id="properties">Properties
</h2>
<a id="Hi_MachiningProcs_MachiningSession_CurrentSourceCommand_" data-uid="Hi.MachiningProcs.MachiningSession.CurrentSourceCommand*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_CurrentSourceCommand" data-uid="Hi.MachiningProcs.MachiningSession.CurrentSourceCommand">
CurrentSourceCommand
</h3>
<div class="markdown level1 summary"><p>Gets or sets the current source command being processed.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public IIndexedFileLine CurrentSourceCommand { get; set; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.Common.FileLines.IIndexedFileLine.html">IIndexedFileLine</a></dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_FileIndexOnRunCommand_" data-uid="Hi.MachiningProcs.MachiningSession.FileIndexOnRunCommand*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_FileIndexOnRunCommand" data-uid="Hi.MachiningProcs.MachiningSession.FileIndexOnRunCommand">
FileIndexOnRunCommand
</h3>
<div class="markdown level1 summary"><p>File index counter, auto-incremented per <a class="xref" href="Hi.Numerical.INcRunner.html#Hi_Numerical_INcRunner_RunNcLines_System_String_System_Collections_Generic_IEnumerable_System_String__Hi_MachiningProcs_MachiningSession_Hi_MachiningProcs_StepDiagnosticProgress_Hi_NcParsers_NcDiagnosticProgress_System_Threading_CancellationToken_">RunNcLines(string, IEnumerable&lt;string&gt;, MachiningSession, StepDiagnosticProgress, NcDiagnosticProgress, CancellationToken)</a>
call within this session.</p>
<p>
<b>Legacy use only.</b> Read and incremented by
<code>HardNcRunner</code> and <code>CsvRunner</code>. <a class="xref" href="Hi.NcParsers.SoftNcRunner.html">SoftNcRunner</a>
no longer touches this field — it allocates file indices through
<a class="xref" href="Hi.NcParsers.Dependencys.SystemWired.FileIndexCounterDependency.html">FileIndexCounterDependency</a>,
which both the runner and inlined-subprogram syntaxes
(<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.SubProgramCallSyntax.html">SubProgramCallSyntax</a>) share so
every loaded file (top-level program plus every M98 / M198 inline,
including each <code>L</code> repetition) gets a distinct index.
Do not introduce new readers; the field will be removed once the
legacy runners retire.
</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public int FileIndexOnRunCommand { 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.int32">int</a></dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_Host_" data-uid="Hi.MachiningProcs.MachiningSession.Host*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_Host" data-uid="Hi.MachiningProcs.MachiningSession.Host">
Host
</h3>
<div class="markdown level1 summary"><p>The project-level service hosting this session — injected so the session
can reach project-level resources (act runner, NC runners, player,
sinks, base directory, …) it needs to run NC program lines.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public IMachiningService Host { get; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.MachiningSteps.IMachiningService.html">IMachiningService</a></dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_IsNcOptOptionListUpdatedByStep_" data-uid="Hi.MachiningProcs.MachiningSession.IsNcOptOptionListUpdatedByStep*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_IsNcOptOptionListUpdatedByStep" data-uid="Hi.MachiningProcs.MachiningSession.IsNcOptOptionListUpdatedByStep">
IsNcOptOptionListUpdatedByStep
</h3>
<div class="markdown level1 summary"><p>Internal Use Only.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public bool IsNcOptOptionListUpdatedByStep { 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_MachiningSession_IsRunningNcLines_" data-uid="Hi.MachiningProcs.MachiningSession.IsRunningNcLines*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_IsRunningNcLines" data-uid="Hi.MachiningProcs.MachiningSession.IsRunningNcLines">
IsRunningNcLines
</h3>
<div class="markdown level1 summary"><p>True while an NC program file is actively being played through the runner (the
paced <a class="xref" href="Hi.MachiningProcs.MachiningSession.html#Hi_MachiningProcs_MachiningSession_PlayNcFile_System_String_System_String_Hi_MachiningProcs_NcKind_">PlayNcFile(string, string, NcKind)</a> loop). A runner-suit
switch must not run
while this is true: the runner's <code>RunNcLines</code> iterator is
mid-enumeration and holds this session's <code>SyntaxPieceLayers</code>, so
resetting <a class="xref" href="Hi.MachiningProcs.MachiningSession.html#Hi_MachiningProcs_MachiningSession_NcRunnerSessionState">NcRunnerSessionState</a> underneath it would corrupt the
in-flight walk. The switch entry point checks this and refuses otherwise.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public bool IsRunningNcLines { get; }</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_MachiningSession_IsSteppingSentence_" data-uid="Hi.MachiningProcs.MachiningSession.IsSteppingSentence*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_IsSteppingSentence" data-uid="Hi.MachiningProcs.MachiningSession.IsSteppingSentence">
IsSteppingSentence
</h3>
<div class="markdown level1 summary"><p>True while the player is stepping sentence-by-sentence (pauses at each
source-command boundary). Session-run state.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public bool IsSteppingSentence { 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_MachiningSession_NcConversions_" data-uid="Hi.MachiningProcs.MachiningSession.NcConversions*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_NcConversions" data-uid="Hi.MachiningProcs.MachiningSession.NcConversions">
NcConversions
</h3>
<div class="markdown level1 summary"><p>Writeback conversions retained from the latest
<a class="xref" href="Hi.MachiningProcs.MachiningSession.html#Hi_MachiningProcs_MachiningSession_ConvertClToNcFiles_System_String_System_String_System_IProgress_Hi_Common_Messages_IMessage__">ConvertClToNcFiles(string, string, IProgress&lt;IMessage&gt;)</a> run (one per written NC file, in
written order): the destination <a class="xref" href="Hi.NcParsers.Syntaxs.SyntaxPiece.html">SyntaxPiece</a> streams
plus the src↔dst <span class="xref">Hi.NcParsers.NcWriteback.NcPieceMap</span>s. This is the hook point
for GUI cross-navigation (click a source line ↔ jump to its
converted lines). Cleared at the start of each conversion run.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public List&lt;NcConversion&gt; NcConversions { get; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<span class="xref">NcConversion</span>&gt;</dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_NcOptOption_" data-uid="Hi.MachiningProcs.MachiningSession.NcOptOption*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_NcOptOption" data-uid="Hi.MachiningProcs.MachiningSession.NcOptOption">
NcOptOption
</h3>
<div class="markdown level1 summary"><p>Gets or sets the NC optimization options for UI operations.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public NcOptOption NcOptOption { get; set; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.NcOpt.NcOptOption.html">NcOptOption</a></dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_NcOptimizations_" data-uid="Hi.MachiningProcs.MachiningSession.NcOptimizations*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_NcOptimizations" data-uid="Hi.MachiningProcs.MachiningSession.NcOptimizations">
NcOptimizations
</h3>
<div class="markdown level1 summary"><p>Writeback conversions retained from the latest
<a class="xref" href="Hi.MachiningProcs.MachiningSession.html#Hi_MachiningProcs_MachiningSession_OptimizeNcFiles_System_String_System_String_Hi_MillingForces_Fittings_ICuttingPara_System_IProgress_Hi_Common_Messages_IMessage__System_Threading_CancellationToken_System_Func_System_Int32_Hi_MillingSteps_MillingStepLuggage__System_Action_">OptimizeNcFiles(string, string, ICuttingPara, IProgress&lt;IMessage&gt;, CancellationToken, Func&lt;int, MillingStepLuggage&gt;, Action)</a> run (one per written optimized NC file,
in written order): the destination <a class="xref" href="Hi.NcParsers.Syntaxs.SyntaxPiece.html">SyntaxPiece</a> streams
plus the src↔dst <span class="xref">Hi.NcParsers.NcWriteback.NcPieceMap</span>s, for GUI cross-navigation.
Deliberately separate from <a class="xref" href="Hi.MachiningProcs.MachiningSession.html#Hi_MachiningProcs_MachiningSession_NcConversions">NcConversions</a> so a conversion
run and an optimization run do not clear each other's results.
Cleared at the start of each optimization run.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public List&lt;NcConversion&gt; NcOptimizations { get; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<span class="xref">NcConversion</span>&gt;</dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_NcRunnerSessionState_" data-uid="Hi.MachiningProcs.MachiningSession.NcRunnerSessionState*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_NcRunnerSessionState" data-uid="Hi.MachiningProcs.MachiningSession.NcRunnerSessionState">
NcRunnerSessionState
</h3>
<div class="markdown level1 summary"><p>Per-session NC pipeline state shared across <a class="xref" href="Hi.Numerical.INcRunner.html#Hi_Numerical_INcRunner_RunNcLines_System_String_System_Collections_Generic_IEnumerable_System_String__Hi_MachiningProcs_MachiningSession_Hi_MachiningProcs_StepDiagnosticProgress_Hi_NcParsers_NcDiagnosticProgress_System_Threading_CancellationToken_">RunNcLines(string, IEnumerable&lt;string&gt;, MachiningSession, StepDiagnosticProgress, NcDiagnosticProgress, CancellationToken)</a>
calls. Holds lazy-initialized <a class="xref" href="Hi.NcParsers.NcDiagnosticProgress.html">NcDiagnosticProgress</a> and the per-layer
<a class="xref" href="Hi.Common.Collections.LazyLinkedList-1.html">LazyLinkedList&lt;T&gt;</a> chain used for cross-file modal continuity.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public NcRunnerSessionState NcRunnerSessionState { get; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.MachiningProcs.NcRunnerSessionState.html">NcRunnerSessionState</a></dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_PacePlayee_" data-uid="Hi.MachiningProcs.MachiningSession.PacePlayee*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_PacePlayee" data-uid="Hi.MachiningProcs.MachiningSession.PacePlayee">
PacePlayee
</h3>
<div class="markdown level1 summary"><p>Internal set only.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public PacePlayee PacePlayee { get; set; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.Common.PacePlayee.html">PacePlayee</a></dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_PostBlockScripts_" data-uid="Hi.MachiningProcs.MachiningSession.PostBlockScripts*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_PostBlockScripts" data-uid="Hi.MachiningProcs.MachiningSession.PostBlockScripts">
PostBlockScripts
</h3>
<div class="markdown level1 summary"><p>Per-line scripts injected externally (without modifying NC files).
Key: <a class="xref" href="Hi.Common.FileLines.FileLineIndex.html">FileLineIndex</a> of the NC block.
Value: C# script text to execute <b>after</b> the NC block.
Consumed by <a class="xref" href="Hi.NcParsers.Semantics.CsScriptEndSemantic.html">CsScriptEndSemantic</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public Dictionary&lt;FileLineIndex, string&gt; PostBlockScripts { get; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2">Dictionary</a>&lt;<a class="xref" href="Hi.Common.FileLines.FileLineIndex.html">FileLineIndex</a>, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a>&gt;</dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_PreBlockScripts_" data-uid="Hi.MachiningProcs.MachiningSession.PreBlockScripts*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_PreBlockScripts" data-uid="Hi.MachiningProcs.MachiningSession.PreBlockScripts">
PreBlockScripts
</h3>
<div class="markdown level1 summary"><p>Per-line scripts injected externally (without modifying NC files).
Key: <a class="xref" href="Hi.Common.FileLines.FileLineIndex.html">FileLineIndex</a> of the NC block.
Value: C# script text to execute <b>before</b> the NC block.
Consumed by <a class="xref" href="Hi.NcParsers.Semantics.CsScriptBeginSemantic.html">CsScriptBeginSemantic</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public Dictionary&lt;FileLineIndex, string&gt; PreBlockScripts { get; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2">Dictionary</a>&lt;<a class="xref" href="Hi.Common.FileLines.FileLineIndex.html">FileLineIndex</a>, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a>&gt;</dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_SessionWriters_" data-uid="Hi.MachiningProcs.MachiningSession.SessionWriters*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_SessionWriters" data-uid="Hi.MachiningProcs.MachiningSession.SessionWriters">
SessionWriters
</h3>
<div class="markdown level1 summary"><p>StreamWriters registered during the session (e.g. by diagnostic output methods).
Key: relative output file path. Disposed automatically when the session ends.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public Dictionary&lt;string, StreamWriter&gt; SessionWriters { get; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2">Dictionary</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a>, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.streamwriter">StreamWriter</a>&gt;</dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_ShellProgress_" data-uid="Hi.MachiningProcs.MachiningSession.ShellProgress*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_ShellProgress" data-uid="Hi.MachiningProcs.MachiningSession.ShellProgress">
ShellProgress
</h3>
<div class="markdown level1 summary"><p>Session-level routine / lifecycle message sink on the <a class="xref" href="Hi.Common.Messages.IMessage.html">IMessage</a>
channel (cache reset, file progress, session start/done). Owned here so it is
truly session-scoped — created with the session, released at <code>EndSession</code>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public ShellProgress ShellProgress { get; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.MachiningProcs.ShellProgress.html">ShellProgress</a></dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_StepIndexToNcOptOptionSortedList_" data-uid="Hi.MachiningProcs.MachiningSession.StepIndexToNcOptOptionSortedList*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_StepIndexToNcOptOptionSortedList" data-uid="Hi.MachiningProcs.MachiningSession.StepIndexToNcOptOptionSortedList">
StepIndexToNcOptOptionSortedList
</h3>
<div class="markdown level1 summary"><p>Gets or sets the mapping of step indices to NC optimization options.
For internal use only.
Takes effect during internal optimization process.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public SortedList&lt;int, NcOptOption&gt; StepIndexToNcOptOptionSortedList { 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.collections.generic.sortedlist-2">SortedList</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a>, <a class="xref" href="Hi.NcOpt.NcOptOption.html">NcOptOption</a>&gt;</dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_StepTaskBundle_" data-uid="Hi.MachiningProcs.MachiningSession.StepTaskBundle*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_StepTaskBundle" data-uid="Hi.MachiningProcs.MachiningSession.StepTaskBundle">
StepTaskBundle
</h3>
<div class="markdown level1 summary"><p>Gets or sets the current step task bundle.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public MachiningParallelProc.StepTaskBundle StepTaskBundle { get; set; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.MachiningProcs.MachiningParallelProc.html">MachiningParallelProc</a>.<a class="xref" href="Hi.MachiningProcs.MachiningParallelProc.StepTaskBundle.html">StepTaskBundle</a></dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_WarnedCutterGeometryTools_" data-uid="Hi.MachiningProcs.MachiningSession.WarnedCutterGeometryTools*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_WarnedCutterGeometryTools" data-uid="Hi.MachiningProcs.MachiningSession.WarnedCutterGeometryTools">
WarnedCutterGeometryTools
</h3>
<div class="markdown level1 summary"><p>Tools already surfaced via an unreasonable cutter-geometry
<code>ConfigurationError</code> (see
<a class="xref" href="Hi.MachiningProcs.MachiningActRunner.html#Hi_MachiningProcs_MachiningActRunner_WarnIfCurrentToolCutterGeometryUnreasonable_Hi_MachiningProcs_MachiningSession_Hi_MachiningProcs_StepDiagnosticProgress_System_Nullable_System_Int32__">WarnIfCurrentToolCutterGeometryUnreasonable(MachiningSession, StepDiagnosticProgress, int?)</a>).
Same keying and emission-point rationale as
<a class="xref" href="Hi.MachiningProcs.MachiningSession.html#Hi_MachiningProcs_MachiningSession_WarnedFluteMaterialMissingTools">WarnedFluteMaterialMissingTools</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public HashSet&lt;IMachiningTool&gt; WarnedCutterGeometryTools { get; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.hashset-1">HashSet</a>&lt;<a class="xref" href="Hi.Machining.IMachiningTool.html">IMachiningTool</a>&gt;</dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_WarnedFluteCountZeroTools_" data-uid="Hi.MachiningProcs.MachiningSession.WarnedFluteCountZeroTools*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_WarnedFluteCountZeroTools" data-uid="Hi.MachiningProcs.MachiningSession.WarnedFluteCountZeroTools">
WarnedFluteCountZeroTools
</h3>
<div class="markdown level1 summary"><p>Tools already surfaced via a zero-flute-count
<code>ConfigurationWarning</code> (see
<a class="xref" href="Hi.MachiningProcs.MachiningActRunner.html#Hi_MachiningProcs_MachiningActRunner_WarnIfCurrentToolFluteCountZero_Hi_MachiningProcs_MachiningSession_Hi_MachiningProcs_StepDiagnosticProgress_System_Nullable_System_Int32__">WarnIfCurrentToolFluteCountZero(MachiningSession, StepDiagnosticProgress, int?)</a>).
Same keying and emission-point rationale as
<a class="xref" href="Hi.MachiningProcs.MachiningSession.html#Hi_MachiningProcs_MachiningSession_WarnedFluteMaterialMissingTools">WarnedFluteMaterialMissingTools</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public HashSet&lt;IMachiningTool&gt; WarnedFluteCountZeroTools { get; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.hashset-1">HashSet</a>&lt;<a class="xref" href="Hi.Machining.IMachiningTool.html">IMachiningTool</a>&gt;</dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_WarnedFluteMaterialMissingTools_" data-uid="Hi.MachiningProcs.MachiningSession.WarnedFluteMaterialMissingTools*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_WarnedFluteMaterialMissingTools" data-uid="Hi.MachiningProcs.MachiningSession.WarnedFluteMaterialMissingTools">
WarnedFluteMaterialMissingTools
</h3>
<div class="markdown level1 summary"><p>Tools already surfaced via &ldquo;<a class="xref" href="Hi.Milling.Cutters.MillingCutter.html#Hi_Milling_Cutters_MillingCutter_FluteMaterial">FluteMaterial</a> not set&rdquo;
warning. Keyed by <a class="xref" href="Hi.Machining.IMachiningTool.html">IMachiningTool</a> reference so the dedup is stable
across the two emission points: <a class="xref" href="Hi.MachiningProcs.MachiningActRunner.html#Hi_MachiningProcs_MachiningActRunner_ProcAct_Hi_Numerical_Acts_IAct_Hi_MachiningProcs_MachiningSession_Hi_MachiningSteps_IMachiningService_Hi_NcParsers_ISentenceCarrier_System_Threading_CancellationToken_Hi_MachiningProcs_StepDiagnosticProgress_">ProcAct(IAct, MachiningSession, IMachiningService, ISentenceCarrier, CancellationToken, StepDiagnosticProgress)</a> at each
<a class="xref" href="Hi.Numerical.Acts.IActTooling.html">IActTooling</a>, and <code>BeginSession</code> for the tool that may already
be equipped before the session begins (which has no tool ID to dedup with).
Reference equality is more precise than tool ID — the same tool object equipped
twice should warn once, regardless of how it was reached.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public HashSet&lt;IMachiningTool&gt; WarnedFluteMaterialMissingTools { get; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.hashset-1">HashSet</a>&lt;<a class="xref" href="Hi.Machining.IMachiningTool.html">IMachiningTool</a>&gt;</dt>
<dd></dd>
</dl>
<h2 class="section" id="methods">Methods
</h2>
<a id="Hi_MachiningProcs_MachiningSession_BeginPreserve_" data-uid="Hi.MachiningProcs.MachiningSession.BeginPreserve*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_BeginPreserve" data-uid="Hi.MachiningProcs.MachiningSession.BeginPreserve">
BeginPreserve()
</h3>
<div class="markdown level1 summary"><p>Begins a preserve section in the optimization process.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void BeginPreserve()</code></pre>
</div>
<a id="Hi_MachiningProcs_MachiningSession_ConvertClToNcFiles_" data-uid="Hi.MachiningProcs.MachiningSession.ConvertClToNcFiles*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_ConvertClToNcFiles_System_String_System_String_System_IProgress_Hi_Common_Messages_IMessage__" data-uid="Hi.MachiningProcs.MachiningSession.ConvertClToNcFiles(System.String,System.String,System.IProgress{Hi.Common.Messages.IMessage})">
ConvertClToNcFiles(string, string, IProgress&lt;IMessage&gt;)
</h3>
<div class="markdown level1 summary"><p>Converts the CLSF play of this session into Fanuc NC files —
writeback synthesis mode, two stages
(<span class="xref">Hi.NcParsers.NcWriteback.NcSynthesisConverter</span> over
<span class="xref">Hi.NcParsers.NcWriteback.FanucNcSentenceComposer</span>):
walks the final <a class="xref" href="Hi.MachiningProcs.NcRunnerSessionState.html#Hi_MachiningProcs_NcRunnerSessionState_SyntaxPieceLayers">SyntaxPieceLayers</a>
layer, groups pieces per source file, converts each group into a
destination piece stream with the src↔dst map (stage one; retained in
<a class="xref" href="Hi.MachiningProcs.MachiningSession.html#Hi_MachiningProcs_MachiningSession_NcConversions">NcConversions</a>), and serializes the destination stream
to text (stage two, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">ToLines(IEnumerable&lt;SyntaxPiece&gt;)</a>). The
synthesis re-serializes the brand-neutral sections into Fanuc
vocabulary (MSYS tilt → <code>G68.2</code>, RTCP → <code>G43.4</code>, motions →
<code>G00/G01/G02/G03</code> with rotary words). Requires a prior play
(e.g. <a class="xref" href="Hi.MachiningProcs.MachiningSession.html#Hi_MachiningProcs_MachiningSession_PlayClFile_System_String_System_String_">PlayClFile(string, string)</a>) on an XYZABC machine chain — a
pure-CL milling device leaves no machine-solved sections to
serialize.</p>
<p>
Conversion diagnostics go to the manipulation home
(<a class="xref" href="Hi.MachiningSteps.IMachiningService.html#Hi_MachiningSteps_IMachiningService_NcManipulationDiagnosticProgress">NcManipulationDiagnosticProgress</a>,
cleared at run start) — not to the play-time
<a class="xref" href="Hi.MachiningSteps.IMachiningService.html#Hi_MachiningSteps_IMachiningService_NcDiagnosticProgress">NcDiagnosticProgress</a>. GUI consumers
observe that home directly (webservice: NC Manipulation message tab);
<code class="paramref">messageProgress</code> carries only the lifecycle
messages.
</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public IReadOnlyList&lt;string&gt; ConvertClToNcFiles(string baseDirectory, string relNcFileTemplate = &quot;Output/[NcName].nc&quot;, IProgress&lt;IMessage&gt; messageProgress = null)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>baseDirectory</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>Project root; null falls back to <a class="xref" href="Hi.MachiningSteps.IMachiningService.html#Hi_MachiningSteps_IMachiningService_BaseDirectory">BaseDirectory</a>.</p>
</dd>
<dt><code>relNcFileTemplate</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>Output path template; <code>[NcName]</code>
is replaced by the source file name, <code>[NcFile]</code> by its
slash-flattened relative path.</p>
</dd>
<dt><code>messageProgress</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.iprogress-1">IProgress</a>&lt;<a class="xref" href="Hi.Common.Messages.IMessage.html">IMessage</a>&gt;</dt>
<dd><p>Optional message sink for lifecycle
reporting; session callers inject the shell sink, out-of-session
callers pass their own (or null).</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1">IReadOnlyList</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a>&gt;</dt>
<dd><p>Written NC file paths, relative to <code class="paramref">baseDirectory</code>.</p>
</dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_Dispose_" data-uid="Hi.MachiningProcs.MachiningSession.Dispose*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_Dispose" data-uid="Hi.MachiningProcs.MachiningSession.Dispose">
Dispose()
</h3>
<div class="markdown level1 summary"><p>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void Dispose()</code></pre>
</div>
<a id="Hi_MachiningProcs_MachiningSession_EndPreserve_" data-uid="Hi.MachiningProcs.MachiningSession.EndPreserve*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_EndPreserve" data-uid="Hi.MachiningProcs.MachiningSession.EndPreserve">
EndPreserve()
</h3>
<div class="markdown level1 summary"><p>Ends a preserve section in the optimization process.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void EndPreserve()</code></pre>
</div>
<a id="Hi_MachiningProcs_MachiningSession_GetToolPhysicsPack_" data-uid="Hi.MachiningProcs.MachiningSession.GetToolPhysicsPack*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_GetToolPhysicsPack_System_Int32_" data-uid="Hi.MachiningProcs.MachiningSession.GetToolPhysicsPack(System.Int32)">
GetToolPhysicsPack(int)
</h3>
<div class="markdown level1 summary"><p>Gets the frozen physics pack for a tool id — building it on first access — or
null when the id is not in the tool house. The para-dependent members are keyed
to the current workpiece cutting para. Safe to call from parallel step tasks:
the pack is immutable and published atomically, and a concurrent rebuild
computes identical content.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public MillingToolPhysicsPack GetToolPhysicsPack(int toolId)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>toolId</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>The tool-house id of the tool.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.Milling.MillingTools.MillingToolPhysicsPack.html">MillingToolPhysicsPack</a></dt>
<dd><p>The frozen pack, or null for an unknown tool id.</p>
</dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_InvalidateToolPhysicsPacks_" data-uid="Hi.MachiningProcs.MachiningSession.InvalidateToolPhysicsPacks*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_InvalidateToolPhysicsPacks" data-uid="Hi.MachiningProcs.MachiningSession.InvalidateToolPhysicsPacks">
InvalidateToolPhysicsPacks()
</h3>
<div class="markdown level1 summary"><p>Drops every cached physics pack so the next access rebuilds from the live
objects. Called by the paths that know the tool/cutter/para state may have
changed: every run-op start (<a class="xref" href="Hi.MachiningProcs.MachiningSession.html#Hi_MachiningProcs_MachiningSession_RunNcLines_Hi_Numerical_INcRunner_System_String_System_Collections_Generic_IEnumerable_System_String__System_Threading_CancellationToken_">RunNcLines(INcRunner, string, IEnumerable&lt;string&gt;, CancellationToken)</a>, so edits made between
plays always take effect) and the tool-change act. An editor that must take
effect in the middle of a running play calls this explicitly — otherwise a
mid-play edit lands on the next play, which is also the only mode with a
deterministic outcome.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void InvalidateToolPhysicsPacks()</code></pre>
</div>
<a id="Hi_MachiningProcs_MachiningSession_OptimizeNcFiles_" data-uid="Hi.MachiningProcs.MachiningSession.OptimizeNcFiles*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_OptimizeNcFiles_System_String_System_String_Hi_MillingForces_Fittings_ICuttingPara_System_IProgress_Hi_Common_Messages_IMessage__System_Threading_CancellationToken_System_Func_System_Int32_Hi_MillingSteps_MillingStepLuggage__System_Action_" data-uid="Hi.MachiningProcs.MachiningSession.OptimizeNcFiles(System.String,System.String,Hi.MillingForces.Fittings.ICuttingPara,System.IProgress{Hi.Common.Messages.IMessage},System.Threading.CancellationToken,System.Func{System.Int32,Hi.MillingSteps.MillingStepLuggage},System.Action)">
OptimizeNcFiles(string, string, ICuttingPara, IProgress&lt;IMessage&gt;, CancellationToken, Func&lt;int, MillingStepLuggage&gt;, Action)
</h3>
<div class="markdown level1 summary"><p>Optimizes the NC program played in this session (SoftNc pipeline) and
writes the optimized NC files: classifies the final
<a class="xref" href="Hi.MachiningProcs.NcRunnerSessionState.html#Hi_MachiningProcs_NcRunnerSessionState_SyntaxPieceLayers">SyntaxPieceLayers</a> layer, solves the
per-step feed adjustments from milling physics, patches the F words
onto the verbatim source text and writes one output file per source NC
file by <code class="paramref">relNcFileTemplate</code>. Conversions are retained
in <a class="xref" href="Hi.MachiningProcs.MachiningSession.html#Hi_MachiningProcs_MachiningSession_NcOptimizations">NcOptimizations</a>; piece-anchored diagnostics go to the
manipulation home
(<a class="xref" href="Hi.MachiningSteps.IMachiningService.html#Hi_MachiningSteps_IMachiningService_NcManipulationDiagnosticProgress">NcManipulationDiagnosticProgress</a>,
cleared at run start).
Requires a prior play and a logged-in
<a class="xref" href="Hi.Licenses.AuthFeature.html#Hi_Licenses_AuthFeature_OptNcNoLimit">OptNcNoLimit</a> license.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public List&lt;string&gt; OptimizeNcFiles(string baseDirectory, string relNcFileTemplate, ICuttingPara millingPara, IProgress&lt;IMessage&gt; messageProgress, CancellationToken cancellationToken, Func&lt;int, MillingStepLuggage&gt; luggageGetter = null, Action clearLuggageCache = null)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>baseDirectory</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>Project root; null falls back to <a class="xref" href="Hi.MachiningSteps.IMachiningService.html#Hi_MachiningSteps_IMachiningService_BaseDirectory">BaseDirectory</a>.</p>
</dd>
<dt><code>relNcFileTemplate</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>Output path template; <code>[NcName]</code>
is replaced by the source file name, <code>[NcFile]</code> by its
slash-flattened relative path.</p>
</dd>
<dt><code>millingPara</code> <a class="xref" href="Hi.MillingForces.Fittings.ICuttingPara.html">ICuttingPara</a></dt>
<dd><p>The cutting parameters; null disables physics-computable optimization.</p>
</dd>
<dt><code>messageProgress</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.iprogress-1">IProgress</a>&lt;<a class="xref" href="Hi.Common.Messages.IMessage.html">IMessage</a>&gt;</dt>
<dd><p>Optional message sink for lifecycle / progress reporting.</p>
</dd>
<dt><code>cancellationToken</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken">CancellationToken</a></dt>
<dd><p>Cancellation token to cancel the operation.</p>
</dd>
<dt><code>luggageGetter</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a>, <a class="xref" href="Hi.MillingSteps.MillingStepLuggage.html">MillingStepLuggage</a>&gt;</dt>
<dd><p>Optional thread-safe map from step index to
<a class="xref" href="Hi.MillingSteps.MillingStepLuggage.html">MillingStepLuggage</a>; defaults to
<a class="xref" href="Hi.MachiningSteps.IMachiningService.html#Hi_MachiningSteps_IMachiningService_MillingStepLuggageReader">MillingStepLuggageReader</a>.</p>
</dd>
<dt><code>clearLuggageCache</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action">Action</a></dt>
<dd><p>Optional end-of-run cache clear hook; defaults to the luggage reader's
cache clear.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a>&gt;</dt>
<dd><p>Written NC file paths, relative to <code class="paramref">baseDirectory</code>.</p>
</dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_PlayBrandNcFile_" data-uid="Hi.MachiningProcs.MachiningSession.PlayBrandNcFile*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_PlayBrandNcFile_System_String_System_String_" data-uid="Hi.MachiningProcs.MachiningSession.PlayBrandNcFile(System.String,System.String)">
PlayBrandNcFile(string, string)
</h3>
<div class="markdown level1 summary"><p>Plays a famous-brand NC code file with pace control (no kind
dispatch — always <a class="xref" href="Hi.MachiningSteps.IMachiningService.html#Hi_MachiningSteps_IMachiningService_ActiveNcRunner">ActiveNcRunner</a>).</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void PlayBrandNcFile(string baseDirectory, string relFilePath)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>baseDirectory</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
<dt><code>relFilePath</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_PlayClFile_" data-uid="Hi.MachiningProcs.MachiningSession.PlayClFile*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_PlayClFile_System_String_System_String_" data-uid="Hi.MachiningProcs.MachiningSession.PlayClFile(System.String,System.String)">
PlayClFile(string, string)
</h3>
<div class="markdown level1 summary"><p>Plays an NX-CL (CLSF) file with pace control.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void PlayClFile(string baseDirectory, string relFilePath)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>baseDirectory</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
<dt><code>relFilePath</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_PlayCsvFile_" data-uid="Hi.MachiningProcs.MachiningSession.PlayCsvFile*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_PlayCsvFile_System_String_System_String_" data-uid="Hi.MachiningProcs.MachiningSession.PlayCsvFile(System.String,System.String)">
PlayCsvFile(string, string)
</h3>
<div class="markdown level1 summary"><p>Plays a CSV file with pace control.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void PlayCsvFile(string baseDirectory, string relFilePath)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>baseDirectory</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
<dt><code>relFilePath</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_PlayNc_" data-uid="Hi.MachiningProcs.MachiningSession.PlayNc*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_PlayNc_System_String_System_String_" data-uid="Hi.MachiningProcs.MachiningSession.PlayNc(System.String,System.String)">
PlayNc(string, string)
</h3>
<div class="markdown level1 summary"><p>Plays NC text with pace control.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void PlayNc(string ncText, string fileNameAlternative = &quot;--&quot;)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>ncText</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
<dt><code>fileNameAlternative</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_PlayNcFile_" data-uid="Hi.MachiningProcs.MachiningSession.PlayNcFile*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_PlayNcFile_System_String_System_String_Hi_MachiningProcs_NcKind_" data-uid="Hi.MachiningProcs.MachiningSession.PlayNcFile(System.String,System.String,Hi.MachiningProcs.NcKind)">
PlayNcFile(string, string, NcKind)
</h3>
<div class="markdown level1 summary"><p>Plays an NC program file with pace control, the runner picked by
<code class="paramref">kind</code> (<a class="xref" href="Hi.MachiningProcs.NcKind.html#Hi_MachiningProcs_NcKind_Auto">Auto</a> = by file
extension, see <a class="xref" href="Hi.MachiningProcs.NcKindUtil.html#Hi_MachiningProcs_NcKindUtil_DetectByPath_System_String_">DetectByPath(string)</a>).</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void PlayNcFile(string baseDirectory, string relFilePath, NcKind kind = NcKind.Auto)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>baseDirectory</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
<dt><code>relFilePath</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
<dt><code>kind</code> <a class="xref" href="Hi.MachiningProcs.NcKind.html">NcKind</a></dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_Preserve_" data-uid="Hi.MachiningProcs.MachiningSession.Preserve*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_Preserve" data-uid="Hi.MachiningProcs.MachiningSession.Preserve">
Preserve()
</h3>
<div class="markdown level1 summary"><p>Preserves one line of NC code in the optimization process.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void Preserve()</code></pre>
</div>
<a id="Hi_MachiningProcs_MachiningSession_RunBrandNcFile_" data-uid="Hi.MachiningProcs.MachiningSession.RunBrandNcFile*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_RunBrandNcFile_System_String_System_String_" data-uid="Hi.MachiningProcs.MachiningSession.RunBrandNcFile(System.String,System.String)">
RunBrandNcFile(string, string)
</h3>
<div class="markdown level1 summary"><p>Runs a famous-brand NC code file (no pacing, no kind dispatch —
always <a class="xref" href="Hi.MachiningSteps.IMachiningService.html#Hi_MachiningSteps_IMachiningService_ActiveNcRunner">ActiveNcRunner</a>); returns the
player actions.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public IEnumerable&lt;Action&gt; RunBrandNcFile(string baseDirectory, string relFilePath)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>baseDirectory</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
<dt><code>relFilePath</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action">Action</a>&gt;</dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_RunClFile_" data-uid="Hi.MachiningProcs.MachiningSession.RunClFile*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_RunClFile_System_String_System_String_" data-uid="Hi.MachiningProcs.MachiningSession.RunClFile(System.String,System.String)">
RunClFile(string, string)
</h3>
<div class="markdown level1 summary"><p>Runs an NX-CL (CLSF) file (no pacing); returns the player actions.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public IEnumerable&lt;Action&gt; RunClFile(string baseDirectory, string relFilePath)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>baseDirectory</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
<dt><code>relFilePath</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action">Action</a>&gt;</dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_RunCsvFile_" data-uid="Hi.MachiningProcs.MachiningSession.RunCsvFile*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_RunCsvFile_System_String_System_String_" data-uid="Hi.MachiningProcs.MachiningSession.RunCsvFile(System.String,System.String)">
RunCsvFile(string, string)
</h3>
<div class="markdown level1 summary"><p>Runs a CSV file (no pacing); returns the player actions.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public IEnumerable&lt;Action&gt; RunCsvFile(string baseDirectory, string relFilePath)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>baseDirectory</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
<dt><code>relFilePath</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action">Action</a>&gt;</dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_RunMachiningStepBuilt_" data-uid="Hi.MachiningProcs.MachiningSession.RunMachiningStepBuilt*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_RunMachiningStepBuilt_Hi_MachiningSteps_MachiningStep_Hi_MachiningSteps_MachiningStep_" data-uid="Hi.MachiningProcs.MachiningSession.RunMachiningStepBuilt(Hi.MachiningSteps.MachiningStep,Hi.MachiningSteps.MachiningStep)">
RunMachiningStepBuilt(MachiningStep, MachiningStep)
</h3>
<div class="markdown level1 summary"><p>Internal use only. Invokes <a class="xref" href="Hi.MachiningProcs.MachiningSession.html#Hi_MachiningProcs_MachiningSession_MachiningStepBuilt">MachiningStepBuilt</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void RunMachiningStepBuilt(MachiningStep preStep, MachiningStep curStep)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>preStep</code> <a class="xref" href="Hi.MachiningSteps.MachiningStep.html">MachiningStep</a></dt>
<dd></dd>
<dt><code>curStep</code> <a class="xref" href="Hi.MachiningSteps.MachiningStep.html">MachiningStep</a></dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_RunMachiningStepSelected_" data-uid="Hi.MachiningProcs.MachiningSession.RunMachiningStepSelected*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_RunMachiningStepSelected_Hi_MachiningSteps_MachiningStep_" data-uid="Hi.MachiningProcs.MachiningSession.RunMachiningStepSelected(Hi.MachiningSteps.MachiningStep)">
RunMachiningStepSelected(MachiningStep)
</h3>
<div class="markdown level1 summary"><p>Internal use only. Invokes <a class="xref" href="Hi.MachiningProcs.MachiningSession.html#Hi_MachiningProcs_MachiningSession_MachiningStepSelected">MachiningStepSelected</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void RunMachiningStepSelected(MachiningStep machiningStep)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>machiningStep</code> <a class="xref" href="Hi.MachiningSteps.MachiningStep.html">MachiningStep</a></dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_RunNc_" data-uid="Hi.MachiningProcs.MachiningSession.RunNc*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_RunNc_System_String_System_String_" data-uid="Hi.MachiningProcs.MachiningSession.RunNc(System.String,System.String)">
RunNc(string, string)
</h3>
<div class="markdown level1 summary"><p>Runs NC text (no pacing); returns the player actions.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public IEnumerable&lt;Action&gt; RunNc(string ncText, string fileNameAlternative = &quot;--&quot;)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>ncText</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
<dt><code>fileNameAlternative</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action">Action</a>&gt;</dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_RunNcFile_" data-uid="Hi.MachiningProcs.MachiningSession.RunNcFile*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_RunNcFile_System_String_System_String_Hi_MachiningProcs_NcKind_" data-uid="Hi.MachiningProcs.MachiningSession.RunNcFile(System.String,System.String,Hi.MachiningProcs.NcKind)">
RunNcFile(string, string, NcKind)
</h3>
<div class="markdown level1 summary"><p>Runs an NC program file (no pacing), the runner picked by
<code class="paramref">kind</code> (<a class="xref" href="Hi.MachiningProcs.NcKind.html#Hi_MachiningProcs_NcKind_Auto">Auto</a> = by file
extension, see <a class="xref" href="Hi.MachiningProcs.NcKindUtil.html#Hi_MachiningProcs_NcKindUtil_DetectByPath_System_String_">DetectByPath(string)</a>); returns the
player actions.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public IEnumerable&lt;Action&gt; RunNcFile(string baseDirectory, string relFilePath, NcKind kind = NcKind.Auto)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>baseDirectory</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
<dt><code>relFilePath</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
<dt><code>kind</code> <a class="xref" href="Hi.MachiningProcs.NcKind.html">NcKind</a></dt>
<dd></dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action">Action</a>&gt;</dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_RunNcFileRan_" data-uid="Hi.MachiningProcs.MachiningSession.RunNcFileRan*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_RunNcFileRan" data-uid="Hi.MachiningProcs.MachiningSession.RunNcFileRan">
RunNcFileRan()
</h3>
<div class="markdown level1 summary"><p>Internal use only. Invokes <a class="xref" href="Hi.MachiningProcs.MachiningSession.html#Hi_MachiningProcs_MachiningSession_NcFileRan">NcFileRan</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void RunNcFileRan()</code></pre>
</div>
<a id="Hi_MachiningProcs_MachiningSession_RunNcLines_" data-uid="Hi.MachiningProcs.MachiningSession.RunNcLines*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_RunNcLines_Hi_Numerical_INcRunner_System_String_System_Collections_Generic_IEnumerable_System_String__System_Threading_CancellationToken_" data-uid="Hi.MachiningProcs.MachiningSession.RunNcLines(Hi.Numerical.INcRunner,System.String,System.Collections.Generic.IEnumerable{System.String},System.Threading.CancellationToken)">
RunNcLines(INcRunner, string, IEnumerable&lt;string&gt;, CancellationToken)
</h3>
<div class="markdown level1 summary"><p>Runs the NC program lines through <code class="paramref">ncRunner</code>, producing
the player actions. Session-scoped run loop; reaches project-level resources
via <a class="xref" href="Hi.MachiningProcs.MachiningSession.html#Hi_MachiningProcs_MachiningSession_Host">Host</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public IEnumerable&lt;Action&gt; RunNcLines(INcRunner ncRunner, string relNcFilePath, IEnumerable&lt;string&gt; lines, CancellationToken cancellationToken)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>ncRunner</code> <a class="xref" href="Hi.Numerical.INcRunner.html">INcRunner</a></dt>
<dd><p>The NC runner that parses and runs the lines.</p>
</dd>
<dt><code>relNcFilePath</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>Name/path associated with the program.</p>
</dd>
<dt><code>lines</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a>&gt;</dt>
<dd><p>The NC/CSV lines to run.</p>
</dd>
<dt><code>cancellationToken</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken">CancellationToken</a></dt>
<dd><p>Cancellation token.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action">Action</a>&gt;</dt>
<dd><p>The sequence of player actions.</p>
</dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_RunSourcedActEntry_" data-uid="Hi.MachiningProcs.MachiningSession.RunSourcedActEntry*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_RunSourcedActEntry_Hi_Numerical_SourcedActEntry_" data-uid="Hi.MachiningProcs.MachiningSession.RunSourcedActEntry(Hi.Numerical.SourcedActEntry)">
RunSourcedActEntry(SourcedActEntry)
</h3>
<div class="markdown level1 summary"><p>Internal use only. Invokes <a class="xref" href="Hi.MachiningProcs.MachiningSession.html#Hi_MachiningProcs_MachiningSession_SourcedActEntry">SourcedActEntry</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void RunSourcedActEntry(SourcedActEntry entry)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>entry</code> <a class="xref" href="Hi.Numerical.SourcedActEntry.html">SourcedActEntry</a></dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_RunSyntaxPieceRan_" data-uid="Hi.MachiningProcs.MachiningSession.RunSyntaxPieceRan*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_RunSyntaxPieceRan_Hi_NcParsers_Syntaxs_SyntaxPiece_" data-uid="Hi.MachiningProcs.MachiningSession.RunSyntaxPieceRan(Hi.NcParsers.Syntaxs.SyntaxPiece)">
RunSyntaxPieceRan(SyntaxPiece)
</h3>
<div class="markdown level1 summary"><p>Internal use only. Invokes <a class="xref" href="Hi.MachiningProcs.MachiningSession.html#Hi_MachiningProcs_MachiningSession_SyntaxPieceRan">SyntaxPieceRan</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void RunSyntaxPieceRan(SyntaxPiece syntaxPiece)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>syntaxPiece</code> <a class="xref" href="Hi.NcParsers.Syntaxs.SyntaxPiece.html">SyntaxPiece</a></dt>
<dd></dd>
</dl>
<a id="Hi_MachiningProcs_MachiningSession_UpdateNcOptOptionMapIfNeeded_" data-uid="Hi.MachiningProcs.MachiningSession.UpdateNcOptOptionMapIfNeeded*"></a>
<h3 id="Hi_MachiningProcs_MachiningSession_UpdateNcOptOptionMapIfNeeded_System_Int32_" data-uid="Hi.MachiningProcs.MachiningSession.UpdateNcOptOptionMapIfNeeded(System.Int32)">
UpdateNcOptOptionMapIfNeeded(int)
</h3>
<div class="markdown level1 summary"><p>Records the current <a class="xref" href="Hi.MachiningProcs.MachiningSession.html#Hi_MachiningProcs_MachiningSession_NcOptOption">NcOptOption</a> at <code class="paramref">stepIndex</code>
when it differs from the most recently recorded one, so the map stays a
sparse list of change points — which is what its readers expect: they
resolve a step's option by <code>GetFloor</code> (see
<a class="xref" href="Hi.MachiningSteps.MachiningStep.html#Hi_MachiningSteps_MachiningStep_UpdateNcOptOption_System_Action_Hi_NcOpt_NcOptOption__">UpdateNcOptOption(Action&lt;NcOptOption&gt;)</a> and the
optimization procs), so an unchanged stretch needs no entries at all.
Internal use only.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public bool UpdateNcOptOptionMapIfNeeded(int stepIndex)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>stepIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
<dd><p>The index of the step to update.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd><p>True if the map was updated; otherwise, false.</p>
</dd>
</dl>
<h2 class="section" id="events">Events
</h2>
<h3 id="Hi_MachiningProcs_MachiningSession_MachiningStepBuilt" data-uid="Hi.MachiningProcs.MachiningSession.MachiningStepBuilt">
MachiningStepBuilt
</h3>
<div class="markdown level1 summary"><p>Event triggered when a machining step is built.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public event MachiningActRunner.MachiningStepBuiltDelegate MachiningStepBuilt</code></pre>
</div>
<h4 class="section">Event Type</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.MachiningProcs.MachiningActRunner.html">MachiningActRunner</a>.<a class="xref" href="Hi.MachiningProcs.MachiningActRunner.MachiningStepBuiltDelegate.html">MachiningStepBuiltDelegate</a></dt>
<dd></dd>
</dl>
<h3 id="Hi_MachiningProcs_MachiningSession_MachiningStepSelected" data-uid="Hi.MachiningProcs.MachiningSession.MachiningStepSelected">
MachiningStepSelected
</h3>
<div class="markdown level1 summary"><p>Event triggered when a machining step is selected.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public event Action&lt;MachiningStep&gt; MachiningStepSelected</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.MachiningSteps.MachiningStep.html">MachiningStep</a>&gt;</dt>
<dd></dd>
</dl>
<h3 id="Hi_MachiningProcs_MachiningSession_NcFileRan" data-uid="Hi.MachiningProcs.MachiningSession.NcFileRan">
NcFileRan
</h3>
<div class="markdown level1 summary"><p>Event triggered after an NC/CSV file finishes running (session-scoped).
Bridged to the app-lifetime <code>LocalProjectService.OnNcFileRan</code> in BeginSession.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public event Action NcFileRan</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">Action</a></dt>
<dd></dd>
</dl>
<h3 id="Hi_MachiningProcs_MachiningSession_OnCurrentLineEnd" data-uid="Hi.MachiningProcs.MachiningSession.OnCurrentLineEnd">
OnCurrentLineEnd
</h3>
<div class="markdown level1 summary"><p>Event raised when the current line ends.
The event buffer is cleared on every line change.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public event Action&lt;CancellationToken&gt; OnCurrentLineEnd</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="https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken">CancellationToken</a>&gt;</dt>
<dd></dd>
</dl>
<h3 id="Hi_MachiningProcs_MachiningSession_SourcedActEntry" data-uid="Hi.MachiningProcs.MachiningSession.SourcedActEntry">
SourcedActEntry
</h3>
<div class="markdown level1 summary"><p>Event triggered for each <a class="xref" href="Hi.MachiningProcs.MachiningSession.html#Hi_MachiningProcs_MachiningSession_SourcedActEntry">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; SourcedActEntry</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_MachiningSession_SyntaxPieceRan" data-uid="Hi.MachiningProcs.MachiningSession.SyntaxPieceRan">
SyntaxPieceRan
</h3>
<div class="markdown level1 summary"><p>Event triggered when a syntax piece has been executed.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public event Action&lt;SyntaxPiece&gt; SyntaxPieceRan</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>
</article>
<div class="contribution d-print-none">
</div>
</div>
<div class="affix">
<nav id="affix"></nav>
</div>
</main>
<div class="container-xxl search-results" id="search-results"></div>
<footer class="border-top text-secondary">
<div class="container-xxl">
<div class="flex-fill">
<span> Copyright © 2025 <a href='https://superhightech.com.tw'>Tech Coordinate</a>. All rights reserved. <a href='https://superhightech.com.tw'>超級高科技股份有限公司</a> © 2025 版權所有 </span>
</div>
</div>
</footer>
</body>
</html>