Pārlūkot izejas kodu

DAK与LEK在G客户的Key中,只能同时存在一个。实质DAK与LEK是同类型Key,DAK是高版本。所以DAK的抄写顺序要在前。

Jeff Wang 3 gadi atpakaļ
vecāks
revīzija
6d04fc81c9
1 mainītis faili ar 52 papildinājumiem un 52 dzēšanām
  1. 52 52
      FactoryTool_CShare/Views/OperationPanel.cs

+ 52 - 52
FactoryTool_CShare/Views/OperationPanel.cs

@@ -394,7 +394,7 @@ namespace MOKA_Factory_Tools
                     // 如果是抄写EDID,则不获取白平衡数据;
                     if (CommonMethod.IsEDIDCopy(midListNow))
                         midListNow.whiteType = "-1";
-                    Log.WriteInfoLog("whiteType="+ midListNow.whiteType);
+                    Log.WriteInfoLog("whiteType=" + midListNow.whiteType);
                     switch (midListNow.whiteType)//订单白平衡预置状态
                     {
                         case "0"://旧订单,默认值
@@ -814,7 +814,7 @@ namespace MOKA_Factory_Tools
                     {
                         Verify dlg = new Verify("根据SN获取订单类型失败,停止测试!" + "\r\nSN:" + SN);
                         dlg.ShowDialog();
-                        Log.WriteErrorLog(string.Format("SN={0},错误={1}",SN, strErrorMsg));
+                        Log.WriteErrorLog(string.Format("SN={0},错误={1}", SN, strErrorMsg));
                         SNText.Enabled = true;
                         SNText.Text = "";
                         return;
@@ -1498,17 +1498,17 @@ namespace MOKA_Factory_Tools
                 m_readPSN.Text = "Null";
                 m_readPSN.BackColor = Color.Transparent;
             }
-            if(m_readACASID.Text != LResource.Skip)
+            if (m_readACASID.Text != LResource.Skip)
             {
                 m_readACASID.Text = "Null";
                 m_readACASID.BackColor = Color.Transparent;
             }
-            if(m_readEDIDPID.Text != LResource.Skip)
+            if (m_readEDIDPID.Text != LResource.Skip)
             {
                 m_readEDIDPID.Text = "Null";
                 m_readEDIDPID.BackColor = Color.Transparent;
             }
-            if(m_readEDIDName.Text != LResource.Skip)
+            if (m_readEDIDName.Text != LResource.Skip)
             {
                 m_readEDIDName.Text = "Null";
                 m_readEDIDName.BackColor = Color.Transparent;
@@ -1519,7 +1519,7 @@ namespace MOKA_Factory_Tools
                 m_readACASKey.BackColor = Color.Transparent;
             }
             #endregion
-            
+
             ResultStatus.Text = "Wait";
             ResultStatus.BackColor = Color.Transparent;
 
@@ -1658,7 +1658,7 @@ namespace MOKA_Factory_Tools
             reportMIKey.ChipSN = _MiKey._PSN;
             reportMIKey.DSN = _MiKey.DSN;
             reportMIKey.TVMN = _MiKey.TVMN;
-            reportMIKey.TVSN = SN.Replace("/","");  // 去掉斜杠;
+            reportMIKey.TVSN = SN.Replace("/", "");  // 去掉斜杠;
 
             if (!CommonMethod.ReportMIKey(reportMIKey, out msg))
             {
@@ -1739,7 +1739,7 @@ namespace MOKA_Factory_Tools
                     {
                         if (!Encoding.ASCII.GetString(data).Equals(SN))
                         {
-                            ErrMsg = string.Format("{0} Compare PSN error!\r\n",SN);
+                            ErrMsg = string.Format("{0} Compare PSN error!\r\n", SN);
                             Log.WriteErrorLog(ErrMsg);
                             goto end;
                         }
@@ -2524,7 +2524,7 @@ namespace MOKA_Factory_Tools
             {
                 SetspecificText(SoftwareVersionNote, LResource.SkipChecking, Color.Yellow);
                 SetspecificText(ClientTypeNote, LResource.SkipChecking, Color.Yellow);
-                if(midListNow.projectid.Equals("0"))
+                if (midListNow.projectid.Equals("0"))
                     SetspecificText(ProjectIDNote, LResource.SkipCovering, Color.Yellow);
             }
 
@@ -2604,7 +2604,7 @@ namespace MOKA_Factory_Tools
                         {
                             SetfailStatus(m_readdid);
                             ErrMsg = string.Format("{0} read DID fail!", SN);
-                            Log.WriteErrorLog(ErrMsg);                            
+                            Log.WriteErrorLog(ErrMsg);
                             goto end;
                         }
                     }
@@ -2632,7 +2632,7 @@ namespace MOKA_Factory_Tools
             {
                 string mac = keyInfo.Mac.data.Replace("-", "");
                 if (FunctionSettingNow.MITVEnable == true)
-                    mac = keyInfo.Mac.data.Replace(":","");
+                    mac = keyInfo.Mac.data.Replace(":", "");
                 if (!CommonMethod.IsNumberAndWord(mac))
                 {
                     ErrMsg = string.Format("Mac format error!\r\n{0}", mac);
@@ -2889,6 +2889,44 @@ namespace MOKA_Factory_Tools
                 keyInfo.PEK.result = true;
             }
 
+            // DAK 抄写;
+            if (WriteDAK.Checked)
+            {
+                if (!CommonMethod.IsNumberAndWord(keyInfo.DAK.data))
+                {
+                    ErrMsg = string.Format("DAK format error!\r\n{0}", keyInfo.DAK.data);
+                    Log.WriteErrorLog(ErrMsg);
+                    goto end;
+                }
+                byte[] DAKData = SerialInit.HexToByte(keyInfo.DAK.data);
+                Log.WriteInfoLog("Write DAK...");
+                if (SerialCMD.SetFireTVDAK(TVPort, DAKData, out result, out data, out error, SerailDelay))
+                {
+                    SetsuccessStatus(m_writeDAK);
+                    Log.WriteInfoLog("Check DAK...");
+                    if (writeCheckNow.DAKCheckcheck ? SerialCMD.CheckFireTVDAK(TVPort, out result, out data, out error, SerailDelay) : true)
+                    {
+                        SetsuccessStatus(m_checkDAK);
+                    }
+                    else
+                    {
+                        SetfailStatus(m_checkDAK);
+                        ErrMsg = string.Format("{0}  check DAK fail!", SN);
+                        Log.WriteErrorLog(ErrMsg);
+                        goto end;
+                    }
+                }
+                else
+                {
+                    SetfailStatus(m_writeDAK);
+                    ErrMsg = string.Format("{0}  Write DAK fail!", SN);
+                    Log.WriteErrorLog(ErrMsg);
+                    goto end;
+                }
+
+                keyInfo.DAK.result = true;
+            }
+
             //LEK抄写
             if (WriteLEK.Checked)
             {
@@ -4677,44 +4715,6 @@ namespace MOKA_Factory_Tools
                 SetcolorStatus(ProductMsg_Text, Color.FromArgb(128, 255, 128));
             }
 
-            // DAK 抄写;
-            if ( WriteDAK.Checked )
-            {
-                if (!CommonMethod.IsNumberAndWord(keyInfo.DAK.data))
-                {
-                    ErrMsg = string.Format("DAK format error!\r\n{0}", keyInfo.DAK.data);
-                    Log.WriteErrorLog(ErrMsg);
-                    goto end;
-                }
-                byte[] DAKData = SerialInit.HexToByte(keyInfo.DAK.data);
-                Log.WriteInfoLog("Write DAK...");
-                if (SerialCMD.SetFireTVDAK(TVPort, DAKData, out result, out data, out error, SerailDelay))
-                {
-                    SetsuccessStatus(m_writeDAK);
-                    Log.WriteInfoLog("Check DAK...");
-                    if (writeCheckNow.DAKCheckcheck ? SerialCMD.CheckFireTVDAK(TVPort, out result, out data, out error, SerailDelay) : true)
-                    {
-                        SetsuccessStatus(m_checkDAK);
-                    }
-                    else
-                    {
-                        SetfailStatus(m_checkDAK);
-                        ErrMsg = string.Format("{0}  check DAK fail!", SN);
-                        Log.WriteErrorLog(ErrMsg);
-                        goto end;
-                    }
-                }
-                else
-                {
-                    SetfailStatus(m_writeDAK);
-                    ErrMsg = string.Format("{0}  Write DAK fail!", SN);
-                    Log.WriteErrorLog(ErrMsg);
-                    goto end;
-                }
-
-                keyInfo.DAK.result = true;
-            }
-
             // DSN抄写;
             if (WriteDSN.Checked)
             {
@@ -5126,9 +5126,9 @@ namespace MOKA_Factory_Tools
             }
 
             #region 小米FireTV功能;
-            if ( FunctionSettingNow.MITVEnable )
+            if (FunctionSettingNow.MITVEnable)
             {
-                if ( !ReportMIInfo(out error) )
+                if (!ReportMIInfo(out error))
                 {
                     TestResult = 0;
                     ErrMsg = string.Format("{0}  ReportMIInfo ini fail! {1}", SN, error);
@@ -5184,7 +5184,7 @@ namespace MOKA_Factory_Tools
                     }
                 }
 
-                if (strLastResult.ToString().Equals("0") && (TestResult == 1) && (nOrderType == 0) )
+                if (strLastResult.ToString().Equals("0") && (TestResult == 1) && (nOrderType == 0))
                 {
                     // 上次抄写是失败,这次是成功的,试产NTF要再次要求抄写一次才能上报AMTest.
                     ErrMsg = "试产订单:请再测试一次\r\n上一次测试为FAIL,需要连续2次PASS,请再测试确认结果!";