/// <summary> /// Move all the patterns in the workpiece /// </summary> /// <param name="workPiece"></param> /// <param name="axes"></param> /// <param name="patList"></param> /// <returns>True if completed with no abort</returns> public virtual bool MoveWorkPiece(GWorkPiece workPiece, RealAxes axes, GPattern[] patList) { // Simulation // Do work. // Process one pattern at a time (including the link move to get to the pattern) // Return when everything completed // or return when interrupted (Check GPattern.AbortExecution flag) foreach (GPattern pattern in patList) { pattern.WaitForReady(); if (workPiece.AbortRun) { return(false); } if (pattern.HasChildren) { foreach (GLine line in pattern.Lines) { foreach (GTriggerPoint tPt in line.TriggerPts) { tPt.SimulateTrigger(); if (tPt.PulseWidth > 0) { FirePollingComplete(); double stopPolling = U.DateTimeNow + tPt.PulseWidth.ToTicks; while (stopPolling >= U.DateTimeNow) { U.SleepWithEvents(10); FirePollingComplete(); } } } } } } return(true); }
/// <summary> /// Move all the patterns in the workpiece /// </summary> /// <param name="workPiece"></param> /// <param name="patList"></param> /// <returns>True if completed with no abort</returns> public bool MoveWorkPiece(GWorkPiece wp, GPattern[] patList) { return(_motionSystem.MoveWorkPiece(wp, this, patList)); }