Class HeidenhainDatumTable
- Namespace
- Hi.NcParsers.Dependencys
- Assembly
- HiMech.dll
Heidenhain datum preset and datum shift tables. CYCL DEF 247 Q339=N reads from DatumPresetTable, CYCL DEF 7 #N reads from DatumShiftTable. Each table maps an integer ID (1–20) to a Vec3d offset.
On real Heidenhain controllers, preset and datum tables are separate
disk files (e.g. TNC:\table\preset.pr, *.d) — distinct
from MP-prefixed Machine Parameters (held by
HeidenhainParameterTable). HiNC mirrors that separation
by keeping this dependency independent of HeidenhainParameterTable.
Implements IIsoCoordinateConfig by mapping the ISO/DIN G54–G59 codes to preset rows 1–6, the conventional Heidenhain compatibility mapping for ISO/DIN programs running on a Heidenhain.
public class HeidenhainDatumTable : IIsoCoordinateConfig, INcDependency, IMakeXmlSource
- Inheritance
-
HeidenhainDatumTable
- Implements
- Inherited Members
- Extension Methods
Constructors
HeidenhainDatumTable()
Initializes a new instance with rows 1-20 of DatumPresetTable and DatumShiftTable seeded to zero.
public HeidenhainDatumTable()
HeidenhainDatumTable(XElement)
Initializes a new instance by deserializing from src.
public HeidenhainDatumTable(XElement src)
Parameters
srcXElementXML element produced by MakeXmlSource(string, string, bool).
Properties
CoordinateIds
Enumerates the G-code coordinate ids that this provider currently has data for.
public IEnumerable<string> CoordinateIds { get; }
Property Value
DatumPresetTable
Preset rows (CYCL DEF 247 Q339=N) keyed by preset id (1-20). Rows 1-6 are aliased to ISO G54-G59 via IIsoCoordinateConfig.
public Dictionary<int, Vec3d> DatumPresetTable { get; set; }
Property Value
DatumShiftTable
Datum shift rows (CYCL DEF 7 #N) keyed by table id (1-20).
public Dictionary<int, Vec3d> DatumShiftTable { get; set; }
Property Value
XName
XML element name used to register this dependency with XFactory.
public static string XName { get; }
Property Value
Methods
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
GetDatumPreset(int)
Returns the preset offset for q339, or Zero if absent. See DatumPresetTable.
public Vec3d GetDatumPreset(int q339)
Parameters
q339intPreset id (CYCL DEF 247 Q339).
Returns
GetDatumShift(int)
Returns the datum shift offset for tableId, or Zero if absent. See DatumShiftTable.
public Vec3d GetDatumShift(int tableId)
Parameters
tableIdintDatum shift row id (CYCL DEF 7 #N).
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
SetCoordinateOffset(string, Vec3d)
Sets the offset for the given G-code coordinate id.
public void SetCoordinateOffset(string coordId, Vec3d offset)
Parameters
SetDatumPreset(int, Vec3d)
Sets the preset offset for q339. See DatumPresetTable.
public void SetDatumPreset(int q339, Vec3d offset)
Parameters
SetDatumShift(int, Vec3d)
Sets the datum shift offset for tableId. See DatumShiftTable.
public void SetDatumShift(int tableId, Vec3d offset)