protected void IncrementStatus() { CurrentTxMessage++; if (CurrentTxMessage >= TxMessages.Count && !CompleteTriggered) { CompleteTriggered = true; foreach (Delegate action in MotorCommandProgress.GetInvocationList()) { ((MotorCommandProgressHandler)action).BeginInvoke(CurrentTxMessage, TxMessages.Count, RunMode.Complete, null, null); } } else if (OperationMode == RunMode.Paused) { foreach (Delegate action in MotorCommandProgress.GetInvocationList()) { ((MotorCommandProgressHandler)action).BeginInvoke(CurrentTxMessage, TxMessages.Count, RunMode.Paused, null, null); } } }
public virtual QcMessage EmitTxMessage(RunMode OperationMode) { this.OperationMode = OperationMode; if (CurrentTxMessage < TxMessages.Count) { TxMessagedEmitted = CurrentTxMessage; QcMessage emit = TxMessages[CurrentTxMessage].EmitTxMessage(OperationMode); if (emit.Type != QcPacketType.NoMessage) { foreach (Delegate action in MotorCommandProgress.GetInvocationList()) { ((MotorCommandProgressHandler)action).BeginInvoke(CurrentTxMessage, TxMessages.Count, RunMode.Emitting, null, null); ((MotorCommandProgressHandler)action).BeginInvoke(CurrentTxMessage, TxMessages.Count, RunMode.Running, null, null); } } return(emit); } return(new QcMessage() { Type = QcPacketType.NoMessage }); }