Class IsoCoordinateOffsetSyntax
- Namespace
- Hi.NcParsers.LogicSyntaxs
- Assembly
- HiMech.dll
ISO/Fanuc/Mazak/Okuma/Syntec: resolves G54–G59.9 work coordinate offset. Reads G54/G55/.../G59.9 from Flags, looks up offset Vec3d via IIsoCoordinateConfig dependencies (e.g. brand parameter table or IsoCoordinateTable), composes into ProgramToMcTransform. Modal — active coordinate persists via backward lookback. Default coordinate ID is set by StaticInitializer.
public class IsoCoordinateOffsetSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
IsoCoordinateOffsetSyntax
- Implements
- Inherited Members
- Extension Methods
Examples
The Mat4d arrays below are written as 16 plain doubles in
column-major order; the first 12 are the identity 3×3 rotation, the
last 4 are the translation column (tx, ty, tz, 1). So a pure
translation by (tx, ty, tz) is
[1,0,0,0, 0,1,0,0, 0,0,1,0, tx,ty,tz,1].
G54 flag on the block but no IIsoCoordinateConfig on
the dep list — the resolved offset falls back to Vec3d.Zero
and the composed translation is the identity matrix:
{ "Parsing": { "Flags": ["G54"] } }
#AfterBuild:
{
"CoordinateOffset": {
"CoordinateId": "G54",
"Offset_X": 0, "Offset_Y": 0, "Offset_Z": 0
},
"ProgramToMcTransform": [
{
"Source": "CoordinateOffset",
"Kind": "Static",
"Mat4d": [1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1]
}
]
}
G55 flag with an IsoCoordinateTable
providing G55 → (100, 50, -200) — the offset is written to
the CoordinateOffset section and the same translation is
composed into the transform chain:
#BeforeBuild:
{ "Parsing": { "Flags": ["G55"] } }
#AfterBuild:
{
"CoordinateOffset": {
"CoordinateId": "G55",
"Offset_X": 100, "Offset_Y": 50, "Offset_Z": -200
},
"ProgramToMcTransform": [
{
"Source": "CoordinateOffset",
"Kind": "Static",
"Mat4d": [1,0,0,0, 0,1,0,0, 0,0,1,0, 100,50,-200,1]
}
]
}
No coordinate flag on the current block (e.g. an unrelated M03) but
#Previous: carried G54 — modal lookback inherits
G54, the dep is re-queried (so Offset_X/Y/Z are taken
from the table, not from the previous block), and the transform
chain is rebuilt. The unrelated M03 flag survives in
Parsing.Flags because CleanupParsing only fires on the
new-coord-flag branch:
#Previous:
{
"CoordinateOffset": {
"CoordinateId": "G54",
"Offset_X": 10, "Offset_Y": 20, "Offset_Z": -100
}
}
#BeforeBuild:
{ "Parsing": { "Flags": ["M03"] } }
#AfterBuild:
{
"Parsing": { "Flags": ["M03"] },
"CoordinateOffset": {
"CoordinateId": "G54",
"Offset_X": 10, "Offset_Y": 20, "Offset_Z": -100
},
"ProgramToMcTransform": [
{
"Source": "CoordinateOffset",
"Kind": "Static",
"Mat4d": [1,0,0,0, 0,1,0,0, 0,0,1,0, 10,20,-100,1]
}
]
}
Constructors
IsoCoordinateOffsetSyntax()
Initializes a new instance with default settings.
public IsoCoordinateOffsetSyntax()
IsoCoordinateOffsetSyntax(XElement)
Initializes a new instance by deserializing from the given XML element.
public IsoCoordinateOffsetSyntax(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