Ejemplo n.º 1
0
        public void TagQueried(AW_API_NET.rfTagEvent_t tagEvent)
        {
#if DEBUG
#if TRACE
            Console.WriteLine("Tag queried event fired");
#endif
#endif
        }
Ejemplo n.º 2
0
        public void TagDetectedSani(AW_API_NET.rfTagEvent_t tagEvent)
        {
#if DEBUG
#if TRACE
            Console.WriteLine("Tag detected with Sani event fired");
#endif
#endif
            lock (CommunicationClass.commLock)
            {
                if (AppTagDetectedSaniEventHandler != null)
                {
                    AppTagDetectedSaniEventHandler(tagEvent);
                }
            }
        }
Ejemplo n.º 3
0
 private void UpdateRSSIList(AW_API_NET.rfTagEvent_t tagEvent)
 {
     //rssiControl1.DisplayRSSI(tagEvent);
 }
Ejemplo n.º 4
0
        public void DisplayRSSI(AW_API_NET.rfTagEvent_t tagEvent)
        {
            //get reader id
            //get rssi
            //get index of the reader on the list
            //get the rssi from the list
            //Console.WriteLine("TagID = " + tagEvent.tag.id.ToString());
            //Console.WriteLine("TextTagID = " + TagTextBox.Text.ToString());
            //Console.WriteLine("Tag Type = " + TagTypeComboBox.Text.ToString());

            Console.WriteLine("TagID = " + tagEvent.tag.id.ToString() + "  RSSI = " + tagEvent.RSSI.ToString());

            if ((TagTextBox.Text.Length > 0) && (TagTypeComboBox.Text.Length > 0))
            {
                if (tagEvent.tag.id.ToString() != TagTextBox.Text.ToString())
                {
                    return;
                }
                else
                {
                    switch (tagEvent.tag.tagType)
                    {
                    case 1:      //access
                        if (TagTypeComboBox.Text.ToString() != "ACC")
                        {
                            return;
                        }
                        break;

                    case 2:                              //inventory
                        if (TagTypeComboBox.Text.ToString() != "INV")
                        {
                            return;
                        }
                        break;

                    case 3:                              //asset
                        if (TagTypeComboBox.Text.ToString() != "AST")
                        {
                            return;
                        }
                        break;

                    default:
                        return;

                        break;
                    }     //switch
                }         //if id not match
            }             //if no id
            else
            {
                return;
            }

            int index = 0;

            try
            {
                short threshold = GetThreshold(tagEvent.reader, out index);
                if (index >= 0)
                {
                    RSSIListView.Items[index].BackColor = System.Drawing.Color.LightYellow;
                    //Console.WriteLine("TEST 01 - List GC = " + RSSIListView.Items[index].SubItems[6].Text.ToString());
                    Console.WriteLine("TEST 02 - ID = " + tagEvent.tag.id.ToString() + "  Tag GC = " + tagEvent.tag.groupCount.ToString() + "  GC List = " + RSSIListView.Items[index].SubItems[6].Text.ToString());
                    //if new group ID
                    if ((RSSIListView.Items[index].SubItems[6].Text.ToString() == "2") ||
                        (RSSIListView.Items[index].SubItems[6].Text.ToString() != tagEvent.tag.groupCount.ToString()))
                    {
                        summary[index].numRuns += 1;
                        summary[index].numRead += 1;
                        summary[index].rssi    += Convert.ToUInt64(tagEvent.RSSI);

                        if (tagEvent.RSSI >= threshold)
                        {
                            RSSIListView.Items[index].SubItems[4].Text = "PASS";
                            summary[index].numPass += 1;
                            if (summary[index].highRSSI < tagEvent.RSSI)
                            {
                                summary[index].highRSSI = tagEvent.RSSI;
                            }
                        }
                        else
                        {
                            RSSIListView.Items[index].SubItems[4].Text = "FAIL";
                            if (summary[index].lowRSSI > tagEvent.RSSI)
                            {
                                summary[index].lowRSSI = tagEvent.RSSI;
                            }
                        }

                        RSSIListView.Items[index].SubItems[6].Text      = tagEvent.tag.groupCount.ToString();
                        RSSIListView.Items[index].SubItems[4].ForeColor = System.Drawing.Color.DarkGreen;
                        RSSIListView.Items[index].SubItems[2].Text      = Convert.ToString(tagEvent.RSSI);
                        ProgressBar pb = new ProgressBar();
                        pb       = (ProgressBar)RSSIListView.GetEmbeddedControl(2, index);
                        pb.Value = Convert.ToInt32(tagEvent.RSSI);
                    }
                    else
                    {
                        // same group id
                        //Console.WriteLine("TEST 03 - Tag GC = " + tagEvent.tag.groupCount.ToString());
                        //Console.WriteLine("TEST 04 - LIST GC = " + RSSIListView.Items[index].SubItems[6].Text.ToString());
                        Console.WriteLine("TEST 03 - ID = " + tagEvent.tag.id.ToString() + "  Tag GC = " + tagEvent.tag.groupCount.ToString() + "  GC List = " + RSSIListView.Items[index].SubItems[6].Text.ToString());
                        if (RSSIListView.Items[index].SubItems[6].Text.ToString() == tagEvent.tag.groupCount.ToString())
                        {
                            //Console.WriteLine("TEST 05 - Pass/Fail = " + RSSIListView.Items[index].SubItems[4].Text.ToString());

                            summary[index].numRead += 1;
                            summary[index].rssi    += Convert.ToUInt64(tagEvent.RSSI);

                            if (RSSIListView.Items[index].SubItems[4].Text.ToString() == "FAIL")
                            {
                                if (tagEvent.RSSI >= threshold)
                                {
                                    RSSIListView.Items[index].SubItems[4].Text = "PASS";

                                    //RSSIListView.Items[index].SubItems[4].Text = "PASS";
                                    RSSIListView.Items[index].SubItems[4].ForeColor = System.Drawing.Color.DarkGreen;
                                    RSSIListView.Items[index].SubItems[2].Text      = Convert.ToString(tagEvent.RSSI);
                                    ProgressBar pb = new ProgressBar();
                                    pb       = (ProgressBar)RSSIListView.GetEmbeddedControl(2, index);
                                    pb.Value = Convert.ToInt32(tagEvent.RSSI);

                                    summary[index].numPass += 1;
                                    if (summary[index].highRSSI < tagEvent.RSSI)
                                    {
                                        summary[index].highRSSI = tagEvent.RSSI;
                                    }
                                }
                                else
                                {
                                    if (summary[index].lowRSSI > tagEvent.RSSI)
                                    {
                                        summary[index].lowRSSI = tagEvent.RSSI;
                                    }
                                }
                            }
                            else                             //pass
                            {
                                if (tagEvent.RSSI >= threshold)
                                {
                                    RSSIListView.Items[index].SubItems[4].ForeColor = System.Drawing.Color.DarkGreen;
                                    RSSIListView.Items[index].SubItems[2].Text      = Convert.ToString(tagEvent.RSSI);
                                    ProgressBar pb = new ProgressBar();
                                    pb       = (ProgressBar)RSSIListView.GetEmbeddedControl(2, index);
                                    pb.Value = Convert.ToInt32(tagEvent.RSSI);
                                    if (summary[index].highRSSI < tagEvent.RSSI)
                                    {
                                        summary[index].highRSSI = tagEvent.RSSI;
                                    }
                                }
                                else
                                {
                                    if (summary[index].lowRSSI > tagEvent.RSSI)
                                    {
                                        summary[index].lowRSSI = tagEvent.RSSI;
                                    }
                                }
                            } //pass
                        }     //same GID
                    }         //else
                }             //index
            }                 //try
            catch (Exception ex)
            {
                Console.WriteLine("Setting PASS /FAIL Failed");
            }



            /*if (RSSIListView.Items[index].SubItems[4].Text.ToString() == "FAIL")
             * {
             *      RSSIListView.Items[index].SubItems[6].Text = tagEvent.tag.groupCount.ToString();
             *      RSSIListView.Items[index].SubItems[4].Text = "PASS";
             *      RSSIListView.Items[index].SubItems[4].ForeColor = System.Drawing.Color.DarkGreen;
             *      RSSIListView.Items[index].SubItems[2].Text = Convert.ToString(tagEvent.RSSI);
             *      ProgressBar pb = new ProgressBar();
             *      pb = (ProgressBar)RSSIListView.GetEmbeddedControl(2, index);
             *      pb.Value = Convert.ToInt32(tagEvent.RSSI);
             * }
             * }
             *                          }
             *                          catch (Exception ex)
             *                          {
             *           Console.WriteLine("Setting PASS /FAIL Failed");
             *                          }
             *                  }
             *          }*/

            //compare two rssi
            //display rssi pass/fail
            //calculate the sumary
            //dislay the summery
        }