예제 #1
0
 private void ReadingQueueDataPool(object _)
 {
     while (true)
     {
         while (renderDelayTime == -1)
         {
             Thread.Sleep(1);
         }
         byte[] disData = P543.GetAndReset();
         Dispatcher.Invoke(() =>
         {
             Print(disData);
         });
         Thread.Sleep(renderDelayTime);
     }
 }
예제 #2
0
        private void Print(byte[] disData)
        {
            // каждый разряд
            for (int i = 0; i < P543.TOTAL_DISCHARGE_COUNT; i++)
            {
                // каждый сегмент
                for (int j = discharges[i].Length - 1; j >= 0; j--)
                {
                    if (discharges[i][j] == null)
                    {
                        continue;
                    }

                    if (P543.IsBitSet(disData[i], j))
                    {
                        discharges[i][j].Show();
                    }
                    else
                    {
                        discharges[i][j].HideSmooth();
                    }
                }
            }
        }