Table of Contents

Class CsvNcStep

Namespace
Hi.Mapping
Assembly
HiMech.dll

Represents a numerical control step loaded from a CSV file, with support for interpolation and arithmetic operations.

public class CsvNcStep : IGetFileLineIndex, IAdditionOperators<CsvNcStep, CsvNcStep, CsvNcStep>, IMultiplyOperators<CsvNcStep, double, CsvNcStep>
Inheritance
CsvNcStep
Implements
Inherited Members
Extension Methods

Constructors

CsvNcStep(FileLineIndex, TimeSpan, dvec3d_t, List<double>)

Initializes a new instance of the CsvNcStep class with the specified parameters.

public CsvNcStep(FileLineIndex fileLineIndex, TimeSpan time, dvec3d_t mcXyzabc, List<double> doubleFlexList)

Parameters

fileLineIndex FileLineIndex

The file and line index information.

time TimeSpan

The time value for this step.

mcXyzabc dvec3d_t

The machine coordinates for this step.

doubleFlexList List<double>

The list of additional double values.

Properties

ActualDateTime

Optional absolute controller instant captured at parse time; null when the row was relative. Resolved to ActualTimecode against the project mapping anchor (timecode-first when both are present).

public DateTime? ActualDateTime { get; set; }

Property Value

DateTime?

ActualTimecode

Gets or sets the relative timecode for this step (position from run start). Authoritative for interpolation / arithmetic.

public TimeSpan ActualTimecode { get; set; }

Property Value

TimeSpan

DoubleFlexList

Gets or sets the list of additional double values associated with this step.

public List<double> DoubleFlexList { get; set; }

Property Value

List<double>

FileLineIndex

Gets or sets the file and line index information.

public FileLineIndex FileLineIndex { get; set; }

Property Value

FileLineIndex

McXyzabc

Gets the machine coordinates (XYZ and ABC) for this step.

public dvec3d_t McXyzabc { get; }

Property Value

dvec3d_t

Methods

GetFileLineIndex()

public FileLineIndex GetFileLineIndex()

Returns

FileLineIndex

FileLineIndex

MapSingleByCsvFile(ClStrip, string, string, IProgress<IMessage>, Func<DateTime, TimeSpan>, MapSingleCsvConfig)

Embed single data per step by CSV file. It is one (step) - one (embedded-data) mapping. Time interpolation is applied. It is time-based mapping. Builds a collection of CsvNcStep instances from a CSV file.

public static void MapSingleByCsvFile(ClStrip clStrip, string baseDirectory, string relFile, IProgress<IMessage> messageProgress, Func<DateTime, TimeSpan> toTimecode = null, MapSingleCsvConfig csvConfig = null)

Parameters

clStrip ClStrip

The cutter location strip to populate.

baseDirectory string

The base directory for the file path.

relFile string

The relative file path to the CSV file.

messageProgress IProgress<IMessage>

The message host for logging.

toTimecode Func<DateTime, TimeSpan>

Converter from an absolute controller instant to a run-relative timecode (the project mapping anchor's converter). Used when the actual-time cell is a DateTime rather than a bare timecode; timecode-first when both are parseable. Null falls back to the legacy timecode / sim-time parse.

csvConfig MapSingleCsvConfig

Column titles of the file; null reads the default titles (MappingUtil).

Remarks

Every data column is written onto the steps and none is registered; the overload taking an IStepPropertyAccessHost applies MappedStepColumns instead.

MapSingleByCsvFile(ClStrip, string, string, IProgress<IMessage>, Func<DateTime, TimeSpan>, MapSingleCsvConfig, IStepPropertyAccessHost)

MapSingleByCsvFile(ClStrip, string, string, IProgress<IMessage>, Func<DateTime, TimeSpan>, MapSingleCsvConfig) that applies the step-variable rule of MappedStepColumns on stepVariableHost: a data column named like a built-in step property is not written (one progress message names the skipped columns), and every other one is written and registered as a step variable unless its key is registered already.

public static void MapSingleByCsvFile(ClStrip clStrip, string baseDirectory, string relFile, IProgress<IMessage> messageProgress, Func<DateTime, TimeSpan> toTimecode, MapSingleCsvConfig csvConfig, IStepPropertyAccessHost stepVariableHost)

Parameters

clStrip ClStrip

The cutter location strip to populate.

baseDirectory string

The base directory for the file path.

relFile string

The relative file path to the CSV file.

messageProgress IProgress<IMessage>

The message host for logging.

toTimecode Func<DateTime, TimeSpan>

Converter from an absolute controller instant to a run-relative timecode; see the other overload.

csvConfig MapSingleCsvConfig

Column titles of the file; null reads the default titles.

stepVariableHost IStepPropertyAccessHost

The step-property registry the kept columns are registered on; null writes every data column and registers none, as the other overload.

Operators

operator +(CsvNcStep, CsvNcStep)

Adds two CsvNcStep instances together.

public static CsvNcStep operator +(CsvNcStep left, CsvNcStep right)

Parameters

left CsvNcStep

The first CsvNcStep instance.

right CsvNcStep

The second CsvNcStep instance.

Returns

CsvNcStep

A new CsvNcStep instance with values that are the sum of the two input instances.

operator *(CsvNcStep, double)

Multiplies a CsvNcStep instance by a scalar value.

public static CsvNcStep operator *(CsvNcStep src, double scale)

Parameters

src CsvNcStep

The CsvNcStep instance to multiply.

scale double

The scalar value to multiply by.

Returns

CsvNcStep

A new CsvNcStep instance with values scaled by the specified factor.