RecipeDBCallback.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Xml;
  8. using Aitex.Core.Common;
  9. using Aitex.Core.RT.DataCenter;
  10. using Aitex.Core.RT.Log;
  11. using Aitex.Core.RT.SCCore;
  12. using Aitex.Core.Util;
  13. using MECF.Framework.Common.CommonData;
  14. using MECF.Framework.Common.DBCore;
  15. using MECF.Framework.Common.Equipment;
  16. using MECF.Framework.Common.Jobs;
  17. using MECF.Framework.Common.SubstrateTrackings;
  18. namespace JetVirgoPM.PMs.RecipeExecutors
  19. {
  20. public interface IRecipeDBCallback
  21. {
  22. void RecipeStart(string module, int slot, string guid, string recipeName);
  23. void RecipeComplete(string guid);
  24. void RecipeStepStart(string recipeGuid, int stepNumber, string stepName, float stepTime);
  25. void RecipeStepEnd(string recipeGuid, int stepNumber, List<FdcDataItem> data);
  26. void RecipeFailed(string guid);
  27. }
  28. class RecipeDBCallback : IRecipeDBCallback
  29. {
  30. public void RecipeStart(string module, int slot, string guid, string recipeName)
  31. {
  32. string waferId = "",slotID="",lotID="";
  33. WaferInfo waferInfo = WaferManager.Instance.GetWafer(ModuleHelper.Converter(module), slot);
  34. if (!waferInfo.IsEmpty)
  35. {
  36. waferId = waferInfo.InnerId.ToString();
  37. slotID = waferInfo.OriginSlot.ToString();
  38. lotID = waferInfo.ProcessJob == null || string.IsNullOrEmpty(waferInfo.ProcessJob.ControlJobName) ? "" : waferInfo.ProcessJob.ControlJobName;
  39. }
  40. ProcessDataRecorder.Start(guid, recipeName, waferId, $"{module}{slot+1}",lotID,slotID);
  41. }
  42. public void RecipeUpdateStatus(string guid, string status, float recipeSettingTime)
  43. {
  44. ProcessDataRecorder.UpdateStatus(guid, status);
  45. ProcessDataRecorder.UpdateRecipeSettingTime(guid, recipeSettingTime);
  46. }
  47. public void RecipeComplete(string guid)
  48. {
  49. ProcessDataRecorder.End(guid, "Succeed");
  50. }
  51. public void RecipeStepStart(string recipeGuid, int stepNumber, string stepName, float stepTime)
  52. {
  53. ProcessDataRecorder.StepStart(recipeGuid, stepNumber + 1, stepName, stepTime);
  54. }
  55. public void RecipeStepEnd(string recipeGuid, int stepNumber, List<FdcDataItem> fdc)
  56. {
  57. ProcessDataRecorder.StepEnd(recipeGuid, stepNumber + 1, fdc);
  58. }
  59. public void RecipeFailed(string guid)
  60. {
  61. ProcessDataRecorder.End(guid, "Failed");
  62. }
  63. }
  64. }