Class FanucPathSmoothingSyntax
- Namespace
- Hi.NcParsers.LogicSyntaxs
- Assembly
- HiMech.dll
Consumes Fanuc G05.1 (high-precision contour / AICC II / Nano Smoothing) and records the modal state in the PathSmoothing JSON section using the FanucPathSmoothing schema. Q1 enables, Q0 disables; the optional R{n} precision-level is preserved as Level. The simulation does not alter the tool path — this is a controller-internal interpolation black box; the captured state exists for bidirectional NC-text reconstruction.
Modal carry to subsequent blocks is handled by
ModalCarrySyntax, which already tracks the
PathSmoothing section key and deep-clones it forward.
Also consumes the bare G05 P{n} HPCC family (captured by
G05Syntax) into the block-local
FanucHpcc section — recognized, intentionally not
simulated (the SiemensStopreSyntax pattern).
Ignoring P10000/P0 is safe offline; an ignored high-speed cycle
machining call (P10001–P10999) means the simulation misses that
machining, surfaced as a Warning. See IFanucHpccDef for
the P function-selection semantics. The section is deliberately
separate from the modal PathSmoothing section and is not
modal-carried.
public class FanucPathSmoothingSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
FanucPathSmoothingSyntax
- Implements
- Inherited Members
- Extension Methods
Examples
First block of the stream (no #Previous:) — stamps the default
disabled section so downstream modal lookback always sees a concrete
PathSmoothing:
#BeforeBuild:
{ }
#AfterBuild:
{ "PathSmoothing": { "IsEnabled": false, "Term": "G05.1" } }
G05.1 Q1 with no R — enables, no Level emitted:
#Previous:
{ "PathSmoothing": { "IsEnabled": false, "Term": "G05.1" } }
#BeforeBuild:
{ "Parsing": { "G05.1": { "Q": 1 } } }
#AfterBuild:
{ "PathSmoothing": { "IsEnabled": true, "Term": "G05.1" } }
G05.1 Q1 R3 — enables and preserves the precision level: #Previous:
{ "PathSmoothing": { "IsEnabled": false, "Term": "G05.1" } }
#BeforeBuild:
{ "Parsing": { "G05.1": { "Q": 1, "R": 3 } } }
#AfterBuild:
{ "PathSmoothing": { "IsEnabled": true, "Term": "G05.1", "Level": 3 } }
G05.1 Q0 — disables; any prior Level is dropped (R only meaningful
when enabling):
#Previous:
{ "PathSmoothing": { "IsEnabled": true, "Term": "G05.1", "Level": 3 } }
#BeforeBuild:
{ "Parsing": { "G05.1": { "Q": 0 } } }
#AfterBuild:
{ "PathSmoothing": { "IsEnabled": false, "Term": "G05.1" } }
Bare G05 P10000 — enters HPCC; consumed into the block-local
FanucHpcc section, the modal PathSmoothing section is
not touched:
#Previous:
{ "PathSmoothing": { "IsEnabled": false, "Term": "G05.1" } }
#BeforeBuild:
{ "Parsing": { "G05": { "P": 10000 } } }
#AfterBuild:
{ "FanucHpcc": { "Term": "G05", "IsEnabled": true, "FunctionCode": 10000 } }
G05 P0 — cancels HPCC; consumed silently (cancelling a no-op warrants no message): #Previous:
{ "PathSmoothing": { "IsEnabled": false, "Term": "G05.1" } }
#BeforeBuild:
{ "Parsing": { "G05": { "P": 0 } } }
#AfterBuild:
{ "FanucHpcc": { "Term": "G05", "IsEnabled": false, "FunctionCode": 0 } }
G5 spelling alias — Term keeps the source spelling:
#Previous:
{ "PathSmoothing": { "IsEnabled": false, "Term": "G05.1" } }
#BeforeBuild:
{ "Parsing": { "G5": { "P": 10000 } } }
#AfterBuild:
{ "FanucHpcc": { "Term": "G5", "IsEnabled": true, "FunctionCode": 10000 } }
G05 P10000 on the very first block (no #Previous:) — the HPCC
consumption runs ahead of the first-block early return, which then
still stamps the default disabled PathSmoothing section:
#BeforeBuild:
{ "Parsing": { "G05": { "P": 10000 } } }
#AfterBuild:
{ "FanucHpcc": { "Term": "G05", "IsEnabled": true, "FunctionCode": 10000 }, "PathSmoothing": { "IsEnabled": false, "Term": "G05.1" } }
Constructors
FanucPathSmoothingSyntax()
Initializes a new instance with default settings.
public FanucPathSmoothingSyntax()
FanucPathSmoothingSyntax(XElement)
Initializes a new instance by deserializing from the given XML element.
public FanucPathSmoothingSyntax(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
and chains Reg(factory) on dependents. Idempotent.
public static void Reg(XFactory factory = null)
Parameters
factoryXFactory