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 +++++++++++++++++++++--------
 Properties/AssemblyInfo.cs |    4 ++--
 CarrierBarcodeCtrl.cs      |    4 ++++
 3 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/CarrierBarcodeCtrl.cs b/CarrierBarcodeCtrl.cs
index aaa1b0f..5b19a09 100644
--- a/CarrierBarcodeCtrl.cs
+++ b/CarrierBarcodeCtrl.cs
@@ -6,6 +6,7 @@
 using System.Linq;
 using System.Text;
 using System.Windows.Forms;
+using System.Diagnostics;
 
 namespace M423project
 {
@@ -92,9 +93,12 @@
             }
             else
             {
+                Trace.TraceInformation($"鎵爜杈撳叆锛歿temp}");
                 if (temp.Length == 13)
                 {
                     CarrierBarcode = temp;
+                    Trace.TraceInformation($"鏉$爜杈撳叆淇℃伅锛歿temp}");
+
                     temp = "";
                 }
             }
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;
diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs
index 1e323d3..05da3ed 100644
--- a/Properties/AssemblyInfo.cs
+++ b/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // 鍙互鎸囧畾鎵�鏈夎繖浜涘�硷紝涔熷彲浠ヤ娇鐢ㄢ�滃唴閮ㄧ増鏈彿鈥濆拰鈥滀慨璁㈠彿鈥濈殑榛樿鍊硷紝
 // 鏂规硶鏄寜濡備笅鎵�绀轰娇鐢ㄢ��*鈥�:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.3.0")]
-[assembly: AssemblyFileVersion("1.0.3.0")]
+[assembly: AssemblyVersion("1.0.4.0")]
+[assembly: AssemblyFileVersion("1.0.4.0")]

--
Gitblit v1.8.0