Пример #1
0
        public override void HandleMsg(string msg)
        {
            // optional predicate for "termSig" message
            // predicate string is displayed on sig capture screen
            if (msg.Length > 7 && msg.Substring(0, 7) == "termSig")
            {
                //sig_message = msg.Substring(7);
                msg = "termSig";
            }
            switch (msg)
            {
            case "termReboot":
                lock (pdcLock) {
                    if (!pdc_active)
                    {
                        if (rba != null)
                        {
                            rba.hardReset();
                        }
                        ax_control = null;
                        initDevice();
                    }
                }
                break;

            case "termReset":
                if (rba != null)
                {
                    rba.stubStop();
                }
                initDevice();
                break;

            case "termManual":
                break;

            case "termApproved":
                if (rba != null)
                {
                    rba.showMessage("Approved");
                }
                break;

            case "termDeclined":
                if (rba != null)
                {
                    rba.showMessage("Declined");
                }
                break;

            case "termError":
                if (rba != null)
                {
                    rba.showMessage("Error");
                }
                break;

            case "termSig":
                if (rba != null)
                {
                    rba.stubStop();
                }
                GetSignature();
                break;

            case "termGetType":
                break;

            case "termGetTypeWithFS":
                break;

            case "termGetPin":
                break;

            case "termWait":
                break;

            case "termFindPort":
                var new_port = this.PortSearch(this.device_identifier);
                if (new_port != "" && new_port != this.com_port && new_port.All(char.IsNumber))
                {
                    this.com_port = new_port;
                }
                break;
            }
        }