Table of Contents

Class MapSeriesByCsvFileCommand

Namespace
Hi.SessionCommands
Assembly
HiNc.dll

Command to call MapSeriesByCsvFile(string, CycleSamplingMode, MapSeriesCsvConfig): pairs each step that carries an actual time with its window of a time-series (sensor) CSV file (one-to-many mapping). Carries the column titles of its file (CsvConfig), so a sensor recording maps without renaming its columns first.

[CultureText("zh-Hant", "CSV 一對多映射")]
[CultureText("zh-Hans", "CSV 一对多映射")]
[CultureText("vi", "Ánh xạ một-nhiều từ tệp CSV")]
[CultureText("ja", "CSV ファイルによる一対多の対応付け")]
[CommandCatalog(CommandCategory.Mapping, Order = 1)]
public class MapSeriesByCsvFileCommand : ITitleCommand, ISessionCommand, IMakeXmlSource
Inheritance
MapSeriesByCsvFileCommand
Implements
Inherited Members
Extension Methods

Constructors

MapSeriesByCsvFileCommand()

Default constructor.

public MapSeriesByCsvFileCommand()

MapSeriesByCsvFileCommand(XElement, string)

Ctor.

public MapSeriesByCsvFileCommand(XElement src, string baseDirectory)

Parameters

src XElement

XML

baseDirectory string

Base directory for resolving relative paths

Properties

AxTag

Title of the X acceleration column (g).

[CultureText("zh-Hant", "X 向加速度欄位", Key = "Acceleration X Column")]
[CultureText("zh-Hans", "X 向加速度列", Key = "Acceleration X Column")]
[CultureText("vi", "Cột gia tốc X", Key = "Acceleration X Column")]
[CultureText("ja", "X 方向加速度の列", Key = "Acceleration X Column")]
public string AxTag { get; set; }

Property Value

string

AyTag

Title of the Y acceleration column (g).

[CultureText("zh-Hant", "Y 向加速度欄位", Key = "Acceleration Y Column")]
[CultureText("zh-Hans", "Y 向加速度列", Key = "Acceleration Y Column")]
[CultureText("vi", "Cột gia tốc Y", Key = "Acceleration Y Column")]
[CultureText("ja", "Y 方向加速度の列", Key = "Acceleration Y Column")]
public string AyTag { get; set; }

Property Value

string

AzTag

Title of the Z acceleration column (g).

[CultureText("zh-Hant", "Z 向加速度欄位", Key = "Acceleration Z Column")]
[CultureText("zh-Hans", "Z 向加速度列", Key = "Acceleration Z Column")]
[CultureText("vi", "Cột gia tốc Z", Key = "Acceleration Z Column")]
[CultureText("ja", "Z 方向加速度の列", Key = "Acceleration Z Column")]
public string AzTag { get; set; }

Property Value

string

CsvConfig

Column titles of the file. The tag properties below are its faces for generic field editors. Null is the built-in titles.

public MapSeriesCsvConfig CsvConfig { get; set; }

Property Value

MapSeriesCsvConfig

CycleSamplingMode

How much of the series each step is paired with; see the remarks of MapSeriesByCsvFile(string, CycleSamplingMode).

[CultureText("zh-Hant", "週期取樣模式")]
[CultureText("zh-Hans", "周期采样模式")]
[CultureText("vi", "Chế độ lấy mẫu theo chu kỳ")]
[CultureText("ja", "周期サンプリングモード")]
[CultureText("zh-Hant", "主軸週期", Key = "Spindle Cycle")]
[CultureText("zh-Hans", "主轴周期", Key = "Spindle Cycle")]
[CultureText("vi", "Chu kỳ trục chính", Key = "Spindle Cycle")]
[CultureText("ja", "主軸回転周期", Key = "Spindle Cycle")]
[CultureText("zh-Hant", "刀刃週期", Key = "Flute Cycle")]
[CultureText("zh-Hans", "刀刃周期", Key = "Flute Cycle")]
[CultureText("vi", "Chu kỳ lưỡi cắt", Key = "Flute Cycle")]
[CultureText("ja", "刃通過周期", Key = "Flute Cycle")]
public StepTimeShotUtil.CycleSamplingMode CycleSamplingMode { get; set; }

Property Value

StepTimeShotUtil.CycleSamplingMode

FxTag

Title of the X force column (N).

[CultureText("zh-Hant", "X 向力欄位", Key = "Force X Column")]
[CultureText("zh-Hans", "X 向力列", Key = "Force X Column")]
[CultureText("vi", "Cột lực X", Key = "Force X Column")]
[CultureText("ja", "X 方向力の列", Key = "Force X Column")]
public string FxTag { get; set; }

Property Value

string

FyTag

Title of the Y force column (N).

[CultureText("zh-Hant", "Y 向力欄位", Key = "Force Y Column")]
[CultureText("zh-Hans", "Y 向力列", Key = "Force Y Column")]
[CultureText("vi", "Cột lực Y", Key = "Force Y Column")]
[CultureText("ja", "Y 方向力の列", Key = "Force Y Column")]
public string FyTag { get; set; }

Property Value

string

FzTag

Title of the Z force column (N).

[CultureText("zh-Hant", "Z 向力欄位", Key = "Force Z Column")]
[CultureText("zh-Hans", "Z 向力列", Key = "Force Z Column")]
[CultureText("vi", "Cột lực Z", Key = "Force Z Column")]
[CultureText("ja", "Z 方向力の列", Key = "Force Z Column")]
public string FzTag { get; set; }

Property Value

string

MxTag

Title of the X moment column (N·m).

[CultureText("zh-Hant", "繞 X 軸力矩欄位", Key = "Moment X Column")]
[CultureText("zh-Hans", "绕 X 轴力矩列", Key = "Moment X Column")]
[CultureText("vi", "Cột mô-men X", Key = "Moment X Column")]
[CultureText("ja", "X 軸まわりモーメントの列", Key = "Moment X Column")]
public string MxTag { get; set; }

Property Value

string

MyTag

Title of the Y moment column (N·m).

[CultureText("zh-Hant", "繞 Y 軸力矩欄位", Key = "Moment Y Column")]
[CultureText("zh-Hans", "绕 Y 轴力矩列", Key = "Moment Y Column")]
[CultureText("vi", "Cột mô-men Y", Key = "Moment Y Column")]
[CultureText("ja", "Y 軸まわりモーメントの列", Key = "Moment Y Column")]
public string MyTag { get; set; }

Property Value

string

MzTag

Title of the Z moment column (N·m).

[CultureText("zh-Hant", "繞 Z 軸力矩欄位", Key = "Moment Z Column")]
[CultureText("zh-Hans", "绕 Z 轴力矩列", Key = "Moment Z Column")]
[CultureText("vi", "Cột mô-men Z", Key = "Moment Z Column")]
[CultureText("ja", "Z 軸まわりモーメントの列", Key = "Moment Z Column")]
public string MzTag { get; set; }

Property Value

string

RelFile

Path of the time-series CSV file, relative to the project directory.

public string RelFile { get; set; }

Property Value

string

TimeTag

Title of the sample time column (seconds, a timecode, or an absolute date-time cell). Required.

[CultureText("zh-Hant", "時間欄位", Key = "Time Column")]
[CultureText("zh-Hans", "时间列", Key = "Time Column")]
[CultureText("vi", "Cột thời gian", Key = "Time Column")]
[CultureText("ja", "時刻の列", Key = "Time Column")]
public string TimeTag { get; set; }

Property Value

string

XName

Name for XML IO.

public static string XName { get; }

Property Value

string

Methods

GetCommandTitle(ICommandTextSource)

Gets the title of the command — one row in a command list or a mission tree — composed from the caller's vocabulary: the command owns the composition and degradation rules, the caller owns the language.

The shape is Name, or Name [detail] once there is a detail worth showing. The NAME always leads and is never dropped: a row must say WHAT it is even when the detail is a title the user wrote, otherwise a newcomer cannot tell a command list from a script. The detail trails because these rows truncate from the right. An empty detail takes the bare-name form rather than rendering dangling brackets.

public string GetCommandTitle(ICommandTextSource text)

Parameters

text ICommandTextSource

Culture-bearing vocabulary the static words are taken from.

Returns

string

The command title.

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

Run(SessionShell)

Runs the command, delegating execution to the provided session shell.

public IEnumerable<Action> Run(SessionShell sessionShell)

Parameters

sessionShell SessionShell

Session shell that exposes the machining facade to commands.

Returns

IEnumerable<Action>

Sequence of actions to be executed. A command may do its work as it is enumerated and yield null between the pieces of it. The player invokes each action in order and paces after it – a Pause holds there, jobs queued for the run's pace point run there, and a Stop of its run ends the run there – and it ends a stopped run at a null item too, and before the next row of a ListCommand. An action is not checked for a Stop before it runs: one handed over after the Stop runs, and the run ends at the pace after it. Where the run ends, the player disposes the enumeration: the command's code after that item does not run, and what must run whatever happens belongs in a finally of the iterator. An exception that leaves the enumeration while the run is live ends the run as a fault: the player reports it as Player-Run–Fault, the run ends there as not finished, and no later row of a ListCommand runs; a command that catches and reports its own failure (a ScriptCommand‘s ScriptCommand-Run–Fault, the CSV mapping commands’ Map-SingleCsv–Fault and Map-SeriesCsv–Fault) lets the mission go on. Once the run is stopped, whatever leaves the enumeration – the run's own cancellation, or an exception its unwinding throws – is the Stop, and no message is said for it. A command that catches and reports its own failure still says it after the Stop: a ScriptCommand reports any exception other than a cancellation that comes out of its script's body – the body's own, or one the stopped run's unwinding throws inside the body – as ScriptCommand-Run–Fault, and the CSV mapping commands' catches let a cancellation through alone; the stopped run then starts no later row.