| 
					
				 | 
			
			
				@@ -89,13 +89,11 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         private void SetCheckboxStatusByConfig() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-#if DEBUG 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-#else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // 非小米的抄写,不处理.需要保证其他工厂的配置不受影响; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (!FunctionSettingNow.MITVEnable && !FunctionSettingNow.IndiaMITVEnable) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-#endif 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             #region 默认根据config启用是否抄写; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             SetCheckboxStatus(WriteDID, cfg_writedone.DIDWrite_YesNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             SetCheckboxStatus(WriteMac, cfg_writedone.MacWrite_YesNo); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1832,8 +1830,8 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             string ErrMsg = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             string psn = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             string devicecode = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            //PSN 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            string GetPSNInFsn; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            string GetSmesDSN = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #if !SIMULATION && !OD_VER 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //进工厂 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (!TVPort.IsOpen) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2355,6 +2353,16 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            //北美DSN配置项 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (FunctionSettingNow.UserDSNFromSmes) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (!V2Method.GetDSNFromSmes(SN, out GetSmesDSN)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    ErrMsg = string.Format("GetDSNFromSmes error!\r\n{0}", keyInfo.DSN.data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #if OD_VER 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         if (keyInfo != null) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2436,12 +2444,27 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     if (midListNow.keytype.ContainsKey("DSN")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         // 预防切了pid后,deviceCode变化了; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        if (keyInfo.DSN.data != null && keyInfo.DSN.data.IndexOf(devicecode) == -1) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        //不是北美项目,正常运行 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (!FunctionSettingNow.UserDSNFromSmes) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            ErrMsg = string.Format("The device code [{0}] is not included in the DSN [{1}]!\r\n", devicecode, keyInfo.DSN.data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            // 预防切了pid后,deviceCode变化了; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (keyInfo.DSN.data != null && keyInfo.DSN.data.IndexOf(devicecode) == -1) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                ErrMsg = string.Format("The device code [{0}] is not included in the DSN [{1}]!\r\n", devicecode, keyInfo.DSN.data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            // 用MES的DSN来判断; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (GetSmesDSN != null && GetSmesDSN.IndexOf(devicecode) == -1) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                ErrMsg = string.Format("The device code [{0}] is not included in the GetSmesDSN [{1}]!\r\n", devicecode, GetSmesDSN); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        }                        
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #region EDID屏抄写是从MID中获取值; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -4810,13 +4833,13 @@ namespace MOKA_Factory_Tools 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     {// 如果是G客户,要在抄写其他key前时行fsn+psn查重处理; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        if (!CommonMethod.IsNumberAndWord(keyInfo.DSN.data)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (!CommonMethod.IsNumberAndWord(FunctionSettingNow.UserDSNFromSmes ? GetSmesDSN : keyInfo.DSN.data)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             ErrMsg = string.Format("DSN format error!\r\n{0}", keyInfo.DSN.data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             Log.WriteErrorLog(ErrMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             goto end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        byte[] DSNData = System.Text.Encoding.ASCII.GetBytes(keyInfo.DSN.data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        byte[] DSNData = System.Text.Encoding.ASCII.GetBytes(FunctionSettingNow.UserDSNFromSmes ? GetSmesDSN : keyInfo.DSN.data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         Log.WriteInfoLog("Write DSN..."); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         if (SerialCMD.SetFireTVDSN(TVPort, DSNData, out result, out data, out error, SerailDelay)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         { 
			 |