Table of Contents

Class ControllerParameterTableBase

Namespace
Hi.NcParsers.Dependencys
Assembly
HiMech.dll

Base class for brand-specific controller parameter tables. Provides shared data structures, XML IO, and IHomeMcConfig

  • IMachineAxisConfig implementations. Subclasses define brand-specific parameter numbers, XML attribute names, and derived convenience properties.
public abstract class ControllerParameterTableBase : IHomeMcConfig, IMachineAxisConfig, IRapidFeedrateConfig, IStrokeLimitConfig, INcDependency, IMakeXmlSource
Inheritance
ControllerParameterTableBase
Implements
Derived
Inherited Members
Extension Methods

Properties

AxisNames

Gets the configured axis names in order.

public IEnumerable<string> AxisNames { get; }

Property Value

IEnumerable<string>

AxisParams

Per-axis float parameters. Outer key = parameter number, inner key = axis name.

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

Property Value

Dictionary<int, Dictionary<string, double>>

AxisTypeParamId

Parameter/MD/MP number for axis type (linear/rotary/spindle).

protected abstract int AxisTypeParamId { get; }

Property Value

int

IdAttributeName

XML attribute name for the parameter ID (“ParamId”, “MdId”, “MpId”).

protected abstract string IdAttributeName { get; }

Property Value

string

IntAxisParams

Per-axis integer parameters. Outer key = parameter number, inner key = axis name.

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

Property Value

Dictionary<int, Dictionary<string, int>>

RapidRateParamId

Parameter/MD/MP number for rapid traverse rate per axis. Null if not defined for this controller brand.

protected virtual int? RapidRateParamId { get; }

Property Value

int?

ReferencePositionParamId

Parameter/MD/MP number for reference position (G28 home).

protected abstract int ReferencePositionParamId { get; }

Property Value

int

StrokeLimitNegParamId

Parameter/MD/MP number for negative stroke limit per axis. Null if not defined for this controller brand.

protected virtual int? StrokeLimitNegParamId { get; }

Property Value

int?

StrokeLimitPosParamId

Parameter/MD/MP number for positive stroke limit per axis. Null if not defined for this controller brand.

protected virtual int? StrokeLimitPosParamId { get; }

Property Value

int?

SystemParams

System-wide parameters. Key = parameter number.

public Dictionary<int, double> SystemParams { get; set; }

Property Value

Dictionary<int, double>

Methods

AxisParam(int)

Returns the per-axis float bucket for paramId, creating it if absent. See AxisParams.

public Dictionary<string, double> AxisParam(int paramId)

Parameters

paramId int

Brand-specific parameter/MD/MP number.

Returns

Dictionary<string, double>

ConfigureRotaryAxis(string, double, double)

Configures a rotary axis with home position and rapid rate. Sets axis type to Rotary, home position via SetHomePosition(string, double), and per-axis rapid rate (if RapidRateParamId is defined for this brand). Use RemoveAxis(string) to remove the axis entirely.

public void ConfigureRotaryAxis(string axisName, double homePosition_deg = 0, double rapidRate_degdmin = 36000)

Parameters

axisName string

Axis name (e.g., “A”, “B”, “C”).

homePosition_deg double

Home position in degrees (default 0).

rapidRate_degdmin double

Rapid traverse rate in deg/min (default 36000).

GetHomePosition(string)

Gets the home position for a specific axis. Returns null if the axis has no home position configured.

public double? GetHomePosition(string axisName)

Parameters

axisName string

Returns

double?

GetLinearAxisRapidRate_mmdmin(string)

Gets rapid traverse feedrate for a linear axis in mm/min. Returns a default value if the axis is not configured.

public double GetLinearAxisRapidRate_mmdmin(string axisName)

Parameters

axisName string

Returns

double

GetNegativeLimit(string)

Gets the negative stroke limit for a specific axis. Unit is mm for linear axes, deg for rotary axes. Returns null if not configured (no limit).

public double? GetNegativeLimit(string axisName)

Parameters

axisName string

Returns

double?

GetPositiveLimit(string)

Gets the positive stroke limit for a specific axis. Unit is mm for linear axes, deg for rotary axes. Returns null if not configured (no limit).

public double? GetPositiveLimit(string axisName)

Parameters

axisName string

Returns

double?

GetRotaryAxisRapidRate_degdmin(string)

Gets rapid traverse feedrate for a rotary axis in deg/min. Returns a default value if the axis is not configured.

public double GetRotaryAxisRapidRate_degdmin(string axisName)

Parameters

axisName string

Returns

double

IntAxisParam(int)

Returns the per-axis integer bucket for paramId, creating it if absent. See IntAxisParams.

public Dictionary<string, int> IntAxisParam(int paramId)

Parameters

paramId int

Brand-specific parameter/MD/MP number.

Returns

Dictionary<string, int>

IsRotaryAxis(string)

Returns true if the axis is rotary or spindle, false if linear.

public bool IsRotaryAxis(string axisName)

Parameters

axisName string

Returns

bool

MakeXmlSource(string, string, bool)

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

public abstract 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.

ReadXml(XElement)

Populates SystemParams, AxisParams, and IntAxisParams from src using the brand-specific IdAttributeName.

protected void ReadXml(XElement src)

Parameters

src XElement

XML element produced by WriteXml(string).

RemoveAxis(string)

Removes an axis from the configuration.

public void RemoveAxis(string axisName)

Parameters

axisName string

SetAxis(string, AxisType)

Adds or updates an axis with the specified type.

public void SetAxis(string axisName, AxisType type)

Parameters

axisName string
type AxisType

SetHomePosition(string, double)

Sets the home position for a specific axis.

public void SetHomePosition(string axisName, double value)

Parameters

axisName string
value double

SetLinearAxisRapidRate_mmdmin(string, double)

Sets rapid traverse feedrate for a linear axis in mm/min.

public void SetLinearAxisRapidRate_mmdmin(string axisName, double value)

Parameters

axisName string
value double

SetNegativeLimit(string, double)

Sets the negative stroke limit for a specific axis. Unit is mm for linear axes, deg for rotary axes.

public void SetNegativeLimit(string axisName, double value)

Parameters

axisName string
value double

SetPositiveLimit(string, double)

Sets the positive stroke limit for a specific axis. Unit is mm for linear axes, deg for rotary axes.

public void SetPositiveLimit(string axisName, double value)

Parameters

axisName string
value double

SetRotaryAxisRapidRate_degdmin(string, double)

Sets rapid traverse feedrate for a rotary axis in deg/min.

public void SetRotaryAxisRapidRate_degdmin(string axisName, double value)

Parameters

axisName string
value double

WriteXml(string)

Serializes SystemParams, AxisParams, and IntAxisParams into a new XElement. Inverse of ReadXml(XElement).

protected XElement WriteXml(string xName)

Parameters

xName string

Element name for the produced XML element.

Returns

XElement