Class SiemensFrameTable
- Namespace
- Hi.NcParsers.Dependencys.Siemens
- Assembly
- HiMech.dll
Sinumerik settable work coordinate frames ($P_UIFR[n]).
Models G54–G57 (ISO-compatible), G505–G599 (extended Siemens),
and G500 (cancel — always zero).
On real Sinumerik, $P_UIFR is a frame array containing translation, rotation, scale and mirror per entry. HiNC currently consumes only the translation component, so this table stores Vec3d per id. $P_UIFR is NOT in the machine data table — therefore this is a separate dependency from SiemensMachineDataTable (which holds MD-prefixed OEM machine data such as MD30300 axis type, MD34010 reference position, etc.).
public class SiemensFrameTable : IIsoCoordinateConfig, INcDependency, IMakeXmlSource
- Inheritance
-
SiemensFrameTable
- Implements
- Inherited Members
- Extension Methods
Constructors
SiemensFrameTable()
Initializes a new instance with G54-G57 and the Siemens extended G505-G599 series seeded as zero Vec3d entries in Frames.
public SiemensFrameTable()
SiemensFrameTable(XElement)
Initializes a new instance by deserializing from src.
public SiemensFrameTable(XElement src)
Parameters
srcXElementXML element produced by MakeXmlSource(string, string, bool).
Properties
AxisOffsets
Per-axis translation components beyond X/Y/Z, keyed by G-code id then
uppercase axis letter (e.g. [“G54”][“C”] = 12.5). Real
Sinumerik frames carry a translation per machine axis including
rotaries ($P_UIFR[1,C,TR]); X/Y/Z stay in Frames
so existing consumers (GetCoordinateOffset(string)) are
unaffected. Absent entries read as 0 — matching Sinumerik where every
allocated frame axis defaults to zero. Rotary components are
recorded/read through the $P_UIFR bridge; the transform chain does
not consume them yet (frame work owns that).
public Dictionary<string, Dictionary<string, double>> AxisOffsets { get; set; }
Property Value
CoordinateIds
Enumerates the G-code coordinate ids that this provider currently has data for.
public IEnumerable<string> CoordinateIds { get; }
Property Value
Frames
Settable frames keyed by G-code id. G500 is treated specially (always zero) and is not stored here.
public Dictionary<string, Vec3d> Frames { get; set; }
Property Value
XName
XML element name for serialization.
public static string XName { get; }
Property Value
Methods
GetAxisOffset(string, string)
Reads one axis translation component of a frame
($P_UIFR[n,axis,TR] read side). X/Y/Z route into
Frames; any other axis letter reads
AxisOffsets with 0 as the allocated-but-unset default.
G500 is always 0. Returns null only when
coordId is not an allocated frame — the caller's
lookup chain then falls through (vacant).
public double? GetAxisOffset(string coordId, string axis)
Parameters
Returns
GetCoordinateOffset(string)
Gets the offset for the given G-code coordinate id. Returns null when no offset is configured for that id by this provider (callers iterate the next provider, or fall back to Zero).
public Vec3d GetCoordinateOffset(string coordId)
Parameters
coordIdstring
Returns
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
SetAxisOffset(string, string, double)
Writes one axis translation component of a frame
($P_UIFR[n,axis,TR]=… write side). X/Y/Z replace the
component inside Frames (a fresh Vec3d is
installed — never in-place mutation, so aliased vectors stay
unaffected); other axis letters land in AxisOffsets.
G500 writes are ignored, mirroring
SetCoordinateOffset(string, Vec3d).
public void SetAxisOffset(string coordId, string axis, double value)
Parameters
coordIdstringFrame G-code id.
axisstringUppercase axis letter.
valuedoubleNew translation component value.
SetCoordinateOffset(string, Vec3d)
Sets the offset for the given G-code coordinate id.
public void SetCoordinateOffset(string coordId, Vec3d offset)