EquipmentManager_FA.cs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. using System;
  2. using System.Collections.Generic;
  3. using Aitex.Core.RT.RecipeCenter;
  4. using FurnaceRT.Equipments.Schedulers;
  5. using MECF.Framework.Common.Equipment;
  6. using MECF.Framework.Common.SubstrateTrackings;
  7. using MECF.Framework.FA.Core.E40FA;
  8. using MECF.Framework.FA.Core.E94FA;
  9. using MECF.Framework.FA.Core.FAInterface;
  10. namespace FurnaceRT.Equipments.Systems
  11. {
  12. public partial class EquipmentManager
  13. {
  14. private SchedulerDBCallback _dbCallback;
  15. public void CreatePj(string processName)
  16. {
  17. _auto.CreatePj(processName);
  18. }
  19. public void StartPj()
  20. {
  21. _auto.StartPj();
  22. }
  23. public void EndPj(string endStatus = "Normal")
  24. {
  25. _auto.EndPj(endStatus);
  26. }
  27. }
  28. public partial class EquipmentManager : IJobControlCallBack
  29. {
  30. private Dictionary<string, string> moduleJobIdDictionary = new Dictionary<string, string>();
  31. public bool AssignProcessJob(ProcessMaterialName matrial, string recipe, ProcessRecipeMethod method, Dictionary<string, object> RecVariableList, string pjID)
  32. {
  33. string lp = CarrierManager.Instance.GetLocationByCarrierId(matrial.CarrierID);
  34. string[] slotsequence = new string[25];
  35. for (int i = 0; i < 25; i++)
  36. {
  37. if (matrial.SlotID.Contains(i + 1)) slotsequence[i] = recipe;
  38. else slotsequence[i] = "";
  39. }
  40. Dictionary<string, object> para = new Dictionary<string, object>();
  41. para.Add("JobId", pjID);
  42. para.Add("LotId", pjID);
  43. para.Add("Module", lp);
  44. para.Add("SlotSequence", slotsequence);
  45. para.Add("AutoStart", true);
  46. return CheckToPostMessage((int)MSG.CreateJob, para);
  47. }
  48. public bool AssignControlJob(string cjID, string module, List<string> pjList)
  49. {
  50. return CheckToPostMessage((int)MSG.StartJob, pjList);
  51. }
  52. public bool RegisterEvent(bool isAlarm, string eventname, string eventcontext)
  53. {
  54. return true;
  55. }
  56. public bool PostEvent(bool isAlarm, string eventname, Dictionary<string, string> dvid, Dictionary<string, object> objdvid)
  57. {
  58. return true;
  59. }
  60. public bool ExcuteCommand(string command, object[] paras, out string reason)
  61. {
  62. int _port, _startslot, _endslot;
  63. string _portId;
  64. string _module = "";
  65. string _jobId;
  66. string[] _recipenames;
  67. reason = "";
  68. switch (command)
  69. {
  70. //case "PP-SELECT":
  71. // _portId = paras[0].ToString();
  72. // if (_portId == "1") _module = ModuleName.LP1.ToString();
  73. // else if (_portId == "2") _module = ModuleName.LP2.ToString();
  74. // else if (_portId == "3") _module = ModuleName.LP3.ToString();
  75. // else if (_portId == "4") _module = ModuleName.LP4.ToString();
  76. // string jobId = paras[1].ToString();
  77. // string[] slotsequence = (string[])paras[2];
  78. // for (int i = 0; i < slotsequence.Length; i++)
  79. // {
  80. // slotsequence[i] = slotsequence[i] == "*null*" ? "" : slotsequence[i];
  81. // }
  82. // Dictionary<string, object> para = new Dictionary<string, object>();
  83. // para.Add("JobId", jobId);
  84. // para.Add("Module", _module);
  85. // para.Add("SlotSequence", slotsequence);
  86. // para.Add("AutoStart", true);
  87. // if (Check((int)MSG.CreateJob, out reason) && _auto.CreateJob(para, out reason))
  88. // {
  89. // moduleJobIdDictionary[_module] = jobId;
  90. // return true;
  91. // }
  92. // return false;
  93. case "START":
  94. _portId = paras[0].ToString();
  95. if (_portId == "1") _module = ModuleName.LP1.ToString();
  96. else if (_portId == "2") _module = ModuleName.LP2.ToString();
  97. else if (_portId == "3") _module = ModuleName.LP3.ToString();
  98. else if (_portId == "4") _module = ModuleName.LP4.ToString();
  99. return CheckToPostMessage((int)MSG.StartJob, new object[] { moduleJobIdDictionary[_module] });
  100. case "STOP":
  101. _portId = paras[0].ToString();
  102. if (_portId == "1") _module = ModuleName.LP1.ToString();
  103. else if (_portId == "2") _module = ModuleName.LP2.ToString();
  104. else if (_portId == "3") _module = ModuleName.LP3.ToString();
  105. else if (_portId == "4") _module = ModuleName.LP4.ToString();
  106. return CheckToPostMessage((int)MSG.StopJob, new object[] { moduleJobIdDictionary[_module] });
  107. case "ABORT":
  108. case "ABORT_JOB":
  109. _portId = paras[0].ToString();
  110. if (_portId == "1") _module = ModuleName.LP1.ToString();
  111. else if (_portId == "2") _module = ModuleName.LP2.ToString();
  112. else if (_portId == "3") _module = ModuleName.LP3.ToString();
  113. else if (_portId == "4") _module = ModuleName.LP4.ToString();
  114. return CheckToPostMessage((int)MSG.AbortJob, new object[] { moduleJobIdDictionary[_module] });
  115. case "PAUSE":
  116. _portId = paras[0].ToString();
  117. if (_portId == "1") _module = ModuleName.LP1.ToString();
  118. else if (_portId == "2") _module = ModuleName.LP2.ToString();
  119. else if (_portId == "3") _module = ModuleName.LP3.ToString();
  120. else if (_portId == "4") _module = ModuleName.LP4.ToString();
  121. return CheckToPostMessage((int)MSG.PauseJob, new object[] { moduleJobIdDictionary[_module] });
  122. case "RESUME":
  123. _portId = paras[0].ToString();
  124. if (_portId == "1") _module = ModuleName.LP1.ToString();
  125. else if (_portId == "2") _module = ModuleName.LP2.ToString();
  126. else if (_portId == "3") _module = ModuleName.LP3.ToString();
  127. else if (_portId == "4") _module = ModuleName.LP4.ToString();
  128. return CheckToPostMessage((int)MSG.ResumeJob, new object[] { moduleJobIdDictionary[_module] });
  129. }
  130. return false;
  131. }
  132. public string[] GetRecipeList(string param)
  133. {
  134. if (param == "SEQUENCE")
  135. return RecipeFileManager.Instance.GetSequenceNameList().ToArray();
  136. if (param == "RECIPE")
  137. {
  138. List<string> result = new List<string>();
  139. foreach (var recipeName in RecipeFileManager.Instance.GetRecipes("Track\\AD", true))
  140. {
  141. result.Add("AD\\" + recipeName);
  142. }
  143. return result.ToArray();
  144. }
  145. return RecipeFileManager.Instance.GetSequenceNameList().ToArray();
  146. }
  147. public string GetRecipeBody(string param, string recipename)
  148. {
  149. if (param == "SEQUENCE")
  150. return RecipeFileManager.Instance.GetSequence(recipename, false);
  151. if (param == "RECIPE")
  152. {
  153. string chamberId = recipename.Split('\\')[0];
  154. string recipe = recipename.Split('\\')[1];
  155. return RecipeFileManager.Instance.LoadRecipe("Track\\" + chamberId, recipe, false);
  156. }
  157. return RecipeFileManager.Instance.GetSequence(recipename, false);
  158. }
  159. }
  160. }