123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287 |
- using Aitex.Core.Common;
- using Aitex.Core.RT.Event;
- using Aitex.Core.Util;
- using MECF.Framework.Common.CommonData;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.SubstrateTrackings;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Venus_RT.Modules.PMs
- {
- public interface IRecipeFACallback
- {
- void RecipeStart(string module,string recipeName);
- void RecipeComplete(string module,string recipeName);
- void RecipeFailed(string module, string recipeName);
- void RecipeStepStart(string module, string recipeName, int stepNumber);
- void RecipeStepEnd(string module, string recipeName, int stepNumber);
- }
- public class RecipeFACallback : IRecipeFACallback
- {
- private const string PMARecipeStart = "PMARecipeStart";
- private const string PMARecipeComplete = "PMARecipeComplete";
- private const string PMARecipeStepStart = "PMARecipeStepStart";
- private const string PMARecipeStepEnd = "PMARecipeStepEnd";
- private const string PMARecipeFailed = "PMARecipeFailed";
- private const string PMBRecipeStart = "PMBRecipeStart";
- private const string PMBRecipeComplete = "PMBRecipeComplete";
- private const string PMBRecipeStepStart = "PMBRecipeStepStart";
- private const string PMBRecipeStepEnd = "PMBRecipeStepEnd";
- private const string PMBRecipeFailed = "PMBRecipeFailed";
- private const string PMCRecipeStart = "PMCRecipeStart";
- private const string PMCRecipeComplete = "PMCRecipeComplete";
- private const string PMCRecipeStepStart = "PMCRecipeStepStart";
- private const string PMCRecipeStepEnd = "PMCRecipeStepEnd";
- private const string PMCRecipeFailed = "PMCRecipeFailed";
- private const string PMDRecipeStart = "PMDRecipeStart";
- private const string PMDRecipeComplete = "PMDRecipeComplete";
- private const string PMDRecipeStepStart = "PMDRecipeStepStart";
- private const string PMDRecipeStepEnd = "PMDRecipeStepEnd";
- private const string PMDRecipeFailed = "PMDRecipeFailed";
- private Dictionary<ModuleName, string> PMRecipeStart = new Dictionary<ModuleName, string>()
- {
- {ModuleName.PMA, PMARecipeStart},
- {ModuleName.PMB, PMBRecipeStart},
- {ModuleName.PMC, PMCRecipeStart},
- {ModuleName.PMD, PMDRecipeStart}
- };
- private Dictionary<ModuleName, string> PMRecipeComplete = new Dictionary<ModuleName, string>()
- {
- {ModuleName.PMA, PMARecipeComplete},
- {ModuleName.PMB, PMBRecipeComplete},
- {ModuleName.PMC, PMCRecipeComplete},
- {ModuleName.PMD, PMDRecipeComplete},
- };
- private Dictionary<ModuleName, string> PMRecipeStepStart = new Dictionary<ModuleName, string>()
- {
- {ModuleName.PMA, PMARecipeStepStart},
- {ModuleName.PMB, PMBRecipeStepStart},
- {ModuleName.PMC, PMCRecipeStepStart},
- {ModuleName.PMD, PMDRecipeStepStart},
- };
- private Dictionary<ModuleName, string> PMRecipeStepEnd = new Dictionary<ModuleName, string>()
- {
- {ModuleName.PMA, PMARecipeStepEnd},
- {ModuleName.PMB, PMBRecipeStepEnd},
- {ModuleName.PMC, PMCRecipeStepEnd},
- {ModuleName.PMD, PMDRecipeStepEnd},
- };
- private Dictionary<ModuleName, string> PMRecipeFailed = new Dictionary<ModuleName, string>()
- {
- {ModuleName.PMA, PMARecipeFailed},
- {ModuleName.PMB, PMBRecipeFailed},
- {ModuleName.PMC, PMCRecipeFailed},
- {ModuleName.PMD, PMDRecipeFailed},
- };
- private Dictionary<int, string> PortId = new Dictionary<int, string>()
- {
- {(int)ModuleName.LP1, "1"},
- {(int)ModuleName.LP2, "2"},
- };
- public RecipeFACallback()
- {
- EV.Subscribe(new EventItem("Event", PMARecipeStart, PMARecipeStart));
- EV.Subscribe(new EventItem("Event", PMARecipeComplete, PMARecipeComplete));
- EV.Subscribe(new EventItem("Event", PMARecipeStepStart, PMARecipeStepStart));
- EV.Subscribe(new EventItem("Event", PMARecipeStepEnd, PMARecipeStepEnd));
- EV.Subscribe(new EventItem("Event", PMARecipeFailed, PMARecipeFailed));
- EV.Subscribe(new EventItem("Event", PMBRecipeStart, PMBRecipeStart));
- EV.Subscribe(new EventItem("Event", PMBRecipeComplete, PMBRecipeComplete));
- EV.Subscribe(new EventItem("Event", PMBRecipeStepStart, PMBRecipeStepStart));
- EV.Subscribe(new EventItem("Event", PMBRecipeStepEnd, PMBRecipeStepEnd));
- EV.Subscribe(new EventItem("Event", PMBRecipeFailed, PMBRecipeFailed));
- EV.Subscribe(new EventItem("Event", PMCRecipeStart, PMCRecipeStart));
- EV.Subscribe(new EventItem("Event", PMCRecipeComplete, PMCRecipeComplete));
- EV.Subscribe(new EventItem("Event", PMCRecipeStepStart, PMCRecipeStepStart));
- EV.Subscribe(new EventItem("Event", PMCRecipeStepEnd, PMCRecipeStepEnd));
- EV.Subscribe(new EventItem("Event", PMCRecipeFailed, PMCRecipeFailed));
- EV.Subscribe(new EventItem("Event", PMDRecipeStart, PMDRecipeStart));
- EV.Subscribe(new EventItem("Event", PMDRecipeComplete, PMDRecipeComplete));
- EV.Subscribe(new EventItem("Event", PMDRecipeStepStart, PMDRecipeStepStart));
- EV.Subscribe(new EventItem("Event", PMDRecipeStepEnd, PMDRecipeStepEnd));
- EV.Subscribe(new EventItem("Event", PMDRecipeFailed, PMDRecipeFailed));
- }
- public void RecipeComplete(string module, string recipeName)
- {
- WaferInfo wafer = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 0);
- if (wafer.IsEmpty)
- return;
- ModuleName moduleName = ModuleHelper.Converter(module);
- if (PortId.ContainsKey(wafer.OriginStation))
- {
- EV.Notify(PMRecipeComplete[moduleName], new SerializableDictionary<string, string>()
- {
- {DVIDName.RecipeID, recipeName},
- {DVIDName.StationName, module},
- {DVIDName.PortID, PortId[wafer.OriginStation]},
- {DVIDName.SlotID, (wafer.OriginSlot+1).ToString()},
- {DVIDName.LotID, wafer.LotId},
- {DVIDName.CarrierID,wafer.OriginCarrierID == null ? "" : wafer.OriginCarrierID }
- });
- }
- else
- {
- EV.Notify(PMRecipeComplete[moduleName], new SerializableDictionary<string, string>()
- {
- {DVIDName.RecipeID, recipeName},
- {DVIDName.StationName, module},
- {DVIDName.SlotID, (wafer.OriginSlot+1).ToString()},
- {DVIDName.LotID, wafer.LotId},
- {DVIDName.CarrierID,wafer.OriginCarrierID==null?"":wafer.OriginCarrierID }
- });
- }
- }
- public void RecipeFailed(string module, string recipeName)
- {
- WaferInfo wafer = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 0);
- if (wafer.IsEmpty)
- return;
- ModuleName moduleName = ModuleHelper.Converter(module);
- if (PortId.ContainsKey(wafer.OriginStation))
- {
- EV.Notify(PMRecipeFailed[moduleName], new SerializableDictionary<string, string>()
- {
- {DVIDName.RecipeID, recipeName},
- {DVIDName.StationName, module},
- {DVIDName.PortID, PortId[wafer.OriginStation]},
- {DVIDName.SlotID, (wafer.OriginSlot + 1).ToString()},
- {DVIDName.LotID, wafer.LotId}
- });
- }
- else
- {
- EV.Notify(PMRecipeFailed[moduleName], new SerializableDictionary<string, string>()
- {
- {DVIDName.RecipeID, recipeName},
- {DVIDName.StationName, module},
- {DVIDName.SlotID, (wafer.OriginSlot + 1).ToString()},
- {DVIDName.LotID, wafer.LotId}
- });
- }
- }
- public void RecipeStart(string module, string recipeName)
- {
- WaferInfo wafer = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 0);
- if (wafer.IsEmpty)
- return;
- ModuleName moduleName = ModuleHelper.Converter(module);
- if (PortId.ContainsKey(wafer.OriginStation))
- {
- EV.Notify(PMRecipeStart[moduleName], new SerializableDictionary<string, string>()
- {
- {DVIDName.RecipeID, recipeName},
- {DVIDName.StationName, module},
- {DVIDName.PortID, PortId[wafer.OriginStation]},
- {DVIDName.SlotID, (wafer.OriginSlot + 1).ToString()},
- {DVIDName.LotID, wafer.LotId},
- //{DVIDName.CarrierID,wafer.OriginCarrierID.ToString() }
- {DVIDName.CarrierID,"" }
- });
- }
- else
- {
- EV.Notify(PMRecipeStart[moduleName], new SerializableDictionary<string, string>()
- {
- {DVIDName.RecipeID, recipeName},
- {DVIDName.StationName, module},
- {DVIDName.SlotID, (wafer.OriginSlot + 1).ToString()},
- {DVIDName.LotID, wafer.LotId},
- //{DVIDName.CarrierID,wafer.OriginCarrierID.ToString() }
- });
- }
- }
- public void RecipeStepEnd(string module, string recipeName, int stepNumber)
- {
- WaferInfo wafer = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 0);
- if (wafer.IsEmpty)
- return;
- ModuleName moduleName = ModuleHelper.Converter(module);
- if (PortId.ContainsKey(wafer.OriginStation))
- {
- EV.Notify(PMRecipeStepEnd[moduleName], new SerializableDictionary<string, object>()
- {
- {DVIDName.RecipeID, recipeName},
- {DVIDName.StationName, module},
- {DVIDName.RecipeStepNumber, (stepNumber + 1).ToString()},
- {DVIDName.PortID, PortId[wafer.OriginStation]},
- {DVIDName.SlotID, (wafer.OriginSlot + 1).ToString()},
- //{DVIDName.RecipeStepEndDataSummary, fdc},
- {DVIDName.LotID, wafer.LotId},
- {DVIDName.CarrierID,wafer.OriginCarrierID==null?"":wafer.OriginCarrierID }
- });
- }
- else
- {
- EV.Notify(PMRecipeStepEnd[moduleName], new SerializableDictionary<string, object>()
- {
- {DVIDName.RecipeID, recipeName},
- {DVIDName.StationName, module},
- {DVIDName.RecipeStepNumber, (stepNumber + 1).ToString()},
- {DVIDName.SlotID, (wafer.OriginSlot + 1).ToString()},
- //{DVIDName.RecipeStepEndDataSummary, fdc},
- {DVIDName.LotID, wafer.LotId},
- {DVIDName.CarrierID,wafer.OriginCarrierID==null?"":wafer.OriginCarrierID }
- });
- }
- }
- public void RecipeStepStart(string module, string recipeName, int stepNumber)
- {
- WaferInfo wafer = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), 0);
- if (wafer.IsEmpty)
- return;
- ModuleName moduleName = ModuleHelper.Converter(module);
- if (PortId.ContainsKey(wafer.OriginStation))
- {
- EV.Notify(PMRecipeStepStart[moduleName], new SerializableDictionary<string, string>()
- {
- {DVIDName.RecipeID, recipeName},
- {DVIDName.StationName, module},
- {DVIDName.RecipeStepNumber, (stepNumber + 1).ToString()},
- {DVIDName.PortID, PortId[wafer.OriginStation]},
- {DVIDName.SlotID, (wafer.OriginSlot + 1).ToString()},
- {DVIDName.LotID, wafer.LotId},
- {DVIDName.CarrierID,wafer.OriginCarrierID==null?"":wafer.OriginCarrierID }
- });
- }
- else
- {
- EV.Notify(PMRecipeStepStart[moduleName], new SerializableDictionary<string, string>()
- {
- {DVIDName.RecipeID, recipeName},
- {DVIDName.StationName, module},
- {DVIDName.RecipeStepNumber, (stepNumber + 1).ToString()},
- {DVIDName.SlotID, (wafer.OriginSlot + 1).ToString()},
- {DVIDName.LotID, wafer.LotId},
- {DVIDName.CarrierID,wafer.OriginCarrierID==null?"":wafer.OriginCarrierID.ToString() }
- });
- }
- }
- }
- }
|