Class StepTimeShotUtil
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
FileTimeSectionThe file time section containing file path and time range for filtering.
getTimeShotByRelFileFunc
StepTimeShotUtil.GetTimeShotByFileDelegateThe 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
ClStripThe cutter location strip containing the steps.
stepSection
Range<int>The range of step indices to process.
toolHouse
MachiningToolHouseThe tool house containing available tools.
cycleSamplingMode
StepTimeShotUtil.CycleSamplingModeThe cycle sampling mode to use (spindle or flute cycle).
relFileTimeSection
FileTimeSectionThe file time section containing file path and time range.
getTimeShotByRelFileFunc
StepTimeShotUtil.GetTimeShotByFileDelegateThe 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
stringThe 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.