Пример #1
0
        // This method takes new data from the camera and inserts it, with proper timing, into the queue to be processed by the consumerd
        // the data consumer delegate that processes and displays the data
        public void onNewData(ushort[] data)
        {
            int i;
            int curFrame;

            Frameco++;
            if (quittingBool)
            {
                return;
            }
            curFrame = currentData.AddData(data, Frameco); // Returns the number of frames in the RawData object
            if (curFrame == bufferSize)
            {
                try
                {
                    for (i = 0; i < consumerd.Length; i++)
                    {
                        lock (((ICollection)consumerd[i].myQueue).SyncRoot)
                        {
                            consumerd[i].myQueue.Enqueue(currentData);
                        }
                        consumerd[i].mySyncEvent.NewItemEvent.Set();
                    }
                }
                catch (System.Threading.ThreadAbortException) { }
                catch (Exception ex)
                {
                    EmailError.emailAlert(ex);
                    throw (ex);
                }
                currentData = new RawData(bufferSize);
            }
        }