Table of Contents

Class CancellationTokenDependency

Namespace
Hi.NcParsers.Dependencys.SystemWired
Assembly
HiMech.dll

Carries the CancellationToken of the RunNcLines(string, IEnumerable<string>, MachiningSession, StepDiagnosticProgress, NcDiagnosticProgress, CancellationToken) run in progress to the syntaxes that inline source pieces mid-pipeline: the subprogram and macro calls (SubProgramCallSyntax, FanucMacroCallSyntax, FanucModalMacroSyntax, SiemensSubProgramCallSyntax, HeidenhainSubProgramCallSyntax) and the section repeats (SiemensRepeatSyntax, Heidenhain CALL LBL n REP m). Each reads the token when it builds its call and hands it to the body it prepends, so the body of a cancelled run ends before its next piece and a repeat ends between repetitions, however deep an inlined expansion stands.

RunNcLines(string, IEnumerable<string>, MachiningSession, StepDiagnosticProgress, NcDiagnosticProgress, CancellationToken) assigns Token when a run starts and puts the previous value back when the run's enumeration ends, so the dependency sits in PipelineNcDependencyList like the other system-wired members; a pipeline list without one gets one for the session. Serialization writes only the empty element.

public class CancellationTokenDependency : INcDependency, IMakeXmlSource
Inheritance
CancellationTokenDependency
Implements
Inherited Members
Extension Methods

Constructors

CancellationTokenDependency()

Initializes a new instance carrying the default token; the host runner assigns the run's.

public CancellationTokenDependency()

Properties

Token

The token of the run in progress: assigned by RunNcLines(string, IEnumerable<string>, MachiningSession, StepDiagnosticProgress, NcDiagnosticProgress, CancellationToken) when a run starts and put back to its previous value when that run's enumeration ends; the default (never cancelled) token on a pipeline no run is driving.

public CancellationToken Token { get; }

Property Value

CancellationToken

XName

XML element name used to register this dependency with XFactory.

public static string XName { get; }

Property Value

string

Methods

MakeXmlSource(string, string, bool)

Runtime-only dependency: the token belongs to one run and is not meaningful to persist; serialization writes only the empty element so the dependency survives an XML round-trip.

public XElement MakeXmlSource(string baseDirectory, string relFile, bool exhibitionOnly)

Parameters

baseDirectory string
relFile string
exhibitionOnly bool

Returns

XElement

Reg(XFactory)

Registers this type's deserializer with the given XFactory (or Default when factory is null). Idempotent.

public static void Reg(XFactory factory = null)

Parameters

factory XFactory

TokenOf(List<INcDependency>)

The run token ncDependencyList carries: the Token of its first CancellationTokenDependency, or the default token when the list has none.

public static CancellationToken TokenOf(List<INcDependency> ncDependencyList)

Parameters

ncDependencyList List<INcDependency>

The pipeline's dependency list, as handed to a syntax's Build.

Returns

CancellationToken