Class MachineAxisConfig
- Namespace
- Hi.NcParsers.Dependencys.Generic
- Assembly
- HiMech.dll
Brand-neutral IMachineAxisConfig backed by a plain axis→type map, for pipelines that have no controller parameter table (e.g. the NX CLSF runner). Typically populated from the machine chain via ConfigureByMachiningChain(IMachiningChain); rotary axes default to modular (IsModularRotary(string) inherited), matching the cyclic shortest-path treatment of McAbcCyclicPathSyntax.
public class MachineAxisConfig : IMachineAxisConfig, INcDependency, IMakeXmlSource
- Inheritance
-
MachineAxisConfig
- Implements
- Inherited Members
- Extension Methods
Constructors
MachineAxisConfig()
Creates an empty config; axes are added via SetAxis(string, AxisType).
public MachineAxisConfig()
MachineAxisConfig(XElement)
Reconstructs a config from its XML element.
public MachineAxisConfig(XElement src)
Parameters
srcXElementXML element previously produced by MakeXmlSource(string, string, bool).
Properties
AxisNames
Gets the configured axis names in order.
public IEnumerable<string> AxisNames { get; }
Property Value
XName
XML element name used to register this dependency with XFactory.
public static string XName { get; }
Property Value
Methods
Clear()
Removes every axis. Call before re-populating from a different machine chain — axes left over from a previous chain (e.g. rotaries after switching 5-axis → 3-axis) would otherwise send the modal rotary lookbacks walking the whole stream for values that no block carries.
public void Clear()
IsRotaryAxis(string)
Returns true if the axis is rotary or spindle, false if linear.
public bool IsRotaryAxis(string axisName)
Parameters
axisNamestring
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
RemoveAxis(string)
Removes an axis from the configuration.
public void RemoveAxis(string axisName)
Parameters
axisNamestring
SetAxis(string, AxisType)
Adds or updates an axis with the specified type.
public void SetAxis(string axisName, AxisType type)