Table of Contents

Class HeidenhainApprDepSyntax

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

Heidenhain klartext contour approach and departure statements, the Cartesian forms: APPR LT / APPR LN / APPR CT / APPR LCT and DEP LT / DEP LN / DEP CT / DEP LCT (Klartext Programming User's Manual, “Approaching and departing a contour”; the syntax elements of each form in the TNC7 manual §9.6). The statement head is consumed and the block is recorded as a nested Parsing.APPR or Parsing.DEP record — { “Form”: “LT” | “LN” | “CT” | “LCT” } plus every parameter word of the family the line carries, LEN, CCA and R (the form takes its own: LEN on LT / LN, CCA and R on CT, R on LCT, WordsOf(string)) — for the PostLogic-stage HeidenhainApproachDepartureSyntax, which computes the auxiliary point PH and writes the motion. A parameter word a form does not take (an R on an LT, a CCA on an LN) lands in the record all the same, for that stage to report (HeidenhainApprDep–WordNotTaken) and drop: left on the line, the shared capture would read it and the DIN/ISO arc twin would take a stray R after a klartext arc as an arc of its own, with no message at all. The DIN/ISO arc words I / J / K, which no form takes, are kept in the record for the same reason. A word written more than once lands in the record's RepeatedWords (RepeatedWordsKey), which that stage reports (HeidenhainApprDep–WordRepeated, the first occurrence used) before the record is dropped; the words are read case-insensitively and taken as the word they spell (a len15 is the LEN 15; a second spelling of a word already read is a repeat of it). A parameter word's value may stand apart from the word (CCA 180, as the iTNC 530 manual prints its DEP CT example), as an F value may on this brand.

The approach block's coordinates are the first contour point PA, so they land on the root of Parsing exactly like an L endpoint (the shared Logic consumers resolve them into the block's nominal ProgramXyz, which is the first contour point the compensated path then offsets), its rotary and parallel words with them; the radius compensation words RL/RR/R0 are captured like on HeidenhainLSyntax — the manual programs the compensation of the whole contour on the APPR block; the record lists the axis letters the block states (Axes), which the PostLogic stage reads to tell a plane-normal coordinate the block leaves unstated — kept at the level an M140 retract on the block lifted the tool to — from a stated one. A departure block's principal-axis words stay inside the Parsing.DEP record: on a DEP LCT the coordinates are the end point PN, which the tool reaches only after the tangential arc, and on a DEP LT / LN / CT, whose forms take none, a coordinate is reported by the PostLogic stage and dropped — none may reach the root, where the shared capture that follows this owner in the bundle would read it as the block's own endpoint (a motion of the block, and the corner partner of the contour's last element). The rotary and parallel words of a DEP LCT are coordinates of PN too (the TNC7 syntax of the form lists A, B, C, U, V and W with X, Y and Z) and go to the root like an approach's; on the other departure forms they stay in the record with the rest, reported and dropped. A DEP block always writes R0 as well, because "the DEP blocks automatically discard the tool radius compensation" — the cancel reaches the compensation pass through the same R0 word a programmer writes; a lone R0 spelled on a DEP LT / LN is absorbed as that word, on a DEP CT / LCT it is the radius 0 (no DEP form has a compensation word), and an RL / RR on a DEP block, which no form takes, stays unread.

Incremental words (APPR LT X+20 IY+20 …, DEP LCT IX-20 …) land under the plain axis keys of their section — the Parsing root for an approach, Parsing.DEP for a departure's end point — with the block-root PositioningOverride stamp, through HeidenhainIncrementalAxisWordUtil; the brand's IncrementalResolveSyntax instance walks the Parsing.DEP record as it walks Parsing.CC.

The polar forms (APPR PLT / PLN / PCT / PLCT, DEP PLCT) are not claimed here: they take the polar PA/PR vocabulary of the LP/CP statements, which has no owner yet, so the line stays unread and surfaces as residue like today. The comp word R0 is grabbed before the radius word R and rejects a digit or a dot follower, so a radius R0.5 is never read as the compensation-off word.

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

Examples

The manual's APPR LT example — PA on the root, LEN in the record, the RR word captured, the feed left for the shared F capture: #BeforeBuild.UnparsedText: APPR LT X+20 Y+20 Z-10 LEN15 RR F100 #AfterBuild:

{
  "UnparsedText": "F100",
  "Parsing": {
    "APPR": { "Form": "LT", "LEN": 15, "Axes": "XYZ" },
    "RR": true, "X": 20, "Y": 20, "Z": -10
  }
}

APPR LN with a signed length: #BeforeBuild.UnparsedText: APPR LN X+10 Y+20 Z-10 LEN+15 RR F100 #AfterBuild:

{
  "UnparsedText": "F100",
  "Parsing": {
    "APPR": { "Form": "LN", "LEN": 15, "Axes": "XYZ" },
    "RR": true, "X": 10, "Y": 20, "Z": -10
  }
}

APPR CT — the center angle and the signed radius: #BeforeBuild.UnparsedText: APPR CT X+10 Y+20 Z-10 CCA180 R+10 RR F100 #AfterBuild:

{
  "UnparsedText": "F100",
  "Parsing": {
    "APPR": { "Form": "CT", "CCA": 180, "R": 10, "Axes": "XYZ" },
    "RR": true, "X": 10, "Y": 20, "Z": -10
  }
}

APPR LCT with an incremental Y — the value lands under the plain key and the block root carries the stamp: #BeforeBuild.UnparsedText: APPR LCT X+10 IY+20 R10 RL F100 #AfterBuild:

{
  "UnparsedText": "F100",
  "Parsing": {
    "APPR": { "Form": "LCT", "R": 10, "Axes": "XY" },
    "RL": true, "X": 10, "Y": 20
  },
  "PositioningOverride": { "Y": "Incremental" }
}

DEP LT — no coordinates; the block cancels the compensation (R0): #BeforeBuild.UnparsedText: DEP LT LEN12.5 F100 #AfterBuild:

{
  "UnparsedText": "F100",
  "Parsing": {
    "DEP": { "Form": "LT", "LEN": 12.5 },
    "R0": true
  }
}

DEP CT: #BeforeBuild.UnparsedText: DEP CT CCA180 R+8 F100 #AfterBuild:

{
  "UnparsedText": "F100",
  "Parsing": {
    "DEP": { "Form": "CT", "CCA": 180, "R": 8 },
    "R0": true
  }
}

DEP LCT — the end point PN stays inside the record; a radius written R0.5 is a radius, not the compensation-off word (which the block writes anyway): #BeforeBuild.UnparsedText: DEP LCT X+10 Y+12 R0.5 F100 #AfterBuild:

{
  "UnparsedText": "F100",
  "Parsing": {
    "DEP": { "Form": "LCT", "R": 0.5, "X": 10, "Y": 12 },
    "R0": true
  }
}

DEP LCT with incremental end-point words — in the record, stamped on the block root: #BeforeBuild.UnparsedText: DEP LCT IX-20 IY-20 R5 F1000 #AfterBuild:

{
  "UnparsedText": "F1000",
  "Parsing": {
    "DEP": { "Form": "LCT", "R": 5, "X": -20, "Y": -20 },
    "R0": true
  },
  "PositioningOverride": { "X": "Incremental", "Y": "Incremental" }
}

A polar form is not claimed — the line is left as it was: #BeforeBuild.UnparsedText: APPR PLT PR+15 PA+180 LEN10 RL F100 #AfterBuild:

{ "UnparsedText": "APPR PLT PR+15 PA+180 LEN10 RL F100" }

A DEP LT takes no coordinate (the TNC7 syntax of DEP LT is LEN, F and M only): a written one lands in the record all the same, for the PostLogic stage to report and drop, never on the root; the RR no form takes stays unread and is reported as residue: #BeforeBuild.UnparsedText: DEP LT LEN12.5 Z+50 RR F100 #AfterBuild:

{
  "UnparsedText": "RR F100",
  "Parsing": {
    "DEP": { "Form": "LT", "LEN": 12.5, "Z": 50 },
    "R0": true
  }
}

A parameter word of another form lands in the record all the same, for the PostLogic stage to report and drop (an R left on the line after a klartext arc would be read as a DIN/ISO arc): #BeforeBuild.UnparsedText: APPR LT X+20 Y+20 LEN15 R5 RR F100 #AfterBuild:

{
  "UnparsedText": "F100",
  "Parsing": {
    "APPR": { "Form": "LT", "LEN": 15, "R": 5, "Axes": "XY" },
    "RR": true,
    "X": 20, "Y": 20
  }
}

A lone R0 on a DEP CT is the radius 0, not the compensation word (which the block writes anyway): #BeforeBuild.UnparsedText: DEP CT CCA90 R0 F100 #AfterBuild:

{
  "UnparsedText": "F100",
  "Parsing": {
    "DEP": { "Form": "CT", "CCA": 90, "R": 0 },
    "R0": true
  }
}

A rotary or parallel word on a DEP LCT is a coordinate of PN (the TNC7 syntax of DEP LCT lists X, Y, Z, A, B, C, U, V, W) and goes to the root like an approach's; on the other departure forms it stays in the record: #BeforeBuild.UnparsedText: DEP LCT X+10 Y+12 A+30 R8 F100 #AfterBuild:

{
  "UnparsedText": "F100",
  "Parsing": {
    "DEP": { "Form": "LCT", "R": 8, "X": 10, "Y": 12 },
    "R0": true,
    "A": 30
  }
}

A DIN/ISO arc word on a departure (or an approach) lands in the record, never on the line, where the arc twin would read it after a klartext arc: #BeforeBuild.UnparsedText: DEP LT LEN10 I+5 J+55 F100 #AfterBuild:

{
  "UnparsedText": "F100",
  "Parsing": {
    "DEP": { "Form": "LT", "LEN": 10, "I": 5, "J": 55 },
    "R0": true
  }
}

Constructors

HeidenhainApprDepSyntax()

Initializes a new instance with default settings.

public HeidenhainApprDepSyntax()

HeidenhainApprDepSyntax(XElement)

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

public HeidenhainApprDepSyntax(XElement src)

Parameters

src XElement

Source XML element.

Fields

ApprKey

Key of the nested approach record under Parsing.

public const string ApprKey = "APPR"

Field Value

string

AxesKey

Key of the axis letters an approach block states (“XYZ”), inside the APPR record.

public const string AxesKey = "Axes"

Field Value

string

CcaKey

Center-angle word of the CT forms (degrees).

public const string CcaKey = "CCA"

Field Value

string

DepKey

Key of the nested departure record under Parsing.

public const string DepKey = "DEP"

Field Value

string

ForeignTags

The DIN/ISO arc words no form takes (I, J, K), kept in the record all the same: left on the line, the arc twin would read them.

public static readonly string[] ForeignTags

Field Value

string[]

FormCt

Circular arc tangential to the contour.

public const string FormCt = "CT"

Field Value

string

FormKey

Key of the form word inside either record (LT, LN, CT, LCT).

public const string FormKey = "Form"

Field Value

string

FormLct

Straight line into a circular arc tangential to both.

public const string FormLct = "LCT"

Field Value

string

FormLn

Straight line perpendicular to the contour.

public const string FormLn = "LN"

Field Value

string

FormLt

Straight line tangential to the contour.

public const string FormLt = "LT"

Field Value

string

LenKey

Distance word of the LT/LN forms.

public const string LenKey = "LEN"

Field Value

string

ParameterTags

The parameter words of the family: every form's record holds the ones its line carries.

public static readonly string[] ParameterTags

Field Value

string[]

RKey

Radius word of the CT and LCT forms.

public const string RKey = "R"

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

WordsOf(string)

The words each form takes, and nothing else (the TNC7 syntax tables).

public static string[] WordsOf(string form)

Parameters

form string

Returns

string[]