Class ToolSectionTouchMonitor
- Namespace
- Hi.MachiningProcs
- Assembly
- HiMech.dll
Watches each tool section of a play — the consecutive built steps on one tool id: a tool called again after another opens a new section, the same id called again does not — for the one thing the per-step messages never say: the tool has removed nothing. Two validation warnings, at most one of each per section:
Tool-NoRemoval--Collision— the section has touched nothing so far and this step brings the holder or the shank into the workpiece. Anchored on the colliding step and said when that step is built, at its sequential stage, not at the pause: a play with EnablePauseOnFailure pauses on the step'sCollision--Detectedbefore the step is submitted, so this warning follows the resume, and a play stopped at that pause never says it (the stopped step is not built); and only with collision detection on (EnableCollisionDetection and its licence): the step's collision pairs are all it sees. A collision on the section's first step — the tool change pose itself — is left to the collision rule (Collision--Detected); the next colliding step of the section is reported.Tool-Touch--None— the section ended (the next tool's first step, or Flush(IProgress<StepDiagnostic>) at the end of the play) and none of its steps touched the workpiece. Anchored on the section's first step, naming the tool, its step count and its first and last step; needs no collision detection. Not reported for a section with no feed step after its first one — that first step is the tool change pose itself, built in whatever motion mode was modal, so consecutive tool changes and a return home at rapid are no section to speak of — nor for a section the collision warning above already named, nor for the sections of a session that has touched nothing since its last reset: that is one setup accident, which the session says once asPlay-Touch--None. A section that ends before that first touch is held back until the touch comes, and dropped by Flush(IProgress<StepDiagnostic>) when it never does. A run that stops before its end (the player terminated) does not end its open section: DropOpenSection() forgets it, at the stop and at the next run's start, so a tool the user stopped is not read as one that touched nothing.
Tooling--NoCutter, or Tooling--CutterUnreadable when the
cleared cutter came from a side file; once per call): its moves run
tool-less and build no step, so its section is never seen here. That is
how a tool that is not meant to cut stays out of both warnings.
Why: the collision rule reports every colliding step as
Collision--Detected — hundreds of thousands of them in the plays
this was written for — and nothing said the tool had cut nothing at all; a
tool whose holder and shank never reached the stock said nothing at all.
Showcase cases on 3.2.43 played a whole tool after an M06 without a touch
(the cl valve carried a NaN frame from the M05 ahead of the tool change on)
and read as finished until the exported stock was looked at. The valve is
fixed; the combinations stay worth a sentence: a cutter whose APT profile
refuses its geometry (Cutter-ShaperProfile--AptRefused: it stays
equipped and removes nothing), a length offset or work offset that keeps
one tool in the air, a program run on stock that is already cut — and a
healthy tool whose holder or shank reaches the stock before its first cut,
which is why the collision message states both readings.
One instance per MachiningActRunner. Observe(in Sample, IProgress<StepDiagnostic>) runs on the sequential post-physics stage of every built step (one thread, step order), where the step's touch flag and collision pairs are final; Flush(IProgress<StepDiagnostic>) closes the last section at the end of a play, DropOpenSection() forgets it at a run boundary and Reset() forgets everything on a session reset, all on the shell thread after WaitAll(), so no lock is needed.
public sealed class ToolSectionTouchMonitor
- Inheritance
-
ToolSectionTouchMonitor
- Inherited Members
- Extension Methods
Fields
CollisionMessageId
Id of the warning on a holder or shank collision before the section's first touch.
public const string CollisionMessageId = "Tool-NoRemoval--Collision"
Field Value
TouchNoneMessageId
Id of the warning on a section that ended without a touch.
public const string TouchNoneMessageId = "Tool-Touch--None"
Field Value
Methods
CollidingToolPartsOf(IEnumerable<CollidedKeyPair>)
The holder and shank keys paired with the workpiece in pairs,
holder first and each once; empty for null, for no collision, and for pairs that
do not involve the workpiece or involve it with the flute or the fixture. Either
key order is read: the chains pair work side first, but nothing here depends on it.
public static IReadOnlyList<string> CollidingToolPartsOf(IEnumerable<MachiningStep.CollidedKeyPair> pairs)
Parameters
pairsIEnumerable<MachiningStep.CollidedKeyPair>A step's collided key pairs; null when the step had no collision.
Returns
DropOpenSection()
A run boundary that is not the end of a play — the player terminated before the end, or a new run starts on the session: forgets the open section without reporting it, because the tool did not run its section to the end and a new run's first step must not close the previous run's. The held sections and the touch since the last reset are kept.
public void DropOpenSection()
Flush(IProgress<StepDiagnostic>)
End of a play: closes the open section — the last tool has no successor
to close it — and drops the sections held back for a play that never
touched, whose one message is the session's Play-Touch–None.
A closed section is reported as Tool-Touch–None when none of its
steps touched, at least one step after its first was a feed step and the
collision warning did not name it already; while the play has not touched
yet the report is held back instead.
public void Flush(IProgress<StepDiagnostic> sink)
Parameters
sinkIProgress<StepDiagnostic>Step-anchored sink for the reports; no-op if null.
Observe(in Sample, IProgress<StepDiagnostic>)
Feeds one built step, in step order. A step on another tool closes the open section (see Flush(IProgress<StepDiagnostic>) for what a closed section reports) and opens a new one; the first holder or shank collision with the workpiece in a section that has run at least one step before it and touched nothing yet is reported, once per section.
public void Observe(in ToolSectionTouchMonitor.Sample sample, IProgress<StepDiagnostic> sink)
Parameters
sampleToolSectionTouchMonitor.SampleThe step, see SampleOf(MachiningStep).
sinkIProgress<StepDiagnostic>Step-anchored sink for the reports; no-op if null.
Reset()
Session reset: forgets the open section, the held sections and the play's touch.
public void Reset()
SampleOf(MachiningStep)
Builds the monitor's view of a built step.
public static ToolSectionTouchMonitor.Sample SampleOf(MachiningStep step)
Parameters
stepMachiningStepA built step.