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
toolIdintTool-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).targetTimeSpanContact time to accumulate; zero or less completes on the first touched step.
fromStepIndexintFirst step index considered.
Properties
Accumulated
Contact time accumulated so far (touched steps of the tool only).
public TimeSpan Accumulated { get; }
Property Value
FirstStepIndex
Index of the first touched step in the window; -1 while no contact was seen.
public int FirstStepIndex { get; }
Property Value
FromStepIndex
First step index considered.
public int FromStepIndex { get; }
Property Value
HasContact
True once any touched step of the tool was seen.
public bool HasContact { get; }
Property Value
LastStepIndex
Index of the last touched step in the window; -1 while no contact was seen.
public int LastStepIndex { get; }
Property Value
Reached
True once Accumulated reached Target; the window no longer grows.
public bool Reached { get; }
Property Value
ResolvedToolId
The tool the window is sampling; -1 until the first touched step when ToolId is negative.
public int ResolvedToolId { get; }
Property Value
Target
Contact time the window accumulates before it is complete.
public TimeSpan Target { get; }
Property Value
ToolId
The requested tool id, or a negative value for “the first tool that touches”.
public int ToolId { get; }
Property Value
TouchedStepNum
Number of touched steps in the window.
public int TouchedStepNum { get; }
Property Value
Methods
Observe(int, int, bool, TimeSpan)
Feeds one step, in step order.
public bool Observe(int stepIndex, int toolId, bool isTouched, TimeSpan stepDuration)
Parameters
stepIndexintThe step's index.
toolIdintThe step's tool id.
isTouchedboolWhether the step touched the workpiece.
stepDurationTimeSpanThe 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.