예제 #1
0
        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);
            }
        }
예제 #2
0
        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(); }
            }
        }
예제 #3
0
        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 {}
        }