Table of Contents

Class RapidCutMonitor

Namespace
Hi.MachiningProcs
Assembly
HiMech.dll

Reports a rapid traverse that removed stock: the steps of one NC line that were commanded as rapid traverse (G00, IsRapid) and touched the workpiece fold into one Play-RapidCut–Detected validation warning, anchored on the line's first touching step and carrying the line's total removed volume and its largest cutting depth. A rapid move through material breaks the tool or crashes the machine on a real run, yet with the spindle turning the engine treats it as ordinary cutting: the collision rule (Hi.Machining.MachiningEquipment.Detect) pairs flute and workpiece only while the spindle is stopped, so such a line used to pass with no message at all.

One instance per MachiningActRunner. Observe(in Sample, double, bool, IProgress<StepDiagnostic>) runs on the sequential post-physics stage of every built step (one thread, step order), Flush(double, IProgress<StepDiagnostic>) closes the last line at the end of a play and Reset() drops a pending line on a session reset; both run on the shell thread after WaitAll(), so no lock is needed.

Folding: consecutive rapid steps with the same LineKey (the NC line number, or the sentence itself where a runner has no line numbers) form one report; a feed step, a different line or the end of the play closes it. A line re-entered later (a subprogram loop) reports again, deliberately. The report is emitted only when the line's total removed volume reaches RapidCutVolumeThreshold_mm3 (default 0: any contact). Steps with the spindle stopped are skipped while collision detection is on — that rule owns them and raises Collision--Detected — and counted otherwise.

public sealed class RapidCutMonitor
Inheritance
RapidCutMonitor
Inherited Members
Extension Methods

Fields

MessageId

Id of the warning this monitor emits.

public const string MessageId = "Play-RapidCut--Detected"

Field Value

string

Methods

Flush(double, IProgress<StepDiagnostic>)

Closes the pending rapid line: reports it when its total removed volume reaches volumeThreshold_mm3, then forgets it. Called by Observe(in Sample, double, bool, IProgress<StepDiagnostic>) at a line boundary and by the session at the end of a play, for the last line.

public void Flush(double volumeThreshold_mm3, IProgress<StepDiagnostic> sink)

Parameters

volumeThreshold_mm3 double

Line-total removed volume below which the line is not reported.

sink IProgress<StepDiagnostic>

Step-anchored sink for the report; no-op if null.

Observe(in Sample, double, bool, IProgress<StepDiagnostic>)

Feeds one built step, in step order. A feed step or a step of another line closes the pending rapid line (see Flush(double, IProgress<StepDiagnostic>)); a rapid step that touched the stock opens or extends it.

public void Observe(in RapidCutMonitor.Sample sample, double volumeThreshold_mm3, bool collisionDetectionEnabled, IProgress<StepDiagnostic> sink)

Parameters

sample RapidCutMonitor.Sample

The step, see SampleOf(MachiningStep).

volumeThreshold_mm3 double

Line-total removed volume below which the line is not reported.

collisionDetectionEnabled bool

When true, steps with the spindle stopped are left to collision detection.

sink IProgress<StepDiagnostic>

Step-anchored sink for the report; no-op if null.

Reset()

Forgets a pending line without reporting it (session reset).

public void Reset()

SampleOf(MachiningStep)

Builds the monitor's view of a built step. The removed volume is the step's material removal rate (Mrr_mm3ds, the swept engagement cross-section times the tip feedrate) over the step duration — a geometry-only quantity, so the report needs no physics; a NaN rate (undefined tip feedrate) counts as 0 but the contact still counts.

public static RapidCutMonitor.Sample SampleOf(MachiningStep step)

Parameters

step MachiningStep

A built step.

Returns

RapidCutMonitor.Sample