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_t)

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_t offset)

Parameters

json JsonObject

Block JSON object to update.

offset vec3d_t

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

TryResolveOffset(IEnumerable<INcDependency>, string, out vec3d_t)

Resolves the offset for coordId by scanning every IIsoCoordinateConfig in ncDependencyList and answering the first provider that holds it. Returns false when no provider has data for this id (callers 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 bool TryResolveOffset(IEnumerable<INcDependency> ncDependencyList, string coordId, out vec3d_t offset)

Parameters

ncDependencyList IEnumerable<INcDependency>
coordId string
offset vec3d_t

Returns

bool

WriteSection(JsonObject, string, vec3d_t)

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

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

Parameters

json JsonObject

Block JSON object to update.

coordId string

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

offset vec3d_t

Offset translation in machine coordinates.