SchedulerDBCallback.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Aitex.Core.Common;
  7. using MECF.Framework.Common.DBCore;
  8. using MECF.Framework.Common.Equipment;
  9. using MECF.Framework.Common.Jobs;
  10. using MECF.Framework.Common.SubstrateTrackings;
  11. namespace CyberX8_RT.Schedulers
  12. {
  13. class SchedulerDBCallback : ISchedulerDBCallback
  14. {
  15. public void LotCreated(ControlJobInfo cj)
  16. {
  17. Guid carrierGuid = CarrierManager.Instance.GetCarrier(cj.Module).InnerId;
  18. LotDataRecorder.StartLot(cj.LotInnerId.ToString(), carrierGuid.ToString(), "", cj.LotName, cj.Module, cj.Module, cj.LotWafers.Count);
  19. foreach (var waferInfo in cj.LotWafers)
  20. {
  21. LotDataRecorder.InsertLotWafer(cj.LotInnerId.ToString(), waferInfo.InnerId.ToString());
  22. //WaferDataRecorder.SetWaferLotId(waferInfo.InnerId.ToString(), cj.LotName,waferInfo.SequenceName);
  23. }
  24. }
  25. public void LotUpdate(ControlJobInfo cj)
  26. {
  27. foreach (var waferInfo in cj.LotWafers)
  28. {
  29. WaferDataRecorder.SetWaferLotId(waferInfo.InnerId.ToString(), cj.LotName, waferInfo.SequenceName);
  30. }
  31. }
  32. public void LotFinished(ControlJobInfo cj)
  33. {
  34. int unprocessed = 0;
  35. int aborted = 0;
  36. foreach (var waferInfo in cj.LotWafers)
  37. {
  38. if (waferInfo.ProcessState == EnumWaferProcessStatus.Failed)
  39. {
  40. aborted++;
  41. continue;
  42. }
  43. if (waferInfo.ProcessState != EnumWaferProcessStatus.Completed)
  44. {
  45. unprocessed++;
  46. continue;
  47. }
  48. }
  49. LotDataRecorder.EndLot(cj.LotInnerId.ToString(), aborted, unprocessed);
  50. }
  51. }
  52. }