Class IsoLocalCoordinateOffsetSyntax
- Namespace
- Hi.NcParsers.LogicSyntaxs
- Assembly
- HiMech.dll
ISO G52: Local coordinate system offset (additive to G54-series).
G52 X10 Y20 Z5 → sets local offset.
G52 X0 Y0 Z0 → cancels (resets to zero).
M30 (program end) → also cancels.
Parsing.G52 (from G52Syntax),
writes IsoLocalCoordinateOffset section,
and adds an "IsoLocalCoordinateOffset" entry to the transformation chain.
Modal — persists via backward lookback until changed or cancelled.
public class IsoLocalCoordinateOffsetSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
IsoLocalCoordinateOffsetSyntax
- Implements
- Inherited Members
- Extension Methods
Examples
Mat4d arrays are 16 plain doubles in column-major order; pure
translation by (tx,ty,tz) is
[1,0,0,0, 0,1,0,0, 0,0,1,0, tx,ty,tz,1] — see
IsoCoordinateOffsetSyntax for the column-major template.
First block of the stream (no #Previous:) — the syntax
stamps a zero-offset section and an identity translation in the
chain so downstream lookback always sees a concrete state:
{ }
#AfterBuild:
{
"IsoLocalCoordinateOffset": { "Offset_X": 0, "Offset_Y": 0, "Offset_Z": 0 },
"ProgramToMcTransform": [
{
"Source": "IsoLocalCoordinateOffset",
"Kind": "Static",
"Mat4d": [1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1]
}
]
}
G52 X10 Y20 Z5 on a non-first block alongside an unrelated
M03 flag — the G52 sub-section is consumed (removed from
Parsing) and the translation is composed into the chain; the
unrelated flag stays because this syntax does not call
CleanupParsing:
#Previous:
{ "IsoLocalCoordinateOffset": { "Offset_X": 0, "Offset_Y": 0, "Offset_Z": 0 } }
#BeforeBuild:
{
"Parsing": {
"Flags": ["M03"],
"G52": { "X": 10, "Y": 20, "Z": 5 }
}
}
#AfterBuild:
{
"Parsing": { "Flags": ["M03"] },
"IsoLocalCoordinateOffset": { "Offset_X": 10, "Offset_Y": 20, "Offset_Z": 5 },
"ProgramToMcTransform": [
{
"Source": "IsoLocalCoordinateOffset",
"Kind": "Static",
"Mat4d": [1,0,0,0, 0,1,0,0, 0,0,1,0, 10,20,5,1]
}
]
}
No G52 on the current block but #Previous: had a non-zero
offset — modal lookback inherits it (with the translation
re-composed into this block's chain):
#Previous:
{ "IsoLocalCoordinateOffset": { "Offset_X": 10, "Offset_Y": 20, "Offset_Z": 5 } }
#BeforeBuild:
{ "Parsing": { "Flags": ["M03"] } }
#AfterBuild:
{
"Parsing": { "Flags": ["M03"] },
"IsoLocalCoordinateOffset": { "Offset_X": 10, "Offset_Y": 20, "Offset_Z": 5 },
"ProgramToMcTransform": [
{
"Source": "IsoLocalCoordinateOffset",
"Kind": "Static",
"Mat4d": [1,0,0,0, 0,1,0,0, 0,0,1,0, 10,20,5,1]
}
]
}
Constructors
IsoLocalCoordinateOffsetSyntax()
Initializes a new instance with default settings.
public IsoLocalCoordinateOffsetSyntax()
IsoLocalCoordinateOffsetSyntax(XElement)
Initializes a new instance by deserializing from the given XML element.
public IsoLocalCoordinateOffsetSyntax(XElement src)
Parameters
srcXElementSource XML element.
Fields
TransformSource
Identifier used as the transform source key when composing the local coordinate offset translation into the transform chain.
public const string TransformSource = "IsoLocalCoordinateOffset"
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