コード例 #1
0
        private void Button_Identify_Click(object sender, RoutedEventArgs e)
        {
            //Identify --> Search for transponders
            comboBox_TagID.IsEnabled = false;
            comboBox_TagID.Items.Clear();

            if (m_DocInterface != null)
            {
                if (m_DocInterface.IsInitialized)
                {
                    //This function starts the "Identify" process in a new thread, and reports the result using "DocResultChanged" Event

                    /*
                     * Parameters:
                     *  _repeatCount --> number of times "Identify" will be executed internally
                     *  _delayBetweenSearchMs --> number of milliseconds to wait between internal calls to "Identify"
                     *  _notifySuccessOnly --> if true, "DocResultChanged" Event will only be raised by success on internal "Identify" calls
                     */
                    m_DocInterface.StartIdentify(5, 0, false);
                    textBox_ThreadLog.Text += "\n = StartIdentify =\n";
                    textBox_ThreadLog.ScrollToEnd();
                    progressBar.IsIndeterminate = true;
                    mLastDocResultTimestamp     = DateTime.Now;
                }
            }
        }
コード例 #2
0
 private static void Console_Execute_Identify(DocInterfaceControl _docIntControl)
 {
     m_LastTagID = null;
     //First make sure DocInterfaceControl is initialized
     if (_docIntControl != null)
     {
         if (_docIntControl.IsInitialized)
         {
             Console.WriteLine("");
             docOperationCompleted = false;
             //Start "Identify" process
             //  RepeatCount --> 5 (search for transponder 5 times)
             //  DelayBetweenSearchs --> 0 (ms to wait between each search)
             //  NotifySuccessOnly --> false (raise "DocResultChanged" event even if no transponder found)
             _docIntControl.StartIdentify(5, 0, false);
             //For demo purposes, just wait blocking execution until DOC process is completed (notified using "DocResultChanged" event, ProcessFinished = true)
             while (!docOperationCompleted)
             {
                 Thread.Sleep(100);
             }
             Console.WriteLine("");
         }
         else
         {
             Console.WriteLine("DocInterfaceControl not initialized!");
         }
     }
 }