patrick.xu
2021-11-22 220f43bdfb1e1d1544c892697304f99e967103a4
1. 添加了扫码键盘事件的日志记录,版本号升级到1.0.4.0
3个文件已修改
37 ■■■■ 已修改文件
CarrierBarcodeCtrl.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MainForm.cs 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Properties/AssemblyInfo.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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 = "";
                }
            }
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;
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")]