Пример #1
0
        public void start()
        {
            CheckForIllegalCrossThreadCalls = false;
            if (rdr != null)
            {
                disconnect();
            }
            reader_ip = readerIPTextField.Text;
            connect();

            createServer();
            if (sendingThread == null)
            {
                sendingThread = new System.Threading.Thread(new System.Threading.ThreadStart(
                                                                () =>
                {
                    while (true)
                    {
                        if (running)
                        {
                            Thread.Sleep(Convert.ToInt16(textBox4.Text));
                            if (results.Count > 0)
                            {
                                RFIDResult result = results[0];
                                if (result != null)
                                {
                                    results.Remove(result);
                                    sendToClients(";" + result.makeMeAString() + "\n");
                                }
                            }
                        }
                        else
                        {
                            return;
                        }
                    }
                }
                                                                ));
                sendingThread.Start();
            }
        }
Пример #2
0
 private void OnTagsReported(ImpinjReader sender, TagReport report)
 {
     foreach (Tag tag in report)
     {
         if (results.Count == maxBufferSize)
         {
             results.RemoveAt(0);
         }
         RFIDResult r = new RFIDResult(sender.Name, seq++, mode, tag);
         r.AnalysisEPC();
         results.Add(r);
         if (logging)
         {
             log.WriteLine(r.makeMeAString());
         }
         if (InvokeRequired)
         {
             Invoke(new MethodInvoker(updateInterface));
         }
     }
 }
Пример #3
0
        public void start()
        {
            if (rdr != null)
            {
                disconnect();
            }
            reader_ip = readerIPTextField.Text;
            connect();

            createServer();
            if (sendingThread == null)
            {
                sendingThread = new System.Threading.Thread(new System.Threading.ThreadStart(
                                                                () =>
                {
                    while (true)
                    {
                        if (running)
                        {
                            if (results.Count > 0)
                            {
                                RFIDResult result = results[0];
                                if (result != null)
                                {
                                    results.Remove(result);
                                    sendToClients(";" + result.makeMeAString() + "\n");
                                }
                            }
                        }
                        else
                        {
                            return;
                        }
                    }
                }
                                                                ));
                sendingThread.Start();
            }
        }
Пример #4
0
        private void OnTagsReported(ImpinjReader sender, TagReport report)
        {
            foreach (Tag tag in report)
            {
                if (results.Count == maxBufferSize)
                {
                    RFIDResult temp;
                    while (!results.TryDequeue(out temp))
                    {
                        Thread.Sleep(100);
                    }
                }

                RFIDResult r = new RFIDResult(sender.Name, seq++, impinj_mode, tag);
                r.AnalysisEPC();
                results.Enqueue(r);
                if (logging)
                {
                    log.WriteLine(r.makeMeAString());
                }
                newResultEvent(this, EventArgs.Empty);
            }
        }