Browse Source

1、EDID抄写时,GetProjectID去掉3秒停顿;2、NTF功能不以惠州账号来启动,而是以Config.Json配置项启动。

sat23 3 years ago
parent
commit
2d6ab1d3d1
3 changed files with 15 additions and 12 deletions
  1. 3 2
      IO/SerialCMD.cs
  2. 6 3
      Views/Main.cs
  3. 6 7
      Views/OperationPanel.cs

+ 3 - 2
IO/SerialCMD.cs

@@ -1,4 +1,5 @@
 using System;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -78,9 +79,9 @@ namespace MOKA_Factory_Tools
         /// <param name="data"></param>
         /// <param name="error"></param>
         /// <returns></returns>
-        public static bool GetProjectID(SerialPort Comport, out byte[] result, out byte[] data, out string error,int waitTime)
+        public static bool GetProjectID(SerialPort Comport, out byte[] result, out byte[] data, out string error,int waitTime, bool WriteEDID=false)
         {
-            Thread.Sleep(3000);
+            if (!WriteEDID) Thread.Sleep(3000);
             return Sendcmd(Comport, new byte[] { 0xAA }, new byte[] { 0x84 }, new byte[] { 0x00 }, true, false, out result, out data, out error, waitTime);
         }
 

+ 6 - 3
Views/Main.cs

@@ -82,10 +82,13 @@ namespace MOKA_Factory_Tools
         private void SetDSNLimit()
         {
             #region 试产订单,不需要自动限制条码;
-            string strValue = CommonMethod.ReadProfileString("MOKAFactoryTools", "OrderType", "");
-            if (strValue.Equals("TR",StringComparison.OrdinalIgnoreCase))
+            if (functionSetting1.NTF)
             {
-                return;
+                string strValue = CommonMethod.ReadProfileString("MOKAFactoryTools", "OrderType", "");
+                if (strValue.Equals("TR", StringComparison.OrdinalIgnoreCase))
+                {
+                    return;
+                }
             }
             #endregion
             // 如果抄写PSN,不自动赋值条码限制;

+ 6 - 7
Views/OperationPanel.cs

@@ -104,8 +104,7 @@ namespace MOKA_Factory_Tools
             this.mainform.KeyDownEvent += new KeyDownHandler(SetFocus);
             if (midListNow.rokuCustomer != null)
                 ProductMsg_Text.Text = "Roku:";
-            //if (functionSetting.NTF)
-            if (CommonMethod.GetLoginAccout().Equals("HuiZhou",StringComparison.OrdinalIgnoreCase))
+            if (functionSetting.NTF)
                 ntfBLL = new NTFBLL();
         }
 
@@ -766,7 +765,7 @@ namespace MOKA_Factory_Tools
                 }
 
                 #region 只有惠州工厂才启用G客户防呆措施;
-                if (CommonMethod.GetLoginAccout().Equals("Huizhou", StringComparison.OrdinalIgnoreCase))
+                if (FunctionSettingNow.NTF)
                 {
                     StringBuilder strValue = new StringBuilder(256);
                     // 获取上一次的SN号;
@@ -3911,7 +3910,7 @@ namespace MOKA_Factory_Tools
                             {
                                 Thread.Sleep(writeDoneNow.PIDWriteDelay);//MS6586切完PID需要强制等待3s
                             }
-                            if (SerialCMD.GetProjectID(TVPort, out result, out data, out error, SerailDelay))
+                            if (SerialCMD.GetProjectID(TVPort, out result, out data, out error, SerailDelay, CommonMethod.IsEDIDCopy(midListNow)))
                             {
                                 int readpid2 = CommonMethod.BytelisttoInt(data);
                                 if (readpid2.ToString() != ProjectIDText.Text)
@@ -3949,7 +3948,7 @@ namespace MOKA_Factory_Tools
                 }
                 else
                 {
-                    if (SerialCMD.GetProjectID(TVPort, out result, out data, out error, SerailDelay))
+                    if (SerialCMD.GetProjectID(TVPort, out result, out data, out error, SerailDelay, CommonMethod.IsEDIDCopy(midListNow)))
                     {
                         int readpid = CommonMethod.BytelisttoInt(data);
                         if (readpid.ToString() != ProjectIDText.Text)
@@ -3967,7 +3966,7 @@ namespace MOKA_Factory_Tools
                                         Thread.Sleep(writeDoneNow.PIDWriteDelay);//MS6586切完PID需要强制等待3s
                                     }
                                     Log.WriteInfoLog("Check projectID...");
-                                    if (SerialCMD.GetProjectID(TVPort, out result, out data, out error, SerailDelay))
+                                    if (SerialCMD.GetProjectID(TVPort, out result, out data, out error, SerailDelay, CommonMethod.IsEDIDCopy(midListNow)))
                                     {
                                         int readpid2 = CommonMethod.BytelisttoInt(data);
                                         if (readpid2.ToString() != ProjectIDText.Text)
@@ -4679,7 +4678,7 @@ namespace MOKA_Factory_Tools
             Thread.Sleep(FunctionSettingNow.Wait_after_completion);
         end:
             #region 只有惠州工厂才启用G客户防呆措施;
-            if (CommonMethod.GetLoginAccout().Equals("Huizhou", StringComparison.OrdinalIgnoreCase))
+            if (FunctionSettingNow.NTF)
             {
                 string strLastResult = "";
                 string strLastSN = CommonMethod.ReadProfileString("MOKAFactoryTools", "LastGSN", "");