private void BtnStart_Click(object sender, RoutedEventArgs e)
        {
            if (t != null)
            {
                return;
            }

            t = new Thread((o) =>
            {
                while (true)
                {
                    if (!m_IsPause)
                    {
                        BurrerData data = new BurrerData()
                        {
                            Data = index++
                        };
                        m_Buffer.WriteBuffer(data);
                        m_ViewModel.StartIndex = m_Buffer.GetStartIndex();
                        m_ViewModel.EndIndex   = m_Buffer.DataEnd;
                        m_ViewModel.DataCount  = m_Buffer.GetDataCount();
                    }


                    Thread.Sleep(100);
                }
            });
            t.Start();
        }
        public void WriteBuffer(BurrerData buffer)
        {
            if (DataEnd < Buffer.Length)            // 数据没到结尾
            {
                Buffer[DataEnd] = buffer;
                DataEnd        += 1;
                DataCount      += 1;
            }
            else           //  数据结束索引超出结尾 循环到开始
            {
                m_HaseRestart = true;
                System.Diagnostics.Debug.WriteLine("缓存重新开始....");

                DataEnd         = 0;
                Buffer[DataEnd] = buffer;
                DataEnd        += 1;
                DataCount      += 1;
            }
        }
 }                                  // 数据结束索引
 public RingBufferManager(int bufferSize)
 {
     DataCount = 0;
     DataEnd   = 0;
     Buffer    = new BurrerData[bufferSize];
 }