Table of Contents

Class ToolHeightOffsetSyntax

Namespace
Hi.NcParsers.LogicSyntaxs
Assembly
HiMech.dll

Resolves tool height offset ID to the effective offset value (mm) and composes the offset as a translation into the accumulated ProgramToMcTransform matrix.

Reads parsed G43/G43.4/G44/G49 flags and H numbers from upstream parsing syntaxes, looks up the offset value from IToolOffsetConfig dependency, writes the resolved state to a IToolHeightCompensationDef section for debuggability, and composes ProgramToMcTransform.Trans += toolOrientation * height_mm.

The tool orientation direction is read from a "ToolOrientation" key in JSON (written by a prior syntax, e.g., ToolOrientationSyntax). If absent, falls back to the current ProgramToMcTransform's AxialNormal (rotated Z). If no transformation exists yet, defaults to UnitZ.

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

Remarks

Input data locations in JsonObject:

  • Parsing.G43 / Parsing.G43.4 / Parsing.G44 → from ParameterizedFlagSyntax, {"H": "5"}
  • Parsing.H → from IntegerTagSetupSyntax, standalone modal H (int)
  • Parsing.Flags → from NumberedFlagSyntax, "G49" for cancellation
  • ToolOrientation → from a prior syntax (optional, default = Transformation.AxialNormal or UnitZ)
Modal state is persisted in the IToolHeightCompensationDef section (not syntax fields) and recovered from backward node traversal.

Constructors

ToolHeightOffsetSyntax()

public ToolHeightOffsetSyntax()

ToolHeightOffsetSyntax(XElement)

public ToolHeightOffsetSyntax(XElement src)

Parameters

src XElement

Fields

ToolOrientationKey

public const string ToolOrientationKey = "ToolOrientation"

Field Value

string

TransformSource

public const string TransformSource = "ToolHeightCompensation"

Field Value

string

Properties

Name

public string Name { get; }

Property Value

string

XName

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.