Table of Contents

Class StepTimeShotUtil

Namespace
Hi.Mapping
Assembly
HiMech.dll

Utility methods for working with time-based shots (measurements) and mapping them to machining steps.

public static class StepTimeShotUtil
Inheritance
StepTimeShotUtil
Inherited Members

Methods

GetStepToShotsDictionaryByActualTime(ClStrip, CycleSamplingMode, string, GetTimeShotByFileDelegate, IDictionary<int, List<ITimeShot>>, IProgress<IMessage>, CancellationToken?, Range<int>)

Gets a dictionary mapping step indices to time shots based on actual time.

public static void GetStepToShotsDictionaryByActualTime(ClStrip clStrip, StepTimeShotUtil.CycleSamplingMode cycleSamplingMode, string timeShotRelFile, StepTimeShotUtil.GetTimeShotByFileDelegate getTimeShotByRelFileFunc, IDictionary<int, List<ITimeShot>> dstStepToShotsDictionary, IProgress<IMessage> messageProgress, CancellationToken? cancellationToken, Range<int> stepSection = null)

Parameters

clStrip ClStrip

The cutter location strip.

cycleSamplingMode StepTimeShotUtil.CycleSamplingMode

The cycle sampling mode.

timeShotRelFile string

The relative file path for time shots.

getTimeShotByRelFileFunc StepTimeShotUtil.GetTimeShotByFileDelegate

The delegate function to get time shots by relative file path.

dstStepToShotsDictionary IDictionary<int, List<ITimeShot>>

The destination dictionary to store the mapping.

messageProgress IProgress<IMessage>

The session message host for logging.

cancellationToken CancellationToken?

The cancellation token.

stepSection Range<int>

Optional step-index window (inclusive): only the stamped-step pairs that overlap it are mapped, so an estimate on a few seconds of a long strip does not pay for the whole strip. A pair straddling an edge is mapped in full — the caller keys its consumers by step index anyway. Null maps the whole strip.

GetTimeShotByFile(string, Action<int>, CancellationToken?, Func<DateTime, TimeSpan>, MapSeriesCsvConfig)

Gets time shots from a file, reading and parsing force acceleration data.

public static List<ITimeShot> GetTimeShotByFile(string file, Action<int> lineReaded, CancellationToken? cancellationToken = null, Func<DateTime, TimeSpan> toTimecode = null, MapSeriesCsvConfig csvConfig = null)

Parameters

file string

The file path to read time shots from.

lineReaded Action<int>

Action to call when a line is read, providing progress feedback with the current line number.

cancellationToken CancellationToken?

Optional cancellation token to cancel the reading operation.

toTimecode Func<DateTime, TimeSpan>

Converter from an absolute sample DateTime to its timecode TimeSpan (used for step timing).

csvConfig MapSeriesCsvConfig

Column titles of the file; null reads the built-in titles.

Returns

List<ITimeShot>

A list of time shots read from the file, or null if the file cannot be read or is invalid.