private void gf_CheckSerializer_Load(object sender, EventArgs e)
        {
            ////mSemaphore = new System.Threading.Semaphore(0, 1);

            //打开串口
            //mSpSlot = new Uart();
            //mSpSlot.loadConfig();
            //mSpSlot.open();

            mSpSlot = Uart.slot;//串口初始化

            //BarCode.BarCodeEvent += new BarCodeHook.BarCodeDelegate(BarCode_BarCodeEvent);

            //Protocol = new UartProtocol(mSpSlot.slot);//初始化uart对象
            Protocol = new UartProtocol(mSpSlot);//初始化uart对象

            richtxt_LincenseBoard.Enabled = false;
            richtxt_LincenseAdo.Enabled = false;
            richtxt_connect.Enabled = false;
            richtxt_Tips.Enabled = false;
            txt_CAID.Enabled = false;
            txt_STBID.Enabled = false;
            txt_SmartCardID.Enabled = false;

            #region 让文本框失去焦点
            richtxt_connect.TabStop = false;
            richtxt_Tips.TabStop = false;
            txt_CAID.TabStop = false;
            txt_SmartCardID.TabStop = false;
            txt_STBID.TabStop = false;
            richtxt_LincenseAdo.TabStop = false;
            richtxt_LincenseBoard.TabStop = false;
            btn_begin.TabStop=false;
            btn_deleteCheck.TabStop=false;
            #endregion

            btn_begin.Enabled = true;
            txt_ReceiveBarCode.Focus();
            //Control.CheckForIllegalCrossThreadCalls = false;
        }
        private void gf_RemoteFlashProtect_Load(object sender, EventArgs e)
        {
            mSpSlot = Uart.slot;
            Protocol = new UartProtocol(mSpSlot);//初始化uart对象

            btn_RemoteFlash.Focus();
            richtxt_info.Enabled = false;

            //timer1.Interval = 1000;
            //timer1.Enabled = false;

            btn_RemoteFlash.Enabled = true;

            //Control.CheckForIllegalCrossThreadCalls = false;//这个方法不推荐,目前暂时关闭(目的是解除界面假死)
        }
        private void gf_ReadChipID_Load(object sender, EventArgs e)
        {
            mSpSlot = Uart.slot;
            Protocol = new UartProtocol(mSpSlot);//初始化uart对象

            btn_ReadChipID.Focus();

            //timer1.Interval = 1000;
            //timer1.Enabled = false;

            btn_ReadChipID.Enabled = true;

            //Control.CheckForIllegalCrossThreadCalls = false;
        }
        private void gf_Serializer_Load(object sender, EventArgs e)
        {
            mSpSlot = Uart.slot;

            ////BarCode.BarCodeEvent += new BarCodeHook.BarCodeDelegate(BarCode_BarCodeEvent);

            //Protocol = new UartProtocol(mSpSlot.slot);//初始化uart对象
            Protocol = new UartProtocol(mSpSlot);//初始化uart对象

            richtxt_Connect.Enabled = false;
            richtxt_info.Enabled = false;
            txt_SerialID.Enabled = false;
            txt_CAID.Enabled = false;
            txt_ChipID.Enabled = false;
            txt_STBID.Enabled = false;
            richtxt_ManufacturerID.Enabled = false; richtxt_ModelID.Enabled = false; richtxt_HardwareID.Enabled = false;

            chkbox_FlashWP.Checked = false;
            chkbox_FlashWP.TabStop = false;

            #region 失去焦点
            btn_begin.TabStop = false;
            richtxt_Connect.TabStop = false;
            richtxt_info.TabStop = false;
            txt_SerialID.TabStop = false;
            txt_CAID.TabStop = false;
            txt_STBID.TabStop = false;
            txt_ChipID.TabStop = false;
            richtxt_ManufacturerID.TabStop = false;
            richtxt_ModelID.TabStop = false;
            richtxt_HardwareID.TabStop = false;
            #endregion

            initControl();
            btn_begin.Enabled = true;

            ////mSemaphore = new System.Threading.Semaphore(0, 1);

            //timer1.Interval = 1000;
            //timer1.Enabled = false;
            // Control.CheckForIllegalCrossThreadCalls = false;//这个方法不推荐,目前暂时关闭(目的是解除界面假死)
        }