| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 | 
							- using Aitex.Core.RT.Fsm;
 
- using Aitex.Core.RT.Log;
 
- using Aitex.Core.Util;
 
- using MECF.Framework.Common.Equipment;
 
- using MECF.Framework.Common.RecipeCenter;
 
- using MECF.Framework.Common.ToolLayout;
 
- using PunkHPX8_RT.Modules;
 
- using PunkHPX8_RT.Modules.Reservoir;
 
- using System;
 
- using System.Collections.Generic;
 
- using System.Linq;
 
- using System.Text;
 
- using System.Threading.Tasks;
 
- namespace PunkHPX8_RT.Schedulers
 
- {
 
-     public class SchedulerSequenceRecipeManager : Singleton<SchedulerSequenceRecipeManager>
 
-     {
 
-         /// <summary>
 
-         /// 是否存在可用的cell
 
-         /// </summary>
 
-         /// <param name="sequenceRecipe"></param>
 
-         /// <returns></returns>
 
-         public bool ExistAvaibleProcessCell(SequenceRecipe sequenceRecipe, bool showError, bool checkSrd = false)
 
-         {
 
-             if (sequenceRecipe == null)
 
-             {
 
-                 if (showError)
 
-                 {
 
-                     LOG.WriteLog(eEvent.ERR_SEQUENCE, "System", "sequence recipe is null");
 
-                 }
 
-                 return false;
 
-             }
 
-             int count = 0;
 
-             for (int i = 0; i < sequenceRecipe.Recipes.Count; i++)
 
-             {
 
-                 string item = sequenceRecipe.Recipes[i];
 
-                 if (string.IsNullOrEmpty(item))
 
-                 {
 
-                     continue;
 
-                 }
 
-                 if (item.ToLower().EndsWith("srd.rcp") && !checkSrd)
 
-                 {
 
-                     continue;
 
-                 }
 
-                 if (item.ToLower().EndsWith("srd.rcp") && !checkSrd)
 
-                 {
 
-                     continue;
 
-                 }
 
-                 if (i == 0 && item.ToLower().EndsWith("qdr.rcp"))
 
-                 {
 
-                     RinseItem rinseItem = RinseItemManager.Instance.GetPrewetRinseItem();
 
-                     if (rinseItem == null)
 
-                     {
 
-                         if (showError)
 
-                         {
 
-                             LOG.WriteLog(eEvent.ERR_SEQUENCE, "System", $"sequence {sequenceRecipe.Ppid} has no pwt rinse cell");
 
-                         }
 
-                         return false;
 
-                     }
 
-                 }
 
-                 ModuleType moduleType = SequenceRecipeManager.Instance.GetModuleType(item);
 
-                 if (moduleType == ModuleType.None)
 
-                 {
 
-                     if (showError)
 
-                     {
 
-                         LOG.WriteLog(eEvent.ERR_SEQUENCE, "System", $"sequence {sequenceRecipe.Ppid} item {item} is invalid type");
 
-                     }
 
-                     return false;
 
-                 }
 
-                 if (moduleType == ModuleType.Metal)
 
-                 {
 
-                     DepRecipe depRecipe =(DepRecipe)SequenceRecipeManager.Instance.LoadSequenceTypeRecipe(sequenceRecipe.SequenceType,item, RecipeType.DEP);
 
-                     if (depRecipe == null)
 
-                     {
 
-                         if (showError)
 
-                         {
 
-                             LOG.WriteLog(eEvent.ERR_SEQUENCE, "System", $"sequece {sequenceRecipe.Ppid} metal recipe {depRecipe.Ppid} is invalid ");
 
-                         }
 
-                         return false;
 
-                     }
 
-                 }
 
-                 else 
 
-                 {
 
-                     ModuleName moduleName= SchedulerSequenceManager.Instance.GetAvaibleModuleCell(sequenceRecipe.SequenceType,moduleType);
 
-                     if(moduleName==ModuleName.Unknown)
 
-                     {
 
-                         if (showError)
 
-                         {
 
-                             LOG.WriteLog(eEvent.ERR_SEQUENCE, "System", $"sequece {sequenceRecipe.Ppid} has not avaible {moduleType} module");
 
-                         }
 
-                         return false;
 
-                     }
 
-                 }
 
-                 count++;
 
-             }
 
-             if (count == 0)
 
-             {
 
-                 if (showError)
 
-                 {
 
-                     LOG.WriteLog(eEvent.ERR_SEQUENCE, "System", $"sequece {sequenceRecipe.Ppid} not set avaible cell");
 
-                 }
 
-                 return false;
 
-             }
 
-             return true;
 
-         }
 
-         /// <summary>
 
-         /// 获取sequence的化学液
 
-         /// </summary>
 
-         /// <param name="sequenceRecipe"></param>
 
-         /// <returns></returns>
 
-         public List<string> GetSequenceChemistry(SequenceRecipe sequenceRecipe)
 
-         {
 
-             List<string> chemistries = new List<string>();
 
-             for (int i = 0; i < sequenceRecipe.Recipes.Count; i++)
 
-             {
 
-                 string item = sequenceRecipe.Recipes[i];
 
-                 if (string.IsNullOrEmpty(item))
 
-                 {
 
-                     continue;
 
-                 }
 
-                 ModuleType moduleType = SequenceRecipeManager.Instance.GetModuleType(item);
 
-                 if (moduleType == ModuleType.Metal)
 
-                 {
 
-                     DepRecipe depRecipe = (DepRecipe)SequenceRecipeManager.Instance.LoadSequenceTypeRecipe(sequenceRecipe.SequenceType, item, RecipeType.DEP);
 
-                     if (!chemistries.Contains(depRecipe.Chemistry))
 
-                     {
 
-                         chemistries.Add(depRecipe.Chemistry);
 
-                     }
 
-                 }
 
-             }
 
-             return chemistries;
 
-         }
 
-         /// <summary>
 
-         /// 是否Sequence Recipe是否可用
 
-         /// </summary>
 
-         /// <param name="sequenceRecipe"></param>
 
-         /// <returns></returns>
 
-         public bool CheckSequenceRecipeAvaible(SequenceRecipe sequenceRecipe,ref string reason)
 
-         {
 
-             if (sequenceRecipe == null)
 
-             {
 
-                 reason = "sequence recipe is null";
 
-                 LOG.WriteLog(eEvent.ERR_SEQUENCE, "System", reason);
 
-                 return false;
 
-             }
 
-             for (int i = 0; i < sequenceRecipe.Recipes.Count; i++)
 
-             {
 
-                 string item = sequenceRecipe.Recipes[i];
 
-                 if (string.IsNullOrEmpty(item))
 
-                 {
 
-                     continue;
 
-                 }
 
-                 RecipeType recipeType= SequenceRecipeManager.Instance.GetRecipeType(item);
 
-                 object recipe = SequenceRecipeManager.Instance.LoadSequenceTypeRecipe(sequenceRecipe.SequenceType, item, recipeType);
 
-                 if (recipe == null)
 
-                 {
 
-                     reason = $"{item} is not in {sequenceRecipe.SequenceType}";
 
-                     LOG.WriteLog(eEvent.ERR_SEQUENCE, "System", reason);
 
-                     return false;
 
-                 }
 
-             }
 
-             return true;
 
-         }
 
-     }
 
- }
 
 
  |