private void SendLine() { GrblCommand tosend = null; try { tosend = mQueuePtr.Count > 0 ? mQueuePtr.Peek() : null; if (tosend != null) { tosend.SetSending(); mSentPtr.Add(tosend); mPending.Enqueue(tosend); mQueuePtr.Dequeue(); mBuffer += (tosend.Command.Length + 2); //+2 for \r\n com.WriteLine(tosend.Command); if (mTP.InProgram) { mTP.JobSent(); } } } catch (Exception ex) { if (tosend != null) { Logger.LogMessage("SendLine", "Error sending [{0}] command", tosend.Command); } Logger.LogException("SendLine", ex); } }
private void SendLine() { GrblCommand tosend = PeekNextCommand(); if (tosend != null) { try { tosend.BuildHelper(); tosend.SetSending(); mSentPtr.Add(tosend); mPending.Enqueue(tosend); RemoveManagedCommand(); mBuffer += tosend.SerialData.Length; com.Write(tosend.SerialData); if (mTP.InProgram) { mTP.JobSent(); } } catch (Exception ex) { if (tosend != null) { Logger.LogMessage("SendLine", "Error sending [{0}] command", tosend.Command); } Logger.LogException("SendLine", ex); } finally { tosend.DeleteHelper(); } } }
private void SendLine() { try { GrblCommand tosend = mQueuePtr.Count > 0 ? mQueuePtr.Peek() : null; if (tosend != null) { tosend.SetSending(); mSentPtr.Add(tosend); mPending.Enqueue(tosend); mQueuePtr.Dequeue(); mBuffer += (tosend.Command.Length + 2); //+2 for \r\n com.WriteLine(tosend.Command); if (mTP.InProgram) { mTP.JobSent(); } } } catch {} }