JetPMBase.cs 14 KB

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