Class VolatileVariableLookup
- Namespace
- Hi.NcParsers.EvaluationSyntaxs.Evaluation
- Assembly
- HiMech.dll
Reads Fanuc-style non-retained common variables (#100-#499)
from Vars.Volatile. Self-gates the id range so the evaluator's
RuntimeVariableLookups chain can
fall through to the next lookup for out-of-range keys.
Single-step lookup: VolatileVariableReadingSyntax already
dict-merges every block's Vars.Volatile into the next block, so
the entry — if it exists — must be on the current block (when this
lookup runs after the reader) or on the immediately previous block
(when this lookup runs before the reader on the same block, which is
the Fanuc preset's order — evaluator first, reader second). No
arbitrary walk-back: such a walk would be defensive overkill given
the reader's carry guarantee.
Stateless and dependency-free — instances are interchangeable. Reads stay decoupled from the reader (read side here; write side in the reader).
public class VolatileVariableLookup : IRuntimeVariableLookup, IMakeXmlSource
- Inheritance
-
VolatileVariableLookup
- Implements
- Inherited Members
- Extension Methods
Constructors
VolatileVariableLookup()
Default constructor.
public VolatileVariableLookup()
VolatileVariableLookup(XElement)
Loads from an XML element produced by MakeXmlSource(string, string, bool). Stateless — no fields to deserialise.
public VolatileVariableLookup(XElement src)
Parameters
srcXElement
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
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