Browse Source

JobAutoStart 初版完成

JET-JJY 4 days ago
parent
commit
0d4eb424c1

+ 2 - 1
FrameworkLocal/Common/Jobs/ProcessJobInfo.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Runtime.Serialization;
+using MECF.Framework.Common.DataCenter;
 using MECF.Framework.Common.Equipment;
 using MECF.Framework.Common.Schedulers;
 
@@ -84,7 +85,7 @@ namespace MECF.Framework.Common.Jobs
         public bool IsStandbyStarted { get; set; }
         public string N2PurgeModeStr { get; set; }
         public bool IsJobAutoStartTrigger { get; set; }
-
+        public ScheduleMaintenanceDataItem scheduleMaintenanceDataItem { get; set; }
 
         public ProcessJobInfo()
         {

+ 43 - 21
Furnace/FurnaceRT/Equipments/Jobs/AutoTransfer.cs

@@ -52,6 +52,7 @@ using System.Windows.Ink;
 using Aitex.Core.UI.Control;
 using MECF.Framework.UI.Client.CenterViews.DataLogs.ProcessHistory;
 using MECF.Framework.Common.FAServices;
+using Newtonsoft.Json;
 
 namespace FurnaceRT.Equipments.Jobs
 {
@@ -76,6 +77,7 @@ namespace FurnaceRT.Equipments.Jobs
         private SchedulerFACallback _faCallback;
         private SchedulerDBCallback _dbCallback;
         private ProcessJobInfo _secondPj;
+        private ProcessJobInfo _acitiveProcessJobInfo;
         private Dictionary<string, int> _sideDummyWafers = new Dictionary<string, int>();
         private Dictionary<string, int> _extraDummyWafers = new Dictionary<string, int>();
         private List<int> _sideDummySlots = new List<int>();
@@ -690,7 +692,12 @@ namespace FurnaceRT.Equipments.Jobs
             pj.CoolTimeSec = coolTime;
             pj.IsEmptyLayout = !layoutRecipeDataExpert.Items.Any(x => x != "----");
             pj.N2PurgeModeStr = recipeHead.N2PurgeModeStr;
-            pj.IsJobAutoStartTrigger = param.ContainsKey("IsJobAutoStart") ? bool.Parse(param["IsJobAutoStart"].ToString()) : false;
+            var isJobAutoStart = param.ContainsKey("IsJobAutoStart") ? bool.Parse(param["IsJobAutoStart"].ToString()) : false;
+            if (isJobAutoStart)
+            {
+                pj.IsJobAutoStartTrigger = isJobAutoStart;
+                pj.scheduleMaintenanceDataItem = JsonConvert.DeserializeObject<ScheduleMaintenanceDataItem>(param["ScheduleMaintenanceDataItem"].ToString());
+            }
 
             if (useStockers.Any() && !CheckChargeRule(pj, out bool waferShort, false, true, out reason))
             {
@@ -1049,6 +1056,10 @@ namespace FurnaceRT.Equipments.Jobs
                 }
                 else
                 {
+                    if (pj.ProcessingState == EnumProcessingState.WaitingProcess)
+                    {
+                        _acitiveProcessJobInfo = pj;
+                    }
                     if (pj.State == EnumProcessJobState.Processing)
                     {
                         var pmModule = Singleton<EquipmentManager>.Instance.Modules[ModuleName.PM1] as PMModule;
@@ -1351,19 +1362,22 @@ namespace FurnaceRT.Equipments.Jobs
                 return;
             _secondPj = GetSecondlyProcessJobV2();
 
-            ControlJobInfo cjActived = null;
-            DateTime dtMin = DateTime.MaxValue;
-            foreach (var cj in _lstControlJobs)
+            ControlJobInfo cjActived = _lstControlJobs.FirstOrDefault(r => r.State == EnumControlJobState.Executing || r.State == EnumControlJobState.Paused);//已有执行cj,不再查找
+            if (cjActived == null)
             {
-                if (cj.State == EnumControlJobState.Completed)
-                    continue;
-                if (cj.CreateTime.CompareTo(dtMin) < 0)
+                int level = _lstControlJobs.Max(r => r.PriorityExecuteLevel);
+                DateTime dtMin = DateTime.MaxValue;
+                foreach (var cj in _lstControlJobs)
                 {
-                    dtMin = cj.CreateTime;
-                    cjActived = cj;
+                    if (cj.State == EnumControlJobState.Completed || cj.PriorityExecuteLevel < level)//优先级低的先不执行
+                        continue;
+                    if (cj.CreateTime.CompareTo(dtMin) < 0)
+                    {
+                        dtMin = cj.CreateTime;//记录第一个job的创建时间,获取最早的cj
+                        cjActived = cj;
+                    }
                 }
             }
-
             if (cjActived == null)
                 return;
 
@@ -4834,7 +4848,7 @@ namespace FurnaceRT.Equipments.Jobs
                 if (needPAndCurrect > 0)
                 {
                     //判断dumy是否够补充p类型
-                    var surplusDumyCount = ( currentEDWaferNum) - needPAndCurrect;
+                    var surplusDumyCount = (currentEDWaferNum) - needPAndCurrect;
                     if (surplusDumyCount >= 0)
                     {
                         //判断剩余dumy是否足够Layout配置
@@ -4862,7 +4876,7 @@ namespace FurnaceRT.Equipments.Jobs
                                         currentEDWaferNum--;
                                         needPAndCurrect--;
                                     }
-                                  
+
                                 }
                             }
                         }
@@ -4889,7 +4903,7 @@ namespace FurnaceRT.Equipments.Jobs
                                             currentEDWaferNum--;
                                             needPAndCurrect--;
                                         }
-                                        
+
                                     }
                                 }
                             }
@@ -6476,7 +6490,7 @@ namespace FurnaceRT.Equipments.Jobs
 
 
                                     Singleton<EquipmentManager>.Instance.SDWaferTypeUseCountAlarm.Set(msg);
-                                    pm.TriggerJobAutoStart(maintenanceItemCarrierUseFreq.AssociationProcessRecipeName, RecipeExecEntryEnum.SDWaferRangeTrigger);
+                                    pm.TriggerJobAutoStart(maintenanceItemCarrierUseFreq, RecipeExecEntryEnum.SDWaferRangeTrigger);
                                     LOG.Info($"{msg} Trigger {maintenanceItemCarrierUseFreq.AssociationProcessRecipeName}");
                                     //  Singleton<ScheduleMaintenanceDataManager>.Instance.SetValue(maintenanceItemCarrierUseFreq.Item, 0, true);
                                     return false;
@@ -6506,7 +6520,7 @@ namespace FurnaceRT.Equipments.Jobs
                                     }
 
                                     Singleton<EquipmentManager>.Instance.SDWaferTypeUseTimeAlarm.Set(msg);
-                                    pm.TriggerJobAutoStart(maintenanceItemWaferUserTime.AssociationProcessRecipeName, RecipeExecEntryEnum.SDWaferRangeTrigger);
+                                    pm.TriggerJobAutoStart(maintenanceItemWaferUserTime, RecipeExecEntryEnum.SDWaferRangeTrigger);
                                     LOG.Info($"{msg} Trigger {maintenanceItemWaferUserTime.AssociationProcessRecipeName}");
 
                                     //  Singleton<ScheduleMaintenanceDataManager>.Instance.SetValue(maintenanceItemWaferUserTime.Item, 0, true);
@@ -6537,7 +6551,7 @@ namespace FurnaceRT.Equipments.Jobs
 
 
                                     Singleton<EquipmentManager>.Instance.SDWaferTypeThicknessAlarm.Set(msg);
-                                    pm.TriggerJobAutoStart(maintenanceItemWaferThickness.AssociationProcessRecipeName, RecipeExecEntryEnum.SDWaferRangeTrigger);
+                                    pm.TriggerJobAutoStart(maintenanceItemWaferThickness, RecipeExecEntryEnum.SDWaferRangeTrigger);
                                     LOG.Info($"{msg} Trigger {maintenanceItemWaferThickness.AssociationProcessRecipeName}");
 
 
@@ -6613,7 +6627,7 @@ namespace FurnaceRT.Equipments.Jobs
                                         return false;
                                     }
                                     Singleton<EquipmentManager>.Instance.FDWaferTypeUseCountAlarm.Set(msg);
-                                    pm.TriggerJobAutoStart(maintenanceItemCarrierUseFreq.AssociationProcessRecipeName, RecipeExecEntryEnum.EDWaferRangeTrigger);
+                                    pm.TriggerJobAutoStart(maintenanceItemCarrierUseFreq, RecipeExecEntryEnum.EDWaferRangeTrigger);
                                     LOG.Info($"{msg} Trigger {maintenanceItemCarrierUseFreq.AssociationProcessRecipeName}");
 
 
@@ -6648,7 +6662,7 @@ namespace FurnaceRT.Equipments.Jobs
                                     }
 
                                     Singleton<EquipmentManager>.Instance.FDWaferTypeUseTimeAlarm.Set(msg);
-                                    pm.TriggerJobAutoStart(maintenanceItemWaferUserTime.AssociationProcessRecipeName, RecipeExecEntryEnum.EDWaferRangeTrigger);
+                                    pm.TriggerJobAutoStart(maintenanceItemWaferUserTime, RecipeExecEntryEnum.EDWaferRangeTrigger);
                                     LOG.Info($"{msg} Trigger {maintenanceItemWaferUserTime.AssociationProcessRecipeName}");
 
                                     //   Singleton<ScheduleMaintenanceDataManager>.Instance.SetValue(maintenanceItemWaferUserTime.Item, 0, true);
@@ -6676,7 +6690,7 @@ namespace FurnaceRT.Equipments.Jobs
                                         return false;
                                     }
                                     Singleton<EquipmentManager>.Instance.FDWaferTypeThicknessAlarm.Set(msg);
-                                    pm.TriggerJobAutoStart(maintenanceItemWaferThickness.AssociationProcessRecipeName, RecipeExecEntryEnum.EDWaferRangeTrigger);
+                                    pm.TriggerJobAutoStart(maintenanceItemWaferThickness, RecipeExecEntryEnum.EDWaferRangeTrigger);
                                     LOG.Info($"{msg} Trigger {maintenanceItemWaferThickness.AssociationProcessRecipeName}");
 
 
@@ -6858,14 +6872,14 @@ namespace FurnaceRT.Equipments.Jobs
                         (Singleton<EquipmentManager>.Instance.Modules[ModuleName.WaferRobot] as WaferRobotModule).Home(out _);
                         pj.RobotHomed = true;
                     }
+                    pj.ProcessingState = EnumProcessingState.WaitingProcess;
 
-                    pj.ProcessingState = EnumProcessingState.Processing;
 
                     var _boatslotmap = GetBoatSlotMap();
                     _faCallback.EndCharge(pj, _boatslotmap);
 
                     pmModule?.SetN2PurgeLAO2CheckFirstEnable(false);
-                    if (pm.Process((string)pj.ProcessRecipe, false, true))
+                    if (pm.Process((string)pj.ProcessRecipe, false, true, pj.IsJobAutoStartTrigger))
                         return;
                 }
 
@@ -8073,5 +8087,13 @@ namespace FurnaceRT.Equipments.Jobs
             }
             return null;
         }
+
+        public void SetPJState()
+        {
+            if (_acitiveProcessJobInfo == null)
+                return;
+
+            _acitiveProcessJobInfo.ProcessingState = EnumProcessingState.Processing;
+        }
     }
 }

+ 4 - 2
Furnace/FurnaceRT/Equipments/PMs/PMModule.cs

@@ -47,6 +47,7 @@ using FabConnect.SecsGemInterface.Common;
 using MECF.Framework.Common.FAServices;
 using MECF.Framework.FA.Core.FAInterface;
 using MECF.Framework.Common.Device;
+using MECF.Framework.Common.Jobs;
 
 namespace FurnaceRT.Equipments.PMs
 {
@@ -901,6 +902,7 @@ namespace FurnaceRT.Equipments.PMs
             Transition(STATE.CloseSlitValve, MSG.Abort, FsmAbortTask, STATE.Idle);
 
             //PreProcess
+            Transition(STATE.Idle, MSG.RunIdleRecipe, FsmStartIdleRecipePreProcess, STATE.PreProcess);
             Transition(STATE.Process, MSG.RunIdleRecipe, FsmStartIdleRecipePreProcess, STATE.PreProcess);
             Transition(STATE.Process, MSG.RunOtherRecipe, FsmStartOtherRecipePreProcess, STATE.PreProcess);
             Transition(STATE.Idle, MSG.RunOtherRecipe, FsmStartOtherRecipePreProcess, STATE.PreProcess);
@@ -1065,7 +1067,7 @@ namespace FurnaceRT.Equipments.PMs
 
             RecipeExecEntryEnumValue = RecipeExecEntryEnum.MaintenanceJobTrigger;
 
-            _preprocessRoutine.Init((string)param[0]);
+            _preprocessRoutine.Init((string)param[0], true, (bool)param[1]);
             Result ret = StartRoutine(_preprocessRoutine);
             if (ret == Result.FAIL || ret == Result.DONE)
                 return false;
@@ -1736,7 +1738,7 @@ namespace FurnaceRT.Equipments.PMs
 
         }
         #region 
-
+     
         #region 
         private string _processRecipeStepNumber = "";
         private string _processRecipeStepName = "";

+ 14 - 12
Furnace/FurnaceRT/Equipments/PMs/PMScheduleMaintenance.cs

@@ -11,6 +11,7 @@ using Aitex.Core.UI.Control;
 using Aitex.Core.Util;
 using DocumentFormat.OpenXml.VariantTypes;
 using FurnaceRT.Equipments.Systems;
+using HslCommunication;
 using MECF.Framework.Common.CommonData.EnumData;
 using MECF.Framework.Common.DataCenter;
 using MECF.Framework.Common.DBCore;
@@ -20,6 +21,7 @@ using MECF.Framework.Common.OperationCenter;
 using MECF.Framework.Common.Utilities;
 using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.PMs;
 using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot;
+using Newtonsoft.Json;
 using System;
 using System.Collections;
 using System.Collections.Generic;
@@ -217,11 +219,10 @@ namespace FurnaceRT.Equipments.PMs
         #endregion
         #region ScheduleMaintenance
 
-        public void TriggerJobAutoStart(string recipe, RecipeExecEntryEnum recipeExecEntryEnumValue)
+        public void TriggerJobAutoStart(ScheduleMaintenanceDataItem item, RecipeExecEntryEnum recipeExecEntryEnumValue)
         {
             RecipeExecEntryEnumValue = recipeExecEntryEnumValue;
-            ScheduleMaintenanceCommandCreateJob(recipe);
-
+            ScheduleMaintenanceCommandCreateJob(item);
         }
         public string GetAlarmWarningMsg(ScheduleMaintenanceDataItem item, bool isJobAutoStart = false, string currentValue = "", string minValue = "", string maxValue = "")
         {
@@ -471,7 +472,7 @@ namespace FurnaceRT.Equipments.PMs
                             // var logInfo = $"{message} Trigger {item.AssociationProcessRecipeName} ,auto clear CurrentValue {item.LimitValue} to 0";
                             LOG.Info(logInfo);
                             RecipeExecEntryEnumValue = RecipeExecEntryEnum.RecipeStepRangeTrigger;
-                            ScheduleMaintenanceCommandCreateJob(item.AssociationProcessRecipeName);
+                            ScheduleMaintenanceCommandCreateJob(item);
                         }
 
                     }
@@ -537,7 +538,7 @@ namespace FurnaceRT.Equipments.PMs
                         // var logInfo = $"{message} Trigger {item.AssociationProcessRecipeName} ,auto clear CurrentValue {item.LimitValue} to 0";
                         LOG.Info(logInfo);
                         RecipeExecEntryEnumValue = RecipeExecEntryEnum.RecipeStepRangeTrigger;
-                        ScheduleMaintenanceCommandCreateJob(item.AssociationProcessRecipeName);
+                        ScheduleMaintenanceCommandCreateJob(item);
                     }
                 }
                 isPause = true;
@@ -591,7 +592,7 @@ namespace FurnaceRT.Equipments.PMs
                         var logInfo = $"{message} Trigger {item.AssociationProcessRecipeName}";
                         LOG.Info(logInfo);
                         RecipeExecEntryEnumValue = RecipeExecEntryEnum.RecipeStepRangeTrigger;
-                        ScheduleMaintenanceCommandCreateJob(item.AssociationProcessRecipeName);
+                        ScheduleMaintenanceCommandCreateJob(item);
 
                     }
                 }
@@ -656,7 +657,7 @@ namespace FurnaceRT.Equipments.PMs
                         // var logInfo = $"{message} Trigger {item.AssociationProcessRecipeName} ,auto clear CurrentValue {item.LimitValue} to 0";
                         LOG.Info(logInfo);
                         RecipeExecEntryEnumValue = RecipeExecEntryEnum.RecipeRangeTrigger;
-                        ScheduleMaintenanceCommandCreateJob(item.AssociationProcessRecipeName);
+                        ScheduleMaintenanceCommandCreateJob(item);
                     }
                 }
                 isPause = true;
@@ -712,7 +713,7 @@ namespace FurnaceRT.Equipments.PMs
                         // var logInfo = $"{message} Trigger {item.AssociationProcessRecipeName} ,auto clear CurrentValue {item.LimitValue} to 0";
                         LOG.Info(logInfo);
                         RecipeExecEntryEnumValue = RecipeExecEntryEnum.BoatRecipeRangeTrigger;
-                        ScheduleMaintenanceCommandCreateJob(item.AssociationProcessRecipeName, false);
+                        ScheduleMaintenanceCommandCreateJob(item, false);
 
                     }
 
@@ -770,7 +771,7 @@ namespace FurnaceRT.Equipments.PMs
                         // var logInfo = $"{message} Trigger {item.AssociationProcessRecipeName} ,auto clear CurrentValue {item.LimitValue} to 0";
                         LOG.Info(logInfo);
                         RecipeExecEntryEnumValue = RecipeExecEntryEnum.RecipeRangeTrigger;
-                        ScheduleMaintenanceCommandCreateJob(item.AssociationProcessRecipeName);
+                        ScheduleMaintenanceCommandCreateJob(item);
                     }
 
                 }
@@ -782,16 +783,16 @@ namespace FurnaceRT.Equipments.PMs
         }
 
 
-        public void ScheduleMaintenanceCommandCreateJob(string jobName, bool isCheck = true)
+        public void ScheduleMaintenanceCommandCreateJob(ScheduleMaintenanceDataItem scheduleMaintenanceDataItem, bool isCheck = true)
         {
-            if (string.IsNullOrEmpty(jobName))
+            if (string.IsNullOrEmpty(scheduleMaintenanceDataItem.AssociationProcessRecipeName))
                 return;
             var time = DateTime.Now.ToString("yyyyMMddHHmmssfff");
             Dictionary<string, object> param = new Dictionary<string, object>()
                         {
                             {"PJID", $"PJ_{time}"},
                             {"CJID", $"CJ_{time}"},
-                            {"JobRecipe", jobName},
+                            {"JobRecipe", scheduleMaintenanceDataItem.AssociationProcessRecipeName},
                             {"CarrierPara", ""},
                             {"m1CarrierPara", ""},
                             {"m2CarrierPara", ""},
@@ -799,6 +800,7 @@ namespace FurnaceRT.Equipments.PMs
                             {"Charge", false},
                             {"IsNeedCheck", isCheck},
                             {"IsJobAutoStart", true},
+                            {"ScheduleMaintenanceDataItem",JsonConvert.SerializeObject(scheduleMaintenanceDataItem)},
                         };
             Singleton<EquipmentManager>.Instance.ScheduleMaintenanceCommandCreateJob(param, 1);
 

+ 7 - 50
Furnace/FurnaceRT/Equipments/PMs/RecipeExecutions/PreProcess.cs

@@ -45,6 +45,7 @@ namespace FurnaceRT.Equipments.PMs.RecipeExecutions
             _isJobAutoStart = IsJobAutoStart;
         }
 
+
         private List<RecipeStep> _recipeSteps;
         public override Result Start(params object[] objs)
         {
@@ -59,61 +60,15 @@ namespace FurnaceRT.Equipments.PMs.RecipeExecutions
             if (_isProcessRecipe)
             {
 
-
-
                 if (!RecipeParser.Parse(_recipeName, Module, out recipeHead, out _recipeSteps, out reason, "Process"))
                 {
                     PMModule.PreprocessStartFailedWarning.Set($"Load process recipe {_recipeName} failed, {reason}");
                     return Result.FAIL;
                 }
-
-                #region MyRegion
-
-                //var isScheduleMaintenance = SC.ContainsItem("System.EnableScheduleMaintenance") && SC.GetValue<bool>("System.EnableScheduleMaintenance");
-                //if (isScheduleMaintenance)
-                //{
-
-                //    var pm = (Singleton<EquipmentManager>.Instance.Modules[ModuleName.PM1] as PMModule);
-
-                //    pm.GetAllDBRecord();
-
-
-                //    pm.CheckBoatRecipeThicknessMoreThan(out var boatRecipeThicknessIsPause, out string boatRecipeThicknessJobName);
-                //    if (boatRecipeThicknessIsPause)
-                //        return Result.FAIL;
-
-                //    pm.CheckRecipeThicknessMoreThan(_recipeName, out var isPause, out string jobName);
-                //    if (isPause)
-                //        return Result.FAIL;
-
-                //    pm.CheckRecipeExecuteFreqMoreThan(_recipeName, out var isPause1, out string jobName1);
-                //    if (isPause1)
-                //        return Result.FAIL;
-
-
-                //    foreach (var item in recipeSteps)
-                //    {
-
-                //        pm.CheckRecipeStepFreqMoreThan(item.StepName, out var isPause2, out string jobName2);
-                //        if (isPause2)
-                //            return Result.FAIL;
-
-                //        pm.CheckRecipeStepTimeMoreThan(item.StepName, out var isPause3, out string jobName3);
-                //        if (isPause3)
-                //            return Result.FAIL;
-
-                //        pm.CheckRecipeStepGroupThicknessMoreThan(item.StepName, out var isPause4, out string jobName4);
-                //        if (isPause4)
-                //            return Result.FAIL;
-
-                //    }
-
-                //}
-                #endregion
-
-
                 PMModule.RecipeRunningInfo.MainRecipeName = _recipeName;
                 PMModule.RecipeRunningInfo.Head = recipeHead;
+                PMModule.RecipeRunningInfo.IsProcessRecipe = _isProcessRecipe;
+                PMModule.RecipeRunningInfo.IsJobAutoStart = _isJobAutoStart;
                 PMModule.RecipeRunningInfo.RecipeStepList = _recipeSteps;
                 PMModule.RecipeRunningInfo.ExecRecipeType = _recipeSteps.Count > 0 ? _recipeSteps[0].RecipeType : string.Empty;
             }
@@ -145,7 +100,7 @@ namespace FurnaceRT.Equipments.PMs.RecipeExecutions
             {
                 return Result.FAIL;
             }
-
+            Singleton<EquipmentManager>.Instance.SetPJState();
             return Result.DONE;
         }
         public void CheckSchedule(int id, PMModule pm, int timeout)
@@ -161,7 +116,9 @@ namespace FurnaceRT.Equipments.PMs.RecipeExecutions
                 return true;
             }, () =>
             {
-              
+                if (_isJobAutoStart|| !_isProcessRecipe)
+                    return true;
+           
                 pm.CheckBoatRecipeThicknessMoreThan(out var boatRecipeThicknessIsPause, out string boatRecipeThicknessJobName, false);
                 if (boatRecipeThicknessIsPause)
                     return false;

+ 3 - 2
Furnace/FurnaceRT/Equipments/PMs/RecipeExecutions/Process.cs

@@ -843,8 +843,9 @@ namespace FurnaceRT.Equipments.PMs.RecipeExecutions
                                     EV.PostWarningLog(PMModule.Module, "Auto profile failed");
 
                                 PMModule.UpdateRecipeFre(PMModule.RecipeRunningInfo.RecipeName);
-                                CheckScheduleMaintenanceModule(PMModule.RecipeRunningInfo.RecipeName);
-
+                                if (!PMModule.RecipeRunningInfo.IsJobAutoStart && PMModule.RecipeRunningInfo.IsProcessRecipe)
+                                    CheckScheduleMaintenanceModule(PMModule.RecipeRunningInfo.RecipeName);
+                                
                                 PMModule.ResetFDCRecipeStepName();
                                 Notify("End");
                                 return Result.DONE;

+ 4 - 0
Furnace/FurnaceRT/Equipments/PMs/RecipeExecutions/RecipeRunningInfo.cs

@@ -49,5 +49,9 @@ namespace FurnaceRT.Equipments.PMs.RecipeExecutions
 
         public bool IsLooping { get; set; }
         public double RemainTimeExcludeEndStep { get; set; }
+
+        public bool IsJobAutoStart { get; set; }
+        public bool IsProcessRecipe { get; set; }
+
     }
 }

+ 6 - 0
Furnace/FurnaceRT/Equipments/Schedulers/SchedulerDBCallback.cs

@@ -16,6 +16,7 @@ using MECF.Framework.Common.CommonData.EnumData;
 using MECF.Framework.Common.DataCenter;
 using Aitex.Core.Util;
 using FurnaceRT.Equipments.Systems;
+using MECF.Framework.Common.Device;
 
 namespace FurnaceRT.Equipments.Schedulers
 {
@@ -124,6 +125,8 @@ namespace FurnaceRT.Equipments.Schedulers
             _processJobInfo.JobRecipe = pj.JobRecipe;
             _processJobInfo.ProcessRecipe = pj.ProcessRecipe;
             _processJobInfo.LayoutRecipe = pj.LayoutRecipe;
+            _processJobInfo.IsJobAutoStartTrigger = pj.IsJobAutoStartTrigger;
+            _processJobInfo.scheduleMaintenanceDataItem = pj.scheduleMaintenanceDataItem;
             var batchId = DateTime.Now.ToString("yyyyMMddHHmmssffff");
 
             RecipeParser.LayoutRecipeParse(_processJobInfo.LayoutRecipe, ModuleName.PM1.ToString(),
@@ -204,6 +207,9 @@ namespace FurnaceRT.Equipments.Schedulers
             if (_processJobInfo != null)
             {
                 endStatus = (Singleton<EquipmentManager>.Instance.Modules[ModuleName.PM1] as PMModule).GetRecipeAbnormalEndByPJId(_processJobInfo.InnerId.ToString());
+                if (endStatus == ConstantsCommon.NormalEnd.ToString()&& _processJobInfo.IsJobAutoStartTrigger)
+                    Singleton<ScheduleMaintenanceDataManager>.Instance.SetValue(_processJobInfo.scheduleMaintenanceDataItem.Item, 0);
+
                 JobDataRecorder.EndPJ(_processJobInfo.InnerId.ToString(), endStatus);
             }
         }

+ 8 - 0
Furnace/FurnaceRT/Equipments/Systems/EquipmentManager.cs

@@ -1857,7 +1857,15 @@ namespace FurnaceRT.Equipments.Systems
             return CheckToPostMessage((int)MSG.CreateJob, param, priorityExecuteLevel);
         }
 
+        public void SetPJState()
+        {
+            if (_auto == null)
+                return;
+
+            _auto.SetPJState();
 
+
+        }
         #endregion
     }
 }

+ 1 - 0
Furnace/FurnaceRT/FurnaceRT.csproj

@@ -75,6 +75,7 @@
     <Reference Include="Microsoft.DwayneNeed">
       <HintPath>..\..\ThirdParty\dlls\Microsoft.DwayneNeed.dll</HintPath>
     </Reference>
+    <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" />
     <Reference Include="RTCommunicatorBase, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\ThirdParty\Minices\RTCommunicatorBase.dll</HintPath>