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

GetShots(FileTimeSection, GetTimeShotByFileDelegate)

Gets time shots from a file time section, filtering and interpolating based on the specified time range.

public static List<ITimeShot> GetShots(FileTimeSection relFileTimeSection, StepTimeShotUtil.GetTimeShotByFileDelegate getTimeShotByRelFileFunc)

Parameters

relFileTimeSection FileTimeSection

The file time section containing file path and time range for filtering.

getTimeShotByRelFileFunc StepTimeShotUtil.GetTimeShotByFileDelegate

The delegate function to get time shots from a file.

Returns

List<ITimeShot>

A list of time shots that:

  • Fall within the specified time range
  • Include interpolated values at range boundaries
  • Are sorted by time Returns null if no shots are found or if reading fails.

Remarks

The returned shots are:

  • Filtered to the specified time range
  • Interpolated at range boundaries for accuracy
  • Sorted by time

GetStepToShotsDictionary(ClStrip, Range<int>, MachiningToolHouse, CycleSamplingMode, FileTimeSection, GetTimeShotByFileDelegate)

Gets a dictionary mapping step indices to lists of time shots.

public static Dictionary<int, List<ITimeShot>> GetStepToShotsDictionary(ClStrip clStrip, Range<int> stepSection, MachiningToolHouse toolHouse, StepTimeShotUtil.CycleSamplingMode cycleSamplingMode, FileTimeSection relFileTimeSection, StepTimeShotUtil.GetTimeShotByFileDelegate getTimeShotByRelFileFunc)

Parameters

clStrip ClStrip

The cutter location strip containing the steps.

stepSection Range<int>

The range of step indices to process.

toolHouse MachiningToolHouse

The tool house containing available tools.

cycleSamplingMode StepTimeShotUtil.CycleSamplingMode

The cycle sampling mode to use (spindle or flute cycle).

relFileTimeSection FileTimeSection

The file time section containing file path and time range.

getTimeShotByRelFileFunc StepTimeShotUtil.GetTimeShotByFileDelegate

The delegate function to get time shots from a file.

Returns

Dictionary<int, List<ITimeShot>>

A dictionary mapping step indices to time shot lists, or null if:

  • File reading fails
  • Time range calculation fails
  • No valid shots are found

Remarks

For each step, this method:

  • Calculates the appropriate time range
  • Filters shots to that range
  • Interpolates values at range boundaries
  • Ensures at least one full cycle of data

GetTimeShotByFile(string, Action<int>, CancellationToken?)

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)

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.

Returns

List<ITimeShot>

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