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)
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
jsonJsonObjectBlock JSON object to update.
offsetVec3dTranslation 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
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
ncDependencyListIEnumerable<INcDependency>coordIdstring
Returns
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
jsonJsonObjectBlock JSON object to update.
coordIdstringCoordinate system identifier (e.g., G54).
offsetVec3dOffset translation in machine coordinates.