Class HeidenhainMirrorImageSyntax
- Namespace
- Hi.NcParsers.ParsingSyntaxs.Heidenhain
- Assembly
- HiMech.dll
Heidenhain DIN/ISO G28 = MIRROR IMAGE (the CYCL DEF 8 twin;
basic course 62192: G28 X flips the X sign about the current
datum, G28 X Y flips both, bare G28 resets) — the exact
opposite of the Fanuc reference-point return the shared
G28Syntax would read it as. Claims the
whole statement (code plus trailing axis words) ahead of the generic
kit and records each statement under
Parsing.MirrorImageKey for the Logic-stage
HeidenhainMirrorTransformSyntax,
which simulates the mirror as a
ProgramToMcTransform entry.
Axis words are the manual's bare letters; a glued numeric or
Q-variable follower (G28 X0 Y0 — the Fanuc idiom a mislabeled
.I file could carry — or G28 XQ1) is claimed too so the
value can never fall through to the root tag captures as a ghost
coordinate, and the statement is stamped ValuedKey so
the Logic stage keeps it recognized-but-not-simulated (mirroring on
the Fanuc-shaped form would wreck a mislabeled reference-return
file). A bare axis letter glued to another word (G28 CC…)
stops the claim run — the leftover surfaces through the residue
sentinels instead of being guessed at.
public class HeidenhainMirrorImageSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
HeidenhainMirrorImageSyntax
- Implements
- Inherited Members
- Extension Methods
Examples
Course 62192 single-axis form — statement claimed whole and recorded
for the Logic-stage transform writer:
#BeforeBuild.UnparsedText: G28 X
#AfterBuild:
{ "Parsing": { "MirrorImage": [ { "Axes": ["X"] } ] } }
Two-axis form:
#BeforeBuild.UnparsedText: G28 X Y
#AfterBuild:
{ "Parsing": { "MirrorImage": [ { "Axes": ["X", "Y"] } ] } }
Bare reset form — an empty axis list:
#BeforeBuild.UnparsedText: G28
#AfterBuild:
{ "Parsing": { "MirrorImage": [ { "Axes": [] } ] } }
Other words on the block survive the surgical claim:
#BeforeBuild.UnparsedText: G90 G28 X
#AfterBuild:
{
"UnparsedText": "G90",
"Parsing": { "MirrorImage": [ { "Axes": ["X"] } ] }
}
The Fanuc-shaped valued idiom — axis values are claimed with their
words so no ghost coordinate reaches the root tag captures, and the
statement carries the Valued stamp that keeps the Logic stage
from arming a mirror off it:
#BeforeBuild.UnparsedText: G91 G28 X0 Y0 Z0
#AfterBuild:
{
"UnparsedText": "G91",
"Parsing": {
"MirrorImage": [ { "Axes": ["X", "Y", "Z"], "Valued": true } ]
}
}
Digit follower keeps the gate shut (not a G28 word):
#BeforeBuild.UnparsedText: G284 X
#AfterBuild:
{ "UnparsedText": "G284 X" }
A glued Q-variable follower is claimed with its word — unclaimed it
would parse cleanly through the root tag captures (a silent ghost
coordinate, invisible even to the residue sentinels):
#BeforeBuild.UnparsedText: G91 G28 XQ1
#AfterBuild:
{
"UnparsedText": "G91",
"Parsing": { "MirrorImage": [ { "Axes": ["X"], "Valued": true } ] }
}
Multiple G28 statements on one block are each claimed and recorded in
source order (the Logic stage applies them sequentially — each
statement replaces the mirror set):
#BeforeBuild.UnparsedText: G28 X G28 Y
#AfterBuild:
{
"Parsing": {
"MirrorImage": [ { "Axes": ["X"] }, { "Axes": ["Y"] } ]
}
}
Constructors
HeidenhainMirrorImageSyntax()
Initializes a new instance with default settings.
public HeidenhainMirrorImageSyntax()
HeidenhainMirrorImageSyntax(XElement)
Initializes a new instance by deserializing from the given XML element.
public HeidenhainMirrorImageSyntax(XElement src)
Parameters
srcXElementSource XML element.
Fields
AxesKey
Per-statement key: the axis letters, in source order (empty = bare reset).
public const string AxesKey = "Axes"
Field Value
MirrorImageKey
Key of the statement list this syntax records under Parsing:
a JsonArray with one entry per claimed G28 statement,
in source order. Consumed by
HeidenhainMirrorTransformSyntax.
public const string MirrorImageKey = "MirrorImage"
Field Value
ValuedKey
Per-statement key: present (true) when any axis word carried a glued value — the Fanuc-shaped idiom the Logic stage must not arm a mirror off.
public const string ValuedKey = "Valued"
Field Value
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