Class RotaryAxisUtil
- Namespace
- Hi.NcParsers.LogicSyntaxs
- Assembly
- HiMech.dll
Shared utilities for rotary axis (A/B/C) resolution. Used by G53p1RotaryPositionSyntax, McAbcSyntax, IsoG68p2TiltSyntax, IncrementalResolveSyntax and other syntaxes that read or write rotary axis values.
public static class RotaryAxisUtil
- Inheritance
-
RotaryAxisUtil
- Inherited Members
Methods
ConsumeAxis(JsonObject, string, ISentenceCarrier, NcDiagnosticProgress)
Consumes an optional axis value (degrees) from Parsing. Post-processor hints (e.g., A/B/C on G68.2 or G53.1 lines) are parsed by FloatTagSetupSyntax into Parsing as doubles. Returns the value and removes the key, or null if not present.
A non-numeric value (e.g. "#124" left by the parser stage)
raises VariableExpression--Unevaluated via
GetParsedDouble(JsonObject, string, ISentenceCarrier, NcDiagnosticProgress) instead of silently dropping
the post-processor hint. The key is consumed regardless so downstream
syntaxes do not re-process it.
public static double? ConsumeAxis(JsonObject parsing, string axisName, ISentenceCarrier sentenceCarrier, NcDiagnosticProgress diag)
Parameters
parsingJsonObjectaxisNamestringsentenceCarrierISentenceCarrierdiagNcDiagnosticProgress
Returns
FindPreviousMcAxisDeg(LazyLinkedListNode<SyntaxPiece>, string)
Walks backward through previous SyntaxPiece nodes to
find the most recent MachineCoordinateState
that carries a numeric value for the given axis
— the axis's modal angle in degrees as the machine-state section
stores it (after the McAbcCyclicPathSyntax wrap of
that block), the anchor an incremental rotary word adds onto.
Returns null when no predecessor carries the axis.
Per-axis (rather than whole-section) because intermediate blocks — e.g. CircularMotionSyntax blocks whose MC was written by SetVec3d(JsonObject, string, Vec3d) with XYZ only — can lack rotary fields; whole-section lookback would stop at such a block and mistakenly conclude the rotary value is unknown. Silent on a non-numeric value (the throwing machine-state reader — a non-numeric MC is a HiAPIs codegen bug, not a program error).
public static double? FindPreviousMcAxisDeg(LazyLinkedListNode<SyntaxPiece> node, string axis)
Parameters
nodeLazyLinkedListNode<SyntaxPiece>axisstring
Returns
GetRotaryAxes(IMachineAxisConfig)
Gets the rotary axis names from the given IMachineAxisConfig. Returns an empty array if no rotary axes exist.
public static string[] GetRotaryAxes(IMachineAxisConfig axisConfig)
Parameters
axisConfigIMachineAxisConfig
Returns
- string[]