123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346 |
- using System.Collections.Generic;
- using Aitex.Core.Common;
- using Aitex.Core.RT.Event;
- using Aitex.Core.RT.OperationCenter;
- using Aitex.Core.Util;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.FAServices;
- using MECF.Framework.Common.Jobs;
- using MECF.Framework.Common.SubstrateTrackings;
- namespace EfemDualSchedulerLib.Schedulers
- {
- 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 PortJobWaitingForStart = "PortJobWaitingForStart";
- private const string PortSequenceSelectFailed = "PortPPSelectFailed";
- private const string PortJobWaferStart = "PortJobWaferStart";
- private const string PortJobWaferEnd = "PortJobWaferEnd";
- private const string E94ControlJobStateChanged = "E94ControlJobStateChanged";
- //private const string Port1JobStarted = "Port1JobStarted";
- //private const string Port1JobStopped = "Port1JobStopped";
- //private const string Port1JobPaused = "Port1JobPaused";
- //private const string Port1JobResumed = "Port1JobResumed";
- //private const string Port1JobAborted = "Port1JobAborted";
- //private const string Port1JobFinished = "Port1JobFinished";
- //private const string Port1JobFailed = "Port1JobFailed";
- //private const string Port1SequenceSelected = "Port1SequenceSelected";
- //private const string Port1SequenceSelectFailed = "Port1SequenceSelectFailed";
- //private const string Port1JobWaferStart = "Port1JobWaferStart";
- //private const string Port1JobWaferEnd = "Port1JobWaferEnd";
- //private const string Port2JobStarted = "Port2JobStarted";
- //private const string Port2JobStopped = "Port2JobStopped";
- //private const string Port2JobPaused = "Port2JobPaused";
- //private const string Port2JobResumed = "Port2JobResumed";
- //private const string Port2JobAborted = "Port2JobAborted";
- //private const string Port2JobFinished = "Port2JobFinished";
- //private const string Port2JobFailed = "Port2JobFailed";
- //private const string Port2SequenceSelected = "Port2SequenceSelected";
- //private const string Port2SequenceSelectFailed = "Port2SequenceSelectFailed";
- //private const string Port2JobWaferStart = "Port2JobWaferStart";
- //private const string Port2JobWaferEnd = "Port2JobWaferEnd";
- //private Dictionary<ModuleName, string> PortJobWaferStart = new Dictionary<ModuleName, string>()
- //{
- // {ModuleName.LP1, Port1JobWaferStart},
- // {ModuleName.LP2, Port2JobWaferStart},
- //};
- //private Dictionary<ModuleName, string> PortJobWaferEnd = new Dictionary<ModuleName, string>()
- //{
- // {ModuleName.LP1, Port1JobWaferEnd},
- // {ModuleName.LP2, Port2JobWaferEnd},
- //};
- //private Dictionary<ModuleName, string> PortJobStarted = new Dictionary<ModuleName, string>()
- //{
- // {ModuleName.LP1, Port1JobStarted},
- // {ModuleName.LP2, Port2JobStarted},
- //};
- //private Dictionary<ModuleName, string> PortJobStopped = new Dictionary<ModuleName, string>()
- //{
- // {ModuleName.LP1, Port1JobStopped},
- // {ModuleName.LP2, Port2JobStopped},
- //};
- //private Dictionary<ModuleName, string> PortJobPaused = new Dictionary<ModuleName, string>()
- //{
- // {ModuleName.LP1, Port1JobPaused},
- // {ModuleName.LP2, Port2JobPaused},
- //};
- //private Dictionary<ModuleName, string> PortJobResumed = new Dictionary<ModuleName, string>()
- //{
- // {ModuleName.LP1, Port1JobResumed},
- // {ModuleName.LP2, Port2JobResumed},
- //};
- //private Dictionary<ModuleName, string> PortJobAborted = new Dictionary<ModuleName, string>()
- //{
- // {ModuleName.LP1, Port1JobAborted},
- // {ModuleName.LP2, Port2JobAborted},
- //};
- //private Dictionary<ModuleName, string> PortJobFinished = new Dictionary<ModuleName, string>()
- //{
- // {ModuleName.LP1, Port1JobFinished},
- // {ModuleName.LP2, Port2JobFinished},
- //};
- //private Dictionary<ModuleName, string> PortJobFailed = new Dictionary<ModuleName, string>()
- //{
- // {ModuleName.LP1, Port1JobFailed},
- // {ModuleName.LP2, Port2JobFailed},
- //};
- //private Dictionary<ModuleName, string> PortSequenceSelected = new Dictionary<ModuleName, string>()
- //{
- // {ModuleName.LP1, Port1SequenceSelected},
- // {ModuleName.LP2, Port2SequenceSelected},
- //};
- //private Dictionary<ModuleName, string> PortSequenceSelectFailed = new Dictionary<ModuleName, string>()
- //{
- // {ModuleName.LP1, Port1SequenceSelectFailed},
- // {ModuleName.LP2, Port2SequenceSelectFailed},
- //};
- private Dictionary<ModuleName, string> PortId = new Dictionary<ModuleName, string>()
- {
- {ModuleName.LP1, "1"},
- {ModuleName.LP2, "2"},
- {ModuleName.LP3, "3"},
- };
- 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));
- EV.Subscribe(new EventItem("Event", PortJobWaitingForStart, PortJobWaitingForStart));
- //EV.Subscribe(new EventItem("Event", Port1JobStarted, Port1JobStarted));
- //EV.Subscribe(new EventItem("Event", Port1JobStopped, Port1JobStopped));
- //EV.Subscribe(new EventItem("Event", Port1JobPaused, Port1JobPaused));
- //EV.Subscribe(new EventItem("Event", Port1JobResumed, Port1JobResumed));
- //EV.Subscribe(new EventItem("Event", Port1JobAborted, Port1JobAborted));
- //EV.Subscribe(new EventItem("Event", Port1JobFinished, Port1JobFinished));
- //EV.Subscribe(new EventItem("Event", Port1JobFailed, Port1JobFailed));
- //EV.Subscribe(new EventItem("Event", Port1SequenceSelected, Port1SequenceSelected));
- //EV.Subscribe(new EventItem("Event", Port1SequenceSelectFailed, Port1SequenceSelectFailed));
- //EV.Subscribe(new EventItem("Event", Port1JobWaferStart, Port1JobWaferStart));
- //EV.Subscribe(new EventItem("Event", Port1JobWaferEnd, Port1JobWaferEnd));
- //EV.Subscribe(new EventItem("Event", Port2JobStarted, Port2JobStarted));
- //EV.Subscribe(new EventItem("Event", Port2JobStopped, Port2JobStopped));
- //EV.Subscribe(new EventItem("Event", Port2JobPaused, Port2JobPaused));
- //EV.Subscribe(new EventItem("Event", Port2JobResumed, Port2JobResumed));
- //EV.Subscribe(new EventItem("Event", Port2JobAborted, Port2JobAborted));
- //EV.Subscribe(new EventItem("Event", Port2JobFinished, Port2JobFinished));
- //EV.Subscribe(new EventItem("Event", Port2JobFailed, Port2JobFailed));
- //EV.Subscribe(new EventItem("Event", Port2SequenceSelected, Port2SequenceSelected));
- //EV.Subscribe(new EventItem("Event", Port2SequenceSelectFailed, Port2SequenceSelectFailed));
- //EV.Subscribe(new EventItem("Event", Port2JobWaferStart, Port2JobWaferStart));
- //EV.Subscribe(new EventItem("Event", Port2JobWaferEnd, Port2JobWaferEnd));
- }
- public void JobCreated(ControlJobInfo cj, ProcessJobInfo pj)
- {
- if (!string.IsNullOrEmpty(cj.Module))
- {
- ModuleName module = ModuleHelper.Converter(cj.Module);
- EV.Notify(PortSequenceSelected, new SerializableDictionary<string, string>()
- {
- {DataVariables.LotID, pj.LotName},
- {DataVariables.JobID, pj.ControlJobName},
- {DataVariables.PortID, PortId[module] },
- {DataVariables.SequenceID, pj.Sequence.Name }
- });
- }
- else
- {
- EV.Notify(PortSequenceSelected, new SerializableDictionary<string, string>()
- {
- {DataVariables.LotID, pj.LotName},
- {DataVariables.JobID, pj.ControlJobName},
- {DataVariables.PortID, "" },
- {DataVariables.SequenceID, pj.Sequence.Name }
- });
- }
- //OP.DoOperation(E94ControlJobStateChanged, cj.Name, cj.State);
- }
- public void JobCreateFailed(string module, string lotID, string jobID, string sequenceID)
- {
- ModuleName moduleName = ModuleHelper.Converter(module);
- EV.Notify(PortSequenceSelectFailed, new SerializableDictionary<string, string>()
- {
- {DataVariables.LotID, lotID},
- {DataVariables.JobID, jobID},
- {DataVariables.PortID, PortId[moduleName] },
- {DataVariables.SequenceID, sequenceID }
- });
- }
- public void JobStarted(ControlJobInfo cj, ProcessJobInfo pj)
- {
- ModuleName module = ModuleHelper.Converter(cj.Module);
- EV.Notify(PortJobStarted, new SerializableDictionary<string, string>()
- {
- {DataVariables.LotID, pj.LotName},
- {DataVariables.JobID, pj.ControlJobName},
- {DataVariables.PortID, PortId[module] },
- {DataVariables.SequenceID, pj.Sequence.Name }
- });
- //OP.DoOperation(E94ControlJobStateChanged, cj.Name, cj.State);
- }
- public void JobWaitingForStart(ControlJobInfo cj, ProcessJobInfo pj)
- {
- ModuleName module = ModuleHelper.Converter(cj.Module);
- EV.Notify(PortJobWaitingForStart, new SerializableDictionary<string, string>()
- {
- {DataVariables.LotID, pj.LotName},
- {DataVariables.JobID, pj.ControlJobName},
- {DataVariables.PortID, PortId[module] },
- {DataVariables.SequenceID, pj.Sequence.Name }
- });
- //OP.DoOperation(E94ControlJobStateChanged,cj.Name, EnumControlJobState.WaitingForStart);
- }
- public void JobStopped(ControlJobInfo cj, ProcessJobInfo pj)
- {
- ModuleName module = ModuleHelper.Converter(cj.Module);
- EV.Notify(PortJobStopped, new SerializableDictionary<string, string>()
- {
- {DataVariables.LotID, pj.LotName},
- {DataVariables.JobID, pj.ControlJobName},
- {DataVariables.PortID, PortId[module] },
- {DataVariables.SequenceID, pj.Sequence.Name }
- });
- //OP.DoOperation(E94ControlJobStateChanged, cj.Name, cj.State);
- }
- public void JobPaused(ControlJobInfo cj, ProcessJobInfo pj)
- {
- ModuleName module = ModuleHelper.Converter(cj.Module);
- EV.Notify(PortJobPaused, new SerializableDictionary<string, string>()
- {
- {DataVariables.LotID, pj.LotName},
- {DataVariables.JobID, pj.ControlJobName},
- {DataVariables.PortID, PortId[module] },
- {DataVariables.SequenceID, pj.Sequence.Name }
- });
- //OP.DoOperation(E94ControlJobStateChanged, cj.Name, cj.State);
- }
- public void JobResumed(ControlJobInfo cj, ProcessJobInfo pj)
- {
- ModuleName module = ModuleHelper.Converter(cj.Module);
- EV.Notify(PortJobResumed, new SerializableDictionary<string, string>()
- {
- {DataVariables.LotID, pj.LotName},
- {DataVariables.JobID, pj.ControlJobName},
- {DataVariables.PortID, PortId[module] },
- {DataVariables.SequenceID, pj.Sequence.Name }
- });
- //OP.DoOperation(E94ControlJobStateChanged, cj.Name, cj.State);
- }
- public void JobAborted(ControlJobInfo cj, ProcessJobInfo pj)
- {
- ModuleName module = ModuleHelper.Converter(cj.Module);
- EV.Notify(PortJobAborted, new SerializableDictionary<string, string>()
- {
- {DataVariables.LotID, cj.LotName},
- {DataVariables.JobID, cj.Name},
- {DataVariables.PortID, PortId[module] },
- {DataVariables.SequenceID, "" }
- });
- //OP.DoOperation(E94ControlJobStateChanged, cj.Name, cj.State);
- }
- 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>()
- {
- {DataVariables.LotID, pj.LotName},
- {DataVariables.JobID, pj.ControlJobName},
- {DataVariables.PortID, PortId[module] },
- {DataVariables.SequenceID, pj.Sequence.Name },
- {DataVariables.ProcessedWaferCount, count.ToString() },
- });
- //OP.DoOperation(E94ControlJobStateChanged, cj.Name, cj.State);
- }
- public void JobFailed(ControlJobInfo cj, ProcessJobInfo pj)
- {
- ModuleName module = ModuleHelper.Converter(cj.Module);
- EV.Notify(PortJobFailed, new SerializableDictionary<string, string>()
- {
- {DataVariables.LotID, pj.LotName},
- {DataVariables.JobID, pj.ControlJobName},
- {DataVariables.PortID, PortId[module] },
- {DataVariables.SequenceID, pj.Sequence.Name }
- });
- }
- public void JobWaferStart(ProcessJobInfo pj, string loadPortName, int slotID)
- {
- var loadPort = ModuleHelper.Converter(loadPortName);
- EV.Notify(PortJobWaferStart, new SerializableDictionary<string, string>()
- {
- {DataVariables.LotID, pj.LotName},
- {DataVariables.JobID, pj.ControlJobName},
- {DataVariables.PortID, PortId[loadPort] },
- {DataVariables.SlotID, (slotID+1).ToString() },
- {DataVariables.SequenceID, pj.Sequence != null ? pj.Sequence.Name:string.Empty }
- });
- }
- public void JobWaferEnd(ProcessJobInfo pj, string loadPortName, int slotID)
- {
- var loadPort = ModuleHelper.Converter(loadPortName);
- WaferInfo wafer = WaferManager.Instance.GetWafer(loadPort, slotID);
- EV.Notify(PortJobWaferEnd, new SerializableDictionary<string, string>()
- {
- {DataVariables.LotID, pj.LotName},
- {DataVariables.JobID, pj.ControlJobName},
- {DataVariables.PortID, PortId[loadPort] },
- {DataVariables.SlotID, (slotID+1).ToString() },
- {DataVariables.WaferProcessResult, (wafer.ProcessState==EnumWaferProcessStatus.Failed ? 0:1).ToString()},
- {DataVariables.SequenceID, pj.Sequence != null ? pj.Sequence.Name:string.Empty }
- });
- }
- }
- }
|