Table of Contents

Namespace Hi.NcParsers.Semantics

Classes

ClLinearMcMotionSemantic

Resolves ClLinear motion into CL-level linear interpolation with per-step inverse kinematics. Used when RTCP (G43.4/TRAORI/M128) is active and rotary axes change, producing ActClLinearMcXyzabcContour.

The CL (cutter location) endpoints are derived from MC endpoints via forward kinematics, then interpolated linearly. The MC path is non-linear because the tool orientation changes during the move.

CompoundMotionSemantic

Resolves ICompoundMotionDef into acts by delegating ItemsKey to ResolveItems(JsonArray, LazyLinkedListNode<SyntaxPiece>, DVec3d, IRapidFeedrateConfig, NcDiagnosticProgress, IMachineAxisConfig, IMachineKinematics).

CoolantSemantic

Resolves the ICoolantDef JSON section (written by CoolantSyntax from M07/M08/M09) into an ActCooling act. Only emits when the coolant mode changes from the previous block — modal state is suppressed so downstream consumers (e.g. StateActRunner) see one act per real transition rather than one per block.

CsScriptBeginSemantic

Resolves BeginScript into ActLineCsScript. Must be placed at the beginning of NcSemanticList so that the script runs before motion and other acts.

CsScriptEndSemantic

Resolves EndScript into ActLineCsScript. Must be placed at the end of NcSemanticList so that the script runs after motion and other acts.

CsScriptSemantic

Base class for resolving CsScript JSON entries into ActLineCsScript. Subclasses specify which script key to read (BeginScript or EndScript).

Also supports an external script dictionary via ExternalScripts. When set, each NC block's FileLineIndex is looked up in the dictionary and the matched script is emitted as an additional ActLineCsScript. This allows runtime injection of per-line scripts without modifying the NC file.

MachineCoordinateStepSemantic

Read MachineCoordinate from MachineCoordinateState in JsonObject and produce ActMcXyzStep. Requires ProgramXyzSyntax to have computed McXyz first.

McArcMotionSemantic

Resolves McArc motion into ActFeedrate + ActMcXyzSpiralContour. Reads arc center, plane normal, and direction from the Hi.Motion section written by CircularMotionSyntax.

McLinearMotionSemantic

Resolves McLinear motion into ActFeedrate/ActRapid + ActMcXyzLinearContour or ActMcXyzabcLinearContour.

Discriminates by whether the block's rotary state actually CHANGED from the previous modal state (HasRotaryMotion(DVec3d, DVec3d, LazyLinkedListNode<SyntaxPiece>) — value comparison, not key presence: MergeKeys completes every motion block's MachineCoordinateState with carried modal rotary values, so key presence no longer means the block moved a rotary axis):

McPolarArcMotionSemantic

Resolves McPolarArc motion into ActFeedrate + ActMcPolarSpiralContour.

The arc geometry (center, direction, additional circles) was resolved by ProgramRxczSyntax on the polar hypothetical plane in central (anchor-origin) coordinates; this semantic computes the plane arc length via ActMcPolarSpiralContour's shared spiral derivative, takes duration = length / feedrate (mirroring HardNc NcProc.GetActSpiralMcXyzContour), and emits the polar spiral act whose per-step polar→machine conversion chains the C-axis branch.

When RadiusCompensationSyntax compensated the block (marked by CompensatedEndCentral in the motion section), the act structure mirrors HardNc NcProc.GetActsFromArcCommand: an optional ActMcPolarLinearContour bridge onto the offset circle (transient begin), the spiral between the compensated endpoints around the NOMINAL center, and an optional bridge off it (transient end) — the polar twin of HardNc GetActMcContourByLinearProgramPos.

McPolarLinearMotionSemantic

Resolves McPolarLinear motion into ActFeedrate + ActMcPolarLinearContour.

Reads the anchor-relative polar positions written by ProgramRxczSyntax (begin from the previous block, end from the current block) and hands the central (anchor-origin) pair to the act, mirroring HardNc NcProc.GetActMcPolarLinearContour. Duration mirrors HardNc GetTimeCostByPolarLinearContour, including the C-axis speed clamp on the hypothetical component — the ceiling comes from the rotary rate bucket (IRapidFeedrateConfig), the same number the legacy import fills from HardNcEnv's MaxRotarySpeedABC.

Rapid polar events (G00 while G12.1 is active — disallowed by Fanuc and warned at parse time) resolve to no act, matching HardNc.
SpindleSpeedSemantic

Resolves ISpindleSpeedDef section into ActSpindleSpeed and ActSpindleDirection. Only emits when spindle speed or direction actually changes from the previous block.

StrokeLimitCheckSemantic

Reports a diagnostic error when MachineCoordinateState exceeds the stroke limits defined in IStrokeLimitConfig. Does not emit any IAct; only produces diagnostics.

ToolChangeSemantic

Resolves SectionName section into ActToolingStep when a change trigger is present (IsChangeKey = true); a T-code-only (pre-selection) block produces no act — magazine pre-rotation is PLC work with no axis or spindle effect. The axis travel to the tooling position is NOT emitted here: ToolChangeMotionSyntax stamps it as a CompoundMotion at the syntax stage, and this semantic is ordered after CompoundMotionSemantic so the ActToolingStep lands at the tooling position. Reads ToolingTime for the change duration.

A string ToolId (Siemens T="name" call) is resolved to a tool number through FindToolNumberByName(string) — the act chain (ActToolingStep, tool-house lookup) is int-keyed. An unresolvable name emits a ToolChange--NameUnresolved warning and produces no act.

ToolingTeleportSemantic

Resolves the SectionName section into ActToolingTeleport: the tool is equipped without the machining-step operation (collision detection, volume removal) that ToolChangeSemantic's ActToolingStep runs at the chain's current pose. For pipelines whose source carries no machine tool-change position: in CSV (recorded telemetry) the tool jumps to its recorded position rather than running a modelled tool-changer cycle; in CLSF the cutter-location stream has no machine coordinates at all, and a step would stamp a cut at the not-yet-positioned device pose (identity = the workpiece program zero). Fires only when IsChangeKey is set (the block's tool id differs from the previous one), so a long run of same-tool blocks emits a single teleport.

Interfaces

INcSemantic

Resolves SyntaxPiece into IAct sequence. Unlike INcSyntax which only transforms data in-place, INcSemantic produces machine actions from the parsed syntax data.