Table of Contents

Class CoordinateOffsetUtil

Namespace
Hi.NcParsers.LogicSyntaxs
Assembly
HiMech.dll

Shared utilities for all coordinate offset syntaxes (ISO, Siemens, Heidenhain). Handles section IO, backward lookback, and ProgramToMcTransform composition.

public static class CoordinateOffsetUtil
Inheritance
CoordinateOffsetUtil
Inherited Members

Fields

TransformSource

Identifier used as the transform source key when composing the coordinate offset translation into ProgramToMcTransform.

public const string TransformSource = "CoordinateOffset"

Field Value

string

Methods

ComposeTranslation(JsonObject, Vec3d)

Composes a translation matrix from the given offset and registers it under TransformSource in the block's transform stack.

public static void ComposeTranslation(JsonObject json, Vec3d offset)

Parameters

json JsonObject

Block JSON object to update.

offset Vec3d

Translation offset to apply.

FindPreviousCoordinateId(LazyLinkedListNode<SyntaxPiece>)

Walks the previous node and returns its CoordinateId if any; used for modal lookback when the current block does not specify one.

public static string FindPreviousCoordinateId(LazyLinkedListNode<SyntaxPiece> node)

Parameters

node LazyLinkedListNode<SyntaxPiece>

Current node to look back from.

Returns

string

GetCurrentCoordinateId(JsonObject)

Gets CoordinateId from the current node's existing CoordinateOffset section (e.g., set by StaticInitializer).

public static string GetCurrentCoordinateId(JsonObject json)

Parameters

json JsonObject

Returns

string

ResolveOffset(IEnumerable<INcDependency>, string)

Resolves the offset for coordId by scanning every IIsoCoordinateConfig in ncDependencyList and returning the first non-null result. Returns null when no provider has data for this id (callers should fall back to Zero).

Multi-provider iteration lets a brand parameter table cover the hardware-mapped subset (e.g. Fanuc G54–G59, G54.1 P1–P48 backed by real parameter numbers) while a standalone IsoCoordinateTable covers HiNC-extension ids the brand table does not handle (e.g. G59.1–G59.9).

public static Vec3d ResolveOffset(IEnumerable<INcDependency> ncDependencyList, string coordId)

Parameters

ncDependencyList IEnumerable<INcDependency>
coordId string

Returns

Vec3d

WriteSection(JsonObject, string, Vec3d)

Writes the CoordinateOffset section with the given coordinate id and XYZ offset components.

public static void WriteSection(JsonObject json, string coordId, Vec3d offset)

Parameters

json JsonObject

Block JSON object to update.

coordId string

Coordinate system identifier (e.g., G54).

offset Vec3d

Offset translation in machine coordinates.