Table of Contents

Interface INcRunner

Namespace
Hi.Numerical
Assembly
HiMech.dll

NC runner — parses and executes NC program lines. Nc is the umbrella term for any machine-readable control program (famous-brand controller code, NX-CL, CSV): the same runner contract serves all of them, and NcKind names the kinds where they must be distinguished.

public interface INcRunner
Extension Methods

Remarks

Renamed from IControlRunner (with RunControlLines) — the implementors were already named SoftNcRunner / HardNcRunner, and the whole soft pipeline (session state, syntax layers, dependencies) carries the Nc prefix while serving CL and CSV too.

Methods

RunNcLines(string, IEnumerable<string>, MachiningSession, StepDiagnosticProgress, NcDiagnosticProgress, CancellationToken)

Runs raw NC program lines and yields source sentence and Act pairs.

IEnumerable<SourcedActEntry> RunNcLines(string relFilePath, IEnumerable<string> lines, MachiningSession machiningSession, StepDiagnosticProgress stepDiagnosticProgress, NcDiagnosticProgress ncDiagnosticProgress, CancellationToken cancellationToken)

Parameters

relFilePath string

The relative path of the NC program file

lines IEnumerable<string>

The enumerable collection of NC program lines

machiningSession MachiningSession

Session-scoped state shared across multiple RunNcLines(string, IEnumerable<string>, MachiningSession, StepDiagnosticProgress, NcDiagnosticProgress, CancellationToken) calls (e.g. lazy-initialized pipeline state, file-index counter).

stepDiagnosticProgress StepDiagnosticProgress

Step-anchored IMessage-channel sink.

ncDiagnosticProgress NcDiagnosticProgress

NC-pipeline diagnostic sink, threaded in as an input so the runner stays host-agnostic (the caller injects it; the production caller passes the service-scoped instance, standalone tests pass their own).

cancellationToken CancellationToken

A cancelled token ends the enumeration between blocks: when the runner observes the cancellation, the block whose entries are being yielded is finished (its last entry is its ActLineEnd), no further block is read or played, and a run that follows in the same session plays none of the stopped program's remaining blocks or pending bodies: it starts from the stopped block's modal state, while the stopped program's call and loop stacks end with it – unless a hosted MachiningSession starts the run that follows a stop from HiNC's program-end reset state (modelled on a controller's RESET; ProgramEndSyntax lists what it cancels, keeps and where each controller differs) at the position the machine stopped at (RunNcLines(INcRunner, string, IEnumerable<string>, CancellationToken)): the SoftNc runner does so, the HardNc runner keeps the boundary above.

Returns

IEnumerable<SourcedActEntry>

Enumerable of source sentence and Act pairs