Bläddra i källkod

Scheduler add wafersize

chenkui 2 veckor sedan
förälder
incheckning
6004f92144

+ 12 - 8
CyberX8_RT/Dispatch/JobDispatcher.cs

@@ -152,7 +152,17 @@ namespace CyberX8_RT.Dispatch
                 {
                     _cycleWatch.Restart();
                 }
-
+                List<ProcessJobInfo> pjs = JobProcesser.Instance.ProcessJobInfos;
+                foreach (ProcessJobInfo item in pjs)
+                {
+                    foreach (var pjSlotWafer in item.SlotWafers)
+                    {
+                        WaferInfo wafer = WaferManager.Instance.GetWafer(pjSlotWafer.Item1, pjSlotWafer.Item2);
+                        wafer.ProcessJob = item;
+                        wafer.NextSequenceStep = 0;
+                        WaferDataRecorder.SetPjInfo(wafer.InnerId.ToString(), item.InnerId.ToString());
+                    }
+                }
                 _cycleState = RState.Running;
             }
             return result;
@@ -285,6 +295,7 @@ namespace CyberX8_RT.Dispatch
                 {
                     pj.SetState(EnumProcessJobState.ProcessingComplete);
                     JobDataRecorder.EndPJ(pj.InnerId.ToString(), 0, 0);
+                    JobProcesser.Instance.RemoveRecipeProcessJob(pj);
                 }
             }
 
@@ -428,13 +439,6 @@ namespace CyberX8_RT.Dispatch
                 {
                     return false;
                 }
-                foreach (var pjSlotWafer in pj.SlotWafers)
-                {
-                    WaferInfo wafer = WaferManager.Instance.GetWafer(pjSlotWafer.Item1, pjSlotWafer.Item2);
-                    wafer.ProcessJob = pj;
-                    wafer.NextSequenceStep = 0;
-                    WaferDataRecorder.SetPjInfo(wafer.InnerId.ToString(), pj.InnerId.ToString());
-                }
                 CarrierInfo carrier = CarrierManager.Instance.GetCarrier(cj.Module);
                 JobDataRecorder.StartPJ(pj.InnerId.ToString(), carrier.InnerId.ToString(), cj.InnerId.ToString(), pj.Name, cj.Module, cj.Module, pj.SlotWafers.Count);
 

+ 19 - 8
CyberX8_RT/Dispatch/JobProcesser.cs

@@ -415,23 +415,34 @@ namespace CyberX8_RT.Dispatch
         /// <returns></returns>
         public List<ProcessJobInfo> GetRecipeStateProcessJobs(EnumProcessJobState enumProcessJobState)
         {
-            string recipe = "";
+            bool isRunInParallelMode = SC.GetValue<Boolean>("Scheduler.IsRunInParallelMode");
+            List<string> enableRecipeLst= new List<string>();
             lock (_recipeLocker)
             {
                 if (_recipeList.Count != 0)
                 {
-                    recipe = _recipeList[0];
+                    if (!isRunInParallelMode)
+                    {
+                        enableRecipeLst.Add(_recipeList[0]);
+                    }
+                    else
+                    {
+                        enableRecipeLst.AddRange(_recipeList);
+                    }
                 }
             }
             List<ProcessJobInfo> processJobInfos = new List<ProcessJobInfo>();
-            if(!string.IsNullOrEmpty(recipe)&&_recipeProcessJobs.ContainsKey(recipe))
+            foreach (string recipe in enableRecipeLst)
             {
-                List<ProcessJobInfo> recipeProcessJobs = _recipeProcessJobs[recipe];
-                foreach (ProcessJobInfo processJobInfo in recipeProcessJobs)
+                if (!string.IsNullOrEmpty(recipe) && _recipeProcessJobs.ContainsKey(recipe))
                 {
-                    if (processJobInfo.State == enumProcessJobState)
+                    List<ProcessJobInfo> recipeProcessJobs = _recipeProcessJobs[recipe];
+                    foreach (ProcessJobInfo processJobInfo in recipeProcessJobs)
                     {
-                        processJobInfos.Add(processJobInfo);
+                        if (processJobInfo.State == enumProcessJobState)
+                        {
+                            processJobInfos.Add(processJobInfo);
+                        }
                     }
                 }
             }
@@ -441,7 +452,7 @@ namespace CyberX8_RT.Dispatch
         /// 移除recipe processjob字典中processjob
         /// </summary>
         /// <param name="processJobInfo"></param>
-        private void RemoveRecipeProcessJob(ProcessJobInfo processJobInfo)
+        public void RemoveRecipeProcessJob(ProcessJobInfo processJobInfo)
         {
             List<ProcessJobInfo> jobs = null;
             if (_recipeProcessJobs.ContainsKey(processJobInfo.SequenceRecipe.Ppid))

+ 1 - 1
CyberX8_RT/Dispatch/WaferHolderTask.cs

@@ -510,7 +510,7 @@ namespace CyberX8_RT.Dispatch
                     continue;
                 }
                 DepRecipe depRecipe = (DepRecipe)sequence.Recipe;
-                bool result= SchedulerSequenceManager.Instance.CalculateAvaibleMetalCellByChemistry(depRecipe.Chemistry, sequence.SequenceType);
+                bool result= SchedulerSequenceManager.Instance.CalculateAvaibleMetalCellByChemistry(depRecipe.Chemistry, sequence.SequenceType,sequence.WaferSize);
                 if (!result)
                 {
                     return false;

+ 1 - 1
CyberX8_RT/Schedulers/Prewet/SchedulerPrewet.cs

@@ -170,7 +170,7 @@ namespace CyberX8_RT.Schedulers.Prewet
                 else
                 {
                     DepRecipe depRecipe = sequence.NextRecipe as DepRecipe;
-                    ModuleName moduleName = SchedulerSequenceManager.Instance.CalculateAvaibleMetalCellByChemistry(depRecipe.Chemistry, "",sequence.SequenceType,ref existEnableCell);
+                    ModuleName moduleName = SchedulerSequenceManager.Instance.CalculateAvaibleMetalCellByChemistry(depRecipe.Chemistry, "",sequence.SequenceType,sequence.WaferSize,ref existEnableCell);
                     if (moduleName != ModuleName.Unknown)
                     {
                         IModuleEntity moduleEntity = Singleton<RouteManager>.Instance.GetModule<IModuleEntity>(moduleName.ToString());

+ 1 - 1
CyberX8_RT/Schedulers/Rinse/SchedulerRinse.cs

@@ -106,7 +106,7 @@ namespace CyberX8_RT.Schedulers.Rinse
                     bool exsitEnableCell = false;
                     DepRecipe depRecipe = schedulerSequence.NextRecipe as DepRecipe;
                     ModuleName moduleName = SchedulerSequenceManager.Instance.CalculateAvaibleMetalCellByChemistry(depRecipe.Chemistry,
-                        Module.ToString(),schedulerSequence.SequenceType,ref exsitEnableCell);
+                        Module.ToString(),schedulerSequence.SequenceType,schedulerSequence.WaferSize,ref exsitEnableCell);
                     if (moduleName != ModuleName.Unknown)
                     {
                         IModuleEntity moduleEntity = Singleton<RouteManager>.Instance.GetModule<IModuleEntity>(moduleName.ToString());

+ 4 - 0
CyberX8_RT/Schedulers/SchedulerSequence.cs

@@ -85,5 +85,9 @@ namespace CyberX8_RT.Schedulers
         /// 下一个模块的recipe
         /// </summary>
         public Object NextRecipe { get; set; }
+        /// <summary>
+        /// Wafer尺寸大小
+        /// </summary>
+        public int WaferSize { get; set; }
     }
 }

+ 44 - 33
CyberX8_RT/Schedulers/SchedulerSequenceManager.cs

@@ -59,13 +59,13 @@ namespace CyberX8_RT.Schedulers
             List<SchedulerSequence> schedulerSequences = new List<SchedulerSequence>();
             int index = 0;
             MoveItem moveItem = new MoveItem((ModuleName)waferInfo.OriginStation, waferInfo.OriginSlot, ModuleName.Aligner1, 0, Aitex.Sorter.Common.Hand.Blade1);
-            SchedulerSequence efemRobotSequence = CreateEfemRobotSequence(moveItem,null,ref index);
+            SchedulerSequence efemRobotSequence = CreateEfemRobotSequence(moveItem,null,sequenceRecipe.SubstrateSize,ref index);
             schedulerSequences.Add(efemRobotSequence);
-            SchedulerSequence alignerSequence=CreateAlignerSequence(sequenceRecipe.AlignmentAngle,ref index);
+            SchedulerSequence alignerSequence=CreateAlignerSequence(sequenceRecipe.AlignmentAngle,sequenceRecipe.SubstrateSize,ref index);
             schedulerSequences.Add(alignerSequence);
             //从Aligner至Puf B面
             MoveItem moveItem2 = new MoveItem(ModuleName.Aligner1, 0, pufModule, 1, Aitex.Sorter.Common.Hand.Blade1);
-            SchedulerSequence secondEfemRobotSequence = CreateEfemRobotSequence(moveItem2,null,ref index);
+            SchedulerSequence secondEfemRobotSequence = CreateEfemRobotSequence(moveItem2,null,sequenceRecipe.SubstrateSize, ref index);
             schedulerSequences.Add(secondEfemRobotSequence);
             SchedulerSequence pufSequence=CreatePufSequence(pufModule,sequenceRecipe,side,true,ref index);
             schedulerSequences.Add(pufSequence);
@@ -101,7 +101,7 @@ namespace CyberX8_RT.Schedulers
                     pufToSrdItem.SourceSlot = 0;
                     pufToSrdItem.DestinationModule = ModuleName.Unknown;
                     pufToSrdItem.RobotHand = Aitex.Sorter.Common.Hand.Blade1;
-                    SchedulerSequence backEfemRobotSequence = CreateEfemRobotSequence(pufToSrdItem,null, ref index);
+                    SchedulerSequence backEfemRobotSequence = CreateEfemRobotSequence(pufToSrdItem,null,sequenceRecipe.SubstrateSize, ref index);
                     schedulerSequences.Add(backEfemRobotSequence);
 
                     SchedulerSequence srdSequence = CreateSRDSequence(srdRecipe, ref index);
@@ -115,7 +115,7 @@ namespace CyberX8_RT.Schedulers
                     srdToLoadPortItem.DestinationModule = (ModuleName)waferInfo.OriginStation;
                     srdToLoadPortItem.DestinationSlot = waferInfo.OriginSlot;
                     srdToLoadPortItem.RobotHand = Aitex.Sorter.Common.Hand.Blade1;
-                    SchedulerSequence srdToLoadPortSequence = CreateEfemRobotSequence(srdToLoadPortItem,null, ref index);
+                    SchedulerSequence srdToLoadPortSequence = CreateEfemRobotSequence(srdToLoadPortItem,null,sequenceRecipe.SubstrateSize, ref index);
                     schedulerSequences.Add(srdToLoadPortSequence);
                 }
                 else
@@ -128,7 +128,7 @@ namespace CyberX8_RT.Schedulers
             {
                 MoveItem pufToLoadPortItem=new MoveItem(pufModule,0,(ModuleName)waferInfo.OriginStation,
                     waferInfo.OriginSlot,Aitex.Sorter.Common.Hand.Blade1);
-                SchedulerSequence pufToLoaderSequence=CreateEfemRobotSequence(pufToLoadPortItem,null, ref index);
+                SchedulerSequence pufToLoaderSequence=CreateEfemRobotSequence(pufToLoadPortItem,null,sequenceRecipe.SubstrateSize, ref index);
                 schedulerSequences.Add(pufToLoaderSequence);
             }
             return schedulerSequences;
@@ -148,7 +148,7 @@ namespace CyberX8_RT.Schedulers
             TransporterAction transporterAction = GenerateTransporterTransferAction(currentLocationModuleName, ModuleType.Buffer, ModuleName.Loader1, ModuleType.Loader);
             string strTRNP = AnalyseLoadTransporterSide(sequenceRecipe, waferCount);
             List<SchedulerSyncModuleMessage> synModules = GenerateLoaderTransporterSyncModuleMessage(strTRNP);
-            SchedulerSequence bufferToLoaderSequence = CreateLoaderTransporterSequence(transporterAction,synModules, ref index);
+            SchedulerSequence bufferToLoaderSequence = CreateLoaderTransporterSequence(transporterAction,synModules,waferHolderInfo.WaferSize, ref index);
             schedulerSequences.Add(bufferToLoaderSequence);
             //尺寸不一致
             bool needFlip = CheckLoaderWaferSizeNotEqual() && waferCount == 2;
@@ -157,20 +157,20 @@ namespace CyberX8_RT.Schedulers
             parameter.WaferCount= needFlip?1: waferCount;
             parameter.LoadCompleteToTransporterSide = strTRNP;
             parameter.NeedWaitFlip = needFlip;
-            SchedulerSequence loaderSequence = CreateLoaderSequence(parameter,ref index);
+            SchedulerSequence loaderSequence = CreateLoaderSequence(parameter,sequenceRecipe.SubstrateSize, ref index);
             schedulerSequences.Add(loaderSequence);
             if (needFlip)
             {
                 string reverse = GetReverseTransporterLocation(strTRNP);
                 TransporterAction flipAction = GenerateTransporterFlipAction(reverse);
-                SchedulerSequence flipSequence=CreateLoaderTransporterSequence(flipAction,null,ref index);
+                SchedulerSequence flipSequence=CreateLoaderTransporterSequence(flipAction,null,sequenceRecipe.SubstrateSize, ref index);
                 schedulerSequences.Add(flipSequence);
                 //Loader
                 LoaderParameter reverseParameter = new LoaderParameter();
                 reverseParameter.WaferCount = 1;
                 reverseParameter.LoadCompleteToTransporterSide = reverse;
                 reverseParameter.NeedWaitFlip = false; 
-                SchedulerSequence reverseLoadSequence = CreateLoaderSequence(reverseParameter, ref index);
+                SchedulerSequence reverseLoadSequence = CreateLoaderSequence(reverseParameter,sequenceRecipe.SubstrateSize, ref index);
                 schedulerSequences.Add(reverseLoadSequence);
             }
             //wafer holder装载后的recipe工序
@@ -280,7 +280,7 @@ namespace CyberX8_RT.Schedulers
             ModuleName bufferModule = (ModuleName)Enum.Parse(typeof(ModuleName), waferHolderInfo.OriginalBuffer);
             List<SchedulerSyncModuleMessage> synModules = GenerateLoaderTransporterSyncModuleMessage(strTRNP);
             TransporterAction transporterAction = GenerateTransporterTransferAction(currentLocationModuleName, ModuleType.Buffer, ModuleName.Loader1, ModuleType.Loader);
-            SchedulerSequence bufferToLoaderSequence = CreateLoaderTransporterSequence(transporterAction,synModules, ref index);
+            SchedulerSequence bufferToLoaderSequence = CreateLoaderTransporterSequence(transporterAction,synModules,waferHolderInfo.WaferSize, ref index);
             schedulerSequences.Add(bufferToLoaderSequence);
 
             //尺寸不一致
@@ -290,26 +290,26 @@ namespace CyberX8_RT.Schedulers
             parameter.WaferCount = needFlip ? 1 : waferCount; ;
             parameter.LoadCompleteToTransporterSide = strTRNP;
             parameter.NeedWaitFlip = needFlip;
-            SchedulerSequence loaderSequence = CreateLoaderSequence(parameter,ref index);
+            SchedulerSequence loaderSequence = CreateLoaderSequence(parameter,waferHolderInfo.WaferSize,ref index);
             schedulerSequences.Add(loaderSequence);
             if (needFlip)
             {
                 string reverse = GetReverseTransporterLocation(strTRNP);
                 TransporterAction flipAction = GenerateTransporterFlipAction(reverse);
-                SchedulerSequence flipSequence = CreateLoaderTransporterSequence(flipAction, null, ref index);
+                SchedulerSequence flipSequence = CreateLoaderTransporterSequence(flipAction, null,waferHolderInfo.WaferSize, ref index);
                 schedulerSequences.Add(flipSequence);
                 //Loader
                 LoaderParameter reverseParameter = new LoaderParameter();
                 reverseParameter.WaferCount = 1;
                 reverseParameter.LoadCompleteToTransporterSide = reverse;
                 reverseParameter.NeedWaitFlip = false;
-                SchedulerSequence reverseLoadSequence = CreateLoaderSequence(reverseParameter, ref index);
+                SchedulerSequence reverseLoadSequence = CreateLoaderSequence(reverseParameter,waferHolderInfo.WaferSize, ref index);
                 schedulerSequences.Add(reverseLoadSequence);
             }
             //Loader To Buffer
             TransporterAction loaderMoveToBufferAction=GenerateTransporterTransferAction (ModuleName.Loader1, ModuleType.Loader,
                 bufferModule, ModuleType.Buffer);
-            SchedulerSequence loaderToBufferSequence = CreateLoaderTransporterSequence(loaderMoveToBufferAction,null, ref index);
+            SchedulerSequence loaderToBufferSequence = CreateLoaderTransporterSequence(loaderMoveToBufferAction,null,waferHolderInfo.WaferSize, ref index);
             schedulerSequences.Add(loaderToBufferSequence);
             return schedulerSequences;
         }
@@ -325,22 +325,22 @@ namespace CyberX8_RT.Schedulers
             int index = 0;
             //DummyCassete至Aligner
             MoveItem moveItem = new MoveItem((ModuleName)waferInfo.Station, waferInfo.Slot, ModuleName.Aligner1, 0, Aitex.Sorter.Common.Hand.Blade1);
-            SchedulerSequence secondEfemRobotSequence = CreateEfemRobotSequence(moveItem, null, ref index);
+            SchedulerSequence secondEfemRobotSequence = CreateEfemRobotSequence(moveItem, null,sequenceRecipe.SubstrateSize, ref index);
             schedulerSequences.Add(secondEfemRobotSequence);
             //Aligner
             SchedulerSequence alignerSequence = null;
             if (sequenceRecipe == null)
             {
-                alignerSequence= CreateAlignerSequence(0, ref index);
+                alignerSequence= CreateAlignerSequence(0,sequenceRecipe.SubstrateSize, ref index);
             }
             else
             {
-                alignerSequence=CreateAlignerSequence(sequenceRecipe.AlignmentAngle, ref index);
+                alignerSequence=CreateAlignerSequence(sequenceRecipe.AlignmentAngle,sequenceRecipe.SubstrateSize, ref index);
             }
             schedulerSequences.Add(alignerSequence);
             //Aligner至Puf
             MoveItem alignerToPufMoveItem = new MoveItem(ModuleName.Aligner1, 0, pufModule, 1, Aitex.Sorter.Common.Hand.Blade1);
-            SchedulerSequence alignerToPufEfemRobotSequence = CreateEfemRobotSequence(alignerToPufMoveItem, null, ref index);
+            SchedulerSequence alignerToPufEfemRobotSequence = CreateEfemRobotSequence(alignerToPufMoveItem, null,sequenceRecipe.SubstrateSize, ref index);
             schedulerSequences.Add(alignerToPufEfemRobotSequence);
             SchedulerSequence pufSequence = CreatePufSequence(pufModule,sequenceRecipe, side,true, ref index);
             schedulerSequences.Add(pufSequence);            
@@ -364,13 +364,13 @@ namespace CyberX8_RT.Schedulers
             //Loader To Buffer
             TransporterAction loaderMoveToBufferAction = GenerateTransporterTransferAction(ModuleName.Loader1, ModuleType.Loader,
                 moduleName, ModuleType.Buffer);
-            SchedulerSequence loaderToBufferSequence = CreateLoaderTransporterSequence(loaderMoveToBufferAction,null, ref index);
+            SchedulerSequence loaderToBufferSequence = CreateLoaderTransporterSequence(loaderMoveToBufferAction,null,sequenceRecipe.SubstrateSize, ref index);
             schedulerSequences.Add(loaderToBufferSequence);
             //解析sequence recipe后续的工序
             var result = AnalyseSequenceRecipeScheduler(sequenceRecipe);
             //buffer to recipe第一个工序
             TransporterAction bufferToFirstAction = GenerateTransporterTransferAction(moduleName, ModuleType.Buffer, ModuleName.Unknown, result.firstModuleType);
-            SchedulerSequence bufferSequence = CreateLoaderTransporterSequence(bufferToFirstAction,null, ref index);
+            SchedulerSequence bufferSequence = CreateLoaderTransporterSequence(bufferToFirstAction,null,sequenceRecipe.SubstrateSize, ref index);
             schedulerSequences.Add(bufferSequence);
             //调整工序后面的索引
             foreach (SchedulerSequence item in result.sequences)
@@ -381,7 +381,7 @@ namespace CyberX8_RT.Schedulers
             schedulerSequences.AddRange(result.sequences);
             //从recipe最后工序
             TransporterAction lastToBufferAction = GenerateTransporterTransferAction(ModuleName.Unknown, result.lastModuleType, moduleName, ModuleType.Buffer);
-            SchedulerSequence lastToBufferSequence = CreateLoaderTransporterSequence(lastToBufferAction,null, ref index);
+            SchedulerSequence lastToBufferSequence = CreateLoaderTransporterSequence(lastToBufferAction,null,sequenceRecipe.SubstrateSize, ref index);
             schedulerSequences.Add(lastToBufferSequence);
             return schedulerSequences;
         }
@@ -411,6 +411,7 @@ namespace CyberX8_RT.Schedulers
                 schedulerSequence.ModuleName = ModuleName.Unknown;
                 schedulerSequence.ModuleType=SequenceRecipeManager.Instance.GetModuleType(item);
                 schedulerSequence.SequenceIndex=i;
+                schedulerSequence.WaferSize = sequenceRecipe.SubstrateSize;
                 MECF.Framework.Common.RecipeCenter.RecipeType recipeType =SequenceRecipeManager.Instance.GetRecipeType(item);
                 schedulerSequence.Recipe = SequenceRecipeManager.Instance.LoadSequenceTypeRecipe(sequenceRecipe.SequenceType,item, recipeType);
                 schedulerSequence.SequenceType = sequenceRecipe.SequenceType;
@@ -451,7 +452,7 @@ namespace CyberX8_RT.Schedulers
                     transporterAction.ActionMsg = TransporterMSG.Transfer;
                     WaferHolderMoveItem moveItem = new WaferHolderMoveItem(ModuleName.Unknown, tmpLst[i].ModuleType, ModuleName.Unknown, tmpLst[i + 1].ModuleType);
                     transporterAction.Parameter = moveItem;
-                    SchedulerSequence schedulerSequence=CreateProcessTransporterSequence(transporterAction,ref index);
+                    SchedulerSequence schedulerSequence=CreateProcessTransporterSequence(transporterAction,sequenceRecipe.SubstrateSize,ref index);
                     schedulerSequences.Add(schedulerSequence);
                 }
             }
@@ -490,7 +491,7 @@ namespace CyberX8_RT.Schedulers
         /// </summary>
         /// <param name="index"></param>
         /// <returns></returns>
-        private SchedulerSequence CreateEfemRobotSequence(MoveItem moveItem,List<SchedulerSyncModuleMessage> synModules,ref int index)
+        private SchedulerSequence CreateEfemRobotSequence(MoveItem moveItem,List<SchedulerSyncModuleMessage> synModules,int waferSize,ref int index)
         {
             SchedulerSequence sequence = new SchedulerSequence();
             sequence.SchedulerModule = SchedulerManager.Instance.GetScheduler(ModuleName.EfemRobot);
@@ -502,6 +503,7 @@ namespace CyberX8_RT.Schedulers
             sequence.Parameters =moveItem;
             sequence.MaterialType = MaterialType.Wafer;
             sequence.SynchronousModuleMessages = synModules;
+            sequence.WaferSize = waferSize;
             index++;
             return sequence;
         }
@@ -510,7 +512,7 @@ namespace CyberX8_RT.Schedulers
         /// </summary>
         /// <param name="index"></param>
         /// <returns></returns>
-        private SchedulerSequence CreateAlignerSequence(double angle,ref int index) 
+        private SchedulerSequence CreateAlignerSequence(double angle,int waferSize,ref int index) 
         {
             SchedulerSequence sequence = new SchedulerSequence();
             sequence.SchedulerModule = SchedulerManager.Instance.GetScheduler(ModuleName.Aligner1);
@@ -521,6 +523,7 @@ namespace CyberX8_RT.Schedulers
             sequence.ModuleType = ModuleType.Aligner;
             sequence.Parameters = angle;
             sequence.MaterialType = MaterialType.Wafer;
+            sequence.WaferSize = waferSize;
             index++;
             return sequence;
         }
@@ -547,6 +550,7 @@ namespace CyberX8_RT.Schedulers
             sequence.IsWaitNotify = !forward;
             sequence.ModuleType = ModuleType.PUF;
             sequence.MaterialType = MaterialType.Wafer;
+            sequence.WaferSize = sequenceRecipe.SubstrateSize;
             index++;
             return sequence;
         }
@@ -555,7 +559,7 @@ namespace CyberX8_RT.Schedulers
         /// </summary>
         /// <param name="index"></param>
         /// <returns></returns>
-        private SchedulerSequence CreateLoaderSequence(LoaderParameter parameter,ref int index)
+        private SchedulerSequence CreateLoaderSequence(LoaderParameter parameter,int waferSize,ref int index)
         {
             SchedulerSequence sequence = new SchedulerSequence();
             sequence.SchedulerModule = SchedulerManager.Instance.GetScheduler(ModuleName.Loader1);
@@ -566,6 +570,7 @@ namespace CyberX8_RT.Schedulers
             sequence.Parameters = parameter;
             sequence.ModuleType = ModuleType.Loader;
             sequence.MaterialType = MaterialType.WaferHolder;
+            sequence.WaferSize = waferSize;
             index++;
             return sequence;
         }
@@ -591,7 +596,7 @@ namespace CyberX8_RT.Schedulers
         /// </summary>
         /// <param name="index"></param>
         /// <returns></returns>
-        private SchedulerSequence CreateLoaderTransporterSequence(TransporterAction transporterAction, List<SchedulerSyncModuleMessage> synModules, ref int index)
+        private SchedulerSequence CreateLoaderTransporterSequence(TransporterAction transporterAction, List<SchedulerSyncModuleMessage> synModules,int waferSize, ref int index)
         {
             SchedulerSequence sequence = new SchedulerSequence();
             sequence.ModuleType = ModuleType.Transporter;
@@ -603,6 +608,7 @@ namespace CyberX8_RT.Schedulers
             sequence.Parameters = transporterAction;
             sequence.MaterialType = MaterialType.WaferHolder;
             sequence.SynchronousModuleMessages = synModules;
+            sequence.WaferSize = waferSize;
             index++;
             return sequence;
         }
@@ -611,7 +617,7 @@ namespace CyberX8_RT.Schedulers
         /// </summary>
         /// <param name="index"></param>
         /// <returns></returns>
-        private SchedulerSequence CreateProcessTransporterSequence(TransporterAction transporterAction, ref int index)
+        private SchedulerSequence CreateProcessTransporterSequence(TransporterAction transporterAction,int waferSize, ref int index)
         {
             SchedulerSequence sequence = new SchedulerSequence();
             sequence.ModuleType = ModuleType.Transporter;
@@ -622,6 +628,7 @@ namespace CyberX8_RT.Schedulers
             sequence.SchedulerModule = SchedulerManager.Instance.GetScheduler(ModuleName.Transporter1);
             sequence.Parameters= transporterAction;
             sequence.MaterialType = MaterialType.WaferHolder;
+            sequence.WaferSize = waferSize;
             index++;
             return sequence;
         }
@@ -728,14 +735,14 @@ namespace CyberX8_RT.Schedulers
         /// </summary>
         /// <param name="chemistry"></param>
         /// <returns></returns>
-        public ModuleName CalculateAvaibleMetalCellByChemistry(string chemistry,string startRinse,string sequenceType,ref bool isExistEnableMetal)
+        public ModuleName CalculateAvaibleMetalCellByChemistry(string chemistry,string startRinse,string sequenceType,int waferSize,ref bool isExistEnableMetal)
         {
             if(!Enum.TryParse(startRinse,out ModuleName startRinseModule)||!ModuleHelper.IsRinse(startRinseModule))
             {
                 startRinse = "";
             }
             isExistEnableMetal = false;
-            List<MetalEntity> moduleEntities = GetAvaibleMetalList(chemistry,sequenceType,true);
+            List<MetalEntity> moduleEntities = GetAvaibleMetalList(chemistry,sequenceType,waferSize,true);
             List<IModuleEntity> avaibleMetalEntities = new List<IModuleEntity>();
             foreach (var item in moduleEntities)
             {
@@ -764,9 +771,9 @@ namespace CyberX8_RT.Schedulers
         /// <param name="chemistry"></param>
         /// <param name="sequenceType"></param>
         /// <returns></returns>
-        public bool CalculateAvaibleMetalCellByChemistry(string chemistry,string sequenceType)
+        public bool CalculateAvaibleMetalCellByChemistry(string chemistry,string sequenceType,int waferSize)
         {
-            List<MetalEntity> moduleEntities = GetAvaibleMetalList(chemistry, sequenceType, false);
+            List<MetalEntity> moduleEntities = GetAvaibleMetalList(chemistry, sequenceType,waferSize,false);
             return moduleEntities.Count != 0;
         }
         /// <summary>
@@ -1272,7 +1279,7 @@ namespace CyberX8_RT.Schedulers
         /// </summary>
         /// <param name="chemistry"></param>
         /// <returns></returns>
-        public List<MetalEntity> GetAvaibleMetalList(string chemistry, string sequenceType, bool isEmpty)
+        public List<MetalEntity> GetAvaibleMetalList(string chemistry, string sequenceType,int waferSize, bool isEmpty)
         {
             List<IModuleEntity> reservoirEntities = Singleton<RouteManager>.Instance.GetModulesByModuleType(ModuleType.Reservoir);
             List<string> avaibles = new List<string>();
@@ -1300,6 +1307,10 @@ namespace CyberX8_RT.Schedulers
                     {
                         continue;
                     }
+                    if (entity.MetalWaferSize != waferSize)
+                    {
+                        continue;
+                    }
                     if (!isEmpty || (isEmpty && entity.WaferHolderInfo == null))
                     {
                         metals.Add(entity);

+ 1 - 1
CyberX8_RT/Schedulers/SchedulerSequenceRecipeManager.cs

@@ -66,7 +66,7 @@ namespace CyberX8_RT.Schedulers
                         }
                         return false;
                     }
-                    List<MetalEntity> metals = SchedulerSequenceManager.Instance.GetAvaibleMetalList(depRecipe.Chemistry,sequenceRecipe.SequenceType,false);
+                    List<MetalEntity> metals = SchedulerSequenceManager.Instance.GetAvaibleMetalList(depRecipe.Chemistry,sequenceRecipe.SequenceType,sequenceRecipe.SubstrateSize,false);
                     if(metals.Count==0)
                     {
                         if (showError)

+ 1 - 1
CyberX8_RT/Schedulers/Transporter/SchedulerProcessTransporter.cs

@@ -404,7 +404,7 @@ namespace CyberX8_RT.Schedulers.Transporter
                             //获取可用的Metal以及Rinse
                             DepRecipe depRecipe = (DepRecipe)sequence.Recipe;
                             ModuleName tmpName = SchedulerSequenceManager.Instance.CalculateAvaibleMetalCellByChemistry(depRecipe.Chemistry, 
-                                waferHolderMoveItem.SourceModule.ToString(),sequence.SequenceType,ref existEnableCell);
+                                waferHolderMoveItem.SourceModule.ToString(),sequence.SequenceType,sequence.WaferSize,ref existEnableCell);
                             if (tmpName != ModuleName.Unknown)
                             {
                                 IModuleEntity moduleEntity = Singleton<RouteManager>.Instance.GetModule<IModuleEntity>(tmpName.ToString());