Ejemplo n.º 1
0
        private void UpdateReaderSettings()
        {
            System.Diagnostics.Debug.WriteLine("Updating Reader Settings... ");
            reader.ApplyDefaultSettings();

            settings = reader.QuerySettings();
            settings.Antennas.GetAntenna(1).IsEnabled          = true;
            settings.Antennas.GetAntenna(1).RxSensitivityInDbm = SolutionConstants.RxSensitivity;
            settings.Antennas.GetAntenna(1).TxPowerInDbm       = SolutionConstants.TxPower;

            settings.Report.IncludeAntennaPortNumber = true;
            settings.Report.IncludePeakRssi          = true;
            settings.Report.IncludeChannel           = true;
            settings.Report.IncludeCrc = true;
            settings.Report.IncludeDopplerFrequency = true;
            settings.Report.IncludeFastId           = true;
            settings.Report.IncludeFirstSeenTime    = true;
            settings.Report.IncludeGpsCoordinates   = true;
            settings.Report.IncludeLastSeenTime     = true;
            settings.Report.IncludePhaseAngle       = true;
            settings.Report.IncludeSeenCount        = true;
            settings.Report.Mode = ReportMode.Individual;

            reader.ApplySettings(settings);
        }
Ejemplo n.º 2
0
        static void DisplayCurrentSettings()
        {
            // Query the current reader settings and print the results.
            Console.WriteLine("Reader Settings");
            Console.WriteLine("---------------");

            Settings settings = reader.QuerySettings();

            Console.WriteLine("Reader mode : {0}", settings.ReaderMode);
            Console.WriteLine("Search mode : {0}", settings.SearchMode);
            Console.WriteLine("Session : {0}", settings.Session);

            if (settings.Antennas.GetAntenna(1).MaxRxSensitivity)
            {
                Console.WriteLine("Rx sensitivity (Antenna 1) : Max");
            }
            else
            {
                Console.WriteLine("Rx sensitivity (Antenna 1) : {0} dBm",
                                  settings.Antennas.GetAntenna(1).RxSensitivityInDbm);
            }

            if (settings.Antennas.GetAntenna(1).MaxTxPower)
            {
                Console.WriteLine("Tx power (Antenna 1) : Max");
            }
            else
            {
                Console.WriteLine("Tx power (Antenna 1) : {0} dBm",
                                  settings.Antennas.GetAntenna(1).TxPowerInDbm);
            }

            Console.WriteLine("");
        }
Ejemplo n.º 3
0
        public double UpdateSettings(ImpinjReader reader, double power, double stepSize)
        {
            Settings settings = reader.QuerySettings();

            settings.Antennas.TxPowerInDbm = power + stepSize;
            reader.ApplySettings(settings);
            Console.WriteLine("Power Level successfully changed");

            return(power + stepSize);
        }
Ejemplo n.º 4
0
        public Form1()
        {
            InitializeComponent();
            //Activamos el RFID como demo
            bool myResult = myReader.Activation("Demo");

            //Conectamos el RFID ME
            myReader.Connect("RFIDME");
            this.cbDispositivo.DropDownStyle = ComboBoxStyle.DropDownList;
            this.KeyPreview            = true;
            this.lboxLog.SelectionMode = SelectionMode.None;


            try
            {
                //Conectamos el Speedway
                reader.Connect(ReaderHostname);
                //Se aplican los valores por defecto al speedway
                reader.ApplyDefaultSettings();
                //Se inicia el speedway
                //reader.Start();
                //Instanciamos settings y le asignamos los settings actuales
                Settings settings = reader.QuerySettings();
                //Se agrega el número de puerto de antena al reporte
                settings.Report.IncludeAntennaPortNumber = true;
                //Se ajusta el modo de lectura al mas óptimo
                settings.ReaderMode = ReaderMode.AutoSetDenseReader;
                //Se captura el hostname en la caja de texto tbIPSpeedway
                tbIPSpeedway.Text = reader.Address;
            }
            catch
            {
                //En caso el speedway no esté conectado se muestra un mensaje
                MessageBox.Show("El speedway no está conectado");
            }
        }
Ejemplo n.º 5
0
        private void LoadSettings(string file = "settings.xml")
        {
            Settings rdr_settings = Settings.Load(file);

            try
            {
                rdr_settings.Antennas.DisableAll();
                //antenna = view.textBox1.Text;
                //string[] words = antenna.Split(' ');
                foreach (Antenna antenna in Antennas)
                {
                    rdr_settings.Antennas.GetAntenna(antenna.ID).IsEnabled        = antenna.enabled;
                    rdr_settings.Antennas.GetAntenna(antenna.ID).TxPowerInDbm     = antenna.power;
                    rdr_settings.Antennas.GetAntenna(antenna.ID).MaxRxSensitivity = antenna.maxSensitivity;
                }

                rdr_settings.ReaderMode = Mode;

                rdr_settings.Report.IncludeAntennaPortNumber = true;

                // Send a tag report for every tag read.
                rdr_settings.Report.Mode = ReportMode.Individual;

                if (Filter)
                {
                    rdr_settings.Filters.TagFilter1.MemoryBank = MemoryBank.Epc;

                    rdr_settings.Filters.TagFilter1.BitPointer = BitPointers.Epc;
                    // Only match tags with EPCs that start with "xxxx"
                    rdr_settings.Filters.TagFilter1.TagMask = TagMask;
                    // This filter is 16 bits long (one word).
                    //rdr_settings.Filters.TagFilter1.BitCount = 16;
                    rdr_settings.Filters.Mode = TagFilterMode.OnlyFilter1;
                }


                rdr.ApplySettings(rdr_settings);
                Console.WriteLine("Settings Applied");
                rdr_settings = rdr.QuerySettings();
                Console.WriteLine(rdr_settings.Report);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 6
0
        private void ReadTick(object data)
        {
            if (FlagFlight == 1)
            {
                if (!reader.IsConnected)
                {
                    try
                    {
                        reader.Connect(hostReader);
                        Settings settings = reader.QuerySettings();

                        settings.Report.IncludeAntennaPortNumber = true;

                        settings.ReaderMode = ReaderMode.AutoSetDenseReader;
                        settings.SearchMode = SearchMode.DualTarget;
                        settings.Session    = 2;

                        reader.ApplySettings(settings);
                        //reader.SaveSettings();

                        // Assign the TagsReported event handler.
                        // This specifies which method to call
                        // when tags reports are available.
                        reader.TagsReported += OnTagsReported;


                        // Start reading.
                        reader.Start();

                        label3.Invoke((MethodInvoker) delegate
                        {
                            label3.Text      = string.Empty;
                            label3.BackColor = System.Drawing.Color.White;
                        });

                        // Wait for the user to press enter.
                        //Console.WriteLine("Press enter to exit.");
                        //Console.ReadLine();

                        // Stop reading.
                        //reader.Stop();

                        // Disconnect from the reader.
                        //reader.Disconnect();
                    }
                    catch (Exception e)
                    {
                        label3.Invoke((MethodInvoker) delegate
                        {
                            label3.Text      = e.ToString();
                            label3.BackColor = System.Drawing.Color.Red;
                        });
                    }
                }
            }
            else
            {
                if (reader.IsConnected)
                {
                    reader.Stop();
                    reader.Disconnect();
                }
                TagsFlight.Clear();
                TagsNotFlightCart.Clear();
                TagsOnline.Clear();
                TagsOnlineCart.Clear();
                TagsBad.Clear();
                TagsMonitor.Clear();
                TagsMonitorNew.Clear();
            }
        }
Ejemplo n.º 7
0
        private void ReadSettingsFromFile()
        {
            Settings rdr_settings = Settings.Load("settings.xml");

            try
            {
                rdr_settings.Antennas.DisableAll();
                antenna = textBox1.Text;
                string[] words = antenna.Split(' ');
                foreach (string word in words)
                {
                    rdr_settings.Antennas.GetAntenna(Convert.ToUInt16(word)).IsEnabled        = true;
                    rdr_settings.Antennas.GetAntenna(Convert.ToUInt16(word)).TxPowerInDbm     = Convert.ToInt16(textBox2.Text);
                    rdr_settings.Antennas.GetAntenna(Convert.ToUInt16(word)).MaxRxSensitivity = true;
                    if (Convert.ToInt16(textBox5.Text) == 1)
                    {
                        rdr_settings.ReaderMode = ReaderMode.MaxThroughput;
                    }
                    else if (Convert.ToInt16(textBox5.Text) == 2)
                    {
                        rdr_settings.ReaderMode = ReaderMode.Hybrid;
                    }
                    else if (Convert.ToInt16(textBox5.Text) == 3)
                    {
                        rdr_settings.ReaderMode = ReaderMode.DenseReaderM4;
                    }
                    else if (Convert.ToInt16(textBox5.Text) == 4)
                    {
                        rdr_settings.ReaderMode = ReaderMode.DenseReaderM8;
                    }

                    //rdr_settings.Antennas.GetAntenna(Convert.ToUInt16(word)).MaxTxPower = true;
                }

                rdr_settings.Report.IncludeAntennaPortNumber = true;

                // Send a tag report for every tag read.
                rdr_settings.Report.Mode = ReportMode.Individual;

                if (checkBox1.Checked)
                {
                    rdr_settings.Filters.TagFilter1.MemoryBank = MemoryBank.Epc;

                    rdr_settings.Filters.TagFilter1.BitPointer = BitPointers.Epc;
                    // Only match tags with EPCs that start with "xxxx"
                    rdr_settings.Filters.TagFilter1.TagMask = textBox3.Text;
                    // This filter is 16 bits long (one word).
                    //rdr_settings.Filters.TagFilter1.BitCount = 16;
                    rdr_settings.Filters.Mode = TagFilterMode.OnlyFilter1;
                }


                rdr.ApplySettings(rdr_settings);
                Console.WriteLine("Settings Applied");
                rdr_settings = rdr.QuerySettings();
                Console.WriteLine(rdr_settings.Report);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 8
0
        private void ReadSettingsFromFile()
        {
            //System.Xml.Serialization.XmlSerializer reader =
            //    new System.Xml.Serialization.XmlSerializer(typeof(Settings));
            //System.IO.StreamReader file = new System.IO.StreamReader(
            //    "settings.xml");
            //rdr_settings = (Settings)reader.Deserialize(file);

            Settings rdr_settings = Settings.Load("settings.xml");

            try
            {
                //foreach (AntennaConfig a in rdr_settings.Antennas)
                //{
                //    a.IsEnabled = true;
                //}


                rdr_settings.Antennas.DisableAll();
                antenna = textBox1.Text;
                string[] words = antenna.Split(' ');
                foreach (string word in words)
                {
                    rdr_settings.Antennas.GetAntenna(Convert.ToUInt16(word)).IsEnabled        = true;
                    rdr_settings.Antennas.GetAntenna(Convert.ToUInt16(word)).TxPowerInDbm     = Convert.ToInt16(textBox2.Text);
                    rdr_settings.Antennas.GetAntenna(Convert.ToUInt16(word)).MaxRxSensitivity = true;
                }

                // Set the Transmit Power and
                // Receive Sensitivity to the maximum.

                //rdr_settings.Report.IncludeAntennaPortNumber = true;
                //rdr_settings.Report.IncludePhaseAngle = true;
                //rdr_settings.Report.IncludePeakRssi = true;
                //rdr_settings.Report.IncludeFirstSeenTime = true;
                //rdr_settings.Report.IncludeChannel = true;
                //rdr_settings.Report.IncludeDopplerFrequency = true;

                //rdr_settings.ReaderMode = ReaderMode.MaxThroughput;
                //rdr_settings.SearchMode = SearchMode.DualTarget;


                // Tell the reader to include the antenna number
                // in all tag reports. Other fields can be added
                // to the reports in the same way by setting the
                // appropriate Report.IncludeXXXXXXX property.
                rdr_settings.Report.IncludeAntennaPortNumber = true;

                // Send a tag report for every tag read.
                rdr_settings.Report.Mode = ReportMode.Individual;

                if (checkBox1.Checked)
                {
                    // Setup a tag filter.
                    // Only the tags that match this filter will respond.
                    // First, setup tag filter #1.
                    // We want to apply the filter to the EPC memory bank.
                    rdr_settings.Filters.TagFilter1.MemoryBank = MemoryBank.Epc;
                    // Start matching at the third word (bit 32), since the
                    // first two words of the EPC memory bank are the
                    // CRC and control bits. BitPointers.Epc is a helper
                    // enumeration you can use, so you don't have to remember this.
                    rdr_settings.Filters.TagFilter1.BitPointer = BitPointers.Epc;
                    // Only match tags with EPCs that start with "xxxx"
                    rdr_settings.Filters.TagFilter1.TagMask = textBox3.Text;
                    // This filter is 16 bits long (one word).
                    //rdr_settings.Filters.TagFilter1.BitCount = 16;
                    rdr_settings.Filters.Mode = TagFilterMode.OnlyFilter1;
                }


                rdr.ApplySettings(rdr_settings);
                Console.WriteLine("Settings Applied");
                rdr_settings = rdr.QuerySettings();
                Console.WriteLine(rdr_settings.Report);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }