123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 |
- using Aitex.Core.Common;
- using Aitex.Core.RT.Event;
- using Aitex.Core.UI.Control;
- using Aitex.Core.Util;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.Jobs;
- using MECF.Framework.Common.SubstrateTrackings;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Controls;
- namespace Venus_RT.Modules
- {
- public interface ISchedulerFACallback
- {
- void JobCreated(ControlJobInfo cj, ProcessJobInfo pj);
- void JobCreateFailed(string module, string lotID, string jobID, string sequenceID);
- void JobStarted(ControlJobInfo cj, ProcessJobInfo pj);
- void JobStopped(ControlJobInfo cj, ProcessJobInfo pj);
- void JobPaused(ControlJobInfo cj, ProcessJobInfo pj);
- void JobResumed(ControlJobInfo cj, ProcessJobInfo pj);
- void JobAborted(ControlJobInfo cj, ProcessJobInfo pj);
- void JobFinished(ControlJobInfo cj, ProcessJobInfo pj);
- void JobFailed(ControlJobInfo cj, ProcessJobInfo pj);
- void JobWaferStart(ControlJobInfo cj, int slotID);
- void JobWaferEnd(ControlJobInfo cj, int slotID);
- }
- public class SchedulerFACallback : ISchedulerFACallback
- {
- private const string PortJobStarted = "PortJobStarted";
- private const string PortJobStopped = "PortJobStopped";
- private const string PortJobPaused = "PortJobPaused";
- private const string PortJobResumed = "PortJobResumed";
- private const string PortJobAborted = "PortJobAborted";
- private const string PortJobFinished = "PortJobFinished";
- private const string PortJobFailed = "PortJobFailed";
- private const string PortSequenceSelected = "PortPPSelected";
- private const string PortSequenceSelectFailed = "PortPPSelectFailed";
- private const string PortJobWaferStart = "PortJobWaferStart";
- private const string PortJobWaferEnd = "PortJobWaferEnd";
- private Dictionary<ModuleName, string> PortId = new Dictionary<ModuleName, string>()
- {
- {ModuleName.LP1, "1"},
- {ModuleName.LP2, "2"},
- {ModuleName.LP3, "3"},
- {ModuleName.VCE1, "1"},
- {ModuleName.VCEA, "1"},
- {ModuleName.VCEB, "2"},
- };
- public SchedulerFACallback()
- {
- EV.Subscribe(new EventItem("Event", PortJobStarted, PortJobStarted));
- EV.Subscribe(new EventItem("Event", PortJobStopped, PortJobStopped));
- EV.Subscribe(new EventItem("Event", PortJobPaused, PortJobPaused));
- EV.Subscribe(new EventItem("Event", PortJobResumed, PortJobResumed));
- EV.Subscribe(new EventItem("Event", PortJobAborted, PortJobAborted));
- EV.Subscribe(new EventItem("Event", PortJobFinished, PortJobFinished));
- EV.Subscribe(new EventItem("Event", PortJobFailed, PortJobFailed));
- EV.Subscribe(new EventItem("Event", PortSequenceSelected, PortSequenceSelected));
- EV.Subscribe(new EventItem("Event", PortSequenceSelectFailed, PortSequenceSelectFailed));
- EV.Subscribe(new EventItem("Event", PortJobWaferStart, PortJobWaferStart));
- EV.Subscribe(new EventItem("Event", PortJobWaferEnd, PortJobWaferEnd));
- }
- public void JobCreated(ControlJobInfo cj, ProcessJobInfo pj)
- {
- ModuleName module = ModuleHelper.Converter(cj.Module);
- EV.Notify(PortSequenceSelected, new SerializableDictionary<string, string>()
- {
- {DVIDName.LotID, pj.LotName},
- {DVIDName.JobID, pj.ControlJobName},
- {DVIDName.PortID, PortId[module] },
- {DVIDName.SequenceID, pj.Sequence.Name }
- });
- }
- public void JobCreateFailed(string module, string lotID, string jobID, string sequenceID)
- {
- ModuleName moduleName = ModuleHelper.Converter(module);
- EV.Notify(PortSequenceSelectFailed, new SerializableDictionary<string, string>()
- {
- {DVIDName.LotID, lotID},
- {DVIDName.JobID, jobID},
- {DVIDName.PortID, PortId[moduleName] },
- {DVIDName.SequenceID, sequenceID }
- });
- }
- public void JobStarted(ControlJobInfo cj,ProcessJobInfo pj)
- {
- ModuleName module= ModuleHelper.Converter(cj.Module);
- EV.Notify(PortJobStarted, new SerializableDictionary<string, string>()
- {
- {DVIDName.LotID, pj.LotName},
- {DVIDName.JobID, pj.ControlJobName},
- {DVIDName.PortID, PortId[module] },
- {DVIDName.SequenceID, pj.Sequence.Name }
- });
- }
- public void JobStopped(ControlJobInfo cj, ProcessJobInfo pj)
- {
- ModuleName module = ModuleHelper.Converter(cj.Module);
- EV.Notify(PortJobStopped, new SerializableDictionary<string, string>()
- {
- {DVIDName.LotID, pj.LotName},
- {DVIDName.JobID, pj.ControlJobName},
- {DVIDName.PortID, PortId[module] },
- {DVIDName.SequenceID, pj.Sequence.Name }
- });
- }
- public void JobPaused(ControlJobInfo cj, ProcessJobInfo pj)
- {
- ModuleName module = ModuleHelper.Converter(cj.Module);
- EV.Notify(PortJobPaused, new SerializableDictionary<string, string>()
- {
- {DVIDName.LotID, pj.LotName},
- {DVIDName.JobID, pj.ControlJobName},
- {DVIDName.PortID, PortId[module] },
- {DVIDName.SequenceID, pj.Sequence.Name }
- });
- }
- public void JobResumed(ControlJobInfo cj, ProcessJobInfo pj)
- {
- ModuleName module = ModuleHelper.Converter(cj.Module);
- EV.Notify(PortJobResumed, new SerializableDictionary<string, string>()
- {
- {DVIDName.LotID, pj.LotName},
- {DVIDName.JobID, pj.ControlJobName},
- {DVIDName.PortID, PortId[module] },
- {DVIDName.SequenceID, pj.Sequence.Name }
- });
- }
- public void JobAborted(ControlJobInfo cj, ProcessJobInfo pj)
- {
- ModuleName module = ModuleHelper.Converter(cj.Module);
- EV.Notify(PortJobAborted, new SerializableDictionary<string, string>()
- {
- {DVIDName.LotID, cj.LotName},
- {DVIDName.JobID, cj.Name},
- {DVIDName.PortID, PortId[module] },
- {DVIDName.SequenceID, "" }
- });
- }
- public void JobFinished(ControlJobInfo cj, ProcessJobInfo pj)
- {
- ModuleName module = ModuleHelper.Converter(cj.Module);
- int count = pj.SlotWafers.Count;
- EV.Notify(PortJobFinished, new SerializableDictionary<string, string>()
- {
- {DVIDName.LotID, pj.LotName},
- {DVIDName.JobID, pj.ControlJobName},
- {DVIDName.PortID, PortId[module] },
- {DVIDName.SequenceID, pj.Sequence.Name },
- {DVIDName.ProcessedWaferCount, count.ToString() },
- });
- }
- public void JobFailed(ControlJobInfo cj, ProcessJobInfo pj)
- {
- ModuleName module = ModuleHelper.Converter(cj.Module);
- EV.Notify(PortJobFailed, new SerializableDictionary<string, string>()
- {
- {DVIDName.LotID, pj.LotName},
- {DVIDName.JobID, pj.ControlJobName},
- {DVIDName.PortID, PortId[module] },
- {DVIDName.SequenceID, pj.Sequence.Name }
- });
- }
- public void JobWaferStart(ControlJobInfo cj, int slotID)
- {
- ModuleName module = ModuleHelper.Converter(cj.Module);
- WaferInfo waferInfo = WaferManager.Instance.GetWafer(module, slotID);
- if (waferInfo != null)
- {
- EV.Notify(PortJobWaferStart, new SerializableDictionary<string, string>()
- {
- {DVIDName.LotID, cj.LotName},
- {DVIDName.JobID, cj.Name},
- {DVIDName.PortID, PortId[module] },
- {DVIDName.SlotID, (slotID+1).ToString() },
- {DVIDName.CarrierID, waferInfo.OriginCarrierID==null?"":waferInfo.OriginCarrierID},
- {DVIDName.SequenceID,waferInfo.SequenceName }
- });
- }
- }
- public void JobWaferEnd(ControlJobInfo cj, int slotID)
- {
- ModuleName module = ModuleHelper.Converter(cj.Module);
- WaferInfo wafer = WaferManager.Instance.GetWafer(module, slotID);
- if (wafer != null)
- {
- EV.Notify(PortJobWaferEnd, new SerializableDictionary<string, string>()
- {
- {DVIDName.LotID, cj.LotName},
- {DVIDName.JobID, cj.Name},
- {DVIDName.PortID, PortId[module] },
- {DVIDName.SlotID, (slotID+1).ToString() },
- {DVIDName.CarrierID, wafer.OriginCarrierID==null?"":wafer.OriginCarrierID},
- {DVIDName.WaferProcessResult, (wafer.ProcessState == EnumWaferProcessStatus.Failed ? 0:1).ToString()},
- {DVIDName.SequenceID,wafer.SequenceName }
- });
- }
- }
- }
- }
|