SchedulerDBCallback.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 VirgoRT.Modules.Schedulers
  12. {
  13. class SchedulerDBCallback : ISchedulerDBCallback
  14. {
  15. public void LotCreated(ControlJobInfo cj)
  16. {
  17. ModuleName module = ModuleHelper.Converter(cj.Module);
  18. Guid carrierGuid = CarrierManager.Instance.GetCarrier(cj.Module).InnerId;
  19. LotDataRecorder.StartLot(cj.LotInnerId.ToString(), carrierGuid.ToString(), "", cj.LotName, cj.Module, cj.Module, cj.LotWafers.Count);
  20. foreach (var waferInfo in cj.LotWafers)
  21. {
  22. LotDataRecorder.InsertLotWafer(cj.LotInnerId.ToString(), waferInfo.InnerId.ToString());
  23. //WaferDataRecorder.SetWaferLotId(waferInfo.InnerId.ToString(), cj.LotName,waferInfo.SequenceName);
  24. }
  25. }
  26. public void LotUpdate(ControlJobInfo cj)
  27. {
  28. foreach (var waferInfo in cj.LotWafers)
  29. {
  30. WaferDataRecorder.SetWaferLotId(waferInfo.InnerId.ToString(), cj.LotName, waferInfo.SequenceName);
  31. }
  32. }
  33. public void LotFinished(ControlJobInfo cj)
  34. {
  35. int unprocessed = 0;
  36. int aborted = 0;
  37. foreach (var waferInfo in cj.LotWafers)
  38. {
  39. if (waferInfo.ProcessState == EnumWaferProcessStatus.Failed)
  40. {
  41. aborted++;
  42. continue;
  43. }
  44. if (waferInfo.ProcessState != EnumWaferProcessStatus.Completed)
  45. {
  46. unprocessed++;
  47. continue;
  48. }
  49. }
  50. LotDataRecorder.EndLot(cj.LotInnerId.ToString(), aborted, unprocessed);
  51. }
  52. }
  53. }