瀏覽代碼

防呆功能:防止同一个SN下载的Key使用到2台机器上,当员工误操作时极有可能出现这种现象。

JeffWang 2 年之前
父節點
當前提交
58a846b98e

+ 2 - 0
FactoryTool_CShare/Models/StructList.cs

@@ -246,6 +246,8 @@ namespace MOKA_Factory_Tools
         #endregion
         // 抄写结束时,是否触发离开工厂模式指令;
         public bool LeaveFactory { get; set; } = false;
+        // 当SN连接2次抄写时提示,主要防止一个SN被扫描在2台机器上;
+        public bool SNDoubleTips { get; set; } = false;
     }
 
     public enum KEY_FROM

+ 1 - 0
FactoryTool_CShare/Views/Main.cs

@@ -708,6 +708,7 @@ namespace MOKA_Factory_Tools
                 functionSetting1.GFoolProofingCount = jObject["GFoolProofingCount"] == null ? 2 : jObject["GFoolProofingCount"].Value<int>();
 
                 functionSetting1.LeaveFactory = jObject["LeaveFactory"] == null ? false : jObject["LeaveFactory"].Value<bool>();
+                functionSetting1.SNDoubleTips = jObject["SNDoubleTips"] == null ? false : jObject["SNDoubleTips"].Value<bool>();
 
                 // 导出日规acas与sn;
                 if (jObject["ExportSNACASID"] == null)

+ 17 - 0
FactoryTool_CShare/Views/OperationPanel.cs

@@ -829,6 +829,23 @@ namespace MOKA_Factory_Tools
                         SNText.Text = "";
                         return;
                     }
+                } 
+                else if ( FunctionSettingNow.SNDoubleTips )
+                {
+                    StringBuilder strValue = new StringBuilder(256);
+                    // 获取上一次的SN号;
+                    CommonMethod.GetProfileString("MOKAFactoryTools", "LastSN", "", strValue, 256);
+                    if (strValue.ToString().Equals(SN, StringComparison.OrdinalIgnoreCase))
+                    {
+                        if ( MessageBox.Show("该SN已连续使用两次,可能误用到其他机器,请确认是否继续", "提示", MessageBoxButtons.YesNo) != System.Windows.Forms.DialogResult.Yes)
+                        {
+                            SNText.Enabled = true;
+                            SNText.Text = "";
+                            return;
+                        }
+                    }
+
+                    CommonMethod.WriteProfileString("MOKAFactoryTools", "LastSN", SN);
                 }
                 #endregion