Namespace Hi.NcParsers
Classes
- NcDiagnostic
A structured diagnostic from the SoftNcRunner pipeline, designed for IProgress<T> consumption. Implements IMessage so it shares the common message channel with SimpleMessage, step diagnostics, and progress fractions, while additionally carrying an NC-source SentenceCarrier anchor that non-NC messages do not have.
Also an ISentenceCarrier itself — GetSentence() and SentenceIndex delegate to SentenceCarrier so a diagnostic can be used directly anywhere a carrier is expected, without the consumer unwrapping the inner anchor.
Id is composed as
{Primary}-{Secondary}--{Abbrev}(e.g.,Cycle-Peck--BadPeckQ,Syntax-Build--Exception). For irregular cases that don't fit the pattern, use a custom string.
- NcDiagnosticProgress
Helper that emits NcDiagnostic records — retaining them in Diagnostics (their canonical home) and forwarding each to an IProgress<T> of IMessage sink for live consumption. Provides one method per (Category, Severity) pair, each with an optional Sentence overload locating the issue in the NC source.
- NcRunnerSuit
A switchable “runner suit”: bundles the per-machine NC pipeline (SoftNcRunner plus its optional side-file path SoftNcRunnerFile) with the per-workpiece PerCaseNcDependencyList the runner's INcDependencyProxy placeholders resolve against. The suit is the proxies' INcDependencyListHost, 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.
Read/Write only (pure IO, no own
XxxFileidentity pointer): the owning project serializes the suit's two members flat in the project XML, keeping the per-workpiece PerCaseNcDependencyList project-local rather than a shared side file.
- Sentence
A small NC block for one or several lines.
- SoftNcRunner
Configurable NC Runner.
- SoftNcUtil
JSON helpers for soft-NC blocks: vectors under Parsing, motion-term queries, flag grab/remove on raw text, and unparsed-line trimming.
Interfaces
- IGetSentence
Abstraction for a source that carries a Sentence.
- ISentenceCarrier
Carries a reference to a source Sentence together with its execution-order SentenceIndex. Used as the cross-process alignment carrier for diagnostics, messages, ClStripPos, MachiningStep, etc. — both the source content (via GetSentence()) and the execution-order position (via SentenceIndex) are available without needing two separate references.
- ISentenceIndexed
Abstraction for an object that carries a SentenceIndex — a 0-based ordinal of its source Sentence in NC execution order. Use as a cross-process alignment key (messages, ClStripPos, MachiningStep, etc.) when the
(FileIndex, LineIndex)source order is not enough because SubProgram inline reorders blocks relative to source order.
- ISessionResettable
Marker for objects that hold session-scoped runtime state which must be cleared when RunControlLines(string, IEnumerable<string>, MachiningSession, StepDiagnosticProgress, NcDiagnosticProgress, CancellationToken) initializes a new session pipeline (the
state.IsInitialized == falseedge).Implementers may live on either chain: INcDependency or INcSyntax. SoftNcRunner scans PipelineNcDependencyList and NcSyntaxList on the session-init edge and calls OnSessionReset() on every match.
Distinct from IPowerResettable: power-reset clears retained-but-volatile state on a controller power cycle (e.g., Fanuc
#100-#499), an edge that survives ordinary session boundaries. Session-reset clears state whose lifetime is one pipeline pass (iteration counters, file-index allocators, etc.).