Browse Source

update scheduler sequence

chenkui 1 month ago
parent
commit
494e4efb12

+ 2 - 1
PunkHPX8_Core/RtState.cs

@@ -168,6 +168,7 @@ namespace PunkHPX8_Core
         Initializing,
         Initialized,
         Idle,
-        CCRing
+        CCRing,
+        RunReciping
     }
 }

+ 1 - 0
PunkHPX8_RT/Dispatch/WaferTaskManager.cs

@@ -289,6 +289,7 @@ namespace PunkHPX8_RT.Dispatch
                 _waferTaskMatchDic[wafers[1].WaferID] = wafers[0].WaferID;
             }
         }
+
         /// <summary>
         /// 获取Dummy Wafer
         /// </summary>

+ 1 - 1
PunkHPX8_RT/Modules/EFEM/EfemEntity.cs

@@ -420,7 +420,7 @@ namespace PunkHPX8_RT.Modules
             AnyStateTransition(MSG.CloseBuzzer,          fnCloseBuzzer, FSM_STATE.SAME);
             AnyStateTransition(MSG.CloseBuzzer,          fnCloseBuzzer, FSM_STATE.SAME);
             
-            Transition(STATE.Unknown,MSG.CommReady, fnCommReady, STATE.Idle);
+            Transition(STATE.Unknown,MSG.CommReady, fnCommReady, STATE.Init);
             //Error
             Transition(STATE.Error, MSG.Recover, fnRecover, STATE.Idle);
 

+ 83 - 26
PunkHPX8_RT/Modules/PlatingCell/PlatingCellEntity.cs

@@ -8,6 +8,7 @@ using Aitex.Core.RT.RecipeCenter;
 using Aitex.Core.RT.SCCore;
 using Aitex.Core.Util;
 using Aitex.Core.Utilities;
+using CyberX12_RT.Modules.VpwCell;
 using MECF.Framework.Common.Equipment;
 using MECF.Framework.Common.Persistent.Reservoirs;
 using MECF.Framework.Common.ProcessCell;
@@ -15,6 +16,7 @@ using MECF.Framework.Common.RecipeCenter;
 using MECF.Framework.Common.Routine;
 using MECF.Framework.Common.SubstrateTrackings;
 using MECF.Framework.Common.ToolLayout;
+using MECF.Framework.RT.Core.Equipments;
 using PunkHPX8_Core;
 using PunkHPX8_RT.Devices.PlatingCell;
 using PunkHPX8_RT.Devices.PowerSupplier;
@@ -22,6 +24,7 @@ using PunkHPX8_RT.Devices.Reservoir;
 using PunkHPX8_RT.Devices.Temperature;
 using PunkHPX8_RT.Modules.Reservoir;
 using PunkHPX8_RT.Modules.VpwCell;
+using PunkHPX8_RT.Modules.VpwMain;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -40,7 +43,6 @@ namespace PunkHPX8_RT.Modules.PlatingCell
             Initialize,
             Manual,
             Auto,
-            CurrentShortTest,
             CloseFlowValve,
             OpenFlowValve,
             RunRecipe,
@@ -73,18 +75,19 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// </summary>
         private int _recipeTime;
         /// <summary>
-        /// 当前RunRecipe Routine
-        /// </summary>
-        private RoutineBase _currentRunRecipeRoutine;
-        /// <summary>
         /// c&m Initialize routine
         /// </summary>
         private PlatingCellInitializeRoutine _initializeRoutine;
         /// <summary>
-        /// CCR
+        /// CCR routine
+        /// </summary>
+        private PlatingCellCCRRoutine _platingCellCRRoutine;
+        /// <summary>
+        /// Run recipe routine
         /// </summary>
-        private PlatingCellCCRRoutine _cCRRoutine;
+        private PlatingCellRunRecipeRoutine _runRecipeRoutine;
         #endregion
+
         #region 属性
         /// <summary>
         /// 模块名称
@@ -165,11 +168,14 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// <summary>
         /// Wafer信息
         /// </summary>
-        public WaferInfo WaferInfo { get { return WaferManager.Instance.GetWafer(Module,0); } }
+        public WaferInfo WaferInfo { get { return WaferManager.Instance.GetWafer(Module,0); } }
+
+        /// <summary>
+        /// 当前Metal设置的WaferSize
+        /// </summary>
+        public int MetalWaferSize { get { return _persistentValue.PlatingCellWaferSize; } }
         #endregion
 
-
-
         /// <summary>
         /// 构造函数
         /// </summary>
@@ -184,7 +190,8 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// </summary>
         /// <returns></returns>
         protected override bool Init()
-        {
+        {
+            WaferManager.Instance.SubscribeLocation(Module, 1);
             InitializeRoutine();
             InitializeDATA();
             InitializeOperation();
@@ -210,7 +217,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         private void InitializeRoutine()
         {
             _initializeRoutine = new PlatingCellInitializeRoutine(Module.ToString());
-            _cCRRoutine = new PlatingCellCCRRoutine(Module.ToString());
+            _platingCellCRRoutine = new PlatingCellCCRRoutine(Module.ToString());
         }
         /// <summary>
         /// 初始化DATA
@@ -220,7 +227,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
             DATA.Subscribe($"{Module}.FsmState", () => ((PlatingCellState)fsm.State).ToString(), SubscriptionAttribute.FLAG.IgnoreSaveDB);
             DATA.Subscribe($"{Module}.CurrentRecipe", () => _currentRecipe != null ? _currentRecipe.Ppid : "", SubscriptionAttribute.FLAG.IgnoreSaveDB);
             DATA.Subscribe($"{Module}.TotalTime", () => _recipeTime, SubscriptionAttribute.FLAG.IgnoreSaveDB);
-            DATA.Subscribe($"{Module}.TimeRemain", () => _recipeTime != 0 && _currentRunRecipeRoutine != null ? (_recipeTime - Math.Round((double)_currentRunRecipeRoutine.ElapsedMilliseconds / 1000, 0)) : 0, SubscriptionAttribute.FLAG.IgnoreSaveDB);
+            DATA.Subscribe($"{Module}.TimeRemain", () => _recipeTime != 0 && _runRecipeRoutine != null ? (_recipeTime - Math.Round((double)_runRecipeRoutine.ElapsedMilliseconds / 1000, 0)) : 0, SubscriptionAttribute.FLAG.IgnoreSaveDB);
             DATA.Subscribe($"{Module}.Chemistry", () => _currentRecipe != null ? _currentRecipe.Chemistry : "", SubscriptionAttribute.FLAG.IgnoreSaveDB);
 
             DATA.Subscribe($"{Module}.IsInit", () => IsInit, SubscriptionAttribute.FLAG.IgnoreSaveDB);
@@ -228,8 +235,6 @@ namespace PunkHPX8_RT.Modules.PlatingCell
             DATA.Subscribe($"{Module}.IsError", () => IsError, SubscriptionAttribute.FLAG.IgnoreSaveDB);
             DATA.Subscribe($"{Module}.IsBusy", () => IsBusy, SubscriptionAttribute.FLAG.IgnoreSaveDB);
             DATA.Subscribe($"{Module}.IsDisable", () => IsDisable, SubscriptionAttribute.FLAG.IgnoreSaveDB);
-       
- 
         }
         /// <summary>
         /// 初始化Operation
@@ -245,7 +250,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// </summary>
         private void InitialFsm()
         {
-            fsm = new StateMachine<PlatingCellEntity>(Module.ToString(), (int)PlatingCellState.Init, 100);
+            fsm = new StateMachine<PlatingCellEntity>(Module.ToString(), (int)PlatingCellState.Idle, 100);
             fsm.EnableRepeatedMsg(true);
 
             AnyStateTransition(PlatingCellMsg.Error, NullFunc, PlatingCellState.Error);
@@ -258,9 +263,11 @@ namespace PunkHPX8_RT.Modules.PlatingCell
             //CCR
             Transition(PlatingCellState.Idle, PlatingCellMsg.CCR, ManualCCRStart, PlatingCellState.CCRing);
             Transition(PlatingCellState.CCRing, FSM_MSG.TIMER, CCRMonitor, PlatingCellState.Idle);
-            Transition(PlatingCellState.CCRing, PlatingCellMsg.CCRAbort, CCRAbort, PlatingCellState.Init);
-
-
+            Transition(PlatingCellState.CCRing, PlatingCellMsg.CCRAbort, CCRAbort, PlatingCellState.Init);
+            //Cycle Manual Process
+            Transition(PlatingCellState.Idle, PlatingCellMsg.RunRecipe, CycleManualProcess, PlatingCellState.RunReciping);
+            Transition(PlatingCellState.RunReciping, FSM_MSG.TIMER, CycleManualMonitor, PlatingCellState.Idle);
+            Transition(PlatingCellState.RunReciping, VPWCellMsg.Abort, RunRecipeAbort, PlatingCellState.Idle);
             //直接进入Idle
             Transition(PlatingCellState.Initialized, FSM_MSG.TIMER, NullFunc, PlatingCellState.Idle);
             //Enter Init
@@ -276,7 +283,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// <returns></returns>
         private bool ManualCCRStart(object[] param)
         {
-            bool result = _cCRRoutine.Start() == RState.Running;
+            bool result = _platingCellCRRoutine.Start() == RState.Running;
             return result;
 
         }
@@ -288,7 +295,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         private bool CCRMonitor(object[] param)
         {
             RState rsstate = RState.Running;
-            rsstate = _cCRRoutine.Monitor();
+            rsstate = _platingCellCRRoutine.Monitor();
             if (rsstate == RState.End)
             {
                 return true;
@@ -307,9 +314,9 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// <returns></returns>
         private bool CCRAbort(object[] param)
         {
-            if(_cCRRoutine.Monitor() == RState.Running)
+            if(_platingCellCRRoutine.Monitor() == RState.Running)
             {
-                _cCRRoutine.Abort();
+                _platingCellCRRoutine.Abort();
             }
             return true;
         }
@@ -383,7 +390,6 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// </summary>
         private bool MetalUsageMointor(string Module)
         {
-         
             return true;
         }
         /// <summary>
@@ -418,8 +424,59 @@ namespace PunkHPX8_RT.Modules.PlatingCell
                 CheckToPostMessage<PlatingCellState, PlatingCellMsg>(eEvent.ERR_PLATINGCELL, Module.ToString(), (int)PlatingCellMsg.Init);
             }
         }
-  
-         public bool Check(int msg, out string reason, params object[] args)
+
+        #region cycle manual process
+        /// <summary>
+        /// process
+        /// </summary>
+        /// <param name="param"></param>
+        /// <returns></returns>
+        private bool CycleManualProcess(object[] param)
+        {
+            bool result = _runRecipeRoutine.Start(param) == RState.Running;
+            if (result)
+            {
+            }
+            return result;
+        }
+        /// <summary>
+        /// 监控
+        /// </summary>
+        /// <param name="param"></param>
+        /// <returns></returns>
+        private bool CycleManualMonitor(object[] param)
+        {
+            RState state = _runRecipeRoutine.Monitor();
+            if (state == RState.Failed || state == RState.Timeout)
+            {
+                return false;
+            }
+            bool result = state == RState.End;
+            if (result)
+            {
+            }
+            return result;
+        }
+        /// <summary>
+        /// 中止
+        /// </summary>
+        /// <param name="param"></param>
+        /// <returns></returns>
+        private bool RunRecipeAbort(object[] param)
+        {
+            _runRecipeRoutine.Abort();
+
+            VpwMainEntity vpwMainEntity = Singleton<RouteManager>.Instance.GetModule<VpwMainEntity>("VPWMain1");
+            if (vpwMainEntity != null)
+            {
+                //把main的状态置为暂停
+                vpwMainEntity.PostMsg(VPWMainMsg.Abort);
+            }
+            return true;
+        }
+        #endregion
+
+        public bool Check(int msg, out string reason, params object[] args)
         {
             reason = "";
             return true;

+ 53 - 0
PunkHPX8_RT/Modules/PlatingCell/PlatingCellRunRecipeRoutine.cs

@@ -0,0 +1,53 @@
+using Aitex.Core.RT.Routine;
+using MECF.Framework.Common.Routine;
+using PunkHPX8_Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PunkHPX8_RT.Modules.PlatingCell
+{
+    public class PlatingCellRunRecipeRoutine : RoutineBase, IRoutine
+    {
+        private enum RunRecipeStep
+        {
+            Delay,
+            End
+        }
+        /// <summary>
+        /// 构造函数
+        /// </summary>
+        /// <param name="module"></param>
+        public PlatingCellRunRecipeRoutine(string module) : base(module)
+        {
+        }
+        /// <summary>
+        /// 中止
+        /// </summary>
+        public void Abort()
+        {
+            Runner.Stop("Manual Abort");
+        }
+        /// <summary>
+        /// 监控
+        /// </summary>
+        /// <returns></returns>
+        public RState Monitor()
+        {
+            Runner.Delay(RunRecipeStep.Delay, 5000)
+                .End(RunRecipeStep.End, NullFun);
+            return RState.Init;
+        }
+        /// <summary>
+        /// 启动
+        /// </summary>
+        /// <param name="objs"></param>
+        /// <returns></returns>
+        public RState Start(params object[] objs)
+        {
+            return Runner.Start(Module, "Run Recipe");
+        }
+    }
+}

+ 0 - 45
PunkHPX8_RT/Modules/RouteManager.cs

@@ -189,11 +189,6 @@ namespace PunkHPX8_RT.Modules
                 EFEM.Initialize();
                 _moduleEntitiesDic[ModuleName.EFEM.ToString()] = EFEM;
             }
-
-            WaferManager.Instance.SubscribeLocation(ModuleName.PlatingCell1, 1);
-            WaferManager.Instance.SubscribeLocation(ModuleName.PlatingCell2, 1);
-            WaferManager.Instance.SubscribeLocation(ModuleName.PlatingCell3, 1);
-            WaferManager.Instance.SubscribeLocation(ModuleName.PlatingCell4, 1);
             InitialModuleList(VpwMainItemManager.Instance.InstalledModules, typeof(VpwMainEntity), ModuleType.VpwMain);
             InitialModuleList(VpwCellItemManager.Instance.InstalledModules, typeof(VpwCellEntity), ModuleType.VPW);
             InitialModuleList(SrdItemManager.Instance.InstalledModules, typeof(SRDEntity), ModuleType.SRD);
@@ -396,16 +391,6 @@ namespace PunkHPX8_RT.Modules
                 return true;
             });
 
-            OP.Subscribe("System.ResetIdleCleanTime", (string cmd, object[] args) =>
-            {
-                return CheckToPostMessage((int)MSG.ResetIdleCleanTime, args[0]);
-            });
-
-            OP.Subscribe("System.ResetIdlePurgeTime", (string cmd, object[] args) =>
-            {
-                return CheckToPostMessage((int)MSG.ResetIdlePurgeTime, args[0]);
-            });
-
             OP.Subscribe("System.SetWaferSize", (string cmd, object[] args) =>
             {
                 string module = (string)args[0];
@@ -576,36 +561,6 @@ namespace PunkHPX8_RT.Modules
             return true;
         }
 
-        private bool InvokeReturnWafer(string arg1, object[] args)
-        {
-            ModuleName target = ModuleHelper.Converter(args[0].ToString());
-            int slot = (int)args[1];
-            if (ModuleHelper.IsLoadPort(target))
-            {
-                LOG.Write(eEvent.WARN_ROUTER, "System", string.Format("Wafer already at LoadPort {0} {1}, return operation is not valid", target.ToString(), slot + 1));
-                return false;
-            }
-
-            if (!WaferManager.Instance.IsWaferSlotLocationValid(target, slot))
-            {
-                LOG.Write(eEvent.WARN_ROUTER, "System", string.Format("Invalid position,{0},{1}", target.ToString(), slot.ToString()));
-                return false;
-            }
-
-            WaferInfo wafer = WaferManager.Instance.GetWafer(target, slot);
-            if (wafer.IsEmpty)
-            {
-                LOG.Write(eEvent.WARN_ROUTER, "System", string.Format("No wafer at {0} {1}, return operation is not valid", target.ToString(), slot + 1));
-                return false;
-            }
-
-            return CheckToPostMessage((int)MSG.MoveWafer,
-                target, slot,
-                (ModuleName)wafer.OriginStation, wafer.OriginSlot,
-                false, 0, false, 0, "Blade1");
-            
-        }
-
         protected override bool Init()
         {
             _jobCycle = new JobDispatcher();

+ 1 - 1
PunkHPX8_RT/Modules/VpwCell/VpwCellEntity.cs

@@ -253,7 +253,7 @@ namespace PunkHPX8_RT.Modules.VpwMain
             //Cycle Manual Process
             Transition(VPWCellState.Idle, VPWCellMsg.CycleProcessRecipe, CycleManualProcess, VPWCellState.CycleManualProcessing);
             Transition(VPWCellState.CycleManualProcessing, FSM_MSG.TIMER, CycleManualMonitor, VPWCellState.Idle);
-            Transition(VPWCellState.CycleManualProcessing, VPWCellMsg.Abort, RunRecipeAbort, VPWCellState.Aborting);
+            Transition(VPWCellState.CycleManualProcessing, VPWCellMsg.Abort, RunRecipeAbort, VPWCellState.Idle);
             //Prepare
             Transition(VPWCellState.Idle, VPWCellMsg.Prepare, Prepare, VPWCellState.Preparing);
             Transition(VPWCellState.Preparing, FSM_MSG.TIMER, PrepareMonitor, VPWCellState.WaitForRunRecipe);

+ 1 - 0
PunkHPX8_RT/PunkHPX8_RT.csproj

@@ -299,6 +299,7 @@
     <Compile Include="Modules\PlatingCell\PlatingCellCCRRoutine.cs" />
     <Compile Include="Modules\PlatingCell\PlatingCellEntity.cs" />
     <Compile Include="Modules\PlatingCell\PlatingCellInitializeRoutine.cs" />
+    <Compile Include="Modules\PlatingCell\PlatingCellRunRecipeRoutine.cs" />
     <Compile Include="Modules\ReservoirCellHomeRoutine.cs" />
     <Compile Include="Modules\Reservoir\DIReservoirInitializeRoutine.cs" />
     <Compile Include="Modules\Reservoir\DMInitializeRoutine.cs" />

+ 22 - 159
PunkHPX8_RT/Schedulers/SchedulerSequenceManager.cs

@@ -44,7 +44,7 @@ namespace PunkHPX8_RT.Schedulers
         /// </summary>
         /// <param name="sequenceRecipe"></param>
         /// <returns></returns>
-        public List<SchedulerSequence> AnalyWaferAllSchedulerSequence(WaferInfo waferInfo, SequenceRecipe sequenceRecipe)
+        public List<SchedulerSequence> AnalyWaferAllSchedulerSequence(WaferInfo waferInfo,ModuleName vpw, SequenceRecipe sequenceRecipe)
         {
             List<SchedulerSequence> schedulerSequences = new List<SchedulerSequence>();
             int index = 0;
@@ -54,6 +54,9 @@ namespace PunkHPX8_RT.Schedulers
             schedulerSequences.Add(efemRobotSequence);
             SchedulerSequence alignerSequence = CreateAlignerSequence(sequenceRecipe, ref index);
             schedulerSequences.Add(alignerSequence);
+            MoveItem alignerToMoveItem = new MoveItem(ModuleName.Aligner1, 0, vpw, 0,Hand.Blade1, Flip.Upper, Flip.Upper);
+            SchedulerSequence alignerRobotSequence = CreateEfemRobotSequence(alignerToMoveItem, null, sequenceRecipe.SubstrateSize, ref index);
+            schedulerSequences.Add(alignerRobotSequence);
             //解析sequence recipe后续的工序
             var sequences = AnalyseSequenceRecipeScheduler(sequenceRecipe,false);
             if (sequences.Count == 0)
@@ -65,16 +68,8 @@ namespace PunkHPX8_RT.Schedulers
             {
                 return schedulerSequences;
             }
-            MoveItem alignerToFirstMoveItem = new MoveItem();
-            alignerToFirstMoveItem.SourceModule = ModuleName.Aligner1;
-            alignerToFirstMoveItem.SourceSlot = 0;
-            alignerToFirstMoveItem.DestinationType = firstSequence.ModuleType;
-            alignerToFirstMoveItem.DestinationSlot = 0;
-            alignerToFirstMoveItem.RobotHand = Hand.Blade1;
-            alignerToFirstMoveItem.PickRobotFlip = Flip.Upper;
-            alignerToFirstMoveItem.PlaceRobotFlip = Flip.Upper;
-            SchedulerSequence alignerToFirstSequence = CreateEfemRobotSequence(moveItem, null, sequenceRecipe.SubstrateSize, ref index);
-            schedulerSequences.Add(efemRobotSequence);
+            firstSequence.SchedulerModule = SchedulerManager.Instance.GetScheduler(vpw);
+            firstSequence.ModuleName = vpw;
             //调整工序后面的索引
             foreach (SchedulerSequence item in sequences)
             {
@@ -231,7 +226,7 @@ namespace PunkHPX8_RT.Schedulers
                 schedulerSequence.Recipe = SequenceRecipeManager.Instance.LoadSequenceTypeRecipe(sequenceRecipe.SequenceType,item, recipeType);
                 schedulerSequence.SequenceType = sequenceRecipe.SequenceType;
                 schedulerSequence.State = RState.Init;
-                schedulerSequence.MaterialType = MaterialType.WaferHolder;
+                schedulerSequence.MaterialType = MaterialType.Wafer;
                 tmpLst.Add(schedulerSequence); 
                 if (i != lastIndex)
                 {
@@ -407,18 +402,18 @@ namespace PunkHPX8_RT.Schedulers
         /// <returns></returns>
         public ModuleName GetAvaibleModuleCell(string sequenceType,ModuleType moduleType)
         {
-                List<IModuleEntity> entities = Singleton<RouteManager>.Instance.GetModulesByModuleType(moduleType);
-                List<IModuleEntity> avaibles = new List<IModuleEntity>();
-                foreach (var item in entities)
+            List<IModuleEntity> entities = Singleton<RouteManager>.Instance.GetModulesByModuleType(moduleType);
+            List<IModuleEntity> avaibles = new List<IModuleEntity>();
+            foreach (var item in entities)
+            {
+                bool result = CheckAvaibleModule(item,moduleType,sequenceType);
+                if (result)
                 {
-                    bool result = CheckAvaibleModule(item,moduleType,sequenceType);
-                    if (result)
-                    {
-                        avaibles.Add(item);
-                    }
+                    avaibles.Add(item);
                 }
+            }
 
-                return GetMinTimeToReadyModule(avaibles,moduleType);
+            return GetMinTimeToReadyModule(avaibles,moduleType);
         }
         /// <summary>
         /// 根据化学液计算时间获取可用PlatingCellCell(参考其他PlatingCell剩余时间)
@@ -438,97 +433,6 @@ namespace PunkHPX8_RT.Schedulers
             return (ModuleName.Unknown, ModuleName.Unknown);
         }
         /// <summary>
-        /// 根据化学液获取可用PlatingCell
-        /// </summary>
-        /// <param name="chemistry"></param>
-        /// <param name="sequenceType"></param>
-        /// <returns></returns>
-        public bool CalculateAvaiblePlatingCellCellByChemistry(string chemistry,string sequenceType,int waferSize)
-        {
-            return false;
-        }
-        /// <summary>
-        /// 检验Process transporter正在Transfer WH移动至Rinse
-        /// </summary>
-        /// <returns></returns>
-        private bool CheckProcessTransporterTransfering(List<string> rinseList)
-        {
-            return false;
-        }
-        /// <summary>
-        /// 计算PlatingCell所在Reservoir Busy PlatingCell数量
-        /// </summary>
-        /// <param name="item"></param>
-        /// <returns></returns>
-        private (bool success,int busyCount) CalculatePlatingCellReservoirAllBusyPlatingCellCount(string platingCellName)
-        {
-            string reservoirName = ReservoirItemManager.Instance.GetReservoirByPlatingCell(platingCellName);
-            if (string.IsNullOrEmpty(reservoirName))
-            {
-                return (false,0);
-            }
-            List<string> platingCells = ReservoirItemManager.Instance.GetPlatingCellsByReservoir(reservoirName);
-            int count = 0;
-            foreach (string item in platingCells)
-            {
-                if (platingCellName == item)
-                {
-                    continue;
-                }
-            }
-            return (true,count);
-        }
-        /// <summary>
-        /// 检验独立Rinse是否可用
-        /// </summary>
-        /// <param name="singleRinseItems"></param>
-        /// <param name="platingCellName"></param>
-        /// <returns></returns>
-        private bool CheckSingleRinseItemsCanUsed(List<string> singleRinseItems, string platingCellName)
-        {
-            var result = CalculatePlatingCellReservoirAllBusyPlatingCellCount(platingCellName);
-            if(result.success)
-            {
-                bool transporterTransfering = CheckProcessTransporterTransfering(singleRinseItems);
-                if (transporterTransfering)
-                {
-                    return result.busyCount + 1 < singleRinseItems.Count;
-                }
-                else
-                {
-                    return result.busyCount < singleRinseItems.Count;
-                }
-            }
-            return false;
-        }
-        /// <summary>
-        /// 检验可用
-        /// </summary>
-        /// <param name="item"></param>
-        /// <param name="moduleType"></param>
-        /// <param name="sequenceType"></param>
-        /// <param name="waferHolderId"></param>
-        /// <param name="startTime"></param>
-        /// <param name="processLength"></param>
-        /// <returns></returns>
-        public bool CheckAvaiblePlatingCellModule(IModuleEntity item, ModuleType moduleType, string sequenceType, string waferHolderId, DateTime startTime, int processLength, bool checkConflict)
-        {
-            bool result = CheckAvaibleModule(item, moduleType, sequenceType);
-            if (!result)
-            {
-                return false;
-            }
-            if (checkConflict)
-            {
-                var conflict = SchedulerPlatingCellTimeManager.Instance.CheckPlatingCellConflict(item.Module.ToString(), waferHolderId, startTime, processLength);
-                return !conflict.conflict;
-            }
-            else
-            {
-                return result;
-            }
-        }
-        /// <summary>
         /// 检验模块是否可用
         /// </summary>
         /// <param name="item"></param>
@@ -590,10 +494,6 @@ namespace PunkHPX8_RT.Schedulers
                     selectedModule = item;
                 }
             }
-            if (idleModuleEtities.Count != 0)
-            {
-                return GetMinUsagePlatingCell(idleModuleEtities);
-            }
             if (selectedModule != null)
             {
                 return selectedModule.Module;
@@ -601,53 +501,11 @@ namespace PunkHPX8_RT.Schedulers
             return ModuleName.Unknown;
         }
         /// <summary>
-        /// 获取电量最小的PlatingCell
-        /// </summary>
-        /// <param name="idleModuleEntities"></param>
-        /// <returns></returns>
-        private ModuleName GetMinUsagePlatingCell(List<IModuleEntity> idleModuleEntities, int depProcessLength, SchedulerModulePartTime platingCellPartTime)
-        {
-            ModuleName selectedModuleName = ModuleName.Unknown;
-            List<string> minDateModuleLst = new List<string>();
-            return selectedModuleName;
-        }
-        /// <summary>
-        /// 获取电量最小的PlatingCell
-        /// </summary>
-        /// <param name="idleModuleEntities"></param>
-        /// <returns></returns>
-        private ModuleName GetMinUsagePlatingCell(List<IModuleEntity> idleModuleEntities)
-        {
-            ModuleName selectedModuleName = ModuleName.Unknown;
-            return selectedModuleName;
-        }
-        /// <summary>
-        /// 获取PlatingCell可用的Rinse模块
-        /// </summary>
-        /// <param name="platingCellName"></param>
-        /// <returns></returns>
-        private ModuleName GetPlatingCellAvaibleRinseModule(List<IModuleEntity> items, ModuleName platingCellName)
-        {
-            int platingCellId = CellItemManager.Instance.GetCellIdByModuleName(platingCellName.ToString());
-            if (platingCellId == 0)
-            {
-                return ModuleName.Unknown;
-            }
-            List<LayoutCellItem> rinseItems = CellItemManager.Instance.GetRinseItemsByPlatingCell(platingCellName.ToString());
-            if (rinseItems.Count == 0)
-            {
-                return ModuleName.Unknown;
-            }
-
-            return ModuleName.Unknown;
-        }
-
-        /// <summary>
         /// 根据化学液获取可用的PlatingCell集合
         /// </summary>
         /// <param name="chemistry"></param>
         /// <returns></returns>
-        public List<PlatingCellEntity> GetAvaiblePlatingCellList(string chemistry, string sequenceType, bool isEmpty)
+        public List<PlatingCellEntity> GetAvaiblePlatingCellList(string chemistry, string sequenceType, int waferSize, bool isEmpty)
         {
             List<IModuleEntity> reservoirEntities = Singleton<RouteManager>.Instance.GetModulesByModuleType(ModuleType.Reservoir);
             List<string> avaibles = new List<string>();
@@ -675,6 +533,10 @@ namespace PunkHPX8_RT.Schedulers
                     {
                         continue;
                     }
+                    if (entity.MetalWaferSize != waferSize)
+                    {
+                        continue;
+                    }
                     if (!isEmpty || (isEmpty && entity.WaferInfo == null))
                     {
                         metals.Add(entity);
@@ -683,6 +545,7 @@ namespace PunkHPX8_RT.Schedulers
             }
             return metals;
         }
+
     }
 
 

+ 1 - 1
PunkHPX8_RT/Schedulers/SchedulerSequenceRecipeManager.cs

@@ -70,7 +70,7 @@ namespace PunkHPX8_RT.Schedulers
                 if (moduleType == ModuleType.PlatingCell)
                 {
                     DepRecipe depRecipe=(DepRecipe)recipe;
-                    List<PlatingCellEntity> cells = SchedulerSequenceManager.Instance.GetAvaiblePlatingCellList(depRecipe.Chemistry, sequenceRecipe.SequenceType, false);
+                    List<PlatingCellEntity> cells = SchedulerSequenceManager.Instance.GetAvaiblePlatingCellList(depRecipe.Chemistry, sequenceRecipe.SequenceType,sequenceRecipe.SubstrateSize, false);
                     if (cells.Count == 0)
                     {
                         if (showError)

+ 2 - 2
PunkHPX8_Twincate/PunkHPX8/PlcTest/POUs/MAIN.TcPOU

@@ -192,11 +192,11 @@ VAR
 	//Nitrogen1BPressure
 	Facility_AI_8CHANNEL_0_10V_EL3068_N007_1 AT%I* :INT:=5700;
 	//Nitrogen1APressure
-	Facility_AI_8CHANNEL_0_10V_EL3068_N007_2 AT%I* :INT:=8000;
+	Facility_AI_8CHANNEL_0_10V_EL3068_N007_2 AT%I* :INT:=10000;
 	//Nitrogen2BPressure
 	Facility_AI_8CHANNEL_0_10V_EL3068_N007_3 AT%I* :INT:=5700;
 	//Nitrogen2APressure
-	Facility_AI_8CHANNEL_0_10V_EL3068_N007_4 AT%I* :INT:=8000;
+	Facility_AI_8CHANNEL_0_10V_EL3068_N007_4 AT%I* :INT:=10000;
 	//CDA2Pressure
 	Facility_AI_8CHANNEL_0_10V_EL3068_N007_5 AT%I* :INT:=10000;
 	//CDA1Pressure