Class StepScopedProgress
- Namespace
- Hi.MachiningProcs
- Assembly
- HiMech.dll
A per-step IProgress<T> of IMessage that accumulates the messages emitted while one step is built, upgrading any plain message to a StepDiagnostic anchored to this step's StepIndex / SentenceCarrier. An already step-anchored StepDiagnostic is kept unchanged. (NC diagnostics are not seen here — they live in their own NcDiagnosticProgress, not on this channel.)
It does not forward to a downstream sink as messages arrive; instead it collects them into MessageList and is drained once via FlushTo(IProgress<StepDiagnostic>) at the step's sequential post-physics stage. Because that stage runs strictly in step order, the per-step batches land in execution order with no position-scanning insert.
No locking: a single step's construction is a data-dependency chain (substraction → physics → post-physics), so only one task writes MessageList at a time; parallelism across steps writes to different scopes. Each parallel step task therefore holds its own instance — never a shared mutable "current step" on StepDiagnosticProgress, which would race.
public class StepScopedProgress : IProgress<IMessage>, IProgressMessage, IMessage, IMotionStepIndex
- Inheritance
-
StepScopedProgress
- Implements
- Inherited Members
- Extension Methods
Constructors
StepScopedProgress(int, ISentenceCarrier)
Initializes a new instance of the StepScopedProgress class.
public StepScopedProgress(int stepIndex, ISentenceCarrier sentenceCarrier)
Parameters
stepIndexintExecution-order index of the step.
sentenceCarrierISentenceCarrierNC-source carrier for the step; may be null.
Properties
MessageList
Messages accumulated for this step, in emission order — already upgraded to StepDiagnostic by Report(IMessage). Written by the step's pipelined (one-at-a-time) construction tasks, then drained once via FlushTo(IProgress<StepDiagnostic>).
public List<StepDiagnostic> MessageList { get; }
Property Value
SentenceCarrier
NC-source carrier for the step; may be null.
public ISentenceCarrier SentenceCarrier { get; }
Property Value
StepIndex
Execution-order index of the step this scope anchors to.
public int StepIndex { get; }
Property Value
Methods
FlushTo(IProgress<StepDiagnostic>)
Drains the accumulated MessageList into sink in order. Call
once, at the step's sequential post-physics stage, so the session sink receives whole
per-step batches already in execution order.
public void FlushTo(IProgress<StepDiagnostic> sink)
Parameters
sinkIProgress<StepDiagnostic>The downstream sink (typically the session StepDiagnosticProgress); no-op if null.
Report(IMessage)
Reports a progress update.
public void Report(IMessage value)
Parameters
valueIMessageThe value of the updated progress.