Beispiel #1
0
        /********************************************************************************************************/
        // DEVICE ARTIFACTS
        /********************************************************************************************************/
        #region -- device artifacts --
        private void SetConfiguration()
        {
            Debug.WriteLine("main: update GUI elements =========================================================");

            try
            {
                string[] config = devicePlugin.GetConfig();

                if (config != null)
                {
                    // value expected: either dashed or space separated
                    if (config[1] != null)
                    {
                        this.lblFirmwareVersion.Text      = config[1];
                        this.btnFirmwareUpdate.Enabled    = true;
                        this.btnFirmwareUpdate.Visible    = true;
                        this.FirmwareprogressBar1.Visible = false;
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.error("main: SetConfiguration() exception={0}", (object)ex.Message);
            }
        }
        /********************************************************************************************************/
        // DEVICE ARTIFACTS
        /********************************************************************************************************/
        #region -- device artifacts --

        private void SetConfiguration()
        {
            Debug.WriteLine("main: update GUI elements =========================================================");

            this.lblSerialNumber.Text    = "";
            this.lblFirmwareVersion.Text = "";
            this.lblModelName.Text       = "";
            this.lblModelNumber.Text     = "";
            this.lblPort.Text            = "";
            this.txtCardData.Text        = "";

            string[] config = devicePlugin.GetConfig();

            if (config != null)
            {
                this.lblSerialNumber.Text    = config[0];
                this.lblFirmwareVersion.Text = config[1];
                this.lblModelName.Text       = config[2];
                this.lblModelNumber.Text     = config[3];
                this.lblPort.Text            = config[4];
            }

            // Enable Buttons
            this.btnCardRead.Enabled = (dev_usb_mode == DEV_USB_MODE.USB_HID_MODE) ? true : false;

            // Enable Tab(s)
            this.tabPage1.Enabled         = true;
            this.tabPage2.Enabled         = tc_show_settings_tab;
            this.tabPage3.Enabled         = tc_show_configuration_tab;
            this.tabPage4.Enabled         = tc_show_raw_mode_tab;
            this.picBoxConfigWait.Visible = false;
            this.picBoxJsonWait.Visible   = false;


            // KB Mode
            if (dev_usb_mode == DEV_USB_MODE.USB_KYB_MODE)
            {
                this.txtCardData.ReadOnly  = false;
                this.txtCardData.GotFocus += CardDataTextBoxGotFocus;
                this.txtCardData.ForeColor = this.txtCardData.BackColor;

                stopWatch = new Stopwatch();
                stopWatch.Start();

                // Transaction Timer
                SetTransactionTimer();

                this.Invoke(new MethodInvoker(() =>
                {
                    this.txtCardData.Focus();
                }));
            }
            else
            {
                TransactionTimer?.Stop();
                this.txtCardData.ForeColor = TEXTBOX_FORE_COLOR;
                this.txtCardData.ReadOnly  = true;
                this.txtCardData.GotFocus -= CardDataTextBoxGotFocus;
            }
        }