Class IsoCoordinateTable
- Namespace
- Hi.NcParsers.Dependencys.Generic
- Assembly
- HiMech.dll
Coordinate table for NC controller. The dictionary key is a G-code coordinate name (e.g. “G54”, “G59.2”); the dictionary value is machine coordinate offset.
Brand-agnostic standalone implementation of IIsoCoordinateConfig. Brand parameter tables (Fanuc, Syntec, Siemens, Heidenhain) provide hardware-faithful alternatives that map to real controller parameters.
public class IsoCoordinateTable : Dictionary<string, Vec3d>, IDictionary<string, Vec3d>, ICollection<KeyValuePair<string, Vec3d>>, IReadOnlyDictionary<string, Vec3d>, IReadOnlyCollection<KeyValuePair<string, Vec3d>>, IEnumerable<KeyValuePair<string, Vec3d>>, IDictionary, ICollection, IEnumerable, IDeserializationCallback, ISerializable, IIsoCoordinateConfig, INcDependency, IMakeXmlSource
- Inheritance
-
IsoCoordinateTable
- Implements
- Inherited Members
- Extension Methods
Constructors
IsoCoordinateTable()
Ctor.
public IsoCoordinateTable()
IsoCoordinateTable(XElement)
Initializes a new instance of the IsoCoordinateTable class from XML. Supports both new string ID format (“G54”) and legacy integer format (54000).
public IsoCoordinateTable(XElement src)
Parameters
srcXElementThe XML element containing coordinate data.
Fields
XName
Gets the XML element name for the IsoCoordinateTable.
public static string XName
Field Value
Properties
CoordinateIds
Enumerates the G-code coordinate ids that this provider currently has data for.
public IEnumerable<string> CoordinateIds { 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
LegacyIntToKey(int)
Converts a legacy 1000x integer ID to a G-code string key. e.g. 54000 -> “G54”, 59200 -> “G59.2”.
public static string LegacyIntToKey(int id)
Parameters
idint
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)