Class IsoCoordinateAddressMap
- Namespace
- Hi.NcParsers.Dependencys
- Assembly
- HiMech.dll
Fanuc-style ISO coordinate parameter address mapping. G54–G59 → #5221+ (stride 20, three consecutive numbers per entry for X/Y/Z), G54.1 P1–P48 → #7001+ (stride 20). Shared between FanucParameterTable (which calls these “ParamId”) and SyntecParameterTable (which calls them “PrId”) because both follow the same numeric scheme.
public static class IsoCoordinateAddressMap
- Inheritance
-
IsoCoordinateAddressMap
- Inherited Members
Fields
G54Base
#5221: base address of G54 (X). G54.Y=#5222, G54.Z=#5223.
public const int G54Base = 5221
Field Value
G54p1CoordinateIdPrefix
Coordinate-id prefix of the additional (G54.1 P) work coordinate
systems: the id is this prefix followed by the un-padded P index, e.g.
“G54.1P4” — the G-code spelling without its embedded space.
public const string G54p1CoordinateIdPrefix = "G54.1P"
Field Value
G54p1P1Base
#7001: base address of G54.1 P1 (X). G54.1 P1.Y=#7002, P1.Z=#7003.
public const int G54p1P1Base = 7001
Field Value
G54p1PCount
48: number of G54.1 P entries (P1..P48).
public const int G54p1PCount = 48
Field Value
G5xCount
6: number of G5x entries (G54..G59).
public const int G5xCount = 6
Field Value
Stride
20: address stride between successive coordinate entries.
public const int Stride = 20
Field Value
Methods
DescribeAddress(int)
Inverse of TryResolveBase(string) per single address: describes an address inside the mapped ranges as its work-coordinate component (“G54 X offset”, “G54.1P3 Z offset”), or null outside them (including the unused tail of each 20-address stride).
public static string DescribeAddress(int addr)
Parameters
addrintParameter address (e.g. 5222).
Returns
EnumerateCoordinateIds(IDictionary<int, double>)
Enumerates the coordinate ids (G54..G59, G54.1P1..G54.1P48) that have
at least one axis entry present in systemParams.
public static IEnumerable<string> EnumerateCoordinateIds(IDictionary<int, double> systemParams)
Parameters
systemParamsIDictionary<int, double>
Returns
G54p1CoordinateId(int)
Composes the coordinate id of additional work coordinate system
p (“G54.1P4” for P4). Inverse of
TryParseG54p1Index(string, out int).
public static string G54p1CoordinateId(int p)
Parameters
pintP index as written in the program (1-based).
Returns
Read(IDictionary<int, double>, int)
Reads X/Y/Z from systemParams at consecutive addresses
starting at baseAddr. Returns null when none of the
three addresses are present (i.e. the entry is unmanaged).
public static Vec3d Read(IDictionary<int, double> systemParams, int baseAddr)
Parameters
systemParamsIDictionary<int, double>baseAddrint
Returns
SeedAllDefaults(IDictionary<int, double>)
Seeds all G54–G59 and G54.1 P1–P48 entries with zero. Total 162 SystemParams entries (6×3 + 48×3). Used by brand parameter tables to satisfy the “managed parameter must have default” invariant — real Fanuc on a fresh-battery controller also reads 0 for these addresses, so the model matches hardware.
public static void SeedAllDefaults(IDictionary<int, double> systemParams)
Parameters
systemParamsIDictionary<int, double>
TryParseG54p1Index(string, out int)
Reads the P index back out of an additional work coordinate id
(“G54.1P4” → 4). Any integer is accepted — range checking
against the table (1..G54p1PCount) is
TryResolveBase(string)'s job — so a caller can tell “an
additional system whose index the table does not hold” apart from
“not an additional system at all”.
public static bool TryParseG54p1Index(string coordId, out int p)
Parameters
Returns
TryResolveBase(string)
Resolves a coordinate id to its 3-axis base address (X address; Y at +1, Z at +2), or null if the id is outside the Fanuc-mapped set (G54–G59, G54.1P1–G54.1P48).
public static int? TryResolveBase(string coordId)
Parameters
coordIdstring
Returns
- int?
Write(IDictionary<int, double>, int, Vec3d)
Writes X/Y/Z to systemParams at consecutive addresses
starting at baseAddr.
public static void Write(IDictionary<int, double> systemParams, int baseAddr, Vec3d offset)
Parameters
systemParamsIDictionary<int, double>baseAddrintoffsetVec3d