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.NcParsers.html
T

297 lines
17 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Namespace Hi.NcParsers | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Namespace Hi.NcParsers | 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">
<h1 id="Hi_NcParsers" data-uid="Hi.NcParsers" class="text-break">Namespace Hi.NcParsers</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.ControllerPresetWriter.html">ControllerPresetWriter</a></dt>
<dd><p>Writes the built-in brand controller presets out as standalone
<a class="xref" href="Hi.NcParsers.SoftNcRunner.html">SoftNcRunner</a> resource files.</p>
<p>
A controller resource file is one serialized <a class="xref" href="Hi.NcParsers.SoftNcRunner.html">SoftNcRunner</a> — the
whole pipeline (dependencies, segmenter, initializers, syntaxes, semantics)
that decides how a brand's NC code is interpreted. The shipped copies live
under <code>Resource/Controller/</code> so the Object Management <em>Load</em>
browser starts populated; they are regenerable snapshots, not the source of
truth — the brand properties on <a class="xref" href="Hi.NcParsers.SoftNcRunner.html">SoftNcRunner</a> are.
</p>
<p>
Writing needs no <a class="xref" href="Hi.Common.XmlUtils.XFactory.html">XFactory</a> registration. Reading a file back
does: call <a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_Reg_Hi_Common_XmlUtils_XFactory_">Reg(XFactory)</a> first, otherwise
<code>XFactory.GenListSkippingUnloadable</code> drops every unregistered pipeline
entry and hands back a silently hollow runner.
</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.NcCompositionGate.html">NcCompositionGate</a></dt>
<dd><p>License gate for the NC composition layer — the capability of registering
external (non-built-in) processing units into a <a class="xref" href="Hi.NcParsers.SoftNcRunner.html">SoftNcRunner</a>
pipeline, and of executing NC-embedded C# scripts
(<a class="xref" href="Hi.Numerical.Acts.ActLineCsScript.html">ActLineCsScript</a>).</p>
<p>
The boundary: the <b>script layer</b> (calling the public API from your own
application code, e.g. session scripts) needs no extra license; the
<b>composition layer</b> (registering or replacing processing units inside
the interpretation pipeline — <a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_NcSyntaxList">NcSyntaxList</a>,
<a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_PipelineNcDependencyList">PipelineNcDependencyList</a>,
<a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_NcSemanticList">NcSemanticList</a>,
<a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_NcInitializationList">NcInitializationList</a>,
<a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_Segmenter">Segmenter</a> — or injecting per-line scripts into
it) requires <a class="xref" href="Hi.Licenses.AuthFeature.html#Hi_Licenses_AuthFeature_NcComposition">NcComposition</a>.
</p>
<p>
A unit is <b>built-in</b> when its concrete type lives in this library's
own assembly; anything else is <b>external</b>. Order, count, duplication
and constructor configuration of built-in units are unrestricted — the
gate never inspects the shape of the pipeline, only the identity of each
unit.
</p>
<p>
Degradation is silent and functional: without the license the built-in
dialects run unchanged; external units are skipped for the session and a
single <code>Composition--NotLicensed</code> diagnostic lists them. The decision
and its rejection record live in the native license module.
</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.NcDiagnostic.html">NcDiagnostic</a></dt>
<dd><p>A structured diagnostic from the <a class="xref" href="Hi.NcParsers.SoftNcRunner.html">SoftNcRunner</a> pipeline,
designed for <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.iprogress-1">IProgress&lt;T&gt;</a> consumption. Implements
<a class="xref" href="Hi.Common.Messages.IMessage.html">IMessage</a> so it shares the common message channel with
<a class="xref" href="Hi.Common.Messages.SimpleMessage.html">SimpleMessage</a>, step diagnostics, and progress fractions, while
additionally carrying an NC-source <a class="xref" href="Hi.NcParsers.NcDiagnostic.html#Hi_NcParsers_NcDiagnostic_SentenceCarrier">SentenceCarrier</a> anchor that
non-NC messages do not have.</p>
<p>
Also an <a class="xref" href="Hi.NcParsers.ISentenceCarrier.html">ISentenceCarrier</a> itself — <a class="xref" href="Hi.NcParsers.NcDiagnostic.html#Hi_NcParsers_NcDiagnostic_GetSentence">GetSentence()</a> and
<a class="xref" href="Hi.NcParsers.NcDiagnostic.html#Hi_NcParsers_NcDiagnostic_SentenceIndex">SentenceIndex</a> delegate to <a class="xref" href="Hi.NcParsers.NcDiagnostic.html#Hi_NcParsers_NcDiagnostic_SentenceCarrier">SentenceCarrier</a> so a
diagnostic can be used directly anywhere a carrier is expected, without the
consumer unwrapping the inner anchor.
</p>
<p>
<a class="xref" href="Hi.NcParsers.NcDiagnostic.html#Hi_NcParsers_NcDiagnostic_Id">Id</a> is composed as <code>{Primary}-{Secondary}--{Abbrev}</code>
(e.g., <code>Cycle-Peck--BadPeckQ</code>, <code>Syntax-Build--Exception</code>).
For irregular cases that don't fit the pattern, use a custom string.
</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.NcDiagnosticProgress.html">NcDiagnosticProgress</a></dt>
<dd><p>Helper that emits <a class="xref" href="Hi.NcParsers.NcDiagnostic.html">NcDiagnostic</a> records — retaining them in
<a class="xref" href="Hi.NcParsers.NcDiagnosticProgress.html#Hi_NcParsers_NcDiagnosticProgress_Diagnostics">Diagnostics</a> (their canonical home) and forwarding each to an
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.iprogress-1">IProgress&lt;T&gt;</a> of <a class="xref" href="Hi.Common.Messages.IMessage.html">IMessage</a> sink for live consumption.
Provides one method per (<a class="xref" href="Hi.Common.Messages.Category.html">Category</a>, <a class="xref" href="Hi.Common.Messages.Severity.html">Severity</a>) pair,
each with an optional <a class="xref" href="Hi.NcParsers.Sentence.html">Sentence</a> overload locating the issue in the NC source.
Each method has a <code>*Fmt</code> sibling taking a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.formattablestring">FormattableString</a> that keeps
the interpolated template and values (<a class="xref" href="Hi.NcParsers.NcDiagnostic.html#Hi_NcParsers_NcDiagnostic_Format">Format</a> /
<a class="xref" href="Hi.NcParsers.NcDiagnostic.html#Hi_NcParsers_NcDiagnostic_Args">Args</a>) for client-side localization; the sibling must be opted
into by name — an interpolated string literal passed to the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a> method
binds to <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a> and is not captured.
A caller that runs a bounded operation (an NC play, a writeback run) can wrap
it in <a class="xref" href="Hi.NcParsers.NcDiagnosticProgress.html#Hi_NcParsers_NcDiagnosticProgress_BeginRepeatFold">BeginRepeatFold()</a> so identical repeated diagnostics fold
into a first occurrence plus one counted summary instead of flooding the sink.</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.NcRunnerSuit.html">NcRunnerSuit</a></dt>
<dd><p>A switchable &ldquo;runner suit&rdquo;: bundles the per-machine NC pipeline
(<a class="xref" href="Hi.NcParsers.NcRunnerSuit.html#Hi_NcParsers_NcRunnerSuit_SoftNcRunner">SoftNcRunner</a> plus its optional side-file path
<a class="xref" href="Hi.NcParsers.NcRunnerSuit.html#Hi_NcParsers_NcRunnerSuit_SoftNcRunnerFile">SoftNcRunnerFile</a>) with the per-workpiece
<a class="xref" href="Hi.NcParsers.NcRunnerSuit.html#Hi_NcParsers_NcRunnerSuit_PerCaseNcDependencyList">PerCaseNcDependencyList</a> the runner's
<a class="xref" href="Hi.NcParsers.Dependencys.INcDependencyProxy.html">INcDependencyProxy</a> placeholders resolve against. The suit is the
proxies' <a class="xref" href="Hi.NcParsers.Dependencys.INcDependencyListHost.html">INcDependencyListHost</a>, so the runner and its case data
switch together as one unit — load a different suit to switch the active
parser (NC or CSV) within a session.</p>
<p>
Read/Write only (pure IO, no own <code>XxxFile</code> identity pointer): the owning
project serializes the suit's two members <em>flat</em> in the project XML,
keeping the per-workpiece <a class="xref" href="Hi.NcParsers.NcRunnerSuit.html#Hi_NcParsers_NcRunnerSuit_PerCaseNcDependencyList">PerCaseNcDependencyList</a> project-local
rather than a shared side file.
</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.Sentence.html">Sentence</a></dt>
<dd><p>A small NC block for one or several lines.</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.SoftNcRunner.html">SoftNcRunner</a></dt>
<dd><p>Configurable NC Runner.</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.SoftNcUtil.html">SoftNcUtil</a></dt>
<dd><p>JSON helpers for soft-NC blocks: vectors under <a class="xref" href="Hi.NcParsers.Keywords.IParsingDef.html#Hi_NcParsers_Keywords_IParsingDef_Parsing">Parsing</a>,
motion-term queries, flag grab/remove on raw text, and unparsed-line trimming.</p>
</dd>
</dl>
<h3 id="interfaces">
Interfaces
</h3>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.IGetSentence.html">IGetSentence</a></dt>
<dd><p>Abstraction for a source that carries a <a class="xref" href="Hi.NcParsers.Sentence.html">Sentence</a>.</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.ISentenceCarrier.html">ISentenceCarrier</a></dt>
<dd><p>Carries a reference to a source <a class="xref" href="Hi.NcParsers.Sentence.html">Sentence</a> together with its
execution-order <a class="xref" href="Hi.NcParsers.ISentenceIndexed.html#Hi_NcParsers_ISentenceIndexed_SentenceIndex">SentenceIndex</a>. Used as the
cross-process alignment carrier for diagnostics, messages, ClStripPos,
MachiningStep, etc. — both the source content (via
<a class="xref" href="Hi.NcParsers.IGetSentence.html#Hi_NcParsers_IGetSentence_GetSentence">GetSentence()</a>) and the execution-order position
(via <a class="xref" href="Hi.NcParsers.ISentenceIndexed.html#Hi_NcParsers_ISentenceIndexed_SentenceIndex">SentenceIndex</a>) are available without
needing two separate references.</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.ISentenceIndexed.html">ISentenceIndexed</a></dt>
<dd><p>Abstraction for an object that carries a <a class="xref" href="Hi.NcParsers.ISentenceIndexed.html#Hi_NcParsers_ISentenceIndexed_SentenceIndex">SentenceIndex</a> —
a 0-based ordinal of its source <a class="xref" href="Hi.NcParsers.Sentence.html">Sentence</a> in NC execution
order. Use as a cross-process alignment key (messages, ClStripPos,
MachiningStep, etc.) when the <code>(FileIndex, LineIndex)</code> source order
is not enough because SubProgram inline reorders blocks relative to
source order.</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="Hi.NcParsers.ISessionResettable.html">ISessionResettable</a></dt>
<dd><p>Marker for objects that hold session-scoped runtime state which must be
cleared when <a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_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> initializes a new
session pipeline (the <code>state.IsInitialized == false</code> edge).</p>
<p>
Implementers may live on either chain: <a class="xref" href="Hi.NcParsers.Dependencys.INcDependency.html">INcDependency</a>
or <a class="xref" href="Hi.NcParsers.Syntaxs.INcSyntax.html">INcSyntax</a>. <a class="xref" href="Hi.NcParsers.SoftNcRunner.html">SoftNcRunner</a> scans
<a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_PipelineNcDependencyList">PipelineNcDependencyList</a> and
<a class="xref" href="Hi.NcParsers.SoftNcRunner.html#Hi_NcParsers_SoftNcRunner_NcSyntaxList">NcSyntaxList</a> on the session-init edge and calls
<a class="xref" href="Hi.NcParsers.ISessionResettable.html#Hi_NcParsers_ISessionResettable_OnSessionReset">OnSessionReset()</a> on every match.
</p>
<p>
Distinct from <a class="xref" href="Hi.NcParsers.Dependencys.IPowerResettable.html">IPowerResettable</a>: power-reset clears
retained-but-volatile state on a controller power cycle (e.g., Fanuc
<code>#100-#499</code>), an edge that survives ordinary session boundaries.
Session-reset clears state whose lifetime is one pipeline pass (iteration
counters, file-index allocators, etc.).
</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>