Class ModalCarrySyntax
- Namespace
- Hi.NcParsers.PostLogicSyntaxs
- Assembly
- HiMech.dll
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.
This replaces the earlier CacheSyntax design (which sampled
every Pace blocks). The legacy CacheSyntax XName is still
recognised on load for backward compatibility with previously-saved
project files.
public class ModalCarrySyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
ModalCarrySyntax
- Implements
- Inherited Members
- Extension Methods
Constructors
ModalCarrySyntax()
Creates an empty ModalCarrySyntax; populate TrackedKeys before use.
public ModalCarrySyntax()
ModalCarrySyntax(XElement)
Reconstructs a ModalCarrySyntax from a project XML element previously produced by MakeXmlSource(string, string, bool).
public ModalCarrySyntax(XElement src)
Parameters
srcXElementXML element carrying a
TrackedKeyschild with oneKeyper entry; null is treated as defaults.
Fields
AddedByValue
Value written under AddedByKey on each section this syntax deep-clones from the previous block. Mirrors AddedByValue's role for its own synthesis — both let cache-file readers distinguish post-Logic / Inspection stage injections from LogicSyntaxs-stage authored values (the latter have no AddedByKey).
public const string AddedByValue = "ModalCarry"
Field Value
Properties
Default
Default-configured ModalCarrySyntax with the standard
modal sections (TiltTransform, PathSmoothing,
IsoLocalCoordinateOffset, CannedCycle, MotionState,
MachineCoordinateState) tracked.
public static ModalCarrySyntax Default { get; }
Property Value
Name
Syntax kind name (typically the concrete type name).
public string Name { get; }
Property Value
TrackedKeys
Section keys to carry. Order-insensitive; duplicates ignored.
public List<string> TrackedKeys { get; set; }
Property Value
XName
XML element name for Regs registration.
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> node, List<INcDependency> ncDependencyList, NcDiagnosticProgress ncDiagnosticProgress)
Parameters
nodeLazyLinkedListNode<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.