Table of Contents

Class FirstContactWindow

Namespace
Hi.MillingForces.Training
Assembly
HiNc.dll

Selects “the first x seconds of contact” of one tool from a step stream: from FromStepIndex on, the tool's touched steps in step order until their StepDuration sum reaches Target. The window is what the online setup-angle estimate samples — early in the mounting's life, long enough to average the transients out — and it is a property of the step stream alone, so the same tracker serves the armed (step-built event) and the post-hoc (walk the finished strip) paths.

Contact time counts touched steps only; untouched steps between them do not count but do lie inside the resulting step range (they carry no sample anyway). Steps of other tools are ignored, so a window survives a tool change in the middle and continues when the tool comes back — the setup angle is a property of the mounting, which the simulation keeps across tool changes. Steps before FromStepIndex are ignored, so an arm issued mid-play samples what is cut after it.

public sealed class FirstContactWindow
Inheritance
FirstContactWindow
Inherited Members
Extension Methods

Constructors

FirstContactWindow(int, TimeSpan, int)

Creates the tracker.

public FirstContactWindow(int toolId, TimeSpan target, int fromStepIndex = 0)

Parameters

toolId int

Tool-house id of the tool to sample; a negative value means the first tool that touches the workpiece at or after fromStepIndex (the mounted tool when armed mid-play).

target TimeSpan

Contact time to accumulate; zero or less completes on the first touched step.

fromStepIndex int

First step index considered.

Properties

Accumulated

Contact time accumulated so far (touched steps of the tool only).

public TimeSpan Accumulated { get; }

Property Value

TimeSpan

FirstStepIndex

Index of the first touched step in the window; -1 while no contact was seen.

public int FirstStepIndex { get; }

Property Value

int

FromStepIndex

First step index considered.

public int FromStepIndex { get; }

Property Value

int

HasContact

True once any touched step of the tool was seen.

public bool HasContact { get; }

Property Value

bool

LastStepIndex

Index of the last touched step in the window; -1 while no contact was seen.

public int LastStepIndex { get; }

Property Value

int

Reached

True once Accumulated reached Target; the window no longer grows.

public bool Reached { get; }

Property Value

bool

ResolvedToolId

The tool the window is sampling; -1 until the first touched step when ToolId is negative.

public int ResolvedToolId { get; }

Property Value

int

Target

Contact time the window accumulates before it is complete.

public TimeSpan Target { get; }

Property Value

TimeSpan

ToolId

The requested tool id, or a negative value for “the first tool that touches”.

public int ToolId { get; }

Property Value

int

TouchedStepNum

Number of touched steps in the window.

public int TouchedStepNum { get; }

Property Value

int

Methods

Observe(int, int, bool, TimeSpan)

Feeds one step, in step order.

public bool Observe(int stepIndex, int toolId, bool isTouched, TimeSpan stepDuration)

Parameters

stepIndex int

The step's index.

toolId int

The step's tool id.

isTouched bool

Whether the step touched the workpiece.

stepDuration TimeSpan

The step's duration.

Returns

bool

True on the one step that completes the window; false for every other step, including those fed after completion.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.