JetPMBase.cs 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  1. using Aitex.Core.RT.DataCenter;
  2. using Aitex.Core.RT.Device;
  3. using Aitex.Core.RT.OperationCenter;
  4. using Aitex.Core.Util;
  5. using MECF.Framework.Common.Equipment;
  6. using System.Collections.Generic;
  7. using Venus_Core;
  8. using Aitex.Core.RT.Device.Unit;
  9. using Venus_RT.Modules;
  10. namespace Venus_RT.Devices
  11. {
  12. abstract class JetPMBase : BaseDevice, IDevice
  13. {
  14. // 盖子的状态
  15. public abstract bool IsLidClosed { get; }
  16. public abstract bool IsLidLoadlockClosed { get; }
  17. public abstract bool IsSlitDoorClosed { get; }
  18. public abstract bool IsPumpRunning { get; }
  19. public abstract bool IsTurboPumpRunning { get; }
  20. public abstract bool IsTurboPumpAtSpeed { get; }
  21. public abstract float TurboPumpSpeed { get; }
  22. public abstract bool HasPumpError { get; }
  23. public abstract bool HasTurboPumpError { get; }
  24. public abstract bool IsCDA_OK { get; }
  25. public abstract bool IsFastPumpOpened { get; }
  26. public abstract bool IsSoftPumpOpened { get; }
  27. public abstract bool IsMfc1ValveOpened { get; }
  28. public abstract bool IsMfc2ValveOpened { get; }
  29. public abstract bool IsMfc3ValveOpened { get; }
  30. public abstract bool IsMfc4ValveOpened { get; }
  31. public abstract bool IsMfc5ValveOpened { get; }
  32. public abstract bool IsMfc6ValveOpened { get; }
  33. public abstract bool IsMfc7ValveOpened { get; }
  34. public abstract bool IsMfc8ValveOpened { get; }
  35. public abstract bool IsGuageValveOpened { get; }
  36. public abstract bool IsATM { get; }
  37. public abstract bool PVN22ValveIsOpen { get; }
  38. public abstract bool LiftPinIsDown { get; }
  39. public abstract bool LiftPinIsUp { get; }
  40. public abstract bool IsATMLoadlock { get; }
  41. public abstract bool IsVACLoadLock { get; }
  42. public abstract bool IsVAC { get; }
  43. public abstract bool IsWaterFlowOk { get; }
  44. public abstract bool IsWLK { get; }
  45. public abstract bool IsRFGInterlockOn { get; }
  46. public abstract bool PMLidClosed { get; }
  47. public abstract bool TurboPumpInterlock { get; }
  48. public abstract bool SourceRFFanInterlock { get; }
  49. public abstract bool SlitDoorClosed { get; }
  50. public abstract double ProcessLowPressure { get; }
  51. public abstract double ProcessHighPressure { get; }
  52. public abstract double ProcessPressure { get; }
  53. public abstract double ChamberPressure { get; }
  54. public abstract double ForelinePressure { get; }
  55. public abstract double TargetPressure { get; }
  56. public abstract double ESCHePressure { get; }
  57. public abstract int ESCOutputVoltage { get; }
  58. public abstract double ESCPositiveOutputCurrent { get; }//R+
  59. public abstract double ESCNegativeOutputCurrent { get; }//R-
  60. public abstract bool IsHVOn { get; }
  61. public abstract float CoolantInletTempFB { get; }
  62. public abstract float CoolantOutletTempFB { get; }
  63. public abstract bool ChillerIsRunning { get; }
  64. //Loadlock_Arm
  65. public abstract bool IsLoadlockArmRetract { get; }
  66. public abstract bool IsLoadlockArmExtend { get; }
  67. //Loadlock_Arm DO
  68. public abstract bool LoadlockArmRetract { get; }
  69. public abstract bool LoadlockArmExtend { get; }
  70. public abstract float ReflectPower { get; }
  71. public abstract float BiasReflectPower { get; }
  72. public abstract bool BackSideHeOutOfRange { get; }
  73. public new ModuleName Module;
  74. public abstract MovementPosition LiftPinPosition { get; }
  75. public abstract bool CheckAtm();
  76. public abstract bool CheckSlitDoorOpen();
  77. public abstract bool CheckSlitDoorClose();
  78. public abstract bool CheckLiftUp();
  79. public abstract bool CheckLiftDown();
  80. public abstract double TotalGasSetpoint { get; }
  81. public abstract bool HasGasOutOfRange { get; }
  82. public abstract bool PendulumValveIsOpen();
  83. public abstract double LoadlockPressure { get; }
  84. public double TMPressure { get { return Singleton<RouteManager>.Instance.TM.TMPressure; } }
  85. public bool IsTMATM { get { return Singleton<RouteManager>.Instance.TM.IsTMATM; } }
  86. public bool IsTMVAC { get { return Singleton<RouteManager>.Instance.TM.IsTMVac; } }
  87. // EndPoint
  88. private readonly JetEPDBase _epdClient;
  89. public List<string> EPDCfgList => _epdClient?.CFGFileList;
  90. //public List<string> EPDCfgList=new List<string>() { "1","2"};
  91. public bool EPDCaptured => _epdClient.Captured;
  92. public bool EPDConnected => _epdClient.IsEPDConnected;
  93. public JetPMBase(ModuleName module) : base(module.ToString(), module.ToString(), module.ToString(), module.ToString())
  94. {
  95. Module = module;
  96. _epdClient = DEVICE.GetDevice<JetEPDBase>($"{Module}.{VenusDevice.EndPoint}");
  97. DATA.Subscribe($"{Name}.ForelinePressure", () => ForelinePressure);
  98. DATA.Subscribe($"{Name}.ProcessHighPressure", () => ProcessHighPressure);
  99. DATA.Subscribe($"{Name}.ProcessLowPressure", () => ProcessLowPressure);
  100. DATA.Subscribe($"{Name}.ESCHePressure", () => ESCHePressure);
  101. DATA.Subscribe($"{Name}.LoadlockPressure", () => LoadlockPressure);
  102. DATA.Subscribe($"{Name}.IsATM", () => IsATM);
  103. DATA.Subscribe($"{Name}.IsVAC", () => IsVAC);
  104. DATA.Subscribe($"{Name}.LiftPinIsUp", () => LiftPinIsUp);
  105. DATA.Subscribe($"{Name}.LiftPinIsDown", () => LiftPinIsDown);
  106. DATA.Subscribe($"{Name}.PumpIsRunning", () => IsPumpRunning);
  107. DATA.Subscribe($"{Name}.TurboPumpIsRunning", () => IsTurboPumpRunning);
  108. DATA.Subscribe($"{Name}.IsSlitDoorClosed", () => IsSlitDoorClosed);
  109. DATA.Subscribe($"{Name}.IsLidClosed", () => IsLidClosed);
  110. DATA.Subscribe($"{Name}.TurboPumpRotationalSpeed", () => TurboPumpSpeed);
  111. DATA.Subscribe($"{Name}.IsWaterFlowOk", () => IsWaterFlowOk);
  112. DATA.Subscribe($"{Name}.IsWLK", () => IsWLK);
  113. DATA.Subscribe($"{Name}.IsCDA_OK", () => IsCDA_OK);
  114. DATA.Subscribe($"{Name}.SourceRFFanInterlock", () => SourceRFFanInterlock);
  115. DATA.Subscribe($"{Name}.IsTurboPumpInterlock", () => TurboPumpInterlock);
  116. DATA.Subscribe($"{Name}.IsATMLoadlock", () => IsATMLoadlock);
  117. DATA.Subscribe($"{Name}.IsVACLoadlock", () => IsVACLoadLock);
  118. DATA.Subscribe($"{Name}.GetPVPosition", () => GetPVPosition());
  119. DATA.Subscribe($"{Name}.ESCHV.Temp", () => CoolantOutletTempFB);
  120. DATA.Subscribe($"{Name}.Chiller.Temp", () => CoolantInletTempFB);
  121. DATA.Subscribe($"{Name}.Chiller.IsOn", () => ChillerIsRunning);
  122. DATA.Subscribe($"{Name}.IsTurboPumpAtSpeed", () => IsTurboPumpAtSpeed);
  123. DATA.Subscribe($"{Name}.EPDCfgList", () => EPDCfgList);
  124. OP.Subscribe($"{Module}.SetLiftPin", (cmd, args) => {
  125. if ((bool)args[0] == true)
  126. {
  127. return SetLiftPin(MovementPosition.Up, out _);
  128. }
  129. else
  130. {
  131. return SetLiftPin(MovementPosition.Down, out _);
  132. }
  133. });
  134. OP.Subscribe($"{Module}.SetSRf", (cmd, args) =>
  135. {
  136. var ison = (bool)args[1];
  137. if (ison == true)
  138. {
  139. GeneratorPowerOn(true);
  140. GeneratorSetpower((float)args[0]);
  141. }
  142. else
  143. {
  144. GeneratorPowerOn(false);
  145. }
  146. return true;
  147. });
  148. OP.Subscribe($"{Module}.SetBRf", (cmd, args) => {
  149. var ison = (bool)args[1];
  150. if (ison == true)
  151. {
  152. GeneratorBiasPowerOn(true);
  153. GeneratorBiasSetpower((float)args[0]);
  154. }
  155. else
  156. {
  157. GeneratorBiasPowerOn(false);
  158. }
  159. return true;
  160. });
  161. OP.Subscribe($"{Module}.SetSlitDoor", (cmd, args) => {
  162. SetSlitDoor((bool)args[0], out _);
  163. return true;
  164. });
  165. OP.Subscribe($"{Module}.SetESCHVIsOn", (cmd, args) => {
  166. OnOffSetESCHV((bool)args[0]);
  167. return true;
  168. });
  169. OP.Subscribe($"{Module}.SetESCHV", (cmd, args) => {
  170. SetESCClampVoltage((int)args[0]);
  171. return true;
  172. });
  173. OP.Subscribe($"{Module}.SetPVPostion", (cmd, args) => {
  174. SetPVPostion((int)args[0]);
  175. return true;
  176. });
  177. OP.Subscribe($"{Module}.SetPVPressure", (cmd, args) => {
  178. SetPVPressure((int)args[0]);
  179. return true;
  180. });
  181. OP.Subscribe($"{Module}.ClosePump", (cmd, args) => {
  182. TurnDryPump(false);
  183. return true;
  184. });
  185. OP.Subscribe($"{Module}.CloseTurboPump", (cmd, args) => {
  186. TurnTurboPump(false);
  187. return true;
  188. });
  189. OP.Subscribe($"{Module}.ControlValve", (cmd, args) => {
  190. OpenValve((ValveType)((int)args[0]), (bool)args[1]);
  191. return true;
  192. });
  193. OP.Subscribe($"{Module}.TurnPendulumValve", (cmd, args) => {
  194. TurnPendulumValve((bool)args[0]);
  195. return true;
  196. });
  197. OP.Subscribe($"{Module}.HeatChiller", (cmd, args) => {
  198. HeatChiller((float)args[0], (float)args[1]);
  199. return true;
  200. });
  201. OP.Subscribe($"{Module}.OnOffChiller", (cmd, args) => {
  202. OnOffChiller((bool)args[0]);
  203. return true;
  204. });
  205. OP.Subscribe($"{Module}.WallChiller", (cmd, args) => {
  206. float value;
  207. float.TryParse(args[0].ToString(), out value);
  208. SetWallTCTemperature(value);
  209. return true;
  210. });
  211. OP.Subscribe($"{Module}.SetBacksideHeFlow", (cmd, args) => {
  212. double value;
  213. double.TryParse(args[0].ToString(), out value);
  214. SetBacksideHeFlow(value);
  215. return true;
  216. });
  217. OP.Subscribe($"{Module}.SetBacksideHePressure", (cmd, args) =>
  218. {
  219. float value;
  220. float.TryParse(args[0].ToString(), out value);
  221. SetBacksideHePressure(value);
  222. return true;
  223. });
  224. OP.Subscribe($"{Module}.EndPoint.SearchCfg", (cmd, args) =>
  225. {
  226. _epdClient?.QueryConfigList();
  227. return true;
  228. });
  229. }
  230. public abstract void CloseValves();
  231. public abstract void TurnDryPump(bool on);
  232. public abstract void TurnTurboPump(bool on);
  233. public abstract void OpenValve(ValveType vlvType, bool on);
  234. public virtual void Monitor()
  235. {
  236. }
  237. public virtual bool Initialize()
  238. {
  239. return true;
  240. }
  241. public virtual void Terminate()
  242. {
  243. }
  244. public virtual void Reset()
  245. {
  246. }
  247. public abstract bool OnOffSetESCHV(bool on);
  248. public abstract bool SetWallTCTemperature(float value);
  249. protected abstract void CheckPermanentInterlock();
  250. public abstract void CheckIdleInterlock();
  251. public abstract void BuzzerBlinking(double time);
  252. public abstract void SwitchOnBuzzerAndRed();
  253. public abstract void Home();
  254. public abstract bool SetLiftPin(MovementPosition dirt, out string reason);
  255. public abstract bool SetSlitDoor(bool open, out string reason);
  256. public abstract bool RetractWafer();
  257. public abstract bool ExtendWafer();
  258. public abstract bool FlowGas(int gasNum, double val);
  259. public abstract bool StopGas(int gasNum);
  260. public abstract bool FlowN2(double val);
  261. public abstract bool StopN2();
  262. public abstract void StopAllGases();
  263. public abstract bool TurnPendulumValve(bool on);
  264. public abstract bool SetPVPressure(int pressure);
  265. public abstract bool SetPVPostion(int position);
  266. public abstract int GetPVPosition();
  267. public abstract void HeatChiller(double value, double offset);
  268. public abstract void OnOffChiller(bool onoff);
  269. public abstract bool CheckChillerStatus();
  270. public abstract void SetGeneratorCommunicationMode(int mode);
  271. public abstract bool GeneratorPowerOn(bool on);
  272. public abstract bool GeneratorSetpower(float val);
  273. public abstract bool GeneratorBiasPowerOn(bool on);
  274. public abstract bool GeneratorBiasSetpower(float val);
  275. public abstract bool GeneratorBiasSetMatchMode(bool val);
  276. public abstract bool SetMatchPosition(float c1, float c2);
  277. public abstract bool SetBiasMatchPosition(float c1, float c2);
  278. public abstract bool SetBiasPulseMode(bool on);
  279. public abstract bool SetBiasPulseRateFreq(int nFreq);
  280. public abstract bool SetDiasPulseDutyCycle(int percentage);
  281. public abstract bool SetESCClampVoltage(int nVoltage);
  282. public abstract bool CheckGeneratorAndHVInterlock(VenusDevice device);
  283. #region EndPoint
  284. public void EPDRecipeStart(string recipe)
  285. {
  286. _epdClient.RecipeStart(recipe);
  287. }
  288. public void EPDRecipeStop()
  289. {
  290. _epdClient.RecipeStop();
  291. }
  292. public void EPDStepStart(string cfgName, int step)
  293. {
  294. _epdClient.StepStart(cfgName, step);
  295. }
  296. public void EPDStepStop()
  297. {
  298. _epdClient.StepStop();
  299. }
  300. #endregion
  301. public abstract void SetBacksideHeFlow(double flow);
  302. public abstract bool SetBacksideHePressure(float mTorr);
  303. public abstract bool SetBacksideHeThreshold(int nMin, int nMax);
  304. }
  305. }