Table of Contents

Class NcDiagnostic

Namespace
Hi.NcParsers
Assembly
HiMech.dll

A structured diagnostic from the SoftNcRunner pipeline, designed for IProgress<T> consumption.

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.

public class NcDiagnostic
Inheritance
NcDiagnostic
Inherited Members
Extension Methods

Constructors

NcDiagnostic(NcDiagnosticSeverity, NcDiagnosticCategory, string, string, object, ISentenceCarrier)

Creates a fully-populated NcDiagnostic.

public NcDiagnostic(NcDiagnosticSeverity severity, NcDiagnosticCategory category, string id, string text, object detail = null, ISentenceCarrier sentenceCarrier = null)

Parameters

severity NcDiagnosticSeverity

Importance level — see NcDiagnosticSeverity.

category NcDiagnosticCategory

Diagnostic category — see NcDiagnosticCategory.

id string

Structured diagnostic ID (see Id).

text string

End-user friendly message text.

detail object

Optional detail data or exception. Null if not applicable.

sentenceCarrier ISentenceCarrier

Carrier for the NC source block that triggered this diagnostic; null for pipeline-level messages.

Properties

Category

Diagnostic category.

public NcDiagnosticCategory Category { get; }

Property Value

NcDiagnosticCategory

Detail

Optional detail data or exception. Null if not applicable.

public object Detail { get; }

Property Value

object

Id

Structured diagnostic ID for filtering and suppression. Normally {Primary}-{Secondary}–{Serial:000}.

public string Id { get; }

Property Value

string

SentenceCarrier

Carrier of the NC source block that triggered this diagnostic, exposing both the source Sentence (via GetSentence()) and the execution-order SentenceIndex. Null for pipeline-level messages (e.g., lifecycle start/done) that have no source block.

public ISentenceCarrier SentenceCarrier { get; }

Property Value

ISentenceCarrier

Severity

Importance level.

public NcDiagnosticSeverity Severity { get; }

Property Value

NcDiagnosticSeverity

Text

End-user friendly message text.

public string Text { get; }

Property Value

string

Methods

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.