Пример #1
0
        /// <summary>
        /// Handles the NXPAlarmStreamEvent event of the hNur control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="NurApi.NXPAlarmStreamEventArgs"/> instance containing the event data.</param>
        void hNur_NXPAlarmStreamEvent(object sender, NurApi.NXPAlarmStreamEventArgs e)
        {
            try
            {
                NurApi hNur = sender as NurApi;

                if (e.data.armed)
                {
                    NurApi.TagStorage inventoriedTags = hNur.GetTagStorage();
                    int numberOfNewTag = nxpTagListView.UpdateTagList(inventoriedTags);
                    //tagsFoundLabel.Text = string.Format("{0} Tags", inventoriedTags.Count);
                    //beeperInventory.Beep(numberOfNewTag);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), Program.appName);
            }

            // Restart if stopped by TimeLimit
            //if (e.data.stopped && continueInventory)
            //{
            //    hNur.StartInventoryStream();
            //}

            //Keepd device alive
            HHUtils.KeepDeviceAlive();
        }
Пример #2
0
        /// <summary>
        /// Handles the InventoryStreamEvent event of the NUR module.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="NurApi.InventoryStreamEventArgs" /> instance containing the event data.</param>
        private void hNur_InventoryStreamEvent(object sender, NurApi.InventoryStreamEventArgs e)
        {
            try
            {
                NurApi hNur = sender as NurApi;

                if (e.data.tagsAdded > 0)
                {
                    totalReads += e.data.tagsAdded;
                    NurApi.TagStorage inventoriedTags = hNur.GetTagStorage();
                    int numberOfNewTag = tagListBox.UpdateTagList(inventoriedTags);
                    beeperInventory.Beep(numberOfNewTag);
                    WriteLogToFile(inventoriedTags);
                    UpdateStatistics(inventoriedTags);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), Program.appName);
            }

            // Restart if stopped by TimeLimit
            if (e.data.stopped && continueInventory)
            {
                StartInventory(hNur);
            }

            //Keepd device alive
            HHUtils.KeepDeviceAlive();
        }
Пример #3
0
        /// <summary>
        /// Handles the InventoryStreamEvent event of the hNur control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="NurApi.InventoryStreamEventArgs"/> instance containing the event data.</param>
        void hNur_InventoryStreamEvent(object sender, NurApi.InventoryStreamEventArgs e)
        {
            try
            {
                NurApi hNur = sender as NurApi;

                if (e.data.tagsAdded > 0)
                {
                    NurApi.TagStorage inventoriedTags = hNur.GetTagStorage();
                    int numberOfNewTag = nxpTagListView.UpdateTagList(inventoriedTags);
                    //beeperInventory.Beep(numberOfNewTag);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), Program.appName);
            }

            // Restart if stopped by TimeLimit
            if (e.data.stopped && continueInventory)
            {
                StartPsfInventory();
            }

            //Keepd device alive
            HHUtils.KeepDeviceAlive();
        }
Пример #4
0
        /// <summary>
        /// Handles the Tick event of the updateTimer control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void updateTimer_Tick(object sender, EventArgs e)
        {
            //Keepd device alive
            HHUtils.KeepDeviceAlive();
            bool updateIndicators = false;

            SignalStrength.Signal signal = locatingSignal.GetSignal();
            bool inTheField = signal.scaledRssi > 0;

            if (updTxLevel != signal.txLevelReal)
            {
                // Update new Tx Level
                updateIndicators = true;
                txLevelTxt.Text  = String.Format("TX Level: {0}",
                                                 NurCapabilities.I.ConvertToString(NurApi.SETUP_TXLEVEL, signal.txLevelReal));
                updTxLevel = signal.txLevelReal;
            }

            if (updScaledRSSI != signal.scaledRssi)
            {
                // Update new RSSI Level
                updateIndicators = true;
                if (signal.scaledRssi > NOSIGNAL)
                {
                    rssiLevelTxt.Text = String.Format("RSSI: {0}% {1}dBm", signal.scaledRssi, signal.rssi);
                }
                else
                {
                    rssiLevelTxt.Text = "RSSI: no signal";
                }
                // Update indicators
                locatorBar.Value = signal.scaledRssi;
                updScaledRSSI    = signal.scaledRssi;
            }

            if (updateIndicators)
            {
                // Update indicators
                beeperLocator.Beep(signal.scaledRssi, inTheField != updInTheField);
                updInTheField = inTheField;
            }

            if (!IsRunning)
            {
                updateTimer.Enabled = false;
            }
        }