Table of Contents

Class NcRunnerSessionState

Namespace
Hi.MachiningProcs
Assembly
HiMech.dll

NC pipeline state held on a MachiningSession and shared across multiple RunNcLines(string, IEnumerable<string>, MachiningSession, StepDiagnosticProgress, NcDiagnosticProgress, CancellationToken) calls within that session. The per-layer SyntaxPieceLayers are extended via AppendSource(IEnumerable<T>) for each subsequent file so that Previous/Next connectivity (and thus ModalCarrySyntax deep-clone) crosses file boundaries.

public sealed class NcRunnerSessionState : IDisposable
Inheritance
NcRunnerSessionState
Implements
Inherited Members
Extension Methods

Properties

EffectiveNcDependencyList

Proxy-resolved dependency list — output of GetEffectiveNcDependencyList(), computed once on the first RunNcLines(string, IEnumerable<string>, MachiningSession, StepDiagnosticProgress, NcDiagnosticProgress, CancellationToken) call and reused for every file and pipeline stage in the session so each INcDependencyProxy resolves to one stable instance. Set only by RunNcLines(string, IEnumerable<string>, MachiningSession, StepDiagnosticProgress, NcDiagnosticProgress, CancellationToken) (and cleared by Reset()); readable for inspection.

public List<INcDependency> EffectiveNcDependencyList { get; }

Property Value

List<INcDependency>

EffectiveNcInitializationList

Session-scoped initializer list used to seed the init SyntaxPiece — gated like EffectiveNcSyntaxList.

public List<INcInitializer> EffectiveNcInitializationList { get; }

Property Value

List<INcInitializer>

EffectiveNcSemanticList

Session-scoped semantic list actually driven over the final syntax layer — gated like EffectiveNcSyntaxList.

public List<INcSemantic> EffectiveNcSemanticList { get; }

Property Value

List<INcSemantic>

EffectiveNcSyntaxList

Session-scoped syntax list actually driven by the layer pipeline — stamped at session initialization by ResolveEffectivePipeline(SoftNcRunner, NcRunnerSessionState, NcDiagnosticProgress). Same reference as NcSyntaxList unless the composition gate skipped external units for this session; the runner's persisted list is never mutated.

public List<INcSyntax> EffectiveNcSyntaxList { get; }

Property Value

List<INcSyntax>

EffectiveSegmenter

Session-scoped segmenter actually used to split NC text — the runner's own Segmenter, or the built-in fallback when the composition gate rejected an external one.

public ISegmenter EffectiveSegmenter { get; }

Property Value

ISegmenter

FreezeExecutedPieces

Whether executed SyntaxPieces are frozen to their compact UTF-8 form (Freeze()) once they leave the executing window. Default true — a session retains every executed piece for its whole lifetime, and the live JsonObject graph costs ~13× the frozen bytes (multi-million-line programs OOM a client machine without this). Set false only for A/B measurement or when a custom post-play consumer must mutate executed pieces in place.

public bool FreezeExecutedPieces { get; set; }

Property Value

bool

InitializedByNcRunner

The runner whose first RunNcLines(string, IEnumerable<string>, MachiningSession, StepDiagnosticProgress, NcDiagnosticProgress, CancellationToken) call built the pipeline. The layer count and the cached EffectiveNcDependencyList are sized/bound to THIS runner, so a subsequent call from a DIFFERENT runner (e.g. a CSV play after a brand-NC play in the same session) must be refused — it would index past the layer list or silently run with the wrong dependency list. Cleared by Reset().

public INcRunner InitializedByNcRunner { get; }

Property Value

INcRunner

IsInitialized

True after the first call has built the layered pipeline.

public bool IsInitialized { get; }

Property Value

bool

SyntaxPieceLayers

One LazyLinkedList<T> per pipeline layer. Index 0 is the source layer (init seed + sentence-derived pieces); indices 1..NcSyntaxList.Count are the post-NcSyntax layers. Subsequent RunNcLines(string, IEnumerable<string>, MachiningSession, StepDiagnosticProgress, NcDiagnosticProgress, CancellationToken) calls extend each layer in place via AppendSource(IEnumerable<T>).

public List<LazyLinkedList<SyntaxPiece>> SyntaxPieceLayers { get; set; }

Property Value

List<LazyLinkedList<SyntaxPiece>>

Methods

DeferFreeze(SyntaxPiece)

Hands an executed piece to the deferred-freeze window: it stays live for the next Hi.MachiningProcs.NcRunnerSessionState.FreezeLagPieceCount piece boundaries, then freezes. No-op when FreezeExecutedPieces is false or piece is null. Called by RunNcLines(INcRunner, string, IEnumerable<string>, CancellationToken) at each source-command boundary — the point where the previous piece's syntax builds and semantics have all completed.

public void DeferFreeze(SyntaxPiece piece)

Parameters

piece SyntaxPiece

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

FlushDeferredFreezes()

Freezes everything still in the deferred-freeze window. Called at the end-of-play action (after the act runner's WaitAll) so a finished play retains only frozen pieces; when FreezeExecutedPieces is false the window is just dropped.

public void FlushDeferredFreezes()

Reset()

Drops the per-layer pipeline state so the next RunNcLines(string, IEnumerable<string>, MachiningSession, StepDiagnosticProgress, NcDiagnosticProgress, CancellationToken) call re-builds from scratch. Use this for a controller power reset (where in-flight SyntaxPiece JSON dataflow — including Vars.Volatile, modal carries, and the init seed — must vanish) without disposing the owning MachiningSession itself.

Idempotent and reusable: after Reset() the object is in the same lazy-uninitialised state as a freshly constructed instance, so the first subsequent RunNcLines hits the !IsInitialized branch and re-creates everything.

public void Reset()