Class ProgramXyzSnapshotSyntax
- Namespace
- Hi.NcParsers.PostSyntaxs
- Assembly
- HiMech.dll
Debug / observability snapshot: writes ProgramXyz onto blocks that did not have it written by upstream logic syntaxes (e.g. HomeMcInitializer block, chain-change blocks that only updated MC via a rotary-only path), only when the effective program position has changed from the last block that stored a ProgramXyz.
Skips the block entirely when either of these holds:
- The block already has ProgramXyz written — e.g. by ProgramXyzSyntax, G53p1RotaryPositionSyntax, MachineCoordSelectSyntax, ReferenceReturnSyntax, McAbcXyzFallbackSyntax, or RadiusCompensationSyntax.
- The effective value equals the last stored value (modal-only block such as pure F / S / M / plane-select — no program motion).
Only snapshots the root block; ItemsKey
items are intentionally skipped (they are managed by
Hi.NcParsers.LogicSyntaxs.CompoundMotionSyntaxUtil and per-cycle
syntaxes that already write the right per-item ProgramXyz).
Placement: end of NcSyntaxList, after
UnconsumedCheckSyntax. Runs purely as a
bookkeeping pass — no other syntax / semantic in the default pipeline
reads the additional snapshots it emits, so the runtime output
(IAct stream) is unchanged whether
this syntax is present or not. The only observable effect is
additional ProgramXyz entries in the cached
syntax-pieces dump, which makes block-to-block debugging
and diffing easier.
public class ProgramXyzSnapshotSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
ProgramXyzSnapshotSyntax
- Implements
- Inherited Members
- Extension Methods
Constructors
ProgramXyzSnapshotSyntax()
public ProgramXyzSnapshotSyntax()
Fields
AddedByValue
Value written under AddedByKey on the ProgramXyz JSON object when this syntax synthesized the value. Absent on sub-objects authored by LogicSyntaxs-stage writers (e.g. ProgramXyzSyntax, G53p1RotaryPositionSyntax, MachineCoordSelectSyntax) — the AddedByKey is only present when a PostSyntaxs-stage writer (this syntax, or CacheSyntax) injected the sub-object.
Purely informational — no downstream syntax / semantic reads this marker. Intended for cache-file diffing: its presence means "this block did not originally command program motion; the value is a modal snapshot to make debug dumps more complete".
public const string AddedByValue = "Snapshot"
Field Value
Properties
Name
Syntax kind name (typically the concrete type name).
public string Name { get; }
Property Value
XName
public static string XName { get; }
Property Value
Methods
Build(LazyLinkedListNode<SyntaxPiece>, List<INcDependency>, NcDiagnosticProgress)
Build syntax arrangement into the
syntaxPieceNode in-place.
public void Build(LazyLinkedListNode<SyntaxPiece> syntaxPieceNode, List<INcDependency> ncDependencyList, NcDiagnosticProgress ncDiagnosticProgress)
Parameters
syntaxPieceNodeLazyLinkedListNode<SyntaxPiece>ncDependencyListList<INcDependency>ncDiagnosticProgressNcDiagnosticProgress
MakeXmlSource(string, string, bool)
Creates an XML representation of the object. This method may also generate additional resources such as related files.
public XElement MakeXmlSource(string baseDirectory, string relFile, bool exhibitionOnly)
Parameters
baseDirectorystringThe base directory for resolving relative paths
relFilestringThe relative file path for the XML source
exhibitionOnlyboolif true, the extended file creation is suppressed.
Returns
- XElement
An XML element representing the object's state
Remarks
For the demand of easy moving source folder (especially project folder) without configuration file path corruption, the relative file path is applied.
The baseDirectory is typically the folder at the nearest configuration file folder.
Since the folder can be moving with the configuration file.