PlatingCellRunRecipeRoutine.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Core.RT.Log;
  3. using Aitex.Core.RT.Routine;
  4. using Aitex.Core.Util;
  5. using MECF.Framework.Common.Beckhoff.AxisProvider;
  6. using MECF.Framework.Common.Beckhoff.Station;
  7. using MECF.Framework.Common.CommonData.PowerSupplier;
  8. using MECF.Framework.Common.RecipeCenter;
  9. using MECF.Framework.Common.Routine;
  10. using MECF.Framework.Common.SubstrateTrackings;
  11. using MECF.Framework.Common.ToolLayout;
  12. using MECF.Framework.Common.Utilities;
  13. using PunkHPX8_Core;
  14. using PunkHPX8_RT.Devices.AXIS;
  15. using PunkHPX8_RT.Devices.Facilities;
  16. using PunkHPX8_RT.Devices.PlatingCell;
  17. using PunkHPX8_RT.Devices.PowerSupplier;
  18. using PunkHPX8_RT.Modules.Reservoir;
  19. using SecsGem.Core.ItemModel;
  20. using System;
  21. using System.Collections.Generic;
  22. using System.Diagnostics;
  23. using System.Linq;
  24. using System.Text;
  25. using System.Threading.Tasks;
  26. using static Mono.Security.X509.X520;
  27. namespace PunkHPX8_RT.Modules.PlatingCell
  28. {
  29. public class PlatingCellRunRecipeRoutine : RoutineBase, IRoutine
  30. {
  31. private enum RunRecipeStep
  32. {
  33. Delay,
  34. VerticalGotoRinse,
  35. CheckVerticalGotoRinse,
  36. InterRinse,
  37. CheckInterRinse,
  38. RotationStartEntry,
  39. RotationChangeToEntrySpeed,
  40. AngleTilt,
  41. VerticalGotoPlate,
  42. WaitEntryCurrentProtectedFromRinse,
  43. WaitEntryCurrentProtectedFromHome,
  44. RunPowerStepWithEntryProtect,
  45. CheckVerticalGotoPlate,
  46. AngleVertical,
  47. WaitPlatingDelay,
  48. RunPowerStep,
  49. RunPowerStepWait,
  50. End
  51. }
  52. #region 常量
  53. private const int ALL_DAY_MILLOSECONDS = 24 * 60 * 60 * 1000;
  54. /// <summary>
  55. /// ROTATION电机转速比例
  56. /// </summary>
  57. private const int SPEED_RATIO = 1;
  58. #endregion
  59. #region 内部变量
  60. /// <summary>
  61. /// recipe
  62. /// </summary>
  63. private DepRecipe _recipe;
  64. /// <summary>
  65. /// Platingcell device
  66. /// </summary>
  67. private PlatingCellDevice _device;
  68. /// <summary>
  69. /// Rotation axis
  70. /// </summary>
  71. private JetAxisBase _rotationAxis;
  72. /// <summary>
  73. ///rotation Provider对象
  74. /// </summary>
  75. private BeckhoffProviderAxis _rotationProviderAxis;
  76. /// cycle次数
  77. /// </summary>
  78. private int _cycle;
  79. /// <summary>
  80. /// 当前完成的Cycle次数
  81. /// </summary>
  82. private int _currentCycle;
  83. /// <summary>
  84. /// platingcell entity
  85. /// </summary>
  86. private PlatingCellEntity _platingCellEntity;
  87. /// <summary>
  88. /// 对应reservoir entity
  89. /// </summary>
  90. private ReservoirEntity _reservoirEntity;
  91. /// <summary>
  92. /// interbal rinse routien
  93. /// </summary>
  94. private PlatingCellInterRinseRoutine _interRinseRoutine;
  95. /// <summary>
  96. /// vertical axis entity
  97. /// </summary>
  98. private PlatingCellVerticalEntity _verticalEntity;
  99. /// <summary>
  100. /// vertical 轴的位置数据
  101. /// </summary>
  102. private BeckhoffStationAxis _verticalBeckhoffStation;
  103. /// <summary>
  104. /// recipe中是否存在电机反转
  105. /// </summary>
  106. private bool _isRecipeContainsRevserseRotation = false;
  107. /// <summary>
  108. /// run recipe 过程中电机会停的位置(需要根据recipe计算出来)
  109. /// </summary>
  110. private List<int> _targetPositionList = new List<int>();
  111. #region 电镀通电相关
  112. /// <summary>
  113. /// PlatingDelay计时
  114. /// </summary>
  115. private DateTime _hotPlatingRunTime;
  116. /// <summary>
  117. /// 不通电
  118. /// </summary>
  119. private bool _isZeroCurrent = false;
  120. /// <summary>
  121. /// 通电时长
  122. /// </summary>
  123. private int _totalMicrosecond = 0;
  124. /// <summary>
  125. /// Power 集合
  126. /// </summary>
  127. List<PowerSupplierStepPeriodData> _powerSupplierStepPeriodDatas = new List<PowerSupplierStepPeriodData>();
  128. /// <summary>
  129. /// 记录dep recipe中出现的最大电流,用于启动电源前切换挡位
  130. /// </summary>
  131. private double _maxCurrent = 0;
  132. #endregion
  133. #endregion
  134. /// <summary>
  135. /// 构造函数
  136. /// </summary>
  137. /// <param name="module"></param>
  138. public PlatingCellRunRecipeRoutine(string module) : base(module)
  139. {
  140. _interRinseRoutine = new PlatingCellInterRinseRoutine(module);
  141. }
  142. /// <summary>
  143. /// 中止
  144. /// </summary>
  145. public void Abort()
  146. {
  147. Runner.Stop("Manual Abort");
  148. }
  149. /// <summary>
  150. /// 监控
  151. /// </summary>
  152. /// <returns></returns>
  153. public RState Monitor()
  154. { //vertical去rinse位置
  155. Runner.RunIf(RunRecipeStep.VerticalGotoRinse, _recipe.RinseBeforeEntryEnable, () => { return StartVertical("Rinse", _recipe.IntervalRinseZoffset); }, _delay_1ms)
  156. .WaitWithStopConditionIf(RunRecipeStep.CheckVerticalGotoRinse, _recipe.RinseBeforeEntryEnable, CheckVerticalEnd, CheckVerticalError)
  157. //执行interval rinse
  158. .RunIf(RunRecipeStep.InterRinse, _recipe.RinseBeforeEntryEnable, () => { return _interRinseRoutine.Start(_recipe, _rotationAxis, _device, _rotationProviderAxis, _targetPositionList[0]) == RState.Running; })
  159. .WaitWithStopConditionIf(RunRecipeStep.CheckInterRinse, _recipe.RinseBeforeEntryEnable, CheckInterRinseEndStatus,
  160. () => CommonFunction.CheckRoutineStopState(_interRinseRoutine))
  161. //启动Rotation/Rotation 设置为entry 转速 (没有intercal rinse 在entry开始的时候启动rotation)
  162. .RunIf(RunRecipeStep.RotationStartEntry, !_recipe.RinseBeforeEntryEnable, RotationStartEntry, _delay_1ms)
  163. //有intercal rinse 直接变速 (rotation在interval rinse的时候已经启动了)
  164. .RunIf(RunRecipeStep.RotationChangeToEntrySpeed, _recipe.RinseBeforeEntryEnable, () => { return ChangeSpeed(_recipe.EntrySpinSpeed); }, _delay_1ms)
  165. //Angle tilt 操作
  166. .Run(RunRecipeStep.AngleTilt, _device.HeadtTiltAction, () => { return _device.PlatingCellDeviceData.IsHeadTilt; }, _delay_1s)
  167. //vertical goto plate
  168. .Run(RunRecipeStep.VerticalGotoPlate, () => { return StartVertical("Plate", _recipe.EntryZoffset); }, _delay_1ms)
  169. //vertical 到达entry位置前110ms
  170. .DelayIf(RunRecipeStep.WaitEntryCurrentProtectedFromRinse, !_recipe.RinseBeforeEntryEnable, CalculateVerticaMoveTime("Rinse", "Entry") - 110 > 0 ? CalculateVerticaMoveTime("Rinse", "Entry") : 0) //提前110ms,多10ms
  171. .DelayIf(RunRecipeStep.WaitEntryCurrentProtectedFromHome, _recipe.RinseBeforeEntryEnable, CalculateVerticaMoveTime("Home", "Entry") - 110 > 0 ? CalculateVerticaMoveTime("Home", "Entry") : 0)
  172. //有上电保护,此刻给电
  173. .RunIf(RunRecipeStep.RunPowerStepWithEntryProtect, !_recipe.IsEntryTypeCold,StartPowerStep, _delay_1ms)
  174. //检查vertical到达plate位置
  175. .WaitWithStopCondition(RunRecipeStep.CheckVerticalGotoPlate, CheckVerticalEnd, CheckVerticalError)
  176. //Angle vertical操作
  177. .Run(RunRecipeStep.AngleVertical, _device.HeadtVerticalAction, () => { return _device.PlatingCellDeviceData.IsHeadVertical; }, _delay_1s)
  178. //如果不需要上电保护,执行plating delay
  179. .RunIf(RunRecipeStep.WaitPlatingDelay, _recipe.IsEntryTypeCold, NullFun, _recipe.PlatingDelay)
  180. //没有上电保护,此刻给电
  181. .RunIf(RunRecipeStep.RunPowerStep, _recipe.IsEntryTypeCold, StartPowerStep, _delay_1ms)
  182. .WaitWithStopCondition(RunRecipeStep.RunPowerStepWait, CheckRecipeStepEndStatus, CheckRecipeStepStopStatus, _delay_1ms)
  183. .End(RunRecipeStep.End, NullFun);
  184. return Runner.Status;
  185. }
  186. /// <summary>
  187. /// 启动PowerSupplier
  188. /// </summary>
  189. /// <returns></returns>
  190. private bool StartPowerStep()
  191. {
  192. bool result = _device.PowerSupplier.StartSetStepPeriodNoWaitEnd(_powerSupplierStepPeriodDatas);
  193. if (!result)
  194. {
  195. _device.PowerSupplier.DisableOperation("", null);
  196. return false;
  197. }
  198. return true;
  199. }
  200. /// <summary>
  201. /// 检验Powerstep是否启动完成
  202. /// </summary>
  203. /// <returns></returns>
  204. private bool CheckRecipeStepEndStatus()
  205. {
  206. if (_isZeroCurrent)
  207. {
  208. return true;
  209. }
  210. return _device.PowerSupplier.Status == RState.End;
  211. }
  212. /// <summary>
  213. /// 检验Powerstep是否启动失败
  214. /// </summary>
  215. /// <returns></returns>
  216. private bool CheckRecipeStepStopStatus()
  217. {
  218. if (_isZeroCurrent)
  219. {
  220. return false;
  221. }
  222. return _device.PowerSupplier.Status == RState.Failed || _device.PowerSupplier.Status == RState.Timeout;
  223. }
  224. /// <summary>
  225. /// 计算vertical 从一个位置移动到另一个位置用时
  226. /// </summary>
  227. /// <param name="sourceLocation"></param>
  228. /// <param name="destinationLocation"></param>
  229. /// <returns>返回值单位毫秒</returns>
  230. private int CalculateVerticaMoveTime(string sourceLocation,string destinationLocation)
  231. {
  232. Station sourceStation = _verticalBeckhoffStation.Stations.FirstOrDefault(p => p.Name == $"{_verticalEntity.Module}.{sourceLocation}");
  233. Station destinationStation = _verticalBeckhoffStation.Stations.FirstOrDefault(p => p.Name == $"{_verticalEntity.Module}.{destinationLocation}");
  234. Double.TryParse(sourceStation.Position, out double sourcePosition);
  235. Double.TryParse(destinationStation.Position, out double destinationPosition);
  236. double time = Math.Abs(destinationPosition - sourcePosition) / _verticalEntity.MotionData.ProfileVelocity * 10;
  237. if (time <= 0)
  238. {
  239. NotifyError(eEvent.WARN_PLATINGCELL, "Calculate Vertica Move Time is 0", 0);
  240. return 0;
  241. }
  242. return (int)time;
  243. }
  244. /// <summary>
  245. /// change speed
  246. /// </summary>
  247. /// <returns></returns>
  248. private bool ChangeSpeed(int speed) //参数speed单位是rmp
  249. {
  250. double realSpeed = BeckhoffVelocityUtil.ConvertVelocityToDegPerSecondByRPM(speed);
  251. bool result = _rotationAxis.ChangeSpeed((int)realSpeed);
  252. if (!result)
  253. {
  254. NotifyError(eEvent.ERR_PLATINGCELL, "Change Speed failed", 0);
  255. return false;
  256. }
  257. return true;
  258. }
  259. private bool CheckInterRinseEndStatus()
  260. {
  261. bool result = CommonFunction.CheckRoutineEndState(_interRinseRoutine);
  262. SubRoutineStep = _interRinseRoutine.CurrentStep;
  263. return result;
  264. }
  265. /// <summary>
  266. /// rotation 从entry步骤开始旋转
  267. /// </summary>
  268. /// <returns></returns>
  269. private bool RotationStartEntry()
  270. {
  271. bool result = _rotationAxis.ProfilePosition(_targetPositionList[0], _recipe.IntervalRinseSpeed * SPEED_RATIO, 0, 0);
  272. if (!result)
  273. {
  274. NotifyError(eEvent.ERR_PLATINGCELL, "Start Rotation is failed", 0);
  275. return false;
  276. }
  277. return true;
  278. }
  279. /// <summary>
  280. /// vertical 运行
  281. /// </summary>
  282. /// <param name="positionName"></param> 目标位置名称
  283. /// <param name="offset"></param> 偏移量
  284. /// <returns></returns>
  285. private bool StartVertical(string positionName,double offset)
  286. {
  287. double position = 0;
  288. Station station = _verticalBeckhoffStation.Stations.FirstOrDefault(p => p.Name == $"{_verticalEntity.Module}.{positionName}");
  289. if (station != null)
  290. {
  291. if(!Double.TryParse(station.Position, out position))
  292. {
  293. LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "vertical station position is error");
  294. return false;
  295. }
  296. }
  297. else
  298. {
  299. LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, $"vertical station {_verticalEntity.Module}.{positionName} is null");
  300. return false;
  301. }
  302. return _verticalEntity.CheckToPostMessage<PlatingCellVerticalState, PlatingCellVerticalEntity.VerticalMsg>(Aitex.Core.RT.Log.eEvent.INFO_PLATINGCELL,
  303. Module, (int)PlatingCellVerticalEntity.VerticalMsg.Position, position + offset);
  304. }
  305. /// <summary>
  306. /// 检验垂直电机是否运动完成
  307. /// </summary>
  308. /// <returns></returns>
  309. private bool CheckVerticalEnd()
  310. {
  311. return _verticalEntity.IsIdle;
  312. }
  313. /// <summary>
  314. /// 检验垂直是否出现错误
  315. /// </summary>
  316. /// <returns></returns>
  317. private bool CheckVerticalError()
  318. {
  319. return _verticalEntity.IsError;
  320. }
  321. /// <summary>
  322. /// 启动
  323. /// </summary>
  324. /// <param name="objs"></param>
  325. /// <returns></returns>
  326. public RState Start(params object[] objs)
  327. {
  328. _recipe = objs[0] as DepRecipe;
  329. if (_recipe == null)
  330. {
  331. LOG.WriteLog(eEvent.ERR_METAL, Module, "recipe is null");
  332. return RState.Failed;
  333. }
  334. if (objs.Length > 1)
  335. {
  336. _cycle = (int)objs[1];
  337. }
  338. _device = DEVICE.GetDevice<PlatingCellDevice>(Module);
  339. _rotationAxis = DEVICE.GetDevice<JetAxisBase>($"{Module}.Rotation");
  340. _rotationProviderAxis = BeckhoffAxisProviderManager.Instance.GetAxisProvider($"{Module}.Rotation");
  341. if (_rotationProviderAxis == null)
  342. {
  343. NotifyError(eEvent.ERR_PLATINGCELL, $"{Module}.Rotation Provider is not exist", 0);
  344. return RState.Failed;
  345. }
  346. //获取vertical entity
  347. string vertical = ModuleMatcherManager.Instance.GetPlatingVerticalByCell(Module);
  348. _verticalEntity = Singleton<RouteManager>.Instance.GetModule<PlatingCellVerticalEntity>(vertical);
  349. //获取platingcell eneity
  350. _platingCellEntity = Singleton<RouteManager>.Instance.GetModule<PlatingCellEntity>(Module);
  351. //获取对应reservoir eneity
  352. string reservoir = ReservoirItemManager.Instance.GetReservoirByPlatingCell(Module);
  353. _reservoirEntity = Singleton<RouteManager>.Instance.GetModule<ReservoirEntity>(reservoir);
  354. //获取vertical station信息对象
  355. _verticalBeckhoffStation = BeckhoffStationLocationManager.Instance.GetStationAxis($"{_verticalEntity.Module}", "Vertical");
  356. if (!CheckPreCondition())
  357. {
  358. return RState.Failed;
  359. }
  360. CalculatVerticalPosition(_recipe);
  361. UpdatePowerStepDatas();
  362. _currentCycle = 0;
  363. return Runner.Start(Module, "Run Recipe");
  364. }
  365. /// <summary>
  366. /// 初始化Power step步骤
  367. /// </summary>
  368. private bool UpdatePowerStepDatas()
  369. {
  370. _isZeroCurrent = false;
  371. double current = 0;
  372. _totalMicrosecond = 0;
  373. _powerSupplierStepPeriodDatas.Clear();
  374. if (!_recipe.IsEntryTypeCold)//如果entry带上电保护,那么把上电保护的部分加到步阶电流的第一步
  375. {
  376. PowerSupplierStepPeriodData step = new PowerSupplierStepPeriodData(); //上电保护时间(提前上电时间+延迟时间)
  377. step.Hour = 0;
  378. step.Minute = (ushort)((_recipe.PlatingDelay) / 60);
  379. step.Second = (ushort)(_recipe.PlatingDelay % 60);
  380. step.Microsecond = 110; //到达entry位置提前100ms上电,提前一丢丢
  381. step.Voltage = _recipe.DepMaxVoltageWarning;
  382. _powerSupplierStepPeriodDatas.Add(step);
  383. }
  384. foreach (var item in _recipe.DepSteps)
  385. {
  386. PowerSupplierStepPeriodData step = new PowerSupplierStepPeriodData();
  387. step.Current = item.CurrentValue;
  388. if(item.CurrentValue > _maxCurrent)
  389. {
  390. _maxCurrent = item.CurrentValue;
  391. }
  392. step.Hour = (ushort)(item.DurartionSeconds / 3600);
  393. step.Minute = (ushort)((item.DurartionSeconds - step.Hour * 3600) / 60);
  394. step.Second = (ushort)(item.DurartionSeconds % 60);
  395. step.Microsecond = 0;
  396. step.Voltage = _recipe.DepMaxVoltageWarning;
  397. _powerSupplierStepPeriodDatas.Add(step);
  398. current += step.Current;
  399. _totalMicrosecond += item.DurartionSeconds * 1000;
  400. }
  401. if (current == 0)
  402. {
  403. _isZeroCurrent = true;
  404. }
  405. if(_maxCurrent > 0.6) //设置电源挡位,有超过0.6A的电流则用高档,否则用中挡
  406. {
  407. return _device.PowerSupplier.SetPowerGrade("set power grade high", new object[] { 2 });
  408. }
  409. else
  410. {
  411. return _device.PowerSupplier.SetPowerGrade("set power grade high", new object[] { 1 });
  412. }
  413. }
  414. /// <summary>
  415. /// 根据dep recipe计算出整个电镀过程中Rotation profile position可能去到的位置
  416. /// </summary>
  417. private void CalculatVerticalPosition(DepRecipe recipe)
  418. {
  419. foreach(var item in recipe.DepSteps)
  420. {
  421. if (item.BiDireaction)
  422. {
  423. _isRecipeContainsRevserseRotation = true;
  424. }
  425. else
  426. {
  427. continue;
  428. }
  429. }
  430. //不存在双向旋转直接给roation一个很大的值,电镀完成后再停止
  431. if (!_isRecipeContainsRevserseRotation)
  432. {
  433. _targetPositionList.Add(12 * 60 * 60 * 500 * 6); //以500rmp 运行12个小时的位置
  434. }
  435. else
  436. {
  437. }
  438. }
  439. /// <summary>
  440. /// 检验前置条件
  441. /// </summary>
  442. /// <returns></returns>
  443. private bool CheckPreCondition()
  444. {
  445. if (_recipe == null)
  446. {
  447. LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Recipe is null");
  448. return false;
  449. }
  450. //if (_recipe.DepSteps.Count == 0)
  451. //{
  452. // LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Recipe DepSteps count is 0");
  453. // return false;
  454. //}
  455. CheckAxisHome();
  456. CheckFacility();
  457. CheckModuleAndReservoir();
  458. return true;
  459. }
  460. private bool CheckModuleAndReservoir()
  461. {
  462. if (!_platingCellEntity.IsIdle)
  463. {
  464. LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, $"{Module} is not initialized");
  465. return false;
  466. }
  467. if (!_reservoirEntity.IsIdle)
  468. {
  469. LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, $"Releated reseroivr is not initialized");
  470. return false;
  471. }
  472. if (!_reservoirEntity.TemperatureReached)
  473. {
  474. LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, $"Releated reseroivr temperature is not reached");
  475. return false;
  476. }
  477. if ("Manual".Equals(_reservoirEntity.PersistentValue.OperatingMode) && !WaferManager.Instance.CheckHasWafer(Module, 0))
  478. {
  479. LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, $"Run recipe in manual must has wafer!");
  480. return false;
  481. }
  482. return true;
  483. }
  484. /// <summary>
  485. /// 检查马达是否上电且home
  486. /// </summary>
  487. /// <returns></returns>
  488. private bool CheckAxisHome()
  489. {
  490. if (!_rotationAxis.IsSwitchOn)
  491. {
  492. LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Rotation Axis is off");
  493. return false;
  494. }
  495. if (!_rotationAxis.IsHomed)
  496. {
  497. LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Rotation Axis is not home");
  498. return false;
  499. }
  500. if (!_verticalEntity.IsIdle)
  501. {
  502. LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Vertical Axis is not home");
  503. return false;
  504. }
  505. return true;
  506. }
  507. /// <summary>
  508. /// 检查facility
  509. /// </summary>
  510. /// <returns></returns>
  511. private bool CheckFacility()
  512. {
  513. SystemFacilities systemFacilities = DEVICE.GetDevice<SystemFacilities>("System.Facilities");
  514. if (systemFacilities == null)
  515. {
  516. LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Facility is null");
  517. return false;
  518. }
  519. if (!systemFacilities.CDAEnable)
  520. {
  521. LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Facility CDA is off");
  522. return false;
  523. }
  524. if (!systemFacilities.N2Enable)
  525. {
  526. LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Facility N2 is off");
  527. return false;
  528. }
  529. if (!systemFacilities.DIFillEnable)
  530. {
  531. LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Facility DIW is off");
  532. return false;
  533. }
  534. if (systemFacilities.FacilitiesDataDic["CDA1Pressure"].IsError || systemFacilities.FacilitiesDataDic["CDA2Pressure"].IsError)
  535. {
  536. LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Facility CDA Data is in errro range");
  537. return false;
  538. }
  539. if (systemFacilities.FacilitiesDataDic["Nitrogen1APressure"].IsError ||
  540. systemFacilities.FacilitiesDataDic["Nitrogen1BPressure"].IsError ||
  541. systemFacilities.FacilitiesDataDic["Nitrogen2APressure"].IsError ||
  542. systemFacilities.FacilitiesDataDic["Nitrogen2BPressure"].IsError)
  543. {
  544. LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Facility N2 Data is in errro range");
  545. return false;
  546. }
  547. if (systemFacilities.FacilitiesDataDic["DiWaterPressure"].IsError)
  548. {
  549. LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Facility Diw Pressure value is in errro range");
  550. return false;
  551. }
  552. return true;
  553. }
  554. }
  555. }