Эх сурвалжийг харах

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

JeffWang 2 жил өмнө
parent
commit
7fc73d70c5

+ 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

@@ -707,6 +707,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)
                 {

+ 6 - 0
FactoryTool_CShare/Views/OperationPanel.cs

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