private void btnCashCodeReset_Click(object sender, EventArgs e) { StringBuilder msg = new StringBuilder(); int result = CashCodeImporter.Reset(msg); this.lbCashCodeHint.Text = "复位纸币识别器返回code:" + result + "返回msg:" + msg; }
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); } }
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 + "元现金!"; } } }
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); } }
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(); }