SchedulerDBCallback.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System;
  2. using Aitex.Core.Common;
  3. using MECF.Framework.Common.DBCore;
  4. using MECF.Framework.Common.Equipment;
  5. using MECF.Framework.Common.Jobs;
  6. using MECF.Framework.Common.SubstrateTrackings;
  7. namespace EfemDualSchedulerLib.Schedulers
  8. {
  9. class SchedulerDBCallback : ISchedulerDBCallback
  10. {
  11. public void LotCreated(ControlJobInfo cj)
  12. {
  13. ModuleName module = ModuleHelper.Converter(cj.Module);
  14. Guid carrierGuid = CarrierManager.Instance.GetCarrier(cj.Module).InnerId;
  15. LotDataRecorder.StartLot(cj.LotInnerId.ToString(), carrierGuid.ToString(), "", cj.LotName, cj.Module, cj.Module, cj.LotWafers.Count);
  16. foreach (var waferInfo in cj.LotWafers)
  17. {
  18. LotDataRecorder.InsertLotWafer(cj.LotInnerId.ToString(), waferInfo.InnerId.ToString());
  19. WaferDataRecorder.SetWaferSequence(waferInfo.InnerId.ToString(), waferInfo.PPID);
  20. }
  21. }
  22. public void LotFinished(ControlJobInfo cj )
  23. {
  24. int unprocessed = 0;
  25. int aborted = 0;
  26. foreach (var waferInfo in cj.LotWafers)
  27. {
  28. if (waferInfo.ProcessState == EnumWaferProcessStatus.Failed)
  29. {
  30. aborted++;
  31. continue;
  32. }
  33. if (waferInfo.ProcessState != EnumWaferProcessStatus.Completed)
  34. {
  35. unprocessed++;
  36. continue;
  37. }
  38. }
  39. LotDataRecorder.EndLot(cj.LotInnerId.ToString(),aborted, unprocessed );
  40. }
  41. }
  42. }