예제 #1
0
        private void Reset()
        {
            Result rc = Result.OK;

            MessageWithGpioForm.LaunchForm(this);
            {
                EnableButton(ButtonState.ALL, false);
                Application.DoEvents();
RETRY:
                //Reset Reader first, it will shutdown current reader and restart reader
                //It will also reconfig back previous operation
                if ((rc = Program.ReaderXP.Reconnect(10)) == Result.OK)
                {
                    int retry = 10;
                    //Start inventory
                    Program.ReaderXP.SetOperationMode(RadioOperationMode.CONTINUOUS);
                    while (Program.ReaderXP.StartOperation(Operation.TAG_RANGING, false) != Result.OK)
                    {
                        if (retry-- == 0)
                        {
                            break;
                        }
                    }
                }
                else
                {
                    //if (ShowMsg(String.Format("ResetReader fail rc = {0}. Do you want to retry?", rc)) == DialogResult.Yes)
                    ShowMsg(String.Format("ResetReader fail rc = {0}. Do you want to retry?", rc));
                    goto RETRY;
                }
                EnableButton(ButtonState.ALL, true);
            }
            MessageWithGpioForm.msgform.CloseForm();
        }
예제 #2
0
        static void MsgThreadProc()
        {
            System.Diagnostics.Debug.WriteLine(String.Format("{0} is threadID {1}", System.Threading.Thread.CurrentThread.Name, System.Threading.Thread.CurrentThread.ManagedThreadId));
            msgform = new MessageWithGpioForm();

            msgform.StartPosition = FormStartPosition.CenterScreen;
            msgform.ShowInTaskbar = false;
            Application.Run(msgform);
            System.Diagnostics.Debug.WriteLine("ControlPanel Thread is exiting");
        }