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 checking whether rotary axis values (A/B/C) are present in MachineCoordinateState:
- XYZ only → ActMcXyzLinearContour
- XYZABC → ActMcXyzabcLinearContour with Fanuc
composite feedrate:
d = √(ΔX² + ΔY² + ΔZ² + ΔA_deg² + ΔB_deg² + ΔC_deg²)
- 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 HardNcNcProc.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 HardNcGetActMcContourByLinearProgramPos.
- 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
Rapid polar events (G00 while G12.1 is active — disallowed by Fanuc and warned at parse time) resolve to no act, matching HardNc.NcProc.GetActMcPolarLinearContour. Duration is the polar-plane path length over the feedrate; the HardNc C-axis speed-limit clamp (MaxRotarySpeedABC) is intentionally not mirrored — SoftNc has no equivalent limit configuration yet.
- 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 M06 is present) or ActToolingTeleport (T-code only, no M06). Reads ToolingTime for the change duration.
A string
ToolId(SiemensT="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 aToolChange--NameUnresolvedwarning and produces no act.
Interfaces
- INcSemantic
Resolves SyntaxPiece into IAct sequence. Unlike INcSyntax which only transforms data in-place, INcSemantic produces machine actions from the parsed syntax data.