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
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
jsonJsonObjectBlock JSON object to update.
offsetvec3d_tTranslation 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
nodeLazyLinkedListNode<SyntaxPiece>Current node to look back from.
Returns
GetCurrentCoordinateId(JsonObject)
Gets CoordinateId from the current node's existing CoordinateOffset section (e.g., set by StaticInitializer).
public static string GetCurrentCoordinateId(JsonObject json)
Parameters
jsonJsonObject
Returns
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
ncDependencyListIEnumerable<INcDependency>coordIdstringoffsetvec3d_t
Returns
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
jsonJsonObjectBlock JSON object to update.
coordIdstringCoordinate system identifier (e.g., G54).
offsetvec3d_tOffset translation in machine coordinates.