Ejemplo n.º 1
0
        public virtual void ReadEPCsFromReader()
        {
            string MethodeName = MethodBase.GetCurrentMethod().ToString();

            try
            {
                FormCzasPomiaru czas = new FormCzasPomiaru();
                czas.Visible = true;
                while (!FormCzasPomiaru.CzytajCzas())
                {
                    Application.DoEvents();
                }
                ArrayList alp = new ArrayList();
                alp = Czytaj();
//               alp = ListReadEPCs(); //przekazanie listy odczytanych etykiet
                if (alp == null)
                {
                    String kp = "Nie odczytano żadnej etykiety";
                    MessageBox.Show(kp);
                    return;
                }
                lst.Visible = true;
                foreach (Object ob in alp)
                {
                    lst.AddEPCToList(ob.ToString()); //ukazanie odczytanych etykiet w oknie
                }
                lst.Refresh();
            }
            catch (IdReaderException eId)
            {
                MessageBox.Show("Wyjątek", "Brak połączenia z IdReaderem");
                //                 log.Fatal(eId.Message);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Wyjątek", ex.Message);
                //                  log.Fatal(ex.Message);
            }
        }
        public override void ReadEPCsFromReader()
        {
            string    MethodeName = MethodBase.GetCurrentMethod().ToString();
            ArrayList alp         = new ArrayList();

            try
            {
                while (/*true*/ inwentaryzacja)
                {
                    alp = Czytaj();
                    if (alp == null)
                    {
                        String kp = "Nie odczytano żadnej etykiety";
                        MessageBox.Show(kp);
                        return;
                    }
                    lst.Visible = true;
                    foreach (Object ob in alp)
                    {
                        lst.AddEPCToList(ob.ToString());     //ukazanie odczytanych etykiet w oknie
                    }
                    lst.Refresh();
                    alp.Clear();
                    Application.DoEvents();
                }
            }
            catch (IdReaderException eId)
            {
                MessageBox.Show("Wyjątek", "Brak połączenia z IdReaderem");
                //                 log.Fatal(eId.Message);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Wyjątek", ex.Message);
                //                  log.Fatal(ex.Message);
            }
        }