JetVenusSEPMBase.cs 13 KB

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