HiNC-2025-win-desktop-Deploy/App/wwwroot/HiAPI-docsite/api/Hi.NcParsers.Dependencys.SystemWired.html

224 lines
14 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Namespace Hi.NcParsers.Dependencys.SystemWired | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Namespace Hi.NcParsers.Dependencys.SystemWired | HiAPI-C# 2025 ">
<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.NcParsers.Dependencys.SystemWired">
<h1 id="Hi_NcParsers_Dependencys_SystemWired" data-uid="Hi.NcParsers.Dependencys.SystemWired" class="text-break">Namespace Hi.NcParsers.Dependencys.SystemWired</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>
<div class="markdown level0 remarks"></div>
<h3 id="classes">
Classes
</h3>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.Dependencys.SystemWired.FileIndexCounterDependency.html">FileIndexCounterDependency</a></dt>
<dd><p>Per-session monotonically-increasing file index allocator. Holds the
counter as a private field; <a class="xref" href="Hi.NcParsers.Dependencys.SystemWired.FileIndexCounterDependency.html#Hi_NcParsers_Dependencys_SystemWired_FileIndexCounterDependency_Allocate">Allocate()</a> returns the next
unused value and increments. <a class="xref" href="Hi.NcParsers.Dependencys.SystemWired.FileIndexCounterDependency.html#Hi_NcParsers_Dependencys_SystemWired_FileIndexCounterDependency_Reset">Reset()</a> rewinds to 0 — the
owning <a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_RunControlLines_System_String_System_Collections_Generic_IEnumerable_System_String__Hi_MachiningProcs_MachiningSession_Hi_MachiningProcs_SessionProgress_System_Threading_CancellationToken_">RunControlLines(string, IEnumerable&lt;string&gt;, MachiningSession, SessionProgress, CancellationToken)</a> calls
<a class="xref" href="Hi.NcParsers.Dependencys.SystemWired.FileIndexCounterDependency.html#Hi_NcParsers_Dependencys_SystemWired_FileIndexCounterDependency_Reset">Reset()</a> on the same edge that initializes a fresh
<a class="xref" href="Hi.MachiningProcs.NcRunnerSessionState.html">NcRunnerSessionState</a>, so a controller
power-reset clears both the syntax-piece pipeline and this counter
in lock-step.</p>
<p>
Two consumers share one allocator:
<ul><li><a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_RunControlLines_System_String_System_Collections_Generic_IEnumerable_System_String__Hi_MachiningProcs_MachiningSession_Hi_MachiningProcs_SessionProgress_System_Threading_CancellationToken_">RunControlLines(string, IEnumerable&lt;string&gt;, MachiningSession, SessionProgress, CancellationToken)</a> allocates one
index per top-level NC file that streams through the runner.</li><li><a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.SubProgramCallSyntax.html">SubProgramCallSyntax</a> allocates a
fresh index for each inlined subprogram invocation, including
each <code>L</code> repetition — distinct indices ensure
<code>(FileIndex, LineIndex)</code> pairs stay unique across overlapping
subprogram line ranges.</li></ul>
Holding the counter on this dependency rather than on
<a class="xref" href="Hi.MachiningProcs.NcRunnerSessionState.html">NcRunnerSessionState</a> avoids a duplicate
source-of-truth: the dep is the single seam through which syntaxes
reach the counter, and there is no third reader that would benefit
from session-state visibility.
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.Dependencys.SystemWired.NcKinematicsDependency.html">NcKinematicsDependency</a></dt>
<dd><p>Provides <a class="xref" href="Hi.Numerical.Xyzabc.IMachineKinematics.html">IMachineKinematics</a> as an <a class="xref" href="Hi.NcParsers.Dependencys.INcDependency.html">INcDependency</a>
for <a class="xref" href="Hi.NcParsers.SoftNcRunner.html">SoftNcRunner</a>.<a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_NcDependencyList">NcDependencyList</a>.</p>
<p>
The actual kinematics instance is resolved at runtime via
<a class="xref" href="Hi.NcParsers.Dependencys.SystemWired.NcKinematicsDependency.html#Hi_NcParsers_Dependencys_SystemWired_NcKinematicsDependency_KinematicsProvider">KinematicsProvider</a>. This supports scenarios where
the machine tool is loaded or changed after the runner is configured
(e.g., XML config loaded first, kinematics assigned later).
</p>
<p>
Consumed by <a class="xref" href="Hi.NcParsers.LogicSyntaxs.G53p1RotaryPositionSyntax.html">G53p1RotaryPositionSyntax</a>,
<a class="xref" href="Hi.NcParsers.LogicSyntaxs.IsoG68p2TiltSyntax.html">IsoG68p2TiltSyntax</a>, and
<a class="xref" href="Hi.NcParsers.Semantics.McLinearMotionSemantic.html">McLinearMotionSemantic</a> via
<code>dependencyList.OfType&lt;IMachineKinematics&gt;()</code>.
</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.Dependencys.SystemWired.ProjectFolderDependency.html">ProjectFolderDependency</a></dt>
<dd><p>Exposes the absolute base directory of the project that owns this
runner. Resolved at runtime via <a class="xref" href="Hi.NcParsers.Dependencys.SystemWired.ProjectFolderDependency.html#Hi_NcParsers_Dependencys_SystemWired_ProjectFolderDependency_BaseDirectoryProvider">BaseDirectoryProvider</a>;
the host (e.g. <code>LocalProjectService</code>, a test harness) wires the
provider to its known project root after the runner is constructed,
because <a class="xref" href="Hi.NcParsers.SoftNcRunner.html">SoftNcRunner</a> itself does not retain the
<code>baseDirectory</code> argument it sees during XML deserialization.</p>
<p>
Consumed by syntaxes that need to resolve a project-relative path
to an absolute file system location — e.g.
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.SubProgramCallSyntax.html">SubProgramCallSyntax</a> for <code>O&lt;n&gt;</code>
subprogram lookup under
<a class="xref" href="Hi.NcParsers.Dependencys.Generic.SubProgramFolderConfig.html#Hi_NcParsers_Dependencys_Generic_SubProgramFolderConfig_InternalFolder">InternalFolder</a>.
Reading <a class="xref" href="Hi.NcParsers.Sentence.html#Hi_NcParsers_Sentence_FilePath">FilePath</a> is not a substitute: that
path is relative and resolving it via <code>Path.GetFullPath</code> would
anchor against the process working directory, not the project root.
</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.Dependencys.SystemWired.SegmenterDependency.html">SegmenterDependency</a></dt>
<dd><p>Exposes the active <a class="xref" href="Hi.NcParsers.Segmenters.ISegmenter.html">ISegmenter</a> to syntaxes that need to
re-segment auxiliary NC text mid-pipeline (e.g.,
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.SubProgramCallSyntax.html">SubProgramCallSyntax</a> reading an <code>O&lt;n&gt;</code>
subprogram file and re-using the host runner's segmenter so the inlined
blocks are split with the same rules).</p>
<p>
The actual segmenter is resolved at runtime via
<span class="xref">Hi.NcParsers.Dependencys.SystemWired.SegmenterDependency.SegmenterProvider</span>; <a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_RunControlLines_System_String_System_Collections_Generic_IEnumerable_System_String__Hi_MachiningProcs_MachiningSession_Hi_MachiningProcs_SessionProgress_System_Threading_CancellationToken_">RunControlLines(string, IEnumerable&lt;string&gt;, MachiningSession, SessionProgress, CancellationToken)</a>
wires the provider to its own <a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_Segmenter">Segmenter</a> at the
start of each session run, so this dependency can sit in
<a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_NcDependencyList">NcDependencyList</a> without participating in XML
serialization (see <a class="xref" href="Hi.NcParsers.Dependencys.SystemWired.SegmenterDependency.html#Hi_NcParsers_Dependencys_SystemWired_SegmenterDependency_MakeXmlSource_System_String_System_String_System_Boolean_">MakeXmlSource(string, string, bool)</a>).
</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.Dependencys.SystemWired.SyntaxPieceLayerDependency.html">SyntaxPieceLayerDependency</a></dt>
<dd><p>Exposes the per-session <a class="xref" href="Hi.NcParsers.Syntaxs.SyntaxPiece.html">SyntaxPiece</a> layer chain (one
<a class="xref" href="Hi.Common.Collections.LazyLinkedList-1.html">LazyLinkedList&lt;T&gt;</a> per pipeline stage, owned by
<a class="xref" href="Hi.MachiningProcs.NcRunnerSessionState.html">NcRunnerSessionState</a>) to syntaxes that need
to inject additional source pieces mid-pipeline — most notably
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.SubProgramCallSyntax.html">SubProgramCallSyntax</a>, which inlines a subprogram
file's blocks back into <code>layers[0]</code> immediately after the M98 host
node so the entire syntax pipeline naturally re-processes them.</p>
<p>
The actual layer list is resolved at runtime via
<span class="xref">Hi.NcParsers.Dependencys.SystemWired.SyntaxPieceLayerDependency.LayersProvider</span>; <a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_RunControlLines_System_String_System_Collections_Generic_IEnumerable_System_String__Hi_MachiningProcs_MachiningSession_Hi_MachiningProcs_SessionProgress_System_Threading_CancellationToken_">RunControlLines(string, IEnumerable&lt;string&gt;, MachiningSession, SessionProgress, CancellationToken)</a>
wires the provider to the active session's
<a class="xref" href="Hi.MachiningProcs.NcRunnerSessionState.html#Hi_MachiningProcs_NcRunnerSessionState_SyntaxPieceLayers">SyntaxPieceLayers</a> at
the start of each call. Index 0 is the source layer (init seed +
sentence-derived pieces); indices 1..N are post-NcSyntax layers — same
convention as <a class="xref" href="Hi.MachiningProcs.NcRunnerSessionState.html">NcRunnerSessionState</a>.
</p>
</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>