Преглед изворни кода

1、ACAS ID和SN导出,过滤重复项,而且要验证ACAS ID长度是否等于20,不等于20判定本次抄写失败;
2、EDID屏抄写相关;
3、ACAS Key抄写;

sat23 пре 3 година
родитељ
комит
cabf442c86

+ 50 - 22
SCBC Factory Tools/Business/CommonMethod.cs

@@ -34,7 +34,7 @@ namespace MOKA_Factory_Tools
         public static string FactoryName = "Unknown";
 
         private static string lastOrder = "";
-        private static Dictionary<string, string> AsacSNDict = new Dictionary<string, string>();
+        private static List<string> ListACASSN = new List<string>();
 
         //public static string LocalMacAddress = GetMacAddress();
         /// <summary>
@@ -420,7 +420,7 @@ namespace MOKA_Factory_Tools
                         if (result.StatusCode == System.Net.HttpStatusCode.OK)
                         {
                             Log.WriteGetKeyLog("\r\nGetMac:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html);
-                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "mac", out code, out desc, out key))
+                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "mac", out code, out desc, out key, out md5))
                             {
 
                             }
@@ -449,7 +449,7 @@ namespace MOKA_Factory_Tools
                         if (result.StatusCode == System.Net.HttpStatusCode.OK)
                         {
                             Log.WriteGetKeyLog("\r\nGetHDCP_KEY:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html);
-                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "key", out code, out desc, out key))
+                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "key", out code, out desc, out key, out md5))
                             {
 
                             }
@@ -478,7 +478,7 @@ namespace MOKA_Factory_Tools
                         if (result.StatusCode == System.Net.HttpStatusCode.OK)
                         {
                             Log.WriteGetKeyLog("\r\nGetCI_PLUS_KEY:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html);
-                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "key", out code, out desc, out key))
+                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "key", out code, out desc, out key, out md5))
                             {
 
                             }
@@ -507,7 +507,7 @@ namespace MOKA_Factory_Tools
                         if (result.StatusCode == System.Net.HttpStatusCode.OK)
                         {
                             Log.WriteGetKeyLog("\r\nGetWiDi:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html);
-                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "key", out code, out desc, out key))
+                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "key", out code, out desc, out key, out md5))
                             {
 
                             }
@@ -536,7 +536,7 @@ namespace MOKA_Factory_Tools
                         if (result.StatusCode == System.Net.HttpStatusCode.OK)
                         {
                             Log.WriteGetKeyLog("\r\nGetHDCP2.2_KEY:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html);
-                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "key", out code, out desc, out key))
+                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "key", out code, out desc, out key, out md5))
                             {
 
                             }
@@ -565,7 +565,7 @@ namespace MOKA_Factory_Tools
                         if (result.StatusCode == System.Net.HttpStatusCode.OK)
                         {
                             Log.WriteGetKeyLog("\r\nGetNETFILX_ESN:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html);
-                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "esn", out code, out desc, out key))
+                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "esn", out code, out desc, out key, out md5))
                             {
 
                             }
@@ -594,7 +594,7 @@ namespace MOKA_Factory_Tools
                         if (result.StatusCode == System.Net.HttpStatusCode.OK)
                         {
                             Log.WriteGetKeyLog("\r\nGetMGK:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html);
-                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "key", out code, out desc, out key))
+                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "key", out code, out desc, out key, out md5))
                             {
 
                             }
@@ -623,7 +623,7 @@ namespace MOKA_Factory_Tools
                         if (result.StatusCode == System.Net.HttpStatusCode.OK)
                         {
                             Log.WriteGetKeyLog("\r\nGetFairplay:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html);
-                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "fairplay", out code, out desc, out key))
+                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "fairplay", out code, out desc, out key, out md5))
                             {
 
                             }
@@ -652,7 +652,7 @@ namespace MOKA_Factory_Tools
                         if (result.StatusCode == System.Net.HttpStatusCode.OK)
                         {
                             Log.WriteGetKeyLog("\r\nGetecp:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html);
-                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "ecp", out code, out desc, out key))
+                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "ecp", out code, out desc, out key, out md5))
                             {
 
                             }
@@ -681,7 +681,7 @@ namespace MOKA_Factory_Tools
                         if (result.StatusCode == System.Net.HttpStatusCode.OK)
                         {
                             Log.WriteGetKeyLog("\r\nGetlek:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html);
-                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "lek", out code, out desc, out key))
+                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "lek", out code, out desc, out key, out md5))
                             {
 
                             }
@@ -710,7 +710,7 @@ namespace MOKA_Factory_Tools
                         if (result.StatusCode == System.Net.HttpStatusCode.OK)
                         {
                             Log.WriteGetKeyLog("\r\nGetpek:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html);
-                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "pek", out code, out desc, out key))
+                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "pek", out code, out desc, out key, out md5))
                             {
 
                             }
@@ -739,7 +739,7 @@ namespace MOKA_Factory_Tools
                         if (result.StatusCode == System.Net.HttpStatusCode.OK)
                         {
                             Log.WriteGetKeyLog("\r\nGetplayready:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html);
-                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "playReady", out code, out desc, out key))
+                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "playReady", out code, out desc, out key, out md5))
                             {
 
                             }
@@ -768,7 +768,7 @@ namespace MOKA_Factory_Tools
                         if (result.StatusCode == System.Net.HttpStatusCode.OK)
                         {
                             Log.WriteGetKeyLog("\r\nGethash:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html);
-                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "hash", out code, out desc, out key))
+                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "hash", out code, out desc, out key, out md5))
                             {
 
                             }
@@ -797,7 +797,7 @@ namespace MOKA_Factory_Tools
                         if (result.StatusCode == System.Net.HttpStatusCode.OK)
                         {
                             Log.WriteGetKeyLog("\r\nGet youtube key:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html);
-                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "youtubeKey", out code, out desc, out key))
+                            if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "youtubeKey", out code, out desc, out key, out md5))
                             {
 
                             }
@@ -816,6 +816,35 @@ namespace MOKA_Factory_Tools
                         }
                         break;
                     }
+                case "MOKA_RT2851M_IR": // ACAS Key;
+                {
+                    item.URL = url + "/getAcasKey.do?";
+                    item.Postdata = "type=" + keytype + "&sn=" + sn;
+                    if (sn.Trim().Length > 0)
+                        item.Postdata += "&order=" + order;
+                    HttpResult result = http.GetHtml(item);
+                    if (result.StatusCode == System.Net.HttpStatusCode.OK)
+                    {
+                        Log.WriteGetKeyLog("\r\nGet ACAS key:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html);
+                        if (Xmlconfig.GetOthersKeyXml(result.Html, "response", "acasKey", out code, out desc, out key, out md5))
+                        {
+
+                        }
+                        else
+                        {
+                            error = desc;
+                            ReportErrormsg("Fail to parse ACAS key", error + "\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html, sqliteConn);
+                            return false;
+                        }
+                    }
+                    else
+                    {
+                        error = result.StatusDescription;
+                        ReportErrormsg("Fail to get ACAS key", error + "\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html, sqliteConn);
+                        return false;
+                    }
+                    break;
+                }
             }
             return true;
         }
@@ -921,7 +950,6 @@ namespace MOKA_Factory_Tools
                     Log.WriteErrorLog("\r\nError report return error:\r\n" + ParseText + "\r\nAddress:" + TestMode.errorreportServerurl + "\r\nPostdata:" + jsonError);
                     return false;
                 }
-
             }
             catch (Exception ex)
             {
@@ -1993,29 +2021,29 @@ namespace MOKA_Factory_Tools
             if ( !lastOrder.Equals(ordernum) )
             {
                 lastOrder = ordernum;
-                AsacSNDict.Clear();
+                ListACASSN.Clear();
             }
 
-            if ( AsacSNDict.ContainsKey(sn) )
+            string msg = string.Format("{0};{1}", sn, acasid);
+            if (ListACASSN.Contains(msg))
             {
-                if ( AsacSNDict[sn].Equals(acasid) )
-                    return;
+                return;
             }
 
+            ListACASSN.Add(msg);
             string fileName = path + "\\" + ordernum + ".txt";
-            string msg = string.Format("{0};{1}", sn, acasid);
             var stream = new StreamWriter(fileName, true);
             stream.WriteLine(msg);
             stream.Close();
             stream.Dispose();
         }
     }
+
     /// <summary>
     /// CRC32
     /// </summary>
     class CRC32
     {
-
         //生成CRC32码表
         static uint[] Crc32Table;
         public static void GetCRC32Table()

+ 1 - 3
SCBC Factory Tools/Database/SQLiteHelper.cs

@@ -249,7 +249,6 @@ namespace MOKA_Factory_Tools
 
         static public bool WholeCheckDownloadStatus(SQLiteConnection sqliteConn, string bid)
         {
-
             SQLiteCommand cmd = new SQLiteCommand();
             cmd.Connection = sqliteConn;
             cmd.CommandText = string.Format("select * from mid where bid='{0}'and status='1'", bid);
@@ -279,7 +278,6 @@ namespace MOKA_Factory_Tools
             SQLiteDataReader dr = cmd.ExecuteReader();
             if (dr.Read())
             {
-                
                 NameValueCollection user = dr.GetValues();
                 string values = user.Get("keys");
                 if (user.Get("copy_date").Length>0)
@@ -288,6 +286,7 @@ namespace MOKA_Factory_Tools
                 return values;
             }
             dr.Close();
+            Log.WriteErrorLog("\r\nFail to Get keys to DB:\r\n" + cmd.CommandText);
             return "";
         }
 
@@ -307,7 +306,6 @@ namespace MOKA_Factory_Tools
             SQLiteDataReader dr = cmd.ExecuteReader();
             if (dr.Read())
             {
-
                 NameValueCollection user = dr.GetValues();
                 rokuCustomer = new RokuCustomer()
                 {

+ 4 - 8
SCBC Factory Tools/Http/Xmlconfig.cs

@@ -117,21 +117,19 @@ public class Xmlconfig
                     desc = "CRC32 error";
                     return false;                 
                 }
-                
             }
             return false;
-
         }
         catch (Exception ex)
         {
             desc = ex.Message;
             return false;
         }
-
     }
 
-    public static bool GetOthersKeyXml(string str, string node, string node2, out string code, out string desc, out string value)
+    public static bool GetOthersKeyXml(string str, string node, string node2, out string code, out string desc, out string value, out string md5)
     {
+        md5 = "";
         code = "";
         value = "";
         try
@@ -144,6 +142,8 @@ public class Xmlconfig
             if (code == "200")
             {
                 value = xml.SelectSingleNode(node + "//" + node2).Attributes.GetNamedItem("value").InnerText;
+                if (xml.SelectSingleNode(node + "//" + node2).Attributes.GetNamedItem("md5value") != null)
+                    md5 = xml.SelectSingleNode(node + "//" + node2).Attributes.GetNamedItem("md5value").InnerText;
                 string CRC32 = xml.SelectSingleNode(node + "//" + node2).Attributes.GetNamedItem("crc32").InnerText;
                 if (CrcUtils.CRC32(value) == Convert.ToUInt32(CRC32, 16))
                 {
@@ -154,17 +154,14 @@ public class Xmlconfig
                     desc = "CRC32 error";
                     return false;
                 }
-
             }
             return false;
-
         }
         catch (Exception ex)
         {
             desc = ex.Message;
             return false;
         }
-
     }
 
     public static bool GetWidevineAndAttestationKeyXml(string str, 
@@ -275,7 +272,6 @@ public class Xmlconfig
                 return true;
             }
             return false;
-
         }
         catch (Exception ex)
         {

+ 143 - 1
SCBC Factory Tools/IO/SerialCMD.cs

@@ -2306,6 +2306,149 @@ namespace MOKA_Factory_Tools
             return false;
         }
 
+        /// <summary>
+        /// 读取EDID Pid;
+        /// </summary>
+        /// <param name="Comport"></param>
+        /// <param name="result"></param>
+        /// <param name="data"></param>
+        /// <param name="error"></param>
+        /// <param name="waitTime"></param>
+        /// <returns></returns>
+        public static bool ReadEDIDPid(SerialPort Comport, out byte[] result, out byte[] data, out string error, int waitTime)
+        {
+            if (Sendcmd(Comport, new byte[] { 0xAA }, new byte[] { 0xFC }, new byte[] { 0x03, 0x07 }, true, false, out result, out data, out error, waitTime))
+            {
+                if (data[0] == 0x04 && data[1] == 0x07)
+                {
+                    data = data.Skip(2).Take(data.Length - 2).ToArray();
+                    return true;
+                }
+                else
+                {
+                    error = "返回EDID PID错误,应为0x04 0x07";
+                }
+            }
+
+            return false;
+        }
+
+        /// <summary>
+        /// 设置EDID Pid;
+        /// </summary>
+        /// <param name="Comport"></param>
+        /// <param name="param"></param>
+        /// <param name="result"></param>
+        /// <param name="data"></param>
+        /// <param name="error"></param>
+        /// <param name="waitTime"></param>
+        /// <returns></returns>
+        public static bool SetEDIDPid(SerialPort Comport, byte[] param, out byte[] result, out byte[] data, out string error, int waitTime)
+        {
+            return Sendcmd(Comport, new byte[] { 0xAA }, new byte[] { 0xFC, 0x00, 0x07 }, param, true, false, out result, out data, out error, waitTime);
+        }
+
+        /// <summary>
+        /// 读取EDID Mode Name;
+        /// </summary>
+        /// <param name="Comport"></param>
+        /// <param name="result"></param>
+        /// <param name="data"></param>
+        /// <param name="error"></param>
+        /// <param name="waitTime"></param>
+        /// <returns></returns>
+        public static bool ReadEDIDModelName(SerialPort Comport, out byte[] result, out byte[] data, out string error, int waitTime)
+        {
+            if (Sendcmd(Comport, new byte[] { 0xAA }, new byte[] { 0x9A }, new byte[] { 0x08 }, true, false, out result, out data, out error, waitTime))
+            {
+                if (data[0] == 0x01)
+                {
+                    data = data.Skip(1).Take(data.Length - 1).ToArray();
+                    return true;
+                }
+                else
+                {
+                    error = "返回EDID Mode Name错误,应为01";
+                }
+            }
+            
+            return false;
+        }
+
+        /// <summary>
+        /// 抄写EDID Mode Name;
+        /// </summary>
+        /// <param name="Comport"></param>
+        /// <param name="param"></param>
+        /// <param name="result"></param>
+        /// <param name="data"></param>
+        /// <param name="error"></param>
+        /// <param name="waitTime"></param>
+        /// <returns></returns>
+        public static bool SetEDIDModelName(SerialPort Comport, byte[] param, out byte[] result, out byte[] data, out string error, int waitTime)
+        {
+            return Sendcmd(Comport, new byte[] { 0xAA }, new byte[] { 0x99, 0x09 }, param, true, false, out result, out data, out error, waitTime);
+        }
+
+        /// <summary>
+        /// 读取ACAS Key
+        /// </summary>
+        /// <param name="Comport"></param>
+        /// <param name="result"></param>
+        /// <param name="data"></param>
+        /// <param name="error"></param>
+        /// <param name="waitTime"></param>
+        /// <returns>注意返回值为:md5xxxxx</returns>
+        public static bool ReadACASKey(SerialPort Comport, out byte[] result, out byte[] data, out string error, int waitTime)
+        {
+            if (Sendcmd(Comport, new byte[] { 0xAA }, new byte[] { 0xFC }, new byte[] { 0x03, 0x08 }, true, false, out result, out data, out error, waitTime))
+            {
+                if (data[0] == 0x04 && data[0] == 0x08)
+                {
+                    data = data.Skip(2).Take(data.Length - 2).ToArray();
+                    return true;
+                }
+                else
+                {
+                    error = "返回ACAS KEY错误!";
+                }
+            }
+
+            return false;
+        }
+
+        public static bool CheckACASKey(SerialPort Comport, out byte[] result, out byte[] data, out string error, int waitTime)
+        {
+            if (Sendcmd(Comport, new byte[] { 0xAA }, new byte[] { 0xFC }, new byte[] { 0x01, 0x08 }, true, false, out result, out data, out error, waitTime))
+            {
+                if (data.Length == 3 && data[0] == 0x02 && data[1] == 0x08 && data[1] == 0x01)
+                {
+                    return true;
+                }
+                else
+                {
+                    error = "检验ACAS KEY错误,应为0x02 0x08 0x01";
+                }
+            }
+
+            return false;
+        }
+
+        /// <summary>
+        /// 设置ACAS Key
+        /// </summary>
+        /// <param name="Comport"></param>
+        /// <param name="param"></param>
+        /// <param name="result"></param>
+        /// <param name="data"></param>
+        /// <param name="error"></param>
+        /// <param name="waitTime"></param>
+        /// <returns></returns>
+        public static bool SetACASKey(SerialPort Comport, byte[] param, out byte[] result, out byte[] data, out string error, int waitTime)
+        {
+            return Sendcmd(Comport, new byte[] { 0xAA }, new byte[] { 0xFC, 0x00, 0x08 }, param, true, false, out result, out data, out error, waitTime);
+        }
+
         /// <summary>
         /// 通讯逻辑
         /// </summary>
@@ -2488,7 +2631,6 @@ namespace MOKA_Factory_Tools
                         Thread.Sleep(waitTime);
                     return true;
                 }
-
             }  
             catch(Exception ex)
             {

+ 16 - 0
SCBC Factory Tools/IO/SerialInit.cs

@@ -42,5 +42,21 @@ namespace MOKA_Factory_Tools
             return string.Compare(Convert.ToBase64String(b1), Convert.ToBase64String(b2), false) == 0 ? true : false;
         }
 
+        /// <summary>
+        /// 将16进制字符串转成字节;
+        /// </summary>
+        /// <param name="hexString"></param>
+        /// <returns></returns>
+        public static byte[] strToToHexByte(string hexString)
+        {
+            hexString = hexString.Replace(" ", "");
+            if ((hexString.Length % 2) != 0)
+                hexString += " ";
+            byte[] returnBytes = new byte[hexString.Length / 2];
+            for (int i = 0; i < returnBytes.Length; i++)
+                returnBytes[i] = Convert.ToByte(hexString.Substring(i * 2, 2), 16);
+            return returnBytes;
+        }
+
     }
 }

+ 72 - 0
SCBC Factory Tools/LResource.Designer.cs

@@ -60,6 +60,15 @@ namespace MOKA_Factory_Tools {
             }
         }
         
+        /// <summary>
+        ///   查找类似 The ACAS ID length doesn&apos;t equal 20! 的本地化字符串。
+        /// </summary>
+        internal static string ACASIDLengthError {
+            get {
+                return ResourceManager.GetString("ACASIDLengthError", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   查找类似 Software already running! 的本地化字符串。
         /// </summary>
@@ -438,6 +447,24 @@ namespace MOKA_Factory_Tools {
             }
         }
         
+        /// <summary>
+        ///   查找类似 Contrast EDID Model Name error! 的本地化字符串。
+        /// </summary>
+        internal static string ContrastEDIDModelNameError {
+            get {
+                return ResourceManager.GetString("ContrastEDIDModelNameError", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Contrast EDID PID error! 的本地化字符串。
+        /// </summary>
+        internal static string ContrastEDIDPIDError {
+            get {
+                return ResourceManager.GetString("ContrastEDIDPIDError", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   查找类似 contrast ESN fail 的本地化字符串。
         /// </summary>
@@ -1293,6 +1320,15 @@ namespace MOKA_Factory_Tools {
             }
         }
         
+        /// <summary>
+        ///   查找类似 Read ACAS ID Error! 的本地化字符串。
+        /// </summary>
+        internal static string ReadACASIDError {
+            get {
+                return ResourceManager.GetString("ReadACASIDError", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   查找类似 Read attestation fail 的本地化字符串。
         /// </summary>
@@ -1347,6 +1383,24 @@ namespace MOKA_Factory_Tools {
             }
         }
         
+        /// <summary>
+        ///   查找类似 Read EDID Model Name error! 的本地化字符串。
+        /// </summary>
+        internal static string ReadEDIDModelNameError {
+            get {
+                return ResourceManager.GetString("ReadEDIDModelNameError", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Read EDID Pid error! 的本地化字符串。
+        /// </summary>
+        internal static string ReadEDIDPIDError {
+            get {
+                return ResourceManager.GetString("ReadEDIDPIDError", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   查找类似 Read ESN fail 的本地化字符串。
         /// </summary>
@@ -1923,6 +1977,24 @@ namespace MOKA_Factory_Tools {
             }
         }
         
+        /// <summary>
+        ///   查找类似 Write EDID Model Name error! 的本地化字符串。
+        /// </summary>
+        internal static string WriteEDIDModelNameError {
+            get {
+                return ResourceManager.GetString("WriteEDIDModelNameError", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Write EDID PID  error! 的本地化字符串。
+        /// </summary>
+        internal static string WriteEDIDPidError {
+            get {
+                return ResourceManager.GetString("WriteEDIDPidError", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   查找类似 Write ESN fail 的本地化字符串。
         /// </summary>

+ 24 - 0
SCBC Factory Tools/LResource.resx

@@ -117,6 +117,9 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <data name="ACASIDLengthError" xml:space="preserve">
+    <value>The ACAS ID length doesn't equal 20!</value>
+  </data>
   <data name="AlreadyRun" xml:space="preserve">
     <value>Software already running!</value>
   </data>
@@ -243,6 +246,12 @@
   <data name="ContrastECPError" xml:space="preserve">
     <value>Contrast ECP error!</value>
   </data>
+  <data name="ContrastEDIDModelNameError" xml:space="preserve">
+    <value>Contrast EDID Model Name error!</value>
+  </data>
+  <data name="ContrastEDIDPIDError" xml:space="preserve">
+    <value>Contrast EDID PID error!</value>
+  </data>
   <data name="ContrastESNError" xml:space="preserve">
     <value>contrast ESN fail</value>
   </data>
@@ -528,6 +537,9 @@
   <data name="ProductMsg" xml:space="preserve">
     <value>Product Message</value>
   </data>
+  <data name="ReadACASIDError" xml:space="preserve">
+    <value>Read ACAS ID Error!</value>
+  </data>
   <data name="ReadAttestationError" xml:space="preserve">
     <value>Read attestation fail</value>
   </data>
@@ -546,6 +558,12 @@
   <data name="ReadECPError" xml:space="preserve">
     <value>Read ECP error!</value>
   </data>
+  <data name="ReadEDIDModelNameError" xml:space="preserve">
+    <value>Read EDID Model Name error!</value>
+  </data>
+  <data name="ReadEDIDPIDError" xml:space="preserve">
+    <value>Read EDID Pid error!</value>
+  </data>
   <data name="ReadESNError" xml:space="preserve">
     <value>Read ESN fail</value>
   </data>
@@ -738,6 +756,12 @@
   <data name="WriteECPError" xml:space="preserve">
     <value>Write ECP error!</value>
   </data>
+  <data name="WriteEDIDModelNameError" xml:space="preserve">
+    <value>Write EDID Model Name error!</value>
+  </data>
+  <data name="WriteEDIDPidError" xml:space="preserve">
+    <value>Write EDID PID  error!</value>
+  </data>
   <data name="WriteESNError" xml:space="preserve">
     <value>Write ESN fail</value>
   </data>

+ 24 - 0
SCBC Factory Tools/LResource.zh-CN.resx

@@ -117,6 +117,9 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <data name="ACASIDLengthError" xml:space="preserve">
+    <value>ACAS ID长度不等于20!</value>
+  </data>
   <data name="AlreadyRun" xml:space="preserve">
     <value>软件已经运行!</value>
   </data>
@@ -243,6 +246,12 @@
   <data name="ContrastECPError" xml:space="preserve">
     <value>读取的ECP与写入不符!</value>
   </data>
+  <data name="ContrastEDIDModelNameError" xml:space="preserve">
+    <value>读取的EDID Model Name与写入的不符!</value>
+  </data>
+  <data name="ContrastEDIDPIDError" xml:space="preserve">
+    <value>读取的EDID PID与写入的不符!</value>
+  </data>
   <data name="ContrastESNError" xml:space="preserve">
     <value>读取的ESN与写入数据不符!</value>
   </data>
@@ -528,6 +537,9 @@
   <data name="ProductMsg" xml:space="preserve">
     <value>产品信息</value>
   </data>
+  <data name="ReadACASIDError" xml:space="preserve">
+    <value>读取ACAS ID错误!</value>
+  </data>
   <data name="ReadAttestationError" xml:space="preserve">
     <value>串口读取Attestation key失败!</value>
   </data>
@@ -546,6 +558,12 @@
   <data name="ReadECPError" xml:space="preserve">
     <value>读取ECP失败!</value>
   </data>
+  <data name="ReadEDIDModelNameError" xml:space="preserve">
+    <value>读取EDID Model Name错误!</value>
+  </data>
+  <data name="ReadEDIDPIDError" xml:space="preserve">
+    <value>读取EDID Pid错误!</value>
+  </data>
   <data name="ReadESNError" xml:space="preserve">
     <value>串口读取ESN失败!</value>
   </data>
@@ -738,6 +756,12 @@
   <data name="WriteECPError" xml:space="preserve">
     <value>写入ECP失败!</value>
   </data>
+  <data name="WriteEDIDModelNameError" xml:space="preserve">
+    <value>设置EDID Model Name错误!</value>
+  </data>
+  <data name="WriteEDIDPidError" xml:space="preserve">
+    <value>设置EDID PID错误!</value>
+  </data>
   <data name="WriteESNError" xml:space="preserve">
     <value>串口写入ESN失败!</value>
   </data>

+ 2 - 0
SCBC Factory Tools/MOKA Factory Tools.csproj

@@ -188,9 +188,11 @@
     </EmbeddedResource>
     <EmbeddedResource Include="Views\OperationPanel.resx">
       <DependentUpon>OperationPanel.cs</DependentUpon>
+      <SubType>Designer</SubType>
     </EmbeddedResource>
     <EmbeddedResource Include="Views\OperationPanel.zh-CN.resx">
       <DependentUpon>OperationPanel.cs</DependentUpon>
+      <SubType>Designer</SubType>
     </EmbeddedResource>
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>

+ 11 - 0
SCBC Factory Tools/Models/StructList.cs

@@ -203,6 +203,9 @@ namespace MOKA_Factory_Tools
         public string Hashkey { get; set; }
         public string ECP { get; set; }
         public string YouTube_KEY { get; set; }
+        public string EDIDPid { get; set; }
+        public string EDIDModeName { get; set; }
+        public string ACASKey { get; set; }
     }
 
     public class FireTVKey
@@ -248,6 +251,10 @@ namespace MOKA_Factory_Tools
         public bool HashReadcheck { get; set; }
         public bool DSNReadcheck { get; set; }
         public bool YouTubeReadcheck { get; set; }
+        public bool EDIDPIDReadcheck { get; set; }
+        public bool EDIDModeNameReadcheck { get; set; }
+        public bool ACASKeyReadcheck { get; set; }
+        public bool ACASIDReadcheck { get; set; }
     }
 
     public class WriteCheck
@@ -272,6 +279,7 @@ namespace MOKA_Factory_Tools
         public bool HashCheckcheck { get; set; }
         public bool DSNCheckcheck { get; set; }
         public bool YouTubeCheckcheck { get; set; }
+        public bool ACASKeyCheckcheck { get; set; }
     }
 
     public class WriteDone
@@ -304,6 +312,9 @@ namespace MOKA_Factory_Tools
         public bool HashWrite_YesNo { get; set; }
         public bool DSNWrite_YesNo { get; set; }
         public bool YouTubeWrite_YesNo { get; set; }
+        public bool EDIDPIDWrite_YesNo { get; set; }
+        public bool EDIDModeNameWrite_YesNo { get; set; }
+        public bool ACASKeyWrite_YesNo { get; set; }
     }
 
     public class ErrorInfo

+ 4 - 0
SCBC Factory Tools/Views/Main.cs

@@ -742,6 +742,8 @@ namespace MOKA_Factory_Tools
                 ReadCheck1.HashReadcheck = jObject["ReadCheck"]["Hash"] == null ? CommonMethod.InsertJsonConfig("ReadCheck", "Hash") : jObject["ReadCheck"]["Hash"].Value<bool>();
                 ReadCheck1.DSNReadcheck = jObject["ReadCheck"]["DSN"] == null ? CommonMethod.InsertJsonConfig("ReadCheck", "DSN") : jObject["ReadCheck"]["DSN"].Value<bool>();
                 ReadCheck1.YouTubeReadcheck = jObject["ReadCheck"]["YouTube"] == null ? CommonMethod.InsertJsonConfig("ReadCheck", "YouTube") : jObject["ReadCheck"]["YouTube"].Value<bool>();
+                ReadCheck1.EDIDPIDReadcheck = jObject["ReadCheck"]["EDIDPID"] == null ? CommonMethod.InsertJsonConfig("ReadCheck", "EDIDPID") : jObject["ReadCheck"]["EDIDPID"].Value<bool>();
+                ReadCheck1.EDIDModeNameReadcheck = jObject["ReadCheck"]["EDIDModeName"] == null ? CommonMethod.InsertJsonConfig("ReadCheck", "EDIDModeName") : jObject["ReadCheck"]["EDIDModeName"].Value<bool>();
                 //WriteCheck配置读取
                 WriteCheck1.DIDCheckcheck = jObject["WriteCheck"]["DID"].Value<bool>();
                 WriteCheck1.MacCheckcheck = jObject["WriteCheck"]["MAC"].Value<bool>();
@@ -789,6 +791,8 @@ namespace MOKA_Factory_Tools
                 WriteDone1.DSNWrite_YesNo = jObject["WriteDone"]["DSN"] == null ? CommonMethod.InsertJsonConfig("WriteDone", "DSN") : jObject["WriteDone"]["DSN"].Value<bool>();
                 WriteDone1.AutoWhiteBalance= jObject["WriteDone"]["AutoWhiteBalance"] == null ? CommonMethod.InsertJsonConfig("WriteDone", "AutoWhiteBalance") : jObject["WriteDone"]["AutoWhiteBalance"].Value<bool>();
                 WriteDone1.YouTubeWrite_YesNo = jObject["WriteDone"]["YouTube"] == null ? CommonMethod.InsertJsonConfig("WriteDone", "YouTube") : jObject["WriteDone"]["YouTube"].Value<bool>();
+                WriteDone1.EDIDPIDWrite_YesNo = jObject["WriteDone"]["EDIDPID"] == null ? CommonMethod.InsertJsonConfig("WriteDone", "EDIDPID") : jObject["WriteDone"]["EDIDPID"].Value<bool>();
+                WriteDone1.EDIDModeNameWrite_YesNo = jObject["WriteDone"]["EDIDModeName"] == null ? CommonMethod.InsertJsonConfig("WriteDone", "EDIDModeName") : jObject["WriteDone"]["EDIDModeName"].Value<bool>();
                 file.Close();
                 if (Custom_ProjectID != null)
                     if (Custom_ProjectID.Trim().Length > 0)

+ 228 - 0
SCBC Factory Tools/Views/OperationPanel.Designer.cs

@@ -67,6 +67,16 @@
             this.skinLabel10 = new CCWin.SkinControl.SkinLabel();
             this.skinGroupBox2 = new CCWin.SkinControl.SkinGroupBox();
             this.skinPanel1 = new CCWin.SkinControl.SkinPanel();
+            this.m_readEDIDName = new CCWin.SkinControl.SkinLabel();
+            this.m_checkEDIDName = new CCWin.SkinControl.SkinLabel();
+            this.m_writeEDIDName = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel26 = new CCWin.SkinControl.SkinLabel();
+            this.WriteEDIDName = new CCWin.SkinControl.SkinCheckBox();
+            this.m_readEDIDPID = new CCWin.SkinControl.SkinLabel();
+            this.m_checkEDIDPID = new CCWin.SkinControl.SkinLabel();
+            this.m_writeEDIDPID = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel21 = new CCWin.SkinControl.SkinLabel();
+            this.WriteEDIDPID = new CCWin.SkinControl.SkinCheckBox();
             this.m_readPSN = new CCWin.SkinControl.SkinLabel();
             this.m_checkPSN = new CCWin.SkinControl.SkinLabel();
             this.m_writePSN = new CCWin.SkinControl.SkinLabel();
@@ -180,6 +190,16 @@
             this.SNText = new CCWin.SkinControl.SkinWaterTextBox();
             this.timer1 = new System.Windows.Forms.Timer(this.components);
             this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
+            this.m_readACASKey = new CCWin.SkinControl.SkinLabel();
+            this.m_checkACASKey = new CCWin.SkinControl.SkinLabel();
+            this.m_writeACASKey = new CCWin.SkinControl.SkinLabel();
+            this.ACASKeyCount = new CCWin.SkinControl.SkinLabel();
+            this.WriteACASKey = new CCWin.SkinControl.SkinCheckBox();
+            this.m_readACASID = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel24 = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel27 = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel28 = new CCWin.SkinControl.SkinLabel();
+            this.WriteACASID = new CCWin.SkinControl.SkinCheckBox();
             this.skinGroupBox1.SuspendLayout();
             this.skinGroupBox2.SuspendLayout();
             this.skinPanel1.SuspendLayout();
@@ -535,6 +555,26 @@
             // 
             resources.ApplyResources(this.skinPanel1, "skinPanel1");
             this.skinPanel1.BackColor = System.Drawing.Color.Transparent;
+            this.skinPanel1.Controls.Add(this.m_readACASID);
+            this.skinPanel1.Controls.Add(this.skinLabel24);
+            this.skinPanel1.Controls.Add(this.skinLabel27);
+            this.skinPanel1.Controls.Add(this.skinLabel28);
+            this.skinPanel1.Controls.Add(this.WriteACASID);
+            this.skinPanel1.Controls.Add(this.m_readACASKey);
+            this.skinPanel1.Controls.Add(this.m_checkACASKey);
+            this.skinPanel1.Controls.Add(this.m_writeACASKey);
+            this.skinPanel1.Controls.Add(this.ACASKeyCount);
+            this.skinPanel1.Controls.Add(this.WriteACASKey);
+            this.skinPanel1.Controls.Add(this.m_readEDIDName);
+            this.skinPanel1.Controls.Add(this.m_checkEDIDName);
+            this.skinPanel1.Controls.Add(this.m_writeEDIDName);
+            this.skinPanel1.Controls.Add(this.skinLabel26);
+            this.skinPanel1.Controls.Add(this.WriteEDIDName);
+            this.skinPanel1.Controls.Add(this.m_readEDIDPID);
+            this.skinPanel1.Controls.Add(this.m_checkEDIDPID);
+            this.skinPanel1.Controls.Add(this.m_writeEDIDPID);
+            this.skinPanel1.Controls.Add(this.skinLabel21);
+            this.skinPanel1.Controls.Add(this.WriteEDIDPID);
             this.skinPanel1.Controls.Add(this.m_readPSN);
             this.skinPanel1.Controls.Add(this.m_checkPSN);
             this.skinPanel1.Controls.Add(this.m_writePSN);
@@ -646,6 +686,90 @@
             this.skinPanel1.Name = "skinPanel1";
             this.skinPanel1.NormlBack = null;
             // 
+            // m_readEDIDName
+            // 
+            resources.ApplyResources(this.m_readEDIDName, "m_readEDIDName");
+            this.m_readEDIDName.BackColor = System.Drawing.Color.Transparent;
+            this.m_readEDIDName.BorderColor = System.Drawing.Color.White;
+            this.m_readEDIDName.Name = "m_readEDIDName";
+            // 
+            // m_checkEDIDName
+            // 
+            resources.ApplyResources(this.m_checkEDIDName, "m_checkEDIDName");
+            this.m_checkEDIDName.BackColor = System.Drawing.Color.Transparent;
+            this.m_checkEDIDName.BorderColor = System.Drawing.Color.White;
+            this.m_checkEDIDName.Name = "m_checkEDIDName";
+            // 
+            // m_writeEDIDName
+            // 
+            resources.ApplyResources(this.m_writeEDIDName, "m_writeEDIDName");
+            this.m_writeEDIDName.BackColor = System.Drawing.Color.Transparent;
+            this.m_writeEDIDName.BorderColor = System.Drawing.Color.White;
+            this.m_writeEDIDName.Name = "m_writeEDIDName";
+            // 
+            // skinLabel26
+            // 
+            resources.ApplyResources(this.skinLabel26, "skinLabel26");
+            this.skinLabel26.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel26.BorderColor = System.Drawing.Color.White;
+            this.skinLabel26.Name = "skinLabel26";
+            // 
+            // WriteEDIDName
+            // 
+            resources.ApplyResources(this.WriteEDIDName, "WriteEDIDName");
+            this.WriteEDIDName.BackColor = System.Drawing.Color.Transparent;
+            this.WriteEDIDName.ControlState = CCWin.SkinClass.ControlState.Normal;
+            this.WriteEDIDName.DownBack = null;
+            this.WriteEDIDName.MouseBack = null;
+            this.WriteEDIDName.Name = "WriteEDIDName";
+            this.WriteEDIDName.NormlBack = null;
+            this.WriteEDIDName.SelectedDownBack = null;
+            this.WriteEDIDName.SelectedMouseBack = null;
+            this.WriteEDIDName.SelectedNormlBack = null;
+            this.WriteEDIDName.UseVisualStyleBackColor = false;
+            // 
+            // m_readEDIDPID
+            // 
+            resources.ApplyResources(this.m_readEDIDPID, "m_readEDIDPID");
+            this.m_readEDIDPID.BackColor = System.Drawing.Color.Transparent;
+            this.m_readEDIDPID.BorderColor = System.Drawing.Color.White;
+            this.m_readEDIDPID.Name = "m_readEDIDPID";
+            // 
+            // m_checkEDIDPID
+            // 
+            resources.ApplyResources(this.m_checkEDIDPID, "m_checkEDIDPID");
+            this.m_checkEDIDPID.BackColor = System.Drawing.Color.Transparent;
+            this.m_checkEDIDPID.BorderColor = System.Drawing.Color.White;
+            this.m_checkEDIDPID.Name = "m_checkEDIDPID";
+            // 
+            // m_writeEDIDPID
+            // 
+            resources.ApplyResources(this.m_writeEDIDPID, "m_writeEDIDPID");
+            this.m_writeEDIDPID.BackColor = System.Drawing.Color.Transparent;
+            this.m_writeEDIDPID.BorderColor = System.Drawing.Color.White;
+            this.m_writeEDIDPID.Name = "m_writeEDIDPID";
+            // 
+            // skinLabel21
+            // 
+            resources.ApplyResources(this.skinLabel21, "skinLabel21");
+            this.skinLabel21.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel21.BorderColor = System.Drawing.Color.White;
+            this.skinLabel21.Name = "skinLabel21";
+            // 
+            // WriteEDIDPID
+            // 
+            resources.ApplyResources(this.WriteEDIDPID, "WriteEDIDPID");
+            this.WriteEDIDPID.BackColor = System.Drawing.Color.Transparent;
+            this.WriteEDIDPID.ControlState = CCWin.SkinClass.ControlState.Normal;
+            this.WriteEDIDPID.DownBack = null;
+            this.WriteEDIDPID.MouseBack = null;
+            this.WriteEDIDPID.Name = "WriteEDIDPID";
+            this.WriteEDIDPID.NormlBack = null;
+            this.WriteEDIDPID.SelectedDownBack = null;
+            this.WriteEDIDPID.SelectedMouseBack = null;
+            this.WriteEDIDPID.SelectedNormlBack = null;
+            this.WriteEDIDPID.UseVisualStyleBackColor = false;
+            // 
             // m_readPSN
             // 
             resources.ApplyResources(this.m_readPSN, "m_readPSN");
@@ -1577,6 +1701,90 @@
             this.timer1.Interval = 1000;
             this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
             // 
+            // m_readACASKey
+            // 
+            resources.ApplyResources(this.m_readACASKey, "m_readACASKey");
+            this.m_readACASKey.BackColor = System.Drawing.Color.Transparent;
+            this.m_readACASKey.BorderColor = System.Drawing.Color.White;
+            this.m_readACASKey.Name = "m_readACASKey";
+            // 
+            // m_checkACASKey
+            // 
+            resources.ApplyResources(this.m_checkACASKey, "m_checkACASKey");
+            this.m_checkACASKey.BackColor = System.Drawing.Color.Transparent;
+            this.m_checkACASKey.BorderColor = System.Drawing.Color.White;
+            this.m_checkACASKey.Name = "m_checkACASKey";
+            // 
+            // m_writeACASKey
+            // 
+            resources.ApplyResources(this.m_writeACASKey, "m_writeACASKey");
+            this.m_writeACASKey.BackColor = System.Drawing.Color.Transparent;
+            this.m_writeACASKey.BorderColor = System.Drawing.Color.White;
+            this.m_writeACASKey.Name = "m_writeACASKey";
+            // 
+            // ACASKeyCount
+            // 
+            resources.ApplyResources(this.ACASKeyCount, "ACASKeyCount");
+            this.ACASKeyCount.BackColor = System.Drawing.Color.Transparent;
+            this.ACASKeyCount.BorderColor = System.Drawing.Color.White;
+            this.ACASKeyCount.Name = "ACASKeyCount";
+            // 
+            // WriteACASKey
+            // 
+            resources.ApplyResources(this.WriteACASKey, "WriteACASKey");
+            this.WriteACASKey.BackColor = System.Drawing.Color.Transparent;
+            this.WriteACASKey.ControlState = CCWin.SkinClass.ControlState.Normal;
+            this.WriteACASKey.DownBack = null;
+            this.WriteACASKey.MouseBack = null;
+            this.WriteACASKey.Name = "WriteACASKey";
+            this.WriteACASKey.NormlBack = null;
+            this.WriteACASKey.SelectedDownBack = null;
+            this.WriteACASKey.SelectedMouseBack = null;
+            this.WriteACASKey.SelectedNormlBack = null;
+            this.WriteACASKey.UseVisualStyleBackColor = false;
+            // 
+            // m_readACASID
+            // 
+            resources.ApplyResources(this.m_readACASID, "m_readACASID");
+            this.m_readACASID.BackColor = System.Drawing.Color.Transparent;
+            this.m_readACASID.BorderColor = System.Drawing.Color.White;
+            this.m_readACASID.Name = "m_readACASID";
+            // 
+            // skinLabel24
+            // 
+            resources.ApplyResources(this.skinLabel24, "skinLabel24");
+            this.skinLabel24.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel24.BorderColor = System.Drawing.Color.White;
+            this.skinLabel24.Name = "skinLabel24";
+            // 
+            // skinLabel27
+            // 
+            resources.ApplyResources(this.skinLabel27, "skinLabel27");
+            this.skinLabel27.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel27.BorderColor = System.Drawing.Color.White;
+            this.skinLabel27.Name = "skinLabel27";
+            // 
+            // skinLabel28
+            // 
+            resources.ApplyResources(this.skinLabel28, "skinLabel28");
+            this.skinLabel28.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel28.BorderColor = System.Drawing.Color.White;
+            this.skinLabel28.Name = "skinLabel28";
+            // 
+            // WriteACASID
+            // 
+            resources.ApplyResources(this.WriteACASID, "WriteACASID");
+            this.WriteACASID.BackColor = System.Drawing.Color.Transparent;
+            this.WriteACASID.ControlState = CCWin.SkinClass.ControlState.Normal;
+            this.WriteACASID.DownBack = null;
+            this.WriteACASID.MouseBack = null;
+            this.WriteACASID.Name = "WriteACASID";
+            this.WriteACASID.NormlBack = null;
+            this.WriteACASID.SelectedDownBack = null;
+            this.WriteACASID.SelectedMouseBack = null;
+            this.WriteACASID.SelectedNormlBack = null;
+            this.WriteACASID.UseVisualStyleBackColor = false;
+            // 
             // OperationPanel
             // 
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -1757,5 +1965,25 @@
         private CCWin.SkinControl.SkinLabel m_writePSN;
         private CCWin.SkinControl.SkinLabel skinLabel20;
         private CCWin.SkinControl.SkinCheckBox WritePSN;
+        private CCWin.SkinControl.SkinLabel m_readEDIDName;
+        private CCWin.SkinControl.SkinLabel m_checkEDIDName;
+        private CCWin.SkinControl.SkinLabel m_writeEDIDName;
+        private CCWin.SkinControl.SkinLabel skinLabel26;
+        private CCWin.SkinControl.SkinCheckBox WriteEDIDName;
+        private CCWin.SkinControl.SkinLabel m_readEDIDPID;
+        private CCWin.SkinControl.SkinLabel m_checkEDIDPID;
+        private CCWin.SkinControl.SkinLabel m_writeEDIDPID;
+        private CCWin.SkinControl.SkinLabel skinLabel21;
+        private CCWin.SkinControl.SkinCheckBox WriteEDIDPID;
+        private CCWin.SkinControl.SkinLabel m_readACASID;
+        private CCWin.SkinControl.SkinLabel skinLabel24;
+        private CCWin.SkinControl.SkinLabel skinLabel27;
+        private CCWin.SkinControl.SkinLabel skinLabel28;
+        private CCWin.SkinControl.SkinCheckBox WriteACASID;
+        private CCWin.SkinControl.SkinLabel m_readACASKey;
+        private CCWin.SkinControl.SkinLabel m_checkACASKey;
+        private CCWin.SkinControl.SkinLabel m_writeACASKey;
+        private CCWin.SkinControl.SkinLabel ACASKeyCount;
+        private CCWin.SkinControl.SkinCheckBox WriteACASKey;
     }
 }

+ 226 - 1
SCBC Factory Tools/Views/OperationPanel.cs

@@ -254,6 +254,10 @@ namespace MOKA_Factory_Tools
                 SetspecificText(OSDNote, LResource.SkipChecking, Color.Yellow);
             if (!readCheckNow.YouTubeReadcheck)
                 SetspecificText(m_readYouTube, LResource.SkipChecking, Color.Yellow);
+            if (!readCheckNow.EDIDPIDReadcheck)
+                SetspecificText(m_readEDIDPID, LResource.SkipChecking, Color.Yellow);
+            if (!readCheckNow.EDIDModeNameReadcheck)
+                SetspecificText(m_readEDIDName, LResource.SkipChecking, Color.Yellow);
             /////////////////////////////////////////////////////////////////
             if (!writeDoneNow.PIDWrite_YesNo)
                 SetspecificText(ProjectIDNote, LResource.SkipCovering, Color.Yellow);          
@@ -301,6 +305,10 @@ namespace MOKA_Factory_Tools
                 SetspecificText(m_writeDSN, LResource.Skip, Color.Yellow);
             if (!writeDoneNow.YouTubeWrite_YesNo)
                 SetspecificText(m_writeYouTube, LResource.Skip, Color.Yellow);
+            if (!writeDoneNow.EDIDPIDWrite_YesNo)
+                SetspecificText(m_writeEDIDPID, LResource.Skip, Color.Yellow);
+            if (!writeDoneNow.EDIDModeNameWrite_YesNo)
+                SetspecificText(m_writeEDIDName, LResource.Skip, Color.Yellow);
             if (FunctionSettingNow.WriteChannel)
                 ChannelText.Text = FunctionSettingNow.ChannelList;                  
             else
@@ -709,7 +717,7 @@ namespace MOKA_Factory_Tools
                         return;
                     }
 
-                    if (!FunctionSettingNow.BarcodeWrite && midListNow.keytype.ContainsKey("DSN") )
+                    if (!FunctionSettingNow.BarcodeWrite && (midListNow.keytype != null && midListNow.keytype.ContainsKey("DSN")) )
                     {
                         // 如果不是全大写字母+数字,返回;
                         Regex r = new Regex(@"^[A-Z0-9]+$");
@@ -1583,6 +1591,29 @@ namespace MOKA_Factory_Tools
                 }
             }
 
+            // 如果是要导出ACASID+SN,先判断ACASID是否等于20位长度;
+            if (FunctionSettingNow.ExportSNACASID)
+            {
+                if ( SerialCMD.ReadJapaneseACASID(TVPort, out result, out data, out error, SerailDelay) )
+                {
+                    if (data.Length != 20)
+                    {
+                        SetfailStatus(m_readACASID);
+                        Log.WriteErrorLog("The ACAS ID length doesn't equal 20!\r\n" + data.ToString());
+                        MessageBox.Show(LResource.ACASIDLengthError + "\r\n" + data.ToString());
+                        goto end;
+                    }
+                    SetsuccessStatus(m_readACASID);
+                }
+                else
+                {
+                    SetfailStatus(m_readACASID);
+                    Log.WriteErrorLog("Read ACAS ID error!\r\n");
+                    MessageBox.Show(LResource.ReadACASIDError + "\r\n");
+                    goto end;
+                }
+            }
+
             //获取key                      
             if (midListNow.host == "LocalPC" && !preloadNow)
             {
@@ -3575,6 +3606,154 @@ namespace MOKA_Factory_Tools
                 }
             }
 
+            // EDID Pid抄写;
+            if (WriteEDIDPID.Checked)
+            {
+                // 4字节转成整数:0~65535,0x0000~0xffff;
+                //byte[] EDIDPidData = Encoding.ASCII.GetBytes(keyInfo.EDIDPid);
+                byte[] EDIDPidData = SerialInit.strToToHexByte(keyInfo.EDIDPid);
+                Log.WriteInfoLog("Write EDID Pid...");
+                if (SerialCMD.SetEDIDPid(TVPort, EDIDPidData, out result, out data, out error, SerailDelay))
+                {
+                    SetsuccessStatus(m_writeEDIDPID);
+                    keycontent += "EDIDPid=" + keyInfo.EDIDPid + "&";
+                    Log.WriteInfoLog("Read EDID Pid...");
+                    if (readCheckNow.EDIDPIDReadcheck ? SerialCMD.ReadEDIDPid(TVPort, out result, out data, out error, SerailDelay) : true)
+                    {
+                        if (readCheckNow.EDIDPIDReadcheck)
+                        {
+                            if (SerialInit.BytesCompare_Base64(data, EDIDPidData))
+                            {
+                                SetsuccessStatus(m_readEDIDPID);
+                            }
+                            else
+                            {
+                                SetfailStatus(m_readEDIDPID);
+                                Log.WriteErrorLog(SN + "   contrast EDID PID fail");
+                                MessageBox.Show(LResource.ContrastEDIDPIDError);
+                                goto end;
+                            }
+                        }
+                    }
+                    else
+                    {
+                        SetfailStatus(m_readEDIDPID);
+                        Log.WriteErrorLog(SN + "   read EDID PID fail");
+                        MessageBox.Show(LResource.ReadEDIDPIDError);
+                        goto end;
+                    }
+                }
+                else
+                {
+                    SetfailStatus(m_writeEDIDPID);
+                    Log.WriteErrorLog(SN + "   Write EDID PID fail");
+                    MessageBox.Show(LResource.WriteEDIDPidError);
+                    goto end;
+                }
+            }
+
+            // EDID Mode Name抄写;
+            if (WriteEDIDName.Checked)
+            {
+                // 长度为13字节;
+                byte[] EDIDNameData = Encoding.ASCII.GetBytes(keyInfo.EDIDModeName);
+                Log.WriteInfoLog("Write EDID Mode Name...");
+                if (SerialCMD.SetEDIDModelName(TVPort, EDIDNameData, out result, out data, out error, SerailDelay))
+                {
+                    SetsuccessStatus(m_writeEDIDName);
+                    keycontent += "EDIDModeName=" + keyInfo.EDIDModeName + "&";
+                    Log.WriteInfoLog("Read EDID Mode Name...");
+                    if (readCheckNow.EDIDModeNameReadcheck? SerialCMD.ReadEDIDModelName(TVPort, out result, out data, out error, SerailDelay) : true)
+                    {
+                        if (readCheckNow.EDIDModeNameReadcheck)
+                        {
+                            if (SerialInit.BytesCompare_Base64(data, EDIDNameData))
+                            {
+                                SetsuccessStatus(m_readEDIDName);
+                            }
+                            else
+                            {
+                                SetfailStatus(m_readEDIDName);
+                                Log.WriteErrorLog(SN + "   contrast EDID Mode Name fail");
+                                MessageBox.Show(LResource.ContrastEDIDModelNameError);
+                                goto end;
+                            }
+                        }
+                    }
+                    else
+                    {
+                        SetfailStatus(m_readEDIDPID);
+                        Log.WriteErrorLog(SN + "   read EDID Mode Name fail");
+                        MessageBox.Show(LResource.ReadEDIDModelNameError);
+                        goto end;
+                    }
+                }
+                else
+                {
+                    SetfailStatus(m_writeEDIDPID);
+                    Log.WriteErrorLog(SN + "   Write EDID Mode Name fail");
+                    MessageBox.Show(LResource.WriteEDIDModelNameError);
+                    goto end;
+                }
+            }
+
+            // ACAS Key抄写;
+            if (WriteACASKey.Checked)
+            {
+                // 长度为13字节;
+                byte[] ACASKeyData = Encoding.ASCII.GetBytes(keyInfo.ACASKey);
+                Log.WriteInfoLog("Write ACAC Key...");
+                if (SerialCMD.SetACASKey(TVPort, ACASKeyData, out result, out data, out error, SerailDelay))
+                {
+                    SetsuccessStatus(m_writeACASKey);
+                    keycontent += "ACACKey=" + keyInfo.ACASKey + "&";
+                    Log.WriteInfoLog("Check ACAS Key...");
+                    if (writeCheckNow.ACASKeyCheckcheck ? SerialCMD.CheckACASKey(TVPort, out result, out data, out error, SerailDelay) : true)
+                    {
+                        SetsuccessStatus(m_checkACASKey);
+                        Log.WriteInfoLog("Read ACAS Key...");
+                        if (readCheckNow.ACASIDReadcheck ? SerialCMD.ReadACASKey(TVPort, out result, out data, out error, SerailDelay) : true)
+                        {
+                            if (readCheckNow.ACASIDReadcheck)
+                            {
+                                if (SerialInit.BytesCompare_Base64(data, ACASKeyData))
+                                {
+                                    SetsuccessStatus(m_readACASKey);
+                                }
+                                else
+                                {
+                                    SetfailStatus(m_readACASKey);
+                                    Log.WriteErrorLog(SN + "   contrast ACAS Key fail");
+                                    MessageBox.Show(LResource.ContrastEDIDModelNameError);
+                                    goto end;
+                                }
+                            }
+                        }
+                        else
+                        {
+                            SetfailStatus(m_readACASKey);
+                            Log.WriteErrorLog(SN + "   read ACAS Key fail");
+                            MessageBox.Show(LResource.ReadEDIDModelNameError);
+                            goto end;
+                        }
+                    }
+                    else
+                    {
+                        SetfailStatus(m_checkACASKey);
+                        Log.WriteErrorLog(SN + "   Check ACAS Key fail");
+                        MessageBox.Show(LResource.WriteEDIDModelNameError);
+                        goto end;
+                    }
+                }
+                else
+                {
+                    SetfailStatus(m_writeACASKey);
+                    Log.WriteErrorLog(SN + "   Write ACAS Key fail");
+                    MessageBox.Show(LResource.WriteEDIDModelNameError);
+                    goto end;
+                }
+            }
+
             //Project ID 抄写检查
             if (ProjectIDNote.Text != LResource.SkipCovering)
             {
@@ -4368,6 +4547,22 @@ namespace MOKA_Factory_Tools
                 if (writeDoneNow.DSNWrite_YesNo)
                     SetCheckboxStatus(WriteDSN, true);
             }
+            if(keys.ContainsKey("edid_pid"))
+            {
+                if (writeDoneNow.EDIDPIDWrite_YesNo)
+                    SetCheckboxStatus(WriteEDIDPID, true);
+            }
+            if (keys.ContainsKey("edid_model_name"))
+            {
+                if (writeDoneNow.EDIDModeNameWrite_YesNo)
+                    SetCheckboxStatus(WriteEDIDName, true);
+            }
+            if (keys.ContainsKey("MOKA_RT2851M_IR"))
+            {
+                if(writeDoneNow.ACASKeyWrite_YesNo)
+                    SetCheckboxStatus(WriteACASKey, true);
+                UpdateKeyCount("MOKA_RT2851M_IR", keys["MOKA_RT2851M_IR"], false);
+            }
             return true;
         }
 
@@ -5159,6 +5354,36 @@ namespace MOKA_Factory_Tools
                         }
                         break;
                     }
+                case "MOKA_RT2851M_IR": // 获取ACAS KEY数量;
+                    {
+                        url1 = url + "/statAcasKey.do?";
+                        item.URL = url1;
+                        item.Postdata = "type=" + keytype;
+                        HttpResult result = http.GetHtml(item);
+                        if (result.StatusCode == System.Net.HttpStatusCode.OK)
+                        {
+                            Log.WriteGetKeyLog("\r\nGetACASkey count:\r\n" + item.URL + "\r\n" + item.Postdata + "\r\n" + result.Html);
+                            if (Xmlconfig.KeyCountXml(result.Html, "response", "count", out code, out desc, out count))
+                            {
+                                if (count == "0")
+                                    SetKeyCountStatus(ACASKeyCount, count, 2);
+                                else
+                                    SetKeyCountStatus(ACASKeyCount, count, 0);
+                            }
+                            else
+                            {
+                                CommonMethod.ReportErrormsg("Fail to parse ACAS key count", desc + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow);
+                                SetKeyCountStatus(ACASKeyCount, code + "Error", 1);
+                            }
+                        }
+                        else
+                        {
+                            CommonMethod.ReportErrormsg("Fail to get ACAS key count", result.StatusDescription + "\r\n" + result.Html + "\r\nAddress: " + item.URL + "\r\nPostdata: " + item.Postdata, errorDBNow);
+                            SetKeyCountStatus(ACASKeyCount, result.StatusDescription, 1);
+                            return false;
+                        }
+                        break;
+                    }
                 default:
                     {
                         break;

Разлика између датотеке није приказан због своје велике величине
+ 770 - 98
SCBC Factory Tools/Views/OperationPanel.resx


Неке датотеке нису приказане због велике количине промена