Class SiemensNamedVariableReadingSyntax
- Namespace
- Hi.NcParsers.EvaluationSyntaxs.Siemens
- Assembly
- HiMech.dll
Obtains values for Sinumerik named program variables (GUD/LUD
identifiers such as _X_HOME, declared via DEF REAL or
assigned directly). Reads literal numeric assignments from
Parsing.Assignments.<ident>, dict-merges them with the
previous block's state, and writes the resulting per-block dictionary
into Vars.Named — the same carry-forward pattern as the Fanuc
VolatileVariableReadingSyntax.
Lifetime is bounded by MachiningSession: within one session the
dictionary carries forward block-by-block; session restart abandons the
SyntaxPiece JSON dataflow and starts fresh. This matches LUD scoping
well (program-local) and under-persists real GUD (globally retentive) —
acceptable until a GUD definition-file feature exists.
Only literal numeric RHS values are consumed
(_X_HOME = 155.5 ✓; _A = R1+5 ✗ — the evaluator resolves
those to literals earlier on the same block). String-valued RHS (quoted)
never reaches Assignments — the quote-guard syntaxes quarantine it in
the Parsing bundle.
public class SiemensNamedVariableReadingSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
SiemensNamedVariableReadingSyntax
- Implements
- Inherited Members
- Extension Methods
Examples
#BeforeBuild:
{
"Parsing": { "Assignments": { "_X_HOME": "155.5" } }
}
#AfterBuild:
{
"Vars": { "Named": { "_X_HOME": 155.5 } }
}
Constructors
SiemensNamedVariableReadingSyntax()
Default constructor.
public SiemensNamedVariableReadingSyntax()
SiemensNamedVariableReadingSyntax(XElement)
Loads from an XML element produced by MakeXmlSource(string, string, bool). No state to deserialise.
public SiemensNamedVariableReadingSyntax(XElement src)
Parameters
srcXElement
Properties
Name
Syntax kind name (typically the concrete type name).
public string Name { get; }
Property Value
XName
XML element name for Generators registration.
public static string XName { get; }
Property Value
Methods
Build(LazyLinkedListNode<SyntaxPiece>, List<INcDependency>, NcDiagnosticProgress)
Build syntax arrangement into the
syntaxPieceNode in-place.
public void Build(LazyLinkedListNode<SyntaxPiece> syntaxPieceNode, List<INcDependency> ncDependencyList, NcDiagnosticProgress ncDiagnosticProgress)
Parameters
syntaxPieceNodeLazyLinkedListNode<SyntaxPiece>ncDependencyListList<INcDependency>ncDiagnosticProgressNcDiagnosticProgress
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