Quellcode durchsuchen

退出工厂模式,并不是所有客户TV都实现了该功能,所以需要通过配置文件启动,默认false

JeffWang vor 2 Jahren
Ursprung
Commit
3f2c0c2a53

+ 2 - 0
FactoryTool_CShare/Models/StructList.cs

@@ -244,6 +244,8 @@ namespace MOKA_Factory_Tools
         public bool EnableRetry { get; set; } = false;
         public int RetryCount { get;set; } = 3;
         #endregion
+        // 抄写结束时,是否触发离开工厂模式指令;
+        public bool LeaveFactory { get; set; } = false;
     }
 
     public class KeyData

+ 2 - 0
FactoryTool_CShare/Views/Main.cs

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

+ 3 - 3
FactoryTool_CShare/Views/OperationPanel.cs

@@ -4792,13 +4792,13 @@ namespace MOKA_Factory_Tools
             SetsuccessStatus(ResultStatus);
         end:
             // 退出工厂模式;
-            if ( !SerialCMD.LeaveFactory(TVPort, out result, out data, out error, SerailDelay) )
+            if (FunctionSettingNow.LeaveFactory ? !SerialCMD.LeaveFactory(TVPort, out result, out data, out error, SerailDelay) : false)
             {
-                ErrMsg = string.Format("LeaveFactory Fail\r\n{1}", SN);
+                ErrMsg = string.Format("LeaveFactory Fail\r\n {0}", SN);
                 Log.WriteErrorLog(ErrMsg);
             }
 
-#region 只有惠州工厂才启用G客户防呆措施;
+            #region 只有惠州工厂才启用G客户防呆措施;
             if (FunctionSettingNow.NTF)
             {
                 string strLastResult = "";