Table of Contents

Class HeidenhainGotoIterationDependency

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

Watchdog for Heidenhain FN 9–12 GOTO LBL jumps — the label-keyed sibling of the Siemens SiemensGotoIterationDependency, with the same “soft-cap + runtime counter + session-init ISessionResettable” shape. Kept per-brand for diagnostic clarity and because klartext targets are LBL numbers-or-names, matched in their canonical form (“01”1 on a TNC, quotes stripped).

The counter key is (FileName, Label) where FileName is the source-level file path of the jump host (the relative form carried on FilePath) and Label is the normalised target. Klartext has no direction mnemonic — a backward jump is the language's loop primitive, a forward jump can only fire once per arrival — so all jumps to one label share one bucket and the cap stays generous.

The consuming syntax (HeidenhainGotoSyntax) counts after the condition gate and before the label scan; above MaxIterationsPerLabel the jump warns HeidenhainGoto--IterationLimitExceeded and falls through. A missing dependency disables the cap (Fanuc parity) — the brand preset wires one by default.

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

Constructors

HeidenhainGotoIterationDependency()

Initializes a new instance with the default limit and an empty counter.

public HeidenhainGotoIterationDependency()

HeidenhainGotoIterationDependency(XElement)

Loads MaxIterationsPerLabel from XML produced by MakeXmlSource(string, string, bool); absent element falls back to DefaultMaxIterationsPerLabel.

public HeidenhainGotoIterationDependency(XElement src)

Parameters

src XElement

Root element named XName.

Fields

DefaultMaxIterationsPerLabel

Default for MaxIterationsPerLabel — the Fanuc / Siemens GOTO default: klartext counting loops are short (feed scaling, retry sections), so the cap stays tight.

public const int DefaultMaxIterationsPerLabel = 1000

Field Value

int

Properties

CountByLabel

Per-target hit counter keyed by (FileName, Label) with the label in canonical form. Runtime-only; not serialised. Cleared by OnSessionReset() on the session-init edge.

public Dictionary<(string FileName, string Label), int> CountByLabel { get; }

Property Value

Dictionary<(string FileName, string Label), int>

MaxIterationsPerLabel

Soft cap on fired jumps for any single (FileName, Label) pair. Above this the host block emits HeidenhainGoto–IterationLimitExceeded and falls through.

public int MaxIterationsPerLabel { get; set; }

Property Value

int

XName

XML element name used to register this dependency with XFactory.

public static string XName { get; }

Property Value

string

Methods

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.

OnSessionReset()

Clears CountByLabel; leaves MaxIterationsPerLabel untouched.

public void OnSessionReset()

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