예제 #1
0
        private void btnCashCodeReset_Click(object sender, EventArgs e)
        {
            StringBuilder msg    = new StringBuilder();
            int           result = CashCodeImporter.Reset(msg);

            this.lbCashCodeHint.Text = "复位纸币识别器返回code:" + result + "返回msg:" + msg;
        }
예제 #2
0
        private void btnCashCodeOpenDevice_Click(object sender, EventArgs e)
        {
            StringBuilder msg = new StringBuilder();
            int           i   = CashCodeImporter.OpenDevice(Convert.ToInt32(this.txtCashCodePort.Text.Trim()), msg);

            this.lbCashCodeHint.Text = "打开设备返回code:" + i + "返回msg:" + msg;
            if (i == 0)
            {
                this.SetCashCode(true);
            }
        }
예제 #3
0
        private void IdentifyMoney()
        {
            int           result = 0;
            StringBuilder msg    = new StringBuilder();

            while (AllowAcceptMoney)
            {
                result = CashCodeImporter.IdentifyV2(100, msg);
                if (result > 0)
                {
                    this.txtCashCodeResult.Text += "\r\n" + "收到" + result + "元现金!";
                }
            }
        }
예제 #4
0
        private void btnCashCodeCloseDevice_Click(object sender, EventArgs e)
        {
            StringBuilder msg = new StringBuilder();

            this.AllowAcceptMoney = false;
            CashCodeImporter.StopIdentify(msg);
            int i = CashCodeImporter.CloseDevice(msg);

            this.lbCashCodeHint.Text = "关闭设备返回code:" + i + "返回msg:" + msg;
            if (i == 0)
            {
                this.SetCashCode(false);
            }
        }
예제 #5
0
        private void btnCashCodeIdentify_Click(object sender, EventArgs e)
        {
            StringBuilder msg    = new StringBuilder();
            int           result = CashCodeImporter.StartIdentifyV2("", "", this.GetCashCodeSetting(), msg);

            this.lbCashCodeHint.Text = "准备投币返回code:" + result + "返回msg:" + msg;
            this.AllowAcceptMoney    = true;
            ThreadExecutor thread = new ThreadExecutor(IdentifyMoney);

            thread.BeginInvoke(null, null);

            //Thread thread = new Thread();
            // thread.IsBackground = true;
            // thread.Start();
        }