Namespace Hi.NcParsers.LogicSyntaxs.Heidenhain
Classes
- HeidenhainCircleCenterSyntax
Heidenhain-specific: turns the
Parsing.CCrecord into the modalHeidenhainCircleCenter { X, Y, Z? }section (absolute program coordinates). Self-carrying every block (PlaneSelect pattern — detected ?? previous), so the arc syntax's single-step read always works without ModalCarry involvement; a CC with partial axes merges the missing components from the previous center. Must run before HeidenhainCircularMotionSyntax.
- HeidenhainCircularMotionSyntax
Heidenhain circular motion — replaces the shared CircularMotionSyntax in the Heidenhain list (never run both). Gated by the
Parsing.Cstatement marker (klartext arcs carry no G02/G03 and no modal arc continuation): the endpoint comes from the block's resolvedProgramXyz, the center from the modal HeidenhainCircleCenterSyntax section (implicit center = current position when no CC was ever given), and the direction fromDR-(CW → G02) /DR+(CCW → G03). A closed arc on the active plane is a full circle. A missing DR warns (Arc-DR–Missing) and degrades to the modal linear move to the endpoint (chord).
- HeidenhainCoordinateOffsetSyntax
Heidenhain-specific: resolves coordinate offset from CYCL DEF 247 (Datum Preset) and CYCL DEF 7 (Datum Shift).
CYCL DEF 247 Q339=N: selects datum preset table entry N — written to the shared CoordinateOffset section (kept alive modally by IsoCoordinateOffsetSyntax via HeidenhainDatumTable synthetic-id resolution).
CYCL DEF 7 (
For DIN/ISO compatibility (G54–G59), use IsoCoordinateOffsetSyntax in addition to this syntax in the Heidenhain syntax list. Uses replace-by-source so both syntaxes coexist without double-composing.#Ntable row or direct X/Y/Z) is additive on top of the active preset (TNC semantics; HardNc oracle composes-preset + shift): it is written to its ownDatumShiftsection with a separateProgramToMcTransformentry (DatumShiftTransformSource) so preset and shift compose in the transform chain instead of replacing each other. The shift is carried modally by this syntax itself: on blocks without a CYCL DEF, a numbered row re-resolves from the table and a direct shift carries its values forward. Cancelling is a zero shift (CYCL DEF 7.1 X+0 Y+0 Z+0).
- HeidenhainMFunctionSyntax
Heidenhain-specific M-function semantics for the near-universal corpus family:
M126/M127— shortest-path rotary traverse on/off. Writes the modalRotaryWrap { Shortest }section consumed by McAbcCyclicPathSyntax (absent = shortest, the shared default); the Heidenhain preset's Logic ModalCarry tracks the section.M128/M129— RTCP on/off. P1 consume-level: the capturedParsing.M128record (with its feed-limit F) and the M129 flag are consumed into anRtcp { IsActive, Term }record; activation warnsRtcp--NotSimulateduntil the P3 pivot transform lands. M129 (the off state — matching the simulation) is silent.M140 MB— tool-axis retract. Executes a machine-coordinate move along +Z (the P1 tool axis; the P3 tilt work generalizes it):MB+nretracts by n mm,MB MAXretracts to the positive Z stroke limit (IStrokeLimitConfig; unresolvable limit warnsM140--NoStrokeLimitand skips). The retract runs at the modal feed (the statement's F is recorded on the MotionEvent asRetractFeedrate, not folded into the modal feedrate).
- HeidenhainMotionModeSyntax
Heidenhain-specific: maps the klartext
Lstatement marker (written by HeidenhainLSyntax) onto the shared ISO motion-mode vocabulary. AnLblock carrying the one-shotFMAXflag becomes a rapid (G00) block; every otherLblock is a feed move (G01) driven by the modal feedrate. The injected G00/G01 flag is consumed downstream exactly like a DIN/ISO block — by LinearMotionSyntax on ordinary moves and by MachineCoordSelectSyntax on machine-coordinate (M91) moves — so no shared syntax needs Heidenhain-specific behavior.FMAX is one-shot on the real TNC: because every klartext motion is an
Lstatement and this syntax stamps a mode per statement, the rapid mode never leaks into the next block — the followingLwithout FMAX is stamped G01 again.FAUTO(feed from cycle) is consumed as a feed move. Must be placed at the top of the Logic bundle, before MachineCoordSelectSyntax and LinearMotionSyntax.
- HeidenhainPathSmoothingSyntax
Heidenhain-specific: consumes the structured CYCL DEF 32 TOLERANCE record (HeidenhainToleranceCyclSyntax) into the shared modal
PathSmoothingsection (tracked by the Logic ModalCarry): a positive tolerance arms smoothing ({IsEnabled:true, Term:“CYCL DEF 32”, Tolerance, HscMode?, Ta?}); a bare or zero-tolerance cycle cancels it. Untouched blocks are left to ModalCarry; the stream's first block seeds a conservative{IsEnabled:false}(Siemens sibling shape). Replaces the deadFanucPathSmoothingSyntaxin the Heidenhain list (it readParsing[“G05.1”], which no Heidenhain capture produces).
- HeidenhainProgramHeaderSyntax
Heidenhain-specific: consumes the
Parsing.PGMrecord (BEGIN|END PGM name MM|INCH) — the unit word is pushed intoParsing.Flagsfor the UnitModeSyntax instance configured withInchCodes=[“INCH”], MetricCodes=[“MM”](which must run after this syntax), andEND PGMwrites the shared one-shotProgramEndsection (existence-checked by its consumers exactly like M30). Consuming PGM also removes the program-header unconsumed noise every klartext file used to emit.
- HeidenhainRadiusCompSyntax
Heidenhain-specific: maps the klartext radius-compensation words captured by HeidenhainLSyntax (
RL/RR/R0boolean Parsing-root records) onto the shared vocabulary consumed by the radius-compensation pass:RL → Parsing.G41 {D: toolId},RR → G42,R0 → G40flag. The offset id is the current tool number (klartext has no D word;IToolOffsetConfigdocuments the offset id as the Heidenhain tool number), resolved by walking back to the most recentToolChangesection. A missing or non-numeric tool id degrades to mode-only injection (radius 0 — the compensation pass records the state but applies no geometric offset) with anRadiusComp–ToolUnresolvedwarning.Must run before the PostLogic radius-compensation pass (any Logic position works — PostLogic sees completed Logic output) and after HeidenhainToolChangeSyntax so a same-block TOOL CALL is visible.
- HeidenhainToolChangeSyntax
Heidenhain-specific: consumes the
Parsing[“TOOL CALL”]record (written by HeidenhainToolCallSyntax) into the shared SectionName section so ToolChangeSemantic fires the tooling act. A klartextTOOL CALLalways performs the change — no separate M06 trigger exists — so IsChangeKey is alwaystruewithTerm = “TOOL CALL”.The spindle-speed word (
S) is relocated to the root of Parsing so the shared SpindleSpeedSyntax — which must run after this syntax in the Logic bundle — records it modally. Numeric tool ids are written as ints (the act chain is int-keyed); non-numeric ids stay strings and resolve (or warn) at the semantic layer.P0 limits recorded as diagnostics: non-Z tool axis (
ToolChange--AxisUnsupported), non-zero DL/DR deltas (ToolChange--DeltaUnsupported; zero deltas are consumed silently), and a TOOL CALL without a tool id (ToolChange--MissingToolId, e.g. a variable tool number the parser could not capture).Known P2 limitation: a quoted tool NAME that happens to spell a Q token (
TOOL CALL "Q1" Z) loses its quotes at capture, so the evaluator substitutes the Q parameter's value and the numeric branch below treats it as a tool number. Corpus-zero (real names are"B40R"-style); fixing it needs the capture to preserve the quoted-ness, which would change the P0-pinned record shape.
- HeidenhainToolOffsetSyntax
Heidenhain-specific: klartext TOOL CALL always applies tool-length compensation (there is no cancel word — HardNc compensates unconditionally). On TOOL CALL blocks the effective height = GetToolHeightOffset_mm(int)(tool id) + the TOOL CALL's DL delta; the shared
ToolHeightCompensationsection is written (Term =“TOOL CALL”, OffsetId = tool id — the offset id is documented as the Heidenhain tool number) and the translation composes into the transform chain via the sharedToolHeightCompensationsource (mutual exclusion with the ISO G43 sibling by same-source replace).Modal: on following blocks the section is re-resolved per block from the table (mirroring the Siemens D sibling — give-way when a same block ISO term took ownership; carry Term/OffsetId/Delta_mm otherwise). Must sit after ToolHeightOffsetSyntax (the ISO anchor — last writer wins on mixed-dialect blocks) and after HeidenhainToolChangeSyntax (reads its ToolChange section), before the pivot/tilt syntaxes.