From 220f43bdfb1e1d1544c892697304f99e967103a4 Mon Sep 17 00:00:00 2001 From: patrick.xu <patrick.xu@broconcentric.com> Date: 星期一, 22 十一月 2021 08:42:14 +0800 Subject: [PATCH] 1. 添加了扫码键盘事件的日志记录,版本号升级到1.0.4.0 --- MainForm.cs | 29 +++++++++++++++++++++-------- 1 files changed, 21 insertions(+), 8 deletions(-) diff --git a/MainForm.cs b/MainForm.cs index 9355a5c..3c791e3 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -137,6 +137,8 @@ this.KeyPreview = true; this.KeyPress += MainForm_KeyPress; + Trace.TraceInformation("閿洏浜嬩欢宸插姞杞�"); + hcXyView.Focus(); } @@ -144,16 +146,28 @@ CarrierBarcodeCtrl cBarcodeCtrl = null; private void MainForm_KeyPress(object sender, KeyPressEventArgs e) { - if (e.KeyChar == 27) + try { - hcXyView.Focus(); - } - else - { - if (allowBarcodeFlag) + if (e.KeyChar == 27) { - cBarcodeCtrl.AddChar(e.KeyChar); + hcXyView.Focus(); } + else + { + if (allowBarcodeFlag) + { + Trace.TraceInformation($"閿洏杈撳叆锛歿e.KeyChar}"); + cBarcodeCtrl.AddChar(e.KeyChar); + } + else + { + Trace.TraceInformation($"褰撳墠涓嶅厑璁告寜閿緭鍏ワ細{e.KeyChar}"); + } + } + } + catch (Exception ex) + { + Trace.TraceError($"閿洏浜嬩欢寮傚父锛歿ex.Message}"); } } #endregion @@ -946,7 +960,6 @@ if ((bool)item.value) { //opc.Write(OPCInputTag.UnloadTrayReady, false); - allowBarcodeFlag = false; } break; -- Gitblit v1.8.0