Namespace Hi.NcParsers.PostLogicSyntaxs
Classes
- ModalCarrySyntax
Per-block modal-section carry. For each key in TrackedKeys, if the current block has no section for that key, deep-clone the same section from the immediately previous block (which is itself guaranteed to carry it because every block is processed by this syntax) and set AddedByKey = AddedByValue inside the cloned section. Lets every block stand alone with its full modal context, so downstream readers (cache-file dumps, semantics, UI jumping to a single block) do not need EnumerateBack() to resolve modal state.
A JSON section is a candidate for TrackedKeys when ALL four criteria hold:
- Writers concentrated — one or two syntaxes own the
section (e.g. LinearMotionSyntax /
CircularMotionSyntax own
MotionState; the call/return pair ownSubProgramCall-derived state). - Readers distributed — multiple downstream consumers each need the value, and none of them should walk back to find it. Single-reader sections do not benefit from blanket carry.
- Every block must see the section — cache-dump readers landing randomly, single-block UI views, and look-ahead syntaxes all require the section to be present on every block.
- Carry is unconditional — no frame-gating or other
per-block veto. Sections that need conditional carry (e.g.
FanucLocalVariableReadingSyntax's
frame-aware
Vars.Localdict-merge — carry only whenMacroFramematches) belong in the owning syntax's own carry logic, not here.
node.Previousread, or no carry at all if absence is meaningful — e.g.MacroFrameabsent = main frame).This replaces the earlier
CacheSyntaxdesign (which sampled everyPaceblocks). The legacyCacheSyntaxXName is still recognised on load for backward compatibility with previously-saved project files.- Writers concentrated — one or two syntaxes own the
section (e.g. LinearMotionSyntax /
CircularMotionSyntax own
- RadiusCompensationSyntax
Resolves cutter radius compensation (G41/G42/G40) by offsetting the tool path perpendicular to the programmed direction.
Must be placed after motion syntaxes (CircularMotionSyntax, LinearMotionSyntax) because it reads the Hi.Motion section. Must NOT be placed inside BundleSyntax because it requires look-forward (Next).
For simple cases (line-line, no transient), the syntax overwrites
MachineCoordinatewith the offset position. For arc blocks that need transient bridging segments, theMotionsection is replaced with a CompoundMotion containing sub-items.