Table of Contents

Class HeidenhainToolChangeSyntax

Namespace
Hi.NcParsers.LogicSyntaxs.Heidenhain
Assembly
HiMech.dll

Heidenhain-specific: consumes the Parsing[“TOOL CALL”] record (written by HeidenhainToolCallSyntax) into the shared SectionName section so ToolChangeSemantic fires the tooling act. A klartext TOOL CALL always performs the change — no separate M06 trigger exists — so IsChangeKey is always true with Term = “TOOL CALL”.

The spindle-speed word (S) is relocated to the root of Parsing so the shared SpindleSpeedSyntax — which must run after this syntax in the Logic bundle — records it modally. Numeric tool ids are written as ints (the act chain is int-keyed); non-numeric ids stay strings and resolve (or warn) at the semantic layer.

P0 limits recorded as diagnostics: non-Z tool axis (ToolChange--AxisUnsupported), non-zero DL/DR deltas (ToolChange--DeltaUnsupported; zero deltas are consumed silently), and a TOOL CALL without a tool id (ToolChange--MissingToolId, e.g. a variable tool number the parser could not capture).

Known P2 limitation: a quoted tool NAME that happens to spell a Q token (TOOL CALL "Q1" Z) loses its quotes at capture, so the evaluator substitutes the Q parameter's value and the numeric branch below treats it as a tool number. Corpus-zero (real names are "B40R"-style); fixing it needs the capture to preserve the quoted-ness, which would change the P0-pinned record shape.

public class HeidenhainToolChangeSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
Inheritance
HeidenhainToolChangeSyntax
Implements
Inherited Members
Extension Methods

Examples

Numeric tool call — id becomes an int, S is relocated to the Parsing root for the shared spindle syntax: #BeforeBuild:

{ "Parsing": { "TOOL CALL": { "Axis": "Z", "S": "4000", "T": "2" } } }

#AfterBuild:

{
  "Parsing": { "S": 4000 },
  "ToolChange": { "ToolId": 2, "IsChange": true, "Term": "TOOL CALL" }
}

Named tool with zero deltas — the name carries as a string ToolId; literal DL/DR ride in the section (DL feeds the length compensation; a non-zero DR would warn): #BeforeBuild:

{ "Parsing": { "TOOL CALL": { "Axis": "Z", "S": "1200", "DL": "+0.0", "DR": "+0.0", "T": "B40R" } } }

#AfterBuild:

{
  "Parsing": { "S": 1200 },
  "ToolChange": { "ToolId": "B40R", "IsChange": true, "Term": "TOOL CALL", "DL": 0, "DR": 0 }
}

Constructors

HeidenhainToolChangeSyntax()

Initializes a new instance with default settings.

public HeidenhainToolChangeSyntax()

HeidenhainToolChangeSyntax(XElement)

Initializes a new instance by deserializing from the given XML element.

public HeidenhainToolChangeSyntax(XElement src)

Parameters

src XElement

Source XML element.

Fields

Term

Value written to TermKey for klartext tool calls.

public const string Term = "TOOL CALL"

Field Value

string

Properties

Name

Syntax kind name (typically the concrete type name).

public string Name { get; }

Property Value

string

XName

XML element name used to register this syntax with XFactory.

public static string XName { get; }

Property Value

string

Methods

Build(LazyLinkedListNode<SyntaxPiece>, List<INcDependency>, NcDiagnosticProgress)

Build syntax arrangement into the syntaxPieceNode in-place.

public void Build(LazyLinkedListNode<SyntaxPiece> syntaxPieceNode, List<INcDependency> ncDependencyList, NcDiagnosticProgress ncDiagnosticProgress)

Parameters

syntaxPieceNode LazyLinkedListNode<SyntaxPiece>
ncDependencyList List<INcDependency>
ncDiagnosticProgress NcDiagnosticProgress

MakeXmlSource(string, string, bool)

Creates an XML representation of the object. This method may also generate additional resources such as related files.

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

Parameters

baseDirectory string

The base directory for resolving relative paths

relFile string

The relative file path for the XML source

exhibitionOnly bool

if true, the extended file creation is suppressed.

Returns

XElement

An XML element representing the object's state

Remarks

For the demand of easy moving source folder (especially project folder) without configuration file path corruption, the relative file path is applied. The baseDirectory is typically the folder at the nearest configuration file folder. Since the folder can be moving with the configuration file.

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