Table of Contents

Class SiemensToolOffsetTable

Namespace
Hi.NcParsers.Dependencys.Siemens
Assembly
HiMech.dll

Per-case Siemens tool offset table — the first concrete ISiemensToolOffsetConfig ($TC_DP model): one SiemensToolEdgeOffset row per (tool number T, cutting edge D), each carrying the three length components + radius with their wear counterparts. Effective values are geometry + wear — Sinumerik wear ($TC_DP12..15) is additive; a worn-down tool carries a negative wear value. Unconfigured (T, D) pairs return 0 per the interface contract.

Also carries the ToolNames map ($TC_TP2 analog, case-insensitive) so Siemens string tool calls (T="D8R1") can resolve to the int-keyed act chain — consumed by ToolChangeSemantic.

Per-case editable data — reaches the pipeline through SiemensToolOffsetTableProxy on the host's PerCaseNcDependencyList, never as a concrete instance baked into the shared runner. Deliberately separate from SiemensMachineDataTable (MD-prefixed machine-fixed OEM data) — same split rationale as SiemensFrameTable.

public class SiemensToolOffsetTable : INcDependency, IMakeXmlSource, ISiemensToolOffsetConfig
Inheritance
SiemensToolOffsetTable
Implements
Inherited Members
Extension Methods

Constructors

SiemensToolOffsetTable()

Initializes an empty table.

public SiemensToolOffsetTable()

SiemensToolOffsetTable(XElement)

Initializes a new instance by deserializing from src.

public SiemensToolOffsetTable(XElement src)

Parameters

src XElement

XML element produced by MakeXmlSource(string, string, bool).

Properties

Edges

Offset rows keyed by (tool number T, cutting edge D).

public Dictionary<(int Tool, int Edge), SiemensToolEdgeOffset> Edges { get; set; }

Property Value

Dictionary<(int Tool, int Edge), SiemensToolEdgeOffset>

ToolNames

Tool name → tool number map ($TC_TP2 analog) used to resolve Siemens string tool calls (T=“name”). Case-insensitive.

public Dictionary<string, int> ToolNames { get; set; }

Property Value

Dictionary<string, int>

XName

XML element name for serialization.

public static string XName { get; }

Property Value

string

Methods

FindToolNumberByName(string)

Resolves a Siemens string tool name (T=“name”) to its tool number via ToolNames; null when unmapped.

public int? FindToolNumberByName(string toolName)

Parameters

toolName string

Returns

int?

GetToolHeightOffset_mm(int, int)

Gets the effective tool height offset in mm for a specific tool and cutting edge: $TC_DP3 (length 1, typically Z direction) plus its additive wear $TC_DP12 — Sinumerik wear values are added, a shortened tool carries negative wear. Returns 0 if the tool/edge is not configured.

public double GetToolHeightOffset_mm(int toolNumber, int edgeNumber)

Parameters

toolNumber int

Tool number (T).

edgeNumber int

Cutting edge number (D).

Returns

double

GetToolLengthOffset_mm(int, int, int)

Gets an additional length offset for the specified direction. directionIndex: 0 = L1 ($TC_DP3, Z), 1 = L2 ($TC_DP4, X), 2 = L3 ($TC_DP5, Y). Returns 0 if not configured.

public double GetToolLengthOffset_mm(int toolNumber, int edgeNumber, int directionIndex)

Parameters

toolNumber int
edgeNumber int
directionIndex int

Returns

double

GetToolRadiusOffset_mm(int, int)

Gets the effective tool radius offset in mm for a specific tool and cutting edge: $TC_DP6 (radius) plus its additive wear $TC_DP15. Returns 0 if the tool/edge is not configured.

public double GetToolRadiusOffset_mm(int toolNumber, int edgeNumber)

Parameters

toolNumber int

Tool number (T).

edgeNumber int

Cutting edge number (D).

Returns

double

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

baseDirectory string

The base directory for resolving relative paths

relFile string

The relative file path for the XML source

exhibitionOnly bool

if 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

factory XFactory