Table of Contents

Class CodeXyzabcChain

Namespace
Hi.Numerical.Xyzabc
Assembly
HiMech.dll

A GeneralXyzabcChain authored through chain code — a bracket notation for the connectivity of the mechanism's branches. On purpose of easy XML hand management.

The entity is the inherited GeneralMechanism; ChainCodes is a delegated representation: reading derives the codes from the mechanism's topology, assigning reseeds the mechanism (transformers and solids of same-named components carry over).

Notation: each segment declares branches left to right — [O][Y];[Y][X];[X][w] pairs, or the concatenated sugar [O][Y][X][w]. Words merge by name across segments; [] is an anonymous component (each occurrence is a fresh one). Reserved words: X,Y,Z translational axes, A,B,C rotational axes, w table buckle, t tool buckle; any other word is a plain component. Reserved words are matched exactly as written, so a word differing only in letter case is a plain component.

public class CodeXyzabcChain : GeneralXyzabcChain, IXyzabcChain, IGetXyzabcChain, IMachiningChain, IGetAsmb, IGetAnchor, IGetTopoIndex, IGetAnchorToSolidDictionary, IGetAnchoredDisplayeeList, IExpandToBox3d, IMakeXmlSource
Inheritance
CodeXyzabcChain
Implements
Inherited Members
Extension Methods

Constructors

CodeXyzabcChain(string)

Initializes a new instance seeded from the given chain code.

public CodeXyzabcChain(string chainCode = "[O][Z][C][w];[O][Y][X][B][S][t]")

Parameters

chainCode string

Semicolon-separated branch segments; see the class summary for the notation.

CodeXyzabcChain(string, bool)

Legacy overload keeping the retired vertical/horizontal flag working.

[Obsolete("IsVertical is a legacy orientation shim. Author the ground rotation in the GeneralMechanism instead.")]
public CodeXyzabcChain(string chainCode, bool isVertical)

Parameters

chainCode string

Semicolon-separated branch segments.

isVertical bool

Legacy orientation flag; false lays the machine down via a hidden root rotation.

CodeXyzabcChain(XElement, string, string, IProgress<IMessage>)

Initializes a new instance of the CodeXyzabcChain class from XML.

public CodeXyzabcChain(XElement src, string baseDirectory, string relFile, IProgress<IMessage> progress)

Parameters

src XElement

The XML source element.

baseDirectory string

The base directory for resolving relative paths.

relFile string

The relative file path.

progress IProgress<IMessage>

The progress reporter.

Fields

DefaultChainCode

The classic 5-axis table-tilting layout used when no chain code is given.

public const string DefaultChainCode = "[O][Z][C][w];[O][Y][X][B][S][t]"

Field Value

string

Properties

AnchorToSolid

Gets or sets the dictionary mapping anchors to solids for display purposes — the mechanism's dictionary. Assigning copies the entries into it (the mechanism stays the owner).

The compact wire format keys solids by component name, so a solid attached to an anonymous [] component is not persisted — name the component if its solid must survive a save.

public Dictionary<Anchor, Solid> AnchorToSolid { get; set; }

Property Value

Dictionary<Anchor, Solid>

ChainBegin

Gets the chain begin anchor (the table buckle).

public Anchor ChainBegin { get; }

Property Value

Anchor

ChainCode

The semicolon-joined form of ChainCodes.

public string ChainCode { get; }

Property Value

string

ChainCodes

The chain code segments — a delegated representation of the mechanism's connectivity. Reading derives them (table-buckle segment first, then the tool-buckle one, then any others); assigning reseeds the mechanism, carrying over the transformers and solids of same-named components.

public IReadOnlyList<string> ChainCodes { get; set; }

Property Value

IReadOnlyList<string>

ChainEnd

Gets the chain end anchor (the tool buckle).

public Anchor ChainEnd { get; }

Property Value

Anchor

CodeToAnc

Gets the dictionary mapping component words to anchors — derived from the mechanism; the legacy horizontal shim's hidden root is excluded.

public Dictionary<string, Anchor> CodeToAnc { get; }

Property Value

Dictionary<string, Anchor>

ComponentCodes_O2T

Gets the list of component words from the code view root to the tool buckle.

public List<string> ComponentCodes_O2T { get; }

Property Value

List<string>

ComponentCodes_O2W

Gets the list of component words from the code view root to the table buckle.

public List<string> ComponentCodes_O2W { get; }

Property Value

List<string>

RootAnchor

Gets the root anchor of the XYZABC chain.

public Anchor RootAnchor { get; }

Property Value

Anchor

XName

Gets the XML element name for serialization.

public static string XName { get; }

Property Value

string

Methods

MakeXmlSource(string, string, bool)

Creates an XML representation of the object. This method may also generate additional resources such as related files.

public override 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 and chains Reg(factory) on dependents. Idempotent.

public static void Reg(XFactory factory = null)

Parameters

factory XFactory