Class SiemensCoordinateOffsetSyntax
- Namespace
- Hi.NcParsers.LogicSyntaxs.Siemens
- Assembly
- HiMech.dll
Siemens Sinumerik: resolves work coordinate offset from G54–G57 (ISO-compatible), G505–G599 (extended Siemens), and G500 (cancel — machine coordinate mode). Reads from Flags, looks up IsoCoordinateTable dependency, composes into ProgramToMcTransform.
public class SiemensCoordinateOffsetSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
SiemensCoordinateOffsetSyntax
- Implements
- Inherited Members
- Extension Methods
Examples
Unlike IsoCoordinateOffsetSyntax (Fanuc/ISO), this
Siemens variant does not consume the coordinate flag from
Parsing.Flags — the flag stays for downstream syntaxes /
reconstruction. 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].
G54 with an IsoCoordinateTable
providing G54 → (10, 20, -100) — same shape as
IsoCoordinateOffsetSyntax but the G54 flag
survives:
{ "Parsing": { "Flags": ["G54"] } }
#AfterBuild:
{
"Parsing": { "Flags": ["G54"] },
"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]
}
]
}
Siemens-extended G505 with a table entry for the same id —
proves the syntax recognises the extended series, not only the
ISO-compat G54–G57 subset:
#BeforeBuild:
{ "Parsing": { "Flags": ["G505"] } }
#AfterBuild:
{
"Parsing": { "Flags": ["G505"] },
"CoordinateOffset": {
"CoordinateId": "G505",
"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]
}
]
}
G500 cancel with no IIsoCoordinateConfig on
the dep list — falls back to Vec3d.Zero; the resolved
offset is zero and the composed translation is identity (matching
the special case inside
GetCoordinateOffset(string)
for G500):
#BeforeBuild:
{ "Parsing": { "Flags": ["G500"] } }
#AfterBuild:
{
"Parsing": { "Flags": ["G500"] },
"CoordinateOffset": {
"CoordinateId": "G500",
"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]
}
]
}
Constructors
SiemensCoordinateOffsetSyntax()
Initializes a new instance with default settings.
public SiemensCoordinateOffsetSyntax()
SiemensCoordinateOffsetSyntax(XElement)
Initializes a new instance by deserializing from the given XML element.
public SiemensCoordinateOffsetSyntax(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