Class FanucToolOffsetVariableLookup
- Namespace
- Hi.NcParsers.Dependencys.Fanuc
- Assembly
- HiMech.dll
Fanuc-side adapter that exposes a wrapped ToolOffsetTable
(resolved at call time from the dependency list) as an
IRuntimeVariableLookup following Fanuc Memory C tool
offset addressing: #2001+N → effective height of offset N
(geometry − wear).
The underlying ToolOffsetTable stays brand-neutral —
Heidenhain / Siemens can use the same storage with different addressing
by registering their own adapter alongside the table. Stateless: holds
no reference of its own and resolves the table from the per-call
dependencies list, so XML round-trip is trivial (an empty element).
Registered on a brand preset's
RuntimeVariableLookups, not on
NcDependencyList — the wrapper owns no
long-lived data, only the Fanuc-style id addressing scheme. The
underlying ToolOffsetTable still lives in
NcDependencyList as the data dependency.
public sealed class FanucToolOffsetVariableLookup : IRuntimeVariableLookup, IMakeXmlSource
- Inheritance
-
FanucToolOffsetVariableLookup
- Implements
- Inherited Members
- Extension Methods
Constructors
FanucToolOffsetVariableLookup()
Default constructor.
public FanucToolOffsetVariableLookup()
FanucToolOffsetVariableLookup(XElement)
Loads from an XML element produced by MakeXmlSource(string, string, bool). Stateless — no fields to deserialise.
public FanucToolOffsetVariableLookup(XElement src)
Parameters
srcXElement
Fields
ToolHeightMax
Inclusive upper bound of the Fanuc tool height address range (#2200).
public const int ToolHeightMax = 2200
Field Value
ToolHeightMin
Inclusive lower bound of the Fanuc tool height address range (#2001).
public const int ToolHeightMin = 2001
Field Value
Properties
XName
XML element name for Generators registration.
public static string XName { get; }
Property Value
Methods
Get(string, LazyLinkedListNode<SyntaxPiece>, IReadOnlyList<INcDependency>)
Returns the value of the variable identified by key
in the context of node and
dependencies, or null if the key is outside
this lookup's range or the value is vacant.
public double? Get(string key, LazyLinkedListNode<SyntaxPiece> node, IReadOnlyList<INcDependency> dependencies)
Parameters
keystringnodeLazyLinkedListNode<SyntaxPiece>dependenciesIReadOnlyList<INcDependency>
Returns
Remarks
Routes #2001-#2200 to
GetToolHeightOffset_mm(int) on the
ToolOffsetTable found in dependencies;
other keys return null so the evaluator's lookup chain falls
through.
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