Class FeedrateSyntax
- Namespace
- Hi.NcParsers.LogicSyntaxs
- Assembly
- HiMech.dll
Consumes F (feedrate) from Parsing and G94/G95 mode from Flags. Both are modal — persist across blocks via backward node lookback. Writes resolved state to a IFeedrateDef section.
public class FeedrateSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
FeedrateSyntax
- Implements
- Inherited Members
- Extension Methods
Examples
New F value with explicit G94 mode — both consumed, Unit
derived as mm/min (G94 default):
#BeforeBuild:
{ "Parsing": { "Flags": ["G94"], "F": 100 } }
#AfterBuild:
{ "Feedrate": { "FeedrateValue": 100, "Term": "G94", "Unit": "mm/min" } }
G95 mode flag only — feedrate value inherited from
#Previous:; unit recomputed (mm/rev) from the new term:
#Previous:
{ "Feedrate": { "FeedrateValue": 50, "Term": "G94", "Unit": "mm/min" } }
#BeforeBuild:
{ "Parsing": { "Flags": ["G95"] } }
#AfterBuild:
{ "Feedrate": { "FeedrateValue": 50, "Term": "G95", "Unit": "mm/rev" } }
F value only (no G94/G95 on this block) alongside an unrelated M03
flag — mode inherits from #Previous:; M03 stays in
Parsing.Flags because CleanupParsing is only invoked
on the mode-flag branch:
#Previous:
{ "Feedrate": { "FeedrateValue": 50, "Term": "G95", "Unit": "mm/rev" } }
#BeforeBuild:
{ "Parsing": { "Flags": ["M03"], "F": 200 } }
#AfterBuild:
{
"Parsing": { "Flags": ["M03"] },
"Feedrate": { "FeedrateValue": 200, "Term": "G95", "Unit": "mm/rev" }
}
Constructors
FeedrateSyntax()
Initializes a new instance with default settings.
public FeedrateSyntax()
FeedrateSyntax(XElement)
Initializes a new instance by deserializing from the given XML element.
public FeedrateSyntax(XElement src)
Parameters
srcXElementSource XML element.
Properties
Name
Syntax kind name (typically the concrete type name).
public string Name { get; }
Property Value
XName
XML element name used to register this syntax with XFactory.
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.
Reg(XFactory)
Registers this type's deserializer with the given XFactory
(or Default when factory is
null). Idempotent.
public static void Reg(XFactory factory = null)
Parameters
factoryXFactory