RecipeParser.cs 120 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Xml;
  4. using System.Reflection;
  5. using Aitex.Common.Util;
  6. using Aitex.Core.Common.DeviceData;
  7. using Aitex.Core.RT.Log;
  8. using Aitex.Core.RT.RecipeCenter;
  9. using Aitex.Core.RT.SCCore;
  10. using MECF.Framework.Common.Equipment;
  11. using System.IO;
  12. using MECF.Framework.UI.Client.CenterViews.Editors.Recipe;
  13. namespace FurnaceRT.Equipments.PMs.RecipeExecutions
  14. {
  15. public class RecipeParser
  16. {
  17. public static bool Parse(string recipeFile, string module, out RecipeHead recipeHead, out List<RecipeStep> recipeData, out string reason, string recipeType, int tableID = 1, RecipeHead mainHead = null)
  18. {
  19. reason = string.Empty;
  20. if (mainHead != null)
  21. recipeHead = mainHead;
  22. else
  23. recipeHead = new RecipeHead();
  24. recipeData = new List<RecipeStep>();
  25. string content = string.Empty;
  26. if (recipeType != "Process" && recipeType != "Idle" && recipeType != "Reset")
  27. {
  28. if (!File.Exists($"{PathManager.GetRecipeDir()}\\{SC.GetStringValue("System.Recipe.SupportedChamberType")}\\{SC.GetStringValue($"System.Recipe.Supported{recipeType}Type")}\\{recipeFile}.rcp"))
  29. return true;
  30. }
  31. content = RecipeFileManager.Instance.LoadRecipe($"{SC.GetStringValue("System.Recipe.SupportedChamberType")}\\{SC.GetStringValue($"System.Recipe.Supported{recipeType}Type")}", recipeFile, false);
  32. if (string.IsNullOrEmpty(content))
  33. {
  34. reason = $"{recipeFile} is not a valid recipe file";
  35. return false;
  36. }
  37. try
  38. {
  39. //获取工艺程序文件中允许的命令字符串列表
  40. //目的:如果工艺程序文件中含有规定之外的命令,则被禁止执行
  41. HashSet<string> recipeAllowedCommands = new HashSet<string>();
  42. XmlDocument rcpFormatDoc = new XmlDocument();
  43. string recipeSchema = PathManager.GetCfgDir() + $@"\Recipe\Furnace\Process\{SC.GetStringValue("System.SetUp.ToolType")}\RecipeFormat.xml";
  44. rcpFormatDoc.Load(recipeSchema);
  45. XmlNodeList rcpItemNodeList = rcpFormatDoc.SelectNodes("/Aitex/TableRecipeFormat/Catalog/Group/Step");
  46. foreach (XmlElement item in rcpItemNodeList)
  47. recipeAllowedCommands.Add(item.Attributes["ControlName"].Value);
  48. recipeAllowedCommands.Add("Temperature.ControlMode");
  49. recipeAllowedCommands.Add("Temperature.Correct");
  50. recipeAllowedCommands.Add("Temperature.PID");
  51. recipeAllowedCommands.Add("ConditionCheck");
  52. recipeAllowedCommands.Add("EventSetting");
  53. recipeAllowedCommands.Add("FilmThickFormula");
  54. recipeAllowedCommands.Add("FilmThickCoefficientA");
  55. recipeAllowedCommands.Add("FilmThickCoefficientB");
  56. recipeAllowedCommands.Add("AlarmTableIndex");
  57. recipeAllowedCommands.Add("RFSwitch");
  58. recipeAllowedCommands.Add("RFSetpoint");
  59. recipeAllowedCommands.Add("ForwardPowerAlarmWatchTable");
  60. recipeAllowedCommands.Add("PrAlarmWatchTable");
  61. recipeAllowedCommands.Add("PIAlarmWatchTable");
  62. recipeAllowedCommands.Add("C1Setpoint");
  63. recipeAllowedCommands.Add("C2Setpoint");
  64. recipeAllowedCommands.Add("C1AlarmWatchTable");
  65. recipeAllowedCommands.Add("C2AlarmWatchTable");
  66. recipeAllowedCommands.Add("VppAlarmWatchTable");
  67. recipeAllowedCommands.Add("VdcAlarmWatchTable");
  68. recipeAllowedCommands.Add("PressureSonserValue");
  69. recipeAllowedCommands.Add("PressureValveAngle");
  70. recipeAllowedCommands.Add("PressureSettingVG");
  71. recipeAllowedCommands.Add("PressCommand");
  72. recipeAllowedCommands.Add("PressValue");
  73. recipeAllowedCommands.Add("PressureAlarmTableNo");
  74. recipeAllowedCommands.Add("AbortRecipeTableIndex");
  75. recipeAllowedCommands.Add("AlarmConditionTable");
  76. recipeAllowedCommands.Add("LoaderCommand");
  77. recipeAllowedCommands.Add("LoaderValue");
  78. for (int i = 1; i < 11; i++)
  79. {
  80. recipeAllowedCommands.Add($"AlarmAction.{i}");
  81. recipeAllowedCommands.Add($"AlarmDetails.{i}");
  82. }
  83. for (int i = 1; i < 60; i++)
  84. {
  85. recipeAllowedCommands.Add($"MFC{i}.Flow.Set");
  86. recipeAllowedCommands.Add($"MFC{i}.Flow.SetUnit");
  87. recipeAllowedCommands.Add($"MFC{i}.Flow.Ramprate");
  88. recipeAllowedCommands.Add($"MFC{i}.Flow.RamprateUnit");
  89. recipeAllowedCommands.Add($"MFC{i}.Flow.Check");
  90. recipeAllowedCommands.Add($"MFC{i}.Flow.High");
  91. recipeAllowedCommands.Add($"MFC{i}.Flow.Low");
  92. recipeAllowedCommands.Add($"MFC{i}.Flow.Unit");
  93. }
  94. for (int i = 1; i < 200; i++)
  95. {
  96. recipeAllowedCommands.Add($"AUX.{i}.Set");
  97. recipeAllowedCommands.Add($"AUX.{i}.Check");
  98. recipeAllowedCommands.Add($"AUX.{i}.High");
  99. recipeAllowedCommands.Add($"AUX.{i}.Low");
  100. recipeAllowedCommands.Add($"AUX.{i}.CheckUnit");
  101. }
  102. recipeAllowedCommands.Add("HeaterU.ZoneName");
  103. recipeAllowedCommands.Add("HeaterU.Set");
  104. recipeAllowedCommands.Add("HeaterU.SetUnit");
  105. recipeAllowedCommands.Add("HeaterU.Ramprate");
  106. recipeAllowedCommands.Add("HeaterU.RamprateUnit");
  107. recipeAllowedCommands.Add("HeaterU.Check");
  108. recipeAllowedCommands.Add("HeaterU.High");
  109. recipeAllowedCommands.Add("HeaterU.Low");
  110. recipeAllowedCommands.Add("HeaterU.Unit");
  111. recipeAllowedCommands.Add("HeaterCU.ZoneName");
  112. recipeAllowedCommands.Add("HeaterCU.Set");
  113. recipeAllowedCommands.Add("HeaterCU.SetUnit");
  114. recipeAllowedCommands.Add("HeaterCU.Ramprate");
  115. recipeAllowedCommands.Add("HeaterCU.RamprateUnit");
  116. recipeAllowedCommands.Add("HeaterCU.Check");
  117. recipeAllowedCommands.Add("HeaterCU.High");
  118. recipeAllowedCommands.Add("HeaterCU.Low");
  119. recipeAllowedCommands.Add("HeaterCU.Unit");
  120. recipeAllowedCommands.Add("HeaterC.ZoneName");
  121. recipeAllowedCommands.Add("HeaterC.Set");
  122. recipeAllowedCommands.Add("HeaterC.SetUnit");
  123. recipeAllowedCommands.Add("HeaterC.Ramprate");
  124. recipeAllowedCommands.Add("HeaterC.RamprateUnit");
  125. recipeAllowedCommands.Add("HeaterC.Check");
  126. recipeAllowedCommands.Add("HeaterC.High");
  127. recipeAllowedCommands.Add("HeaterC.Low");
  128. recipeAllowedCommands.Add("HeaterC.Unit");
  129. recipeAllowedCommands.Add("HeaterCL.ZoneName");
  130. recipeAllowedCommands.Add("HeaterCL.Set");
  131. recipeAllowedCommands.Add("HeaterCL.SetUnit");
  132. recipeAllowedCommands.Add("HeaterCL.Ramprate");
  133. recipeAllowedCommands.Add("HeaterCL.RamprateUnit");
  134. recipeAllowedCommands.Add("HeaterCL.Check");
  135. recipeAllowedCommands.Add("HeaterCL.High");
  136. recipeAllowedCommands.Add("HeaterCL.Low");
  137. recipeAllowedCommands.Add("HeaterCL.Unit");
  138. recipeAllowedCommands.Add("HeaterL.ZoneName");
  139. recipeAllowedCommands.Add("HeaterL.Set");
  140. recipeAllowedCommands.Add("HeaterL.SetUnit");
  141. recipeAllowedCommands.Add("HeaterL.Ramprate");
  142. recipeAllowedCommands.Add("HeaterL.RamprateUnit");
  143. recipeAllowedCommands.Add("HeaterL.Check");
  144. recipeAllowedCommands.Add("HeaterL.High");
  145. recipeAllowedCommands.Add("HeaterL.Low");
  146. recipeAllowedCommands.Add("HeaterL.Unit");
  147. recipeAllowedCommands.Add("Loader.Command");
  148. recipeAllowedCommands.Add("Loader.Speed1");
  149. recipeAllowedCommands.Add("Loader.Speed2");
  150. recipeAllowedCommands.Add("Loader.Speed3");
  151. recipeAllowedCommands.Add("Loader.RPM");
  152. recipeAllowedCommands.Add("Press.Command");
  153. recipeAllowedCommands.Add("Press.PID");
  154. recipeAllowedCommands.Add("Press.Set");
  155. recipeAllowedCommands.Add("Press.SlowVacSet");
  156. recipeAllowedCommands.Add("Press.ValveAngleSet");
  157. recipeAllowedCommands.Add("Press.IsWait");
  158. recipeAllowedCommands.Add("Press.LowWait");
  159. recipeAllowedCommands.Add("Press.HighWait");
  160. recipeAllowedCommands.Add("Press.WaitUnit");
  161. recipeAllowedCommands.Add("Press.WaitPress");
  162. //获取工艺程序文件中所有步的内容
  163. XmlDocument rcpDataDoc = new XmlDocument();
  164. rcpDataDoc.LoadXml(content);
  165. XmlNode nodeModule = null;
  166. if (recipeType == "Process" || recipeType == "Idle" || recipeType == "Reset")
  167. nodeModule = rcpDataDoc.SelectSingleNode($"/Aitex/TableRecipeData/Module[@Name='{module}']");
  168. else
  169. nodeModule = rcpDataDoc.SelectSingleNode($"/Aitex/TableRecipeData/Tables/Table[@Index='{tableID}']");
  170. if (nodeModule == null)
  171. {
  172. reason = $"Recipe file does not contains step content for {module}";
  173. return false;
  174. }
  175. XmlElement nodeConfig = nodeModule.SelectSingleNode($"Config") as XmlElement;
  176. if (nodeConfig != null)
  177. {
  178. if (mainHead == null)
  179. {
  180. recipeHead.SubRecipe = nodeConfig.HasAttribute("Combination.SubRecipe") ? nodeConfig.Attributes["Combination.SubRecipe"].Value : "";
  181. recipeHead.AlarmRecipe = nodeConfig.HasAttribute("Combination.AlarmRecipe") ? nodeConfig.Attributes["Combination.AlarmRecipe"].Value : "";
  182. recipeHead.AlarmCondition = nodeConfig.HasAttribute("Combination.AlarmCondition") ? nodeConfig.Attributes["Combination.AlarmCondition"].Value : "";
  183. recipeHead.LeakCheck = nodeConfig.HasAttribute("Combination.LeakCheck") ? nodeConfig.Attributes["Combination.LeakCheck"].Value : "";
  184. recipeHead.AbortRecipe = nodeConfig.HasAttribute("Combination.AbortRecipe") ? nodeConfig.Attributes["Combination.AbortRecipe"].Value : "";
  185. recipeHead.PressApcPID = nodeConfig.HasAttribute("Combination.PressAPCPID") ? nodeConfig.Attributes["Combination.PressAPCPID"].Value : "";
  186. recipeHead.TempCorrect = nodeConfig.HasAttribute("Combination.TempCorrection") ? nodeConfig.Attributes["Combination.TempCorrection"].Value : "";
  187. recipeHead.TempPID = nodeConfig.HasAttribute("Combination.TempPID") ? nodeConfig.Attributes["Combination.TempPID"].Value : "";
  188. recipeHead.ProfileCondition = nodeConfig.HasAttribute("Combination.ProfileCondition") ? nodeConfig.Attributes["Combination.ProfileCondition"].Value : "";
  189. if (nodeConfig.HasAttribute("N2PurgeMode"))
  190. {
  191. recipeHead.N2PurgeModeStr = nodeConfig.Attributes["N2PurgeMode"].Value;
  192. }
  193. if (string.IsNullOrEmpty(recipeHead.AbortRecipe))
  194. recipeHead.AbortRecipe = SC.GetStringValue("System.Recipe.Abort Recipe");
  195. }
  196. }
  197. else
  198. {
  199. if (mainHead == null)
  200. {
  201. recipeHead.SubRecipe = "";
  202. recipeHead.AlarmRecipe = "";
  203. recipeHead.AlarmCondition = "";
  204. recipeHead.LeakCheck = "";
  205. recipeHead.AbortRecipe = "";
  206. recipeHead.PressApcPID = "";
  207. recipeHead.TempCorrect = "";
  208. recipeHead.TempPID = "";
  209. recipeHead.ProfileCondition = "";
  210. if (recipeType == "Sub")
  211. recipeHead.AbortRecipe = SC.GetStringValue("System.Recipe.Abort Recipe");
  212. }
  213. }
  214. XmlNodeList stepNodeList = nodeModule.SelectNodes($"Step");
  215. string strLoopEndStep, strJumpStep;
  216. strLoopEndStep = strJumpStep = string.Empty;
  217. for (int i = 0; i < stepNodeList.Count; i++)
  218. {
  219. var recipeStep = new RecipeStep();
  220. recipeStep.RecipeType = recipeType;
  221. recipeData.Add(recipeStep);
  222. XmlElement stepNode = stepNodeList[i] as XmlElement;
  223. Dictionary<string, string> dic = new Dictionary<string, string>();
  224. //遍历Step节点
  225. foreach (XmlAttribute att in stepNode.Attributes)
  226. {
  227. if (recipeAllowedCommands.Contains(att.Name))
  228. {
  229. dic.Add(att.Name, att.Value);
  230. }
  231. }
  232. //遍历Step子节点中所有的attribute属性节点
  233. foreach (XmlElement subStepNode in stepNode.ChildNodes)
  234. {
  235. foreach (XmlAttribute att in subStepNode.Attributes)
  236. {
  237. if (recipeAllowedCommands.Contains(att.Name))
  238. {
  239. dic.Add(att.Name, att.Value);
  240. }
  241. }
  242. //遍历Step子节点的子节点中所有的attribute属性节点
  243. foreach (XmlElement subsubStepNode in subStepNode.ChildNodes)
  244. {
  245. foreach (XmlAttribute att in subsubStepNode.Attributes)
  246. {
  247. if (recipeAllowedCommands.Contains(att.Name))
  248. {
  249. dic.Add(att.Name, att.Value);
  250. }
  251. }
  252. }
  253. }
  254. recipeStep.StepName = dic["Name"];
  255. if (dic["Name"] == strLoopEndStep)
  256. {
  257. recipeStep.IsLoopEndStep = true;
  258. strLoopEndStep = string.Empty;
  259. }
  260. recipeStep.IsJumpStep = false;
  261. if (dic.ContainsKey("Command"))
  262. {
  263. string commandStr = dic["Command"];
  264. if (commandStr.Contains("CallSystemRecipe"))
  265. {
  266. }
  267. else if (commandStr.ToUpper().StartsWith("CALL"))
  268. {
  269. int subTableID = 0;
  270. var subPara = commandStr.Replace("CALL", "").Replace("[", "").Replace("]", "").Split('*');
  271. if (subPara != null && subPara.Length > 1)
  272. {
  273. int.TryParse(subPara[0], out int loopCount);
  274. var tablePara = subPara[1].Split(':');
  275. if (tablePara != null && tablePara.Length > 1)
  276. {
  277. int.TryParse(tablePara[0], out subTableID);
  278. if (subTableID > 0)
  279. {
  280. recipeStep.IsCallSubStep = true;
  281. recipeStep.SubRecipeLoopCount = loopCount;
  282. }
  283. }
  284. recipeStep.SubRecipeTableInfo = subPara[1];
  285. }
  286. //sub需要修改table id
  287. List<RecipeStep> subRecipeData = null;
  288. if (recipeStep.IsCallSubStep && !Parse(recipeHead.SubRecipe, module, out var head, out subRecipeData, out reason, "Sub", subTableID, recipeHead))
  289. {
  290. return false;
  291. }
  292. if (subRecipeData == null || subRecipeData.Count == 0)
  293. {
  294. reason = $"Sub Recipe {commandStr.Replace("CallSubRecipe:", string.Empty)} is empty";
  295. return false;
  296. }
  297. recipeStep.SubRecipeSteps = subRecipeData;
  298. }
  299. else if (commandStr.ToUpper().StartsWith("LOOP"))
  300. {
  301. recipeStep.IsLoopEndStep = true;
  302. var loopPara = commandStr.Replace("LOOP", "").Replace("[", "").Replace("]", "").Split('*');
  303. if (loopPara != null && loopPara.Length > 1)
  304. {
  305. int.TryParse(loopPara[0], out int loopCount);
  306. recipeStep.LoopCount = loopCount + 1;//加1是因为第一次从正常的start-》end的执行算是一次循环,所以要额外加1
  307. int loopStartStep = -1;
  308. for (int index = 0; index < recipeData.Count; index++)
  309. {
  310. if (recipeData[index].StepName == loopPara[1])
  311. {
  312. loopStartStep = index;
  313. break;
  314. }
  315. }
  316. if (loopStartStep < 0)
  317. {
  318. reason = $"Recipe file does not contains LOOP step {loopPara[1]}";
  319. return false;
  320. }
  321. if (loopPara[1] != null)
  322. {
  323. if (loopStartStep < 0 ||
  324. (recipeType == "Process" && loopStartStep == 0))//Process recipe的standby不参与循环
  325. recipeStep.IsLoopEndStep = false;
  326. else
  327. {
  328. recipeStep.LoopStartStep = loopStartStep;
  329. if (recipeData.Count > loopStartStep)
  330. {
  331. recipeData[loopStartStep].IsLoopStartStep = true;
  332. recipeData[loopStartStep].LoopCount = loopCount + 1;
  333. recipeStep.LoopEndStep = recipeType == "Process" ? i + 1 : i;//Process recipe包含standby,从0开始;其他recipe不包含standby
  334. }
  335. }
  336. }
  337. }
  338. }
  339. else if (commandStr.ToUpper().StartsWith("JUMP"))
  340. {
  341. var jumpPara = commandStr.Replace("Jump:", string.Empty).Replace("[", "").Replace("]", "");//JumpStepNo
  342. if (jumpPara != null)
  343. {
  344. //int.TryParse(jumpPara[0], out int jumpStepNo);
  345. //recipeStep.JumpStepNo = recipeType == "Process" ? jumpStepNo : jumpStepNo - 1;//Process recipe包含standby,从0开始;其他recipe不包含standby
  346. recipeStep.IsJumpStep = true;
  347. recipeStep.JumpStepName = jumpPara;
  348. }
  349. }
  350. }
  351. if (dic.ContainsKey("AbortRecipeTableIndex"))
  352. {
  353. if (dic["AbortRecipeTableIndex"].ToLower() != "none")
  354. {
  355. //格式 1:name
  356. var abortPara = dic["AbortRecipeTableIndex"].Split(':');
  357. int abortTableID = 0;
  358. if (abortPara.Length > 1)
  359. {
  360. int.TryParse(abortPara[0], out abortTableID);
  361. List<RecipeStep> abortRecipeData = null;
  362. if (!Parse(recipeHead.AbortRecipe, module, out var head, out abortRecipeData, out reason, "Abort", abortTableID))
  363. {
  364. return false;
  365. }
  366. if (abortRecipeData == null || abortRecipeData.Count == 0)
  367. {
  368. reason = $"Abort Recipe {recipeHead.AbortRecipe}--{dic["AbortRecipeTableIndex"]} is empty";
  369. return false;
  370. }
  371. recipeStep.AbortRecipeSteps = abortRecipeData;
  372. recipeStep.AbortRecipeTableInfo = dic["AbortRecipeTableIndex"];
  373. }
  374. }
  375. else
  376. {
  377. recipeStep.AbortRecipeSteps = null;
  378. }
  379. }
  380. if (dic.ContainsKey("EventSetting"))
  381. {
  382. string eventSettingStr = dic["EventSetting"];
  383. if (eventSettingStr.ToLower() == "start")
  384. {
  385. recipeStep.IsTimeMeasurementStartStep = true;
  386. }
  387. else if (eventSettingStr.ToLower() == "stop")
  388. {
  389. recipeStep.IsTimeMeasurementStopStep = true;
  390. }
  391. }
  392. if (dic.ContainsKey("FilmThickFormula"))
  393. {
  394. recipeStep.FilmThickFormula = dic["FilmThickFormula"];
  395. }
  396. if (dic.ContainsKey("FilmThickCoefficientA"))
  397. {
  398. recipeStep.FilmThickCoefficientA = float.Parse(dic["FilmThickCoefficientA"]);
  399. }
  400. if (dic.ContainsKey("FilmThickCoefficientB"))
  401. {
  402. recipeStep.FilmThickCoefficientB = float.Parse(dic["FilmThickCoefficientB"]);
  403. }
  404. if (dic.ContainsKey("AlarmConditionTable"))
  405. {
  406. recipeStep.AlarmConditionTable = dic["AlarmConditionTable"];
  407. }
  408. for (int j = 1; j < 11; j++)
  409. {
  410. string tempType = "Ignore Alarm";
  411. string tempDetails = "";
  412. if (dic.ContainsKey($"AlarmAction.{j}"))
  413. {
  414. tempType = dic[$"AlarmAction.{j}"];
  415. }
  416. if (dic.ContainsKey($"AlarmDetails.{j}"))
  417. {
  418. tempDetails = dic[$"AlarmDetails.{j}"];
  419. }
  420. recipeStep.AlarmActionSets.Add(j, new AlarmActions()
  421. {
  422. ProcessingType = tempType,
  423. ProcessingDetails = tempDetails
  424. });
  425. }
  426. //if(dic.ContainsKey("Loop"))
  427. //{
  428. // string loopStr = dic["Loop"];
  429. // recipeStep.IsLoopStartStep = System.Text.RegularExpressions.Regex.Match(loopStr, @"Loop\x20\d+\s*$").Success;
  430. // recipeStep.IsLoopEndStep = System.Text.RegularExpressions.Regex.Match(loopStr, @"Loop End$").Success;
  431. // if (recipeStep.IsLoopStartStep)
  432. // recipeStep.LoopCount = Convert.ToInt32(loopStr.Replace("Loop", string.Empty));
  433. // else
  434. // recipeStep.LoopCount = 0;
  435. //}
  436. //recipe time
  437. if (dic["Name"].ToLower() == "standby")
  438. {
  439. if (DateTime.TryParse(dic["Time"], out DateTime time))
  440. {
  441. recipeStep.StepTime = time.Second + time.Minute * 60 + time.Hour * 3600 + time.Millisecond / 1000.0;
  442. }
  443. else if (float.TryParse(dic["Time"], out float timeInSec))
  444. {
  445. recipeStep.StepTime = timeInSec;
  446. recipeStep.EndBy = EnumEndByCondition.ByTime;
  447. }
  448. else
  449. {
  450. recipeStep.StepTime = 0;
  451. recipeStep.EndBy = EnumEndByCondition.ByStandbyFactor;
  452. }
  453. }
  454. else
  455. {
  456. if (System.Text.RegularExpressions.Regex.Match(dic["Time"], @"[a-zA-Z]").Success)
  457. {
  458. if (SC.ContainsItem($"{module}.RecipeEditParameter.StepTime.{dic["Time"]}"))
  459. {
  460. var time = DateTime.Parse(SC.GetStringValue($"{module}.RecipeEditParameter.StepTime.{dic["Time"]}"));
  461. recipeStep.StepTime = time.Second + time.Minute * 60 + time.Hour * 3600;
  462. }
  463. else
  464. {
  465. reason = $"Configuration does not contains step time config {dic["Time"]}";
  466. return false;
  467. }
  468. }
  469. else
  470. {
  471. if (DateTime.TryParse(dic["Time"], out DateTime time))
  472. {
  473. recipeStep.StepTime = time.Second + time.Minute * 60 + time.Hour * 3600 + time.Millisecond / 1000.0;
  474. }
  475. else if (float.TryParse(dic["Time"], out float timeInSec))
  476. {
  477. recipeStep.StepTime = timeInSec;
  478. }
  479. else
  480. {
  481. reason = $"Step time {dic["Time"]} is invalid";
  482. return false;
  483. }
  484. }
  485. if (dic["ConditionCheck"].ToLower() == "none")
  486. {
  487. recipeStep.EndBy = EnumEndByCondition.ByTime;
  488. }
  489. else
  490. {
  491. recipeStep.EndBy = EnumEndByCondition.ByStandbyFactor;
  492. }
  493. }
  494. //ReplaceControlName(ref dic, "GasLineMFC1.Flow", "MFC1.SetParameters");
  495. //ReplaceControlName(ref dic, "GasLineMFC2.Flow", "MFC2.SetParameters");
  496. //ReplaceControlName(ref dic, "GasLineMFC3.Flow", "MFC3.SetParameters");
  497. //ReplaceControlName(ref dic, "GasLineMFC4.Flow", "MFC4.SetParameters");
  498. //ReplaceControlName(ref dic, "GasLineMFC5.Flow", "MFC5.SetParameters");
  499. //ReplaceControlName(ref dic, "GasLineMFC6.Flow", "MFC6.SetParameters");
  500. //ReplaceControlName(ref dic, "GasLineMFC7.Flow", "MFC7.SetParameters");
  501. //ReplaceControlName(ref dic, "GasLineMFC8.Flow", "MFC8.SetParameters");
  502. //ReplaceControlName(ref dic, "GasLineMFC9.Flow", "MFC9.SetParameters");
  503. //ReplaceControlName(ref dic, "GasLineMFC10.Flow", "MFC10.SetParameters");
  504. //ReplaceControlName(ref dic, "GasLineMFC11.Flow", "MFC11.SetParameters");
  505. //ReplaceControlName(ref dic, "GasLineMFC12.Flow", "MFC12.SetParameters");
  506. //ReplaceControlName(ref dic, "GasLineMFC51.Flow", "MFC51.SetParameters");
  507. AddParameter(ref dic, "MFC1.SetParameters", new string[8] { "MFC1.Flow.Set", "MFC1.Flow.Ramprate", "MFC1.Flow.SetUnit", "MFC1.Flow.RamprateUnit", "MFC1.Flow.Check", "MFC1.Flow.High", "MFC1.Flow.Low", "MFC1.Flow.Unit" });
  508. AddParameter(ref dic, "MFC2.SetParameters", new string[8] { "MFC2.Flow.Set", "MFC2.Flow.Ramprate", "MFC2.Flow.SetUnit", "MFC2.Flow.RamprateUnit", "MFC2.Flow.Check", "MFC2.Flow.High", "MFC2.Flow.Low", "MFC2.Flow.Unit" });
  509. AddParameter(ref dic, "MFC3.SetParameters", new string[8] { "MFC3.Flow.Set", "MFC3.Flow.Ramprate", "MFC3.Flow.SetUnit", "MFC3.Flow.RamprateUnit", "MFC3.Flow.Check", "MFC3.Flow.High", "MFC3.Flow.Low", "MFC3.Flow.Unit" });
  510. AddParameter(ref dic, "MFC4.SetParameters", new string[8] { "MFC4.Flow.Set", "MFC4.Flow.Ramprate", "MFC4.Flow.SetUnit", "MFC4.Flow.RamprateUnit", "MFC4.Flow.Check", "MFC4.Flow.High", "MFC4.Flow.Low", "MFC4.Flow.Unit" });
  511. AddParameter(ref dic, "MFC5.SetParameters", new string[8] { "MFC5.Flow.Set", "MFC5.Flow.Ramprate", "MFC5.Flow.SetUnit", "MFC5.Flow.RamprateUnit", "MFC5.Flow.Check", "MFC5.Flow.High", "MFC5.Flow.Low", "MFC5.Flow.Unit" });
  512. AddParameter(ref dic, "MFC6.SetParameters", new string[8] { "MFC6.Flow.Set", "MFC6.Flow.Ramprate", "MFC6.Flow.SetUnit", "MFC6.Flow.RamprateUnit", "MFC6.Flow.Check", "MFC6.Flow.High", "MFC6.Flow.Low", "MFC6.Flow.Unit" });
  513. AddParameter(ref dic, "MFC7.SetParameters", new string[8] { "MFC7.Flow.Set", "MFC7.Flow.Ramprate", "MFC7.Flow.SetUnit", "MFC7.Flow.RamprateUnit", "MFC7.Flow.Check", "MFC7.Flow.High", "MFC7.Flow.Low", "MFC7.Flow.Unit" });
  514. AddParameter(ref dic, "MFC8.SetParameters", new string[8] { "MFC8.Flow.Set", "MFC8.Flow.Ramprate", "MFC8.Flow.SetUnit", "MFC8.Flow.RamprateUnit", "MFC8.Flow.Check", "MFC8.Flow.High", "MFC8.Flow.Low", "MFC8.Flow.Unit" });
  515. AddParameter(ref dic, "MFC9.SetParameters", new string[8] { "MFC9.Flow.Set", "MFC9.Flow.Ramprate", "MFC9.Flow.SetUnit", "MFC9.Flow.RamprateUnit", "MFC9.Flow.Check", "MFC9.Flow.High", "MFC9.Flow.Low", "MFC9.Flow.Unit" });
  516. AddParameter(ref dic, "MFC10.SetParameters", new string[8] { "MFC10.Flow.Set", "MFC10.Flow.Ramprate", "MFC10.Flow.SetUnit", "MFC10.Flow.RamprateUnit", "MFC10.Flow.Check", "MFC10.Flow.High", "MFC10.Flow.Low", "MFC10.Flow.Unit" });
  517. AddParameter(ref dic, "MFC11.SetParameters", new string[8] { "MFC11.Flow.Set", "MFC11.Flow.Ramprate", "MFC11.Flow.SetUnit", "MFC11.Flow.RamprateUnit", "MFC11.Flow.Check", "MFC11.Flow.High", "MFC11.Flow.Low", "MFC11.Flow.Unit" });
  518. AddParameter(ref dic, "MFC12.SetParameters", new string[8] { "MFC12.Flow.Set", "MFC12.Flow.Ramprate", "MFC12.Flow.SetUnit", "MFC12.Flow.RamprateUnit", "MFC12.Flow.Check", "MFC12.Flow.High", "MFC12.Flow.Low", "MFC12.Flow.Unit" });
  519. AddParameter(ref dic, "MFC13.SetParameters", new string[8] { "MFC13.Flow.Set", "MFC13.Flow.Ramprate", "MFC13.Flow.SetUnit", "MFC13.Flow.RamprateUnit", "MFC13.Flow.Check", "MFC13.Flow.High", "MFC13.Flow.Low", "MFC13.Flow.Unit" });
  520. AddParameter(ref dic, "MFC14.SetParameters", new string[8] { "MFC14.Flow.Set", "MFC14.Flow.Ramprate", "MFC14.Flow.SetUnit", "MFC14.Flow.RamprateUnit", "MFC14.Flow.Check", "MFC14.Flow.High", "MFC14.Flow.Low", "MFC14.Flow.Unit" });
  521. AddParameter(ref dic, "MFC15.SetParameters", new string[8] { "MFC15.Flow.Set", "MFC15.Flow.Ramprate", "MFC15.Flow.SetUnit", "MFC15.Flow.RamprateUnit", "MFC15.Flow.Check", "MFC15.Flow.High", "MFC15.Flow.Low", "MFC15.Flow.Unit" });
  522. AddParameter(ref dic, "MFC16.SetParameters", new string[8] { "MFC16.Flow.Set", "MFC16.Flow.Ramprate", "MFC16.Flow.SetUnit", "MFC16.Flow.RamprateUnit", "MFC16.Flow.Check", "MFC16.Flow.High", "MFC16.Flow.Low", "MFC16.Flow.Unit" });
  523. AddParameter(ref dic, "MFC17.SetParameters", new string[8] { "MFC17.Flow.Set", "MFC17.Flow.Ramprate", "MFC17.Flow.SetUnit", "MFC17.Flow.RamprateUnit", "MFC17.Flow.Check", "MFC17.Flow.High", "MFC17.Flow.Low", "MFC17.Flow.Unit" });
  524. AddParameter(ref dic, "MFC31.SetParameters", new string[8] { "MFC31.Flow.Set", "MFC31.Flow.Ramprate", "MFC31.Flow.SetUnit", "MFC31.Flow.RamprateUnit", "MFC31.Flow.Check", "MFC31.Flow.High", "MFC31.Flow.Low", "MFC31.Flow.Unit" });
  525. AddParameter(ref dic, "MFC32.SetParameters", new string[8] { "MFC32.Flow.Set", "MFC32.Flow.Ramprate", "MFC32.Flow.SetUnit", "MFC32.Flow.RamprateUnit", "MFC32.Flow.Check", "MFC32.Flow.High", "MFC32.Flow.Low", "MFC32.Flow.Unit" });
  526. //AddParameter(ref dic, "MFC51.SetParameters", new string[8] { "MFC51.Flow.Set", "MFC51.Flow.Ramprate", "MFC51.Flow.SetUnit", "MFC51.Flow.RamprateUnit", "MFC51.Flow.Check", "MFC51.Flow.High", "MFC51.Flow.Low", "MFC51.Flow.Unit" });
  527. ReplaceControlName(ref dic, "MFM57Flow", "MFM57.SetParameters");
  528. ReplaceControlName(ref dic, "MFM1Flow", "MFM1.SetParameters");
  529. ReplaceControlName(ref dic, "MFM6Flow", "MFM6.SetParameters");
  530. ReplaceControlName(ref dic, "MFM7Flow", "MFM7.SetParameters");
  531. ReplaceControlName(ref dic, "MFM8Flow", "MFM8.SetParameters");
  532. ReplaceControlName(ref dic, "MFM9Flow", "MFM9.SetParameters");
  533. ReplaceControlName(ref dic, "MFM11Flow", "MFM11.SetParameters");
  534. ReplaceControlName(ref dic, "MFM12Flow", "MFM12.SetParameters");
  535. ReplaceControlName(ref dic, "MFM13Flow", "MFM13.SetParameters");
  536. ReplaceControlName(ref dic, "MFM16Flow", "MFM16.SetParameters");
  537. ReplaceControlName(ref dic, "ConditionCheck", "SetConditionCheck");
  538. ReplaceControlName(ref dic, "Command", "SetCommand");
  539. if (dic.ContainsKey("AlarmConditionTable"))
  540. ReplaceControlName(ref dic, "AlarmConditionTable", "SetAlarmConditionTable");
  541. //ReplaceControlName(ref dic, "Heater2", "ZoneU.SetParameters");
  542. //ReplaceControlName(ref dic, "Heater4", "ZoneCU.SetParameters");
  543. //ReplaceControlName(ref dic, "Heater6", "ZoneC.SetParameters");
  544. //ReplaceControlName(ref dic, "Heater8", "ZoneCL.SetParameters");
  545. //ReplaceControlName(ref dic, "Heater10", "ZoneL.SetParameters");
  546. var controlMode = dic["Temperature.ControlMode"];
  547. var correct = dic["Temperature.Correct"];
  548. var PID = dic["Temperature.PID"];
  549. //AddParameter(ref dic, "ZoneU.SetParameters", controlMode, correct, PID);
  550. //AddParameter(ref dic, "ZoneCU.SetParameters", controlMode, correct, PID);
  551. //AddParameter(ref dic, "ZoneC.SetParameters", controlMode, correct, PID);
  552. //AddParameter(ref dic, "ZoneCL.SetParameters", controlMode, correct, PID);
  553. //AddParameter(ref dic, "ZoneL.SetParameters", controlMode, correct, PID);
  554. AddParameter(ref dic, "HeaterU.SetParameters", new string[9] { "HeaterU.ZoneName", "HeaterU.Set", "HeaterU.SetUnit", "HeaterU.Ramprate", "HeaterU.RamprateUnit", "HeaterU.Check", "HeaterU.High", "HeaterU.Low", "HeaterU.Unit" });
  555. AddParameterValue(ref dic, "HeaterU.SetParameters", new string[8] { controlMode, correct, PID, recipeHead.TempCorrect, recipeHead.TempPID, recipeHead.ProfileCondition, dic["ValveAV91"], dic["BWR"] });
  556. AddParameter(ref dic, "HeaterCU.SetParameters", new string[9] { "HeaterCU.ZoneName", "HeaterCU.Set", "HeaterCU.SetUnit", "HeaterCU.Ramprate", "HeaterCU.RamprateUnit", "HeaterCU.Check", "HeaterCU.High", "HeaterCU.Low", "HeaterCU.Unit" });
  557. AddParameterValue(ref dic, "HeaterCU.SetParameters", new string[8] { controlMode, correct, PID, recipeHead.TempCorrect, recipeHead.TempPID, recipeHead.ProfileCondition, dic["ValveAV91"], dic["BWR"] });
  558. AddParameter(ref dic, "HeaterC.SetParameters", new string[9] { "HeaterC.ZoneName", "HeaterC.Set", "HeaterC.SetUnit", "HeaterC.Ramprate", "HeaterC.RamprateUnit", "HeaterC.Check", "HeaterC.High", "HeaterC.Low", "HeaterC.Unit" });
  559. AddParameterValue(ref dic, "HeaterC.SetParameters", new string[8] { controlMode, correct, PID, recipeHead.TempCorrect, recipeHead.TempPID, recipeHead.ProfileCondition, dic["ValveAV91"], dic["BWR"] });
  560. AddParameter(ref dic, "HeaterCL.SetParameters", new string[9] { "HeaterCL.ZoneName", "HeaterCL.Set", "HeaterCL.SetUnit", "HeaterCL.Ramprate", "HeaterCL.RamprateUnit", "HeaterCL.Check", "HeaterCL.High", "HeaterCL.Low", "HeaterCL.Unit" });
  561. AddParameterValue(ref dic, "HeaterCL.SetParameters", new string[8] { controlMode, correct, PID, recipeHead.TempCorrect, recipeHead.TempPID, recipeHead.ProfileCondition, dic["ValveAV91"], dic["BWR"] });
  562. AddParameter(ref dic, "HeaterL.SetParameters", new string[9] { "HeaterL.ZoneName", "HeaterL.Set", "HeaterL.SetUnit", "HeaterL.Ramprate", "HeaterL.RamprateUnit", "HeaterL.Check", "HeaterL.High", "HeaterL.Low", "HeaterL.Unit" });
  563. AddParameterValue(ref dic, "HeaterL.SetParameters", new string[8] { controlMode, correct, PID, recipeHead.TempCorrect, recipeHead.TempPID, recipeHead.ProfileCondition, dic["ValveAV91"], dic["BWR"] });
  564. AddParameter(ref dic, "APC.SetParameters", new string[10] { "Press.Command", "Press.PID", "Press.Set", "Press.SlowVacSet", "Press.ValveAngleSet", "Press.IsWait", "Press.LowWait", "Press.HighWait", "Press.WaitUnit", "Press.WaitPress" });//APC
  565. AddParameterValue(ref dic, "APC.SetParameters", new string[2] { recipeHead.PressApcPID, dic["ValveAV71"] });//APC
  566. AddParameter(ref dic, "SetBoatMotion", new string[5] { "Loader.Command", "Loader.Speed1", "Loader.Speed2", "Loader.Speed3", "Loader.RPM" });//Boat
  567. List<string> auxCommands = new List<string>();
  568. for (int k = 1; k < 200; k++)
  569. {
  570. if (!dic.ContainsKey($"AUX.{k}.Set"))
  571. continue;
  572. auxCommands.Add($"{k},{dic[$"AUX.{k}.Set"]},{dic[$"AUX.{k}.Check"]},{dic[$"AUX.{k}.High"]},{dic[$"AUX.{k}.Low"]},{dic[$"AUX.{k}.CheckUnit"]}");
  573. dic.Remove($"AUX.{k}.Set");
  574. dic.Remove($"AUX.{k}.Check");
  575. dic.Remove($"AUX.{k}.High");
  576. dic.Remove($"AUX.{k}.Low");
  577. dic.Remove($"AUX.{k}.CheckUnit");
  578. }
  579. dic.Add("AUX.SetParameters", string.Join(";", auxCommands));
  580. //ReplaceControlName(ref dic, "RFSwitch", "RfPower.SetParameters");
  581. //AddParameter(ref dic, "RfPower.SetParameters", dic["RFSetpoint"], dic["ForwardPowerAlarmWatchTable"], dic["PrAlarmWatchTable"], dic["PIAlarmWatchTable"]);
  582. //ReplaceControlName(ref dic, "C1Setpoint", "RfMatch.SetParameters");
  583. //AddParameter(ref dic, "RfMatch.SetParameters", dic["C2Setpoint"], dic["C1AlarmWatchTable"], dic["C2AlarmWatchTable"], dic["VppAlarmWatchTable"]);
  584. AddValveParameter(ref dic, "SetValves", new string[153] {
  585. "ValveAV1",
  586. "ValveAV2",
  587. "ValveAV3",
  588. "ValveAV4",
  589. "ValveAV5",
  590. "ValveAV6",
  591. "ValveAV7",
  592. "ValveAV8",
  593. "ValveAV9",
  594. "ValveAV10",
  595. "ValveAV11",
  596. "ValveAV12",
  597. "ValveAV13",
  598. "ValveAV14",
  599. "ValveAV15",
  600. "ValveAV16",
  601. "ValveAV17",
  602. "ValveAV18",
  603. "ValveAV19",
  604. "ValveAV20",
  605. "ValveAV21",
  606. "ValveAV22",
  607. "ValveAV23",
  608. "ValveAV24",
  609. "ValveAV25",
  610. "ValveAV26",
  611. "ValveAV27",
  612. "ValveAV28",
  613. "ValveAV29",
  614. "ValveAV30",
  615. "ValveAV31",
  616. "ValveAV32",
  617. "ValveAV33",
  618. "ValveAV34",
  619. "ValveAV35",
  620. "ValveAV36",
  621. "ValveAV37",
  622. "ValveAV38",
  623. "ValveAV39",
  624. "ValveAV40",
  625. "ValveAV41",
  626. "ValveAV42",
  627. "ValveAV43",
  628. "ValveAV44",
  629. "ValveAV45",
  630. "ValveAV46",
  631. "ValveAV47",
  632. "ValveAV48",
  633. "ValveAV49",
  634. "ValveAV50",
  635. "ValveAV51",
  636. "ValveAV52",
  637. "ValveAV53",
  638. "ValveAV60",
  639. "ValveAV61",
  640. "ValveAV62",
  641. "ValveAV63",
  642. "ValveAV64",
  643. "ValveAV65",
  644. "ValveAV66",
  645. "ValveAV67",
  646. "ValveAV68",
  647. "ValveAV69",
  648. "ValveAV70",
  649. "ValveAV71",
  650. "ValveAV72",
  651. "ValveAV73",
  652. "ValveAV74",
  653. "ValveAV75",
  654. "ValveAV76",
  655. "ValveAV77",
  656. "ValveAV78",
  657. "ValveAV79",
  658. "ValveAV80",
  659. "ValveAV81",
  660. "ValveAV82",
  661. "ValveAV83",
  662. "ValveAV84",
  663. "ValveAV85",
  664. "ValveAV86",
  665. "ValveAV87",
  666. "ValveAV88",
  667. "ValveAV89",
  668. "ValveAV90",
  669. "ValveAV91",
  670. "ValveAV92",
  671. "ValveAV93",
  672. "ValveAV94",
  673. "ValveAV95",
  674. "ValveAV96",
  675. "ValveAV97",
  676. "ValveAV98",
  677. "ValveAV99",
  678. "ValveAV100",
  679. "ValveAV101",
  680. "ValveAV102",
  681. "ValveAV103",
  682. "ValveAV104",
  683. "ValveAV105",
  684. "ValveAV106",
  685. "ValveAV107",
  686. "ValveAV108",
  687. "ValveAV109",
  688. "ValveAV110",
  689. "ValveAV111",
  690. "ValveAV112",
  691. "ValveAV113",
  692. "ValveAV114",
  693. "ValveAV115",
  694. "ValveAV116",
  695. "ValveAV117",
  696. "ValveAV118",
  697. "ValveAV119",
  698. "ValveAV120",
  699. "ValveAV121",
  700. "ValveAV122",
  701. "ValveAV123",
  702. "ValveAV124",
  703. "ValveAV125",
  704. "ValveAV126",
  705. "ValveAV127",
  706. "ValveAV128",
  707. "ValveAV129",
  708. "ValveAV130",
  709. "ValveAV131",
  710. "ValveAV132",
  711. "ValveAV133",
  712. "ValveAV134",
  713. "ValveAV135",
  714. "ValveAV136",
  715. "DPR",
  716. "AGV",
  717. "AGV2",
  718. "MBP",
  719. "MBP1",
  720. "MBP2",
  721. "DP",
  722. "BWR",
  723. "F2Cln",
  724. "HFCln",
  725. "CEXH",
  726. "DEPO",
  727. "HTR1",
  728. "HTR2",
  729. "HTR3",
  730. "DP1",
  731. "DP2",
  732. "HMNT",
  733. "CMNT",
  734. "HREF",
  735. "CREF",
  736. "HZERO",
  737. "CZERO"
  738. });
  739. //dic.Remove("SetValves");
  740. //dic.Remove("HeaterU.SetParameters");
  741. //dic.Remove("HeaterCU.SetParameters");
  742. //dic.Remove("HeaterC.SetParameters");
  743. //dic.Remove("HeaterCL.SetParameters");
  744. //dic.Remove("HeaterL.SetParameters");
  745. //dic.Remove("MFC1.SetParameters");
  746. //dic.Remove("MFC2.SetParameters");
  747. //dic.Remove("MFC3.SetParameters");
  748. //dic.Remove("MFC4.SetParameters");
  749. //dic.Remove("MFC5.SetParameters");
  750. //dic.Remove("MFC6.SetParameters");
  751. //dic.Remove("MFC7.SetParameters");
  752. //dic.Remove("MFC8.SetParameters");
  753. //dic.Remove("MFC9.SetParameters");
  754. //dic.Remove("MFC10.SetParameters");
  755. //dic.Remove("MFC11.SetParameters");
  756. //dic.Remove("MFC12.SetParameters");
  757. //ReplaceControlNameForValve(ref dic, "ValveAV1");
  758. //ReplaceControlNameForValve(ref dic, "ValveAV2");
  759. //ReplaceControlNameForValve(ref dic, "ValveAV3");
  760. //ReplaceControlNameForValve(ref dic, "ValveAV4");
  761. //ReplaceControlNameForValve(ref dic, "ValveAV5");
  762. //ReplaceControlNameForValve(ref dic, "ValveAV6");
  763. //ReplaceControlNameForValve(ref dic, "ValveAV7");
  764. //ReplaceControlNameForValve(ref dic, "ValveAV8");
  765. //ReplaceControlNameForValve(ref dic, "ValveAV9");
  766. //ReplaceControlNameForValve(ref dic, "ValveAV10");
  767. //ReplaceControlNameForValve(ref dic, "ValveAV11");
  768. //ReplaceControlNameForValve(ref dic, "ValveAV12");
  769. //ReplaceControlNameForValve(ref dic, "ValveAV13");
  770. //ReplaceControlNameForValve(ref dic, "ValveAV14");
  771. //ReplaceControlNameForValve(ref dic, "ValveAV15");
  772. //ReplaceControlNameForValve(ref dic, "ValveAV16");
  773. //ReplaceControlNameForValve(ref dic, "ValveAV17");
  774. //ReplaceControlNameForValve(ref dic, "ValveAV18");
  775. //ReplaceControlNameForValve(ref dic, "ValveAV19");
  776. //ReplaceControlNameForValve(ref dic, "ValveAV20");
  777. //ReplaceControlNameForValve(ref dic, "ValveAV21");
  778. //ReplaceControlNameForValve(ref dic, "ValveAV22");
  779. //ReplaceControlNameForValve(ref dic, "ValveAV23");
  780. //ReplaceControlNameForValve(ref dic, "ValveAV24");
  781. //ReplaceControlNameForValve(ref dic, "ValveAV25");
  782. //ReplaceControlNameForValve(ref dic, "ValveAV26");
  783. //ReplaceControlNameForValve(ref dic, "ValveAV27");
  784. //ReplaceControlNameForValve(ref dic, "ValveAV28");
  785. //ReplaceControlNameForValve(ref dic, "ValveAV29");
  786. //ReplaceControlNameForValve(ref dic, "ValveAV30");
  787. //ReplaceControlNameForValve(ref dic, "ValveAV31");
  788. //ReplaceControlNameForValve(ref dic, "ValveAV32");
  789. //ReplaceControlNameForValve(ref dic, "ValveAV33");
  790. //ReplaceControlNameForValve(ref dic, "ValveAV34");
  791. //ReplaceControlNameForValve(ref dic, "ValveAV35");
  792. //ReplaceControlNameForValve(ref dic, "ValveAV36");
  793. //ReplaceControlNameForValve(ref dic, "ValveAV37");
  794. //ReplaceControlNameForValve(ref dic, "ValveAV38");
  795. //ReplaceControlNameForValve(ref dic, "ValveAV39");
  796. //ReplaceControlNameForValve(ref dic, "ValveAV52");
  797. ////ReplaceControlNameForValve(ref dic, "ValveAV54");
  798. ////ReplaceControlNameForValve(ref dic, "ValveAV56");
  799. ////ReplaceControlNameForValve(ref dic, "ValveAV57");
  800. ////ReplaceControlNameForValve(ref dic, "ValveAV58");
  801. ////ReplaceControlNameForValve(ref dic, "ValveAV59");
  802. //ReplaceControlNameForValve(ref dic, "ValveAV60");
  803. ////ReplaceControlNameForValve(ref dic, "ValveAV65");
  804. ////ReplaceControlNameForValve(ref dic, "ValveAV66");
  805. ////ReplaceControlNameForValve(ref dic, "ValveAV68");
  806. //ReplaceControlNameForValve(ref dic, "ValveAV71");
  807. //ReplaceControlNameForValve(ref dic, "ValveAV72");
  808. //ReplaceControlNameForValve(ref dic, "ValveAV73");
  809. //ReplaceControlNameForValve(ref dic, "ValveAV74");
  810. //ReplaceControlNameForValve(ref dic, "ValveAV75");
  811. //ReplaceControlNameForValve(ref dic, "ValveAV77");
  812. //ReplaceControlNameForValve(ref dic, "ValveAV81");
  813. //ReplaceControlNameForValve(ref dic, "ValveAV82");
  814. //ReplaceControlNameForValve(ref dic, "ValveAV83");
  815. //ReplaceControlNameForValve(ref dic, "ValveAV91");
  816. dic.Remove("StepNo");
  817. dic.Remove("Name");
  818. dic.Remove("EndBy");
  819. dic.Remove("Time");
  820. dic.Remove("ZAxisPosition");
  821. dic.Remove("ZAxisSpeed");
  822. dic.Remove("RotatePosition");
  823. dic.Remove("RotateSpeed");
  824. dic.Remove("RotateDirection");
  825. dic.Remove("Heater1");
  826. dic.Remove("Heater2");
  827. dic.Remove("Heater3");
  828. dic.Remove("Heater4");
  829. dic.Remove("Heater5");
  830. dic.Remove("ValveAV54");
  831. dic.Remove("ValveAV55");
  832. dic.Remove("ValveAV56");
  833. dic.Remove("ValveAV57");
  834. dic.Remove("ValveAV58");
  835. dic.Remove("ValveAV59");
  836. dic.Remove("ValveAV65");
  837. dic.Remove("ValveAV66");
  838. dic.Remove("ValveAV68");
  839. dic.Remove("ExternalOn");
  840. dic.Remove("ExternalOff");
  841. dic.Remove("ExternalSensor");
  842. dic.Remove("TempStabilize");
  843. dic.Remove("FinishAutoProfile");
  844. dic.Remove("ReachTempWait");
  845. dic.Remove("ReachTemp");
  846. dic.Remove("TempUpper");
  847. dic.Remove("TempLower");
  848. dic.Remove("ReachPressureWait");
  849. dic.Remove("ReachPressure");
  850. dic.Remove("PressureUpper");
  851. dic.Remove("PressureLower");
  852. dic.Remove("PressureStabilize");
  853. dic.Remove("External.Out1");
  854. dic.Remove("External.Out2");
  855. dic.Remove("External.Out3");
  856. dic.Remove("External.Out4");
  857. dic.Remove("External.Out5");
  858. dic.Remove("External.Out6");
  859. dic.Remove("RFSwitch");
  860. dic.Remove("RFSetpoint");
  861. dic.Remove("ForwardPowerAlarmWatchTable");
  862. dic.Remove("PrAlarmWatchTable");
  863. dic.Remove("PIAlarmWatchTable");
  864. dic.Remove("C1Setpoint");
  865. dic.Remove("C2Setpoint");
  866. dic.Remove("C1AlarmWatchTable");
  867. dic.Remove("C2AlarmWatchTable");
  868. dic.Remove("VppAlarmWatchTable");
  869. dic.Remove("VdcAlarmWatchTable");
  870. dic.Remove("AbortRecipeTableIndex");
  871. dic.Remove("Temperature.ControlMode");
  872. dic.Remove("Temperature.Correct");
  873. dic.Remove("Temperature.PID");
  874. dic.Remove("Temperature.Profile");
  875. dic.Remove("Temperature.Stabilize");
  876. dic.Remove("Temperature.TempReadyCond");
  877. dic.Remove("FilmThickFormula");
  878. dic.Remove("FilmThickCoefficientA");
  879. dic.Remove("FilmThickCoefficientB");
  880. dic.Remove("APC.SetPressure");
  881. dic.Remove("PressureSettingVG");
  882. dic.Remove("PressureSonserValue");
  883. dic.Remove("PressureValveAngle");
  884. dic.Remove("PressureAlarmTableNo");
  885. dic.Remove("EventSetting");
  886. dic.Remove("AlarmTableIndex");
  887. dic.Remove("AlarmDetails.1");
  888. dic.Remove("AlarmAction.1");
  889. dic.Remove("AlarmDetails.2");
  890. dic.Remove("AlarmAction.2");
  891. dic.Remove("AlarmDetails.3");
  892. dic.Remove("AlarmAction.3");
  893. dic.Remove("AlarmDetails.4");
  894. dic.Remove("AlarmAction.4");
  895. dic.Remove("AlarmDetails.5");
  896. dic.Remove("AlarmAction.5");
  897. dic.Remove("AlarmDetails.6");
  898. dic.Remove("AlarmAction.6");
  899. dic.Remove("AlarmDetails.7");
  900. dic.Remove("AlarmAction.7");
  901. dic.Remove("AlarmDetails.8");
  902. dic.Remove("AlarmAction.8");
  903. dic.Remove("AlarmDetails.9");
  904. dic.Remove("AlarmAction.9");
  905. dic.Remove("AlarmDetails.10");
  906. dic.Remove("AlarmAction.10");
  907. //List<string> mfcCheckInstall = new List<string>()
  908. //{
  909. // "MfcN1",
  910. // "MfcN2",
  911. // "MfcN3",
  912. // "MfcH1",
  913. // "MfcJ1",
  914. // "MfcXN1",
  915. //};
  916. //foreach(var mfc in mfcCheckInstall)
  917. //{
  918. // if (!SC.GetValue<bool>($"PM1.MFC.{mfc}.IsMFCInstalled"))
  919. // dic.Remove($"{mfc}.SetParameters");
  920. //}
  921. foreach (string key in dic.Keys)
  922. recipeStep.RecipeCommands.Add(key, dic[key]);
  923. }
  924. for (int i = 0; i < recipeData.Count; i++)
  925. {
  926. if (recipeData[i].IsJumpStep)
  927. {
  928. bool findJumpStep = false;
  929. for (int j = 0; j < recipeData.Count; j++)
  930. {
  931. if (recipeData[j].StepName == recipeData[i].JumpStepName)
  932. {
  933. recipeData[i].JumpStepNo = j;
  934. findJumpStep = true;
  935. break;
  936. }
  937. }
  938. if (!findJumpStep)
  939. {
  940. reason = $"Recipe file does not contains jump step {recipeData[i].JumpStepName}";
  941. return false;
  942. }
  943. }
  944. }
  945. }
  946. catch (Exception ex)
  947. {
  948. LOG.Write(ex);
  949. reason = $"Recipe file content not valid, {recipeFile}, {ex.Message}";
  950. return false;
  951. }
  952. return true;
  953. }
  954. public static bool LayoutRecipeParse(string recipeFile, string module, out RecipeLayoutEntityNormal layoutRecipeDataNormal, out RecipeLayoutEntityExpert layoutRecipeDataExpert, out RecipeLayoutEntityConfig layoutRecipeDataConfig, out string reason)
  955. {
  956. reason = string.Empty;
  957. layoutRecipeDataNormal = new RecipeLayoutEntityNormal();
  958. layoutRecipeDataExpert = new RecipeLayoutEntityExpert();
  959. layoutRecipeDataConfig = new RecipeLayoutEntityConfig();
  960. string content = RecipeFileManager.Instance.LoadRecipe($"{SC.GetStringValue("System.Recipe.SupportedChamberType")}\\{SC.GetStringValue("System.Recipe.SupportedLayoutType")}", recipeFile, false);
  961. if (string.IsNullOrEmpty(content))
  962. {
  963. reason = $"{recipeFile} is not a valid recipe file";
  964. return false;
  965. }
  966. try
  967. {
  968. XmlDocument rcpDataDoc = new XmlDocument();
  969. rcpDataDoc.LoadXml(content);
  970. XmlNode nodeModule;
  971. nodeModule = rcpDataDoc.SelectSingleNode("/Aitex/TableRecipeData/Module/Step[@Name='Normal']");
  972. if (nodeModule == null)
  973. {
  974. //reason = "Recipe file does not contains step content for Normal";
  975. return false;
  976. }
  977. else
  978. {
  979. Type t = layoutRecipeDataNormal.GetType();
  980. foreach (FieldInfo pi in t.GetFields())
  981. {
  982. XmlElement stepNode = nodeModule as XmlElement;
  983. //遍历Step节点
  984. foreach (XmlAttribute att in stepNode.Attributes)
  985. {
  986. if (pi.Name == att.Name)
  987. {
  988. pi.SetValue(layoutRecipeDataNormal, att.Value);
  989. }
  990. }
  991. }
  992. }
  993. nodeModule = rcpDataDoc.SelectSingleNode("/Aitex/TableRecipeData/Module/Step[@Name='Expert']");
  994. if (nodeModule == null)
  995. {
  996. //reason = "Recipe file does not contains step content for Expert";
  997. return false;
  998. }
  999. else
  1000. {
  1001. XmlElement stepNode = nodeModule as XmlElement;
  1002. string strName = "";
  1003. //遍历Step节点
  1004. foreach (XmlAttribute att in stepNode.Attributes)
  1005. {
  1006. if (att.Name != "Name")
  1007. {
  1008. layoutRecipeDataExpert.Items.Add(att.Value);
  1009. }
  1010. else
  1011. {
  1012. strName = att.Value;
  1013. }
  1014. }
  1015. layoutRecipeDataExpert.Name = strName;
  1016. }
  1017. nodeModule = rcpDataDoc.SelectSingleNode("/Aitex/TableRecipeData/Module[@Name='PM1']/Config");
  1018. if (nodeModule == null)
  1019. {
  1020. return false;
  1021. }
  1022. else
  1023. {
  1024. Type t = layoutRecipeDataConfig.GetType();
  1025. foreach (FieldInfo pi in t.GetFields())
  1026. {
  1027. XmlElement stepNode = nodeModule as XmlElement;
  1028. //遍历Step节点
  1029. foreach (XmlAttribute att in stepNode.Attributes)
  1030. {
  1031. if (pi.Name == att.Name)
  1032. {
  1033. pi.SetValue(layoutRecipeDataConfig, att.Value);
  1034. }
  1035. }
  1036. }
  1037. }
  1038. }
  1039. catch (Exception ex)
  1040. {
  1041. LOG.Write(ex);
  1042. reason = $"Recipe file content not valid, {recipeFile}, {ex.Message}";
  1043. return false;
  1044. }
  1045. return true;
  1046. }
  1047. private static void ReplaceControlName(ref Dictionary<string, string> dic, string from, string to)
  1048. {
  1049. if (dic.ContainsKey(from))
  1050. {
  1051. dic.Add(to, dic[from]);
  1052. dic.Remove(from);
  1053. }
  1054. }
  1055. private static void ReplaceControlName(ref Dictionary<string, string> dic, string from, string to1, string to2)
  1056. {
  1057. dic.Add(to1, dic[from]);
  1058. dic.Add(to2, dic[from]);
  1059. dic.Remove(from);
  1060. }
  1061. private static void ReplaceControlNameForValve(ref Dictionary<string, string> dic, string key)
  1062. {
  1063. switch (dic[key].ToLower())
  1064. {
  1065. case "open":
  1066. dic[key] = "true";
  1067. break;
  1068. case "close":
  1069. dic[key] = "false";
  1070. break;
  1071. case "continue":
  1072. dic[key] = "Continue";
  1073. break;
  1074. }
  1075. //dic[key] = dic[key].ToLower() == "open" ? "true" : "false";
  1076. }
  1077. private static void AddValveParameter(ref Dictionary<string, string> dic, string to, string[] param)
  1078. {
  1079. if (param != null && param.Length > 0)
  1080. {
  1081. foreach (var item in param)
  1082. {
  1083. if (!string.IsNullOrEmpty(item) && dic.ContainsKey(item))
  1084. {
  1085. if (!dic.ContainsKey(to))
  1086. dic.Add(to, "");
  1087. var set = "";
  1088. switch (dic[item].ToLower())
  1089. {
  1090. case "open":
  1091. set = "true";
  1092. break;
  1093. case "close":
  1094. set = "false";
  1095. break;
  1096. case "continue":
  1097. set = "Continue";
  1098. break;
  1099. }
  1100. var value = $"{dic[to]};{item},{set}";
  1101. dic[to] = string.IsNullOrEmpty(dic[to]) ? $"{item},{set}" : value;
  1102. dic.Remove(item);
  1103. }
  1104. }
  1105. }
  1106. }
  1107. private static void AddParameter(ref Dictionary<string, string> dic, string to, string from1, string from2, string from3, string from4 = null)
  1108. {
  1109. var value = $"{dic[to]};{from1};{from2};{from3}";
  1110. if (!string.IsNullOrEmpty(from4))
  1111. value = $"{value};{from4}";
  1112. dic[to] = value;
  1113. }
  1114. private static void AddParameter(ref Dictionary<string, string> dic, string to, string[] param)
  1115. {
  1116. if (param != null && param.Length > 0)
  1117. {
  1118. foreach (var item in param)
  1119. {
  1120. if (!string.IsNullOrEmpty(item) && dic.ContainsKey(item))
  1121. {
  1122. if (!dic.ContainsKey(to))
  1123. dic.Add(to, "");
  1124. var value = $"{dic[to]};{dic[item]}";
  1125. dic[to] = string.IsNullOrEmpty(dic[to]) ? dic[item] : value;
  1126. dic.Remove(item);
  1127. }
  1128. }
  1129. }
  1130. }
  1131. private static void AddParameterValue(ref Dictionary<string, string> dic, string to, string[] param)
  1132. {
  1133. if (!dic.ContainsKey(to))
  1134. dic.Add(to, "");
  1135. if (param != null && param.Length > 0)
  1136. {
  1137. foreach (var item in param)
  1138. {
  1139. var value = $"{dic[to]};{item}";
  1140. dic[to] = string.IsNullOrEmpty(dic[to]) ? item : value;
  1141. }
  1142. }
  1143. }
  1144. public static bool ParseTables(string recipeFile, string module, out Dictionary<int, List<RecipeStep>> recipeDatas, out string reason, string recipeType)
  1145. {
  1146. reason = string.Empty;
  1147. recipeDatas = new Dictionary<int, List<RecipeStep>>();
  1148. string content = string.Empty;
  1149. if (recipeType != "Process" && recipeType != "Idle" && recipeType != "Reset")
  1150. {
  1151. if (!File.Exists($"{PathManager.GetRecipeDir()}\\{SC.GetStringValue("System.Recipe.SupportedChamberType")}\\{SC.GetStringValue($"System.Recipe.Supported{recipeType}Type")}\\{recipeFile}.rcp"))
  1152. return true;
  1153. }
  1154. content = RecipeFileManager.Instance.LoadRecipe($"{SC.GetStringValue("System.Recipe.SupportedChamberType")}\\{SC.GetStringValue($"System.Recipe.Supported{recipeType}Type")}", recipeFile, false);
  1155. if (string.IsNullOrEmpty(content))
  1156. {
  1157. reason = $"{recipeFile} is not a valid recipe file";
  1158. return false;
  1159. }
  1160. try
  1161. {
  1162. //获取工艺程序文件中允许的命令字符串列表
  1163. //目的:如果工艺程序文件中含有规定之外的命令,则被禁止执行
  1164. HashSet<string> recipeAllowedCommands = new HashSet<string>();
  1165. XmlDocument rcpFormatDoc = new XmlDocument();
  1166. string recipeSchema = PathManager.GetCfgDir() + $@"\Recipe\Furnace\Process\{SC.GetStringValue("System.SetUp.ToolType")}\RecipeFormat.xml";
  1167. rcpFormatDoc.Load(recipeSchema);
  1168. XmlNodeList rcpItemNodeList = rcpFormatDoc.SelectNodes("/Aitex/TableRecipeFormat/Catalog/Group/Step");
  1169. foreach (XmlElement item in rcpItemNodeList)
  1170. recipeAllowedCommands.Add(item.Attributes["ControlName"].Value);
  1171. recipeAllowedCommands.Add("Temperature.ControlMode");
  1172. recipeAllowedCommands.Add("Temperature.Correct");
  1173. recipeAllowedCommands.Add("Temperature.PID");
  1174. recipeAllowedCommands.Add("ConditionCheck");
  1175. recipeAllowedCommands.Add("EventSetting");
  1176. recipeAllowedCommands.Add("FilmThickFormula");
  1177. recipeAllowedCommands.Add("FilmThickCoefficientA");
  1178. recipeAllowedCommands.Add("FilmThickCoefficientB");
  1179. recipeAllowedCommands.Add("AlarmTableIndex");
  1180. recipeAllowedCommands.Add("RFSwitch");
  1181. recipeAllowedCommands.Add("RFSetpoint");
  1182. recipeAllowedCommands.Add("ForwardPowerAlarmWatchTable");
  1183. recipeAllowedCommands.Add("PrAlarmWatchTable");
  1184. recipeAllowedCommands.Add("PIAlarmWatchTable");
  1185. recipeAllowedCommands.Add("C1Setpoint");
  1186. recipeAllowedCommands.Add("C2Setpoint");
  1187. recipeAllowedCommands.Add("C1AlarmWatchTable");
  1188. recipeAllowedCommands.Add("C2AlarmWatchTable");
  1189. recipeAllowedCommands.Add("VppAlarmWatchTable");
  1190. recipeAllowedCommands.Add("VdcAlarmWatchTable");
  1191. recipeAllowedCommands.Add("PressureSonserValue");
  1192. recipeAllowedCommands.Add("PressureValveAngle");
  1193. recipeAllowedCommands.Add("PressureSettingVG");
  1194. recipeAllowedCommands.Add("PressCommand");
  1195. recipeAllowedCommands.Add("PressValue");
  1196. recipeAllowedCommands.Add("PressureAlarmTableNo");
  1197. recipeAllowedCommands.Add("AbortRecipeTableIndex");
  1198. recipeAllowedCommands.Add("AlarmConditionTable");
  1199. recipeAllowedCommands.Add("LoaderCommand");
  1200. recipeAllowedCommands.Add("LoaderValue");
  1201. for (int i = 1; i < 11; i++)
  1202. {
  1203. recipeAllowedCommands.Add($"AlarmAction.{i}");
  1204. recipeAllowedCommands.Add($"AlarmDetails.{i}");
  1205. }
  1206. for (int i = 1; i < 60; i++)
  1207. {
  1208. recipeAllowedCommands.Add($"MFC{i}.Flow.Set");
  1209. recipeAllowedCommands.Add($"MFC{i}.Flow.SetUnit");
  1210. recipeAllowedCommands.Add($"MFC{i}.Flow.Ramprate");
  1211. recipeAllowedCommands.Add($"MFC{i}.Flow.RamprateUnit");
  1212. recipeAllowedCommands.Add($"MFC{i}.Flow.Check");
  1213. recipeAllowedCommands.Add($"MFC{i}.Flow.High");
  1214. recipeAllowedCommands.Add($"MFC{i}.Flow.Low");
  1215. recipeAllowedCommands.Add($"MFC{i}.Flow.Unit");
  1216. }
  1217. for (int i = 1; i < 200; i++)
  1218. {
  1219. recipeAllowedCommands.Add($"AUX.{i}.Set");
  1220. recipeAllowedCommands.Add($"AUX.{i}.Check");
  1221. recipeAllowedCommands.Add($"AUX.{i}.High");
  1222. recipeAllowedCommands.Add($"AUX.{i}.Low");
  1223. recipeAllowedCommands.Add($"AUX.{i}.CheckUnit");
  1224. }
  1225. recipeAllowedCommands.Add("HeaterU.ZoneName");
  1226. recipeAllowedCommands.Add("HeaterU.Set");
  1227. recipeAllowedCommands.Add("HeaterU.SetUnit");
  1228. recipeAllowedCommands.Add("HeaterU.Ramprate");
  1229. recipeAllowedCommands.Add("HeaterU.RamprateUnit");
  1230. recipeAllowedCommands.Add("HeaterU.Check");
  1231. recipeAllowedCommands.Add("HeaterU.High");
  1232. recipeAllowedCommands.Add("HeaterU.Low");
  1233. recipeAllowedCommands.Add("HeaterU.Unit");
  1234. recipeAllowedCommands.Add("HeaterCU.ZoneName");
  1235. recipeAllowedCommands.Add("HeaterCU.Set");
  1236. recipeAllowedCommands.Add("HeaterCU.SetUnit");
  1237. recipeAllowedCommands.Add("HeaterCU.Ramprate");
  1238. recipeAllowedCommands.Add("HeaterCU.RamprateUnit");
  1239. recipeAllowedCommands.Add("HeaterCU.Check");
  1240. recipeAllowedCommands.Add("HeaterCU.High");
  1241. recipeAllowedCommands.Add("HeaterCU.Low");
  1242. recipeAllowedCommands.Add("HeaterCU.Unit");
  1243. recipeAllowedCommands.Add("HeaterC.ZoneName");
  1244. recipeAllowedCommands.Add("HeaterC.Set");
  1245. recipeAllowedCommands.Add("HeaterC.SetUnit");
  1246. recipeAllowedCommands.Add("HeaterC.Ramprate");
  1247. recipeAllowedCommands.Add("HeaterC.RamprateUnit");
  1248. recipeAllowedCommands.Add("HeaterC.Check");
  1249. recipeAllowedCommands.Add("HeaterC.High");
  1250. recipeAllowedCommands.Add("HeaterC.Low");
  1251. recipeAllowedCommands.Add("HeaterC.Unit");
  1252. recipeAllowedCommands.Add("HeaterCL.ZoneName");
  1253. recipeAllowedCommands.Add("HeaterCL.Set");
  1254. recipeAllowedCommands.Add("HeaterCL.SetUnit");
  1255. recipeAllowedCommands.Add("HeaterCL.Ramprate");
  1256. recipeAllowedCommands.Add("HeaterCL.RamprateUnit");
  1257. recipeAllowedCommands.Add("HeaterCL.Check");
  1258. recipeAllowedCommands.Add("HeaterCL.High");
  1259. recipeAllowedCommands.Add("HeaterCL.Low");
  1260. recipeAllowedCommands.Add("HeaterCL.Unit");
  1261. recipeAllowedCommands.Add("HeaterL.ZoneName");
  1262. recipeAllowedCommands.Add("HeaterL.Set");
  1263. recipeAllowedCommands.Add("HeaterL.SetUnit");
  1264. recipeAllowedCommands.Add("HeaterL.Ramprate");
  1265. recipeAllowedCommands.Add("HeaterL.RamprateUnit");
  1266. recipeAllowedCommands.Add("HeaterL.Check");
  1267. recipeAllowedCommands.Add("HeaterL.High");
  1268. recipeAllowedCommands.Add("HeaterL.Low");
  1269. recipeAllowedCommands.Add("HeaterL.Unit");
  1270. recipeAllowedCommands.Add("Loader.Command");
  1271. recipeAllowedCommands.Add("Loader.Speed1");
  1272. recipeAllowedCommands.Add("Loader.Speed2");
  1273. recipeAllowedCommands.Add("Loader.Speed3");
  1274. recipeAllowedCommands.Add("Loader.RPM");
  1275. recipeAllowedCommands.Add("Press.Command");
  1276. recipeAllowedCommands.Add("Press.PID");
  1277. recipeAllowedCommands.Add("Press.Set");
  1278. recipeAllowedCommands.Add("Press.SlowVacSet");
  1279. recipeAllowedCommands.Add("Press.ValveAngleSet");
  1280. recipeAllowedCommands.Add("Press.IsWait");
  1281. recipeAllowedCommands.Add("Press.LowWait");
  1282. recipeAllowedCommands.Add("Press.HighWait");
  1283. recipeAllowedCommands.Add("Press.WaitUnit");
  1284. recipeAllowedCommands.Add("Press.WaitPress");
  1285. //获取工艺程序文件中所有步的内容
  1286. XmlDocument rcpDataDoc = new XmlDocument();
  1287. rcpDataDoc.LoadXml(content);
  1288. XmlNodeList tablesNodeList = rcpDataDoc.SelectNodes("//Tables/Table");
  1289. if (tablesNodeList == null || tablesNodeList.Count == 0)
  1290. {
  1291. reason = "No Table nodes found.";
  1292. return false;
  1293. }
  1294. for (int x = 0; x < tablesNodeList.Count; x++)
  1295. {
  1296. XmlNode tableNode = tablesNodeList[x];
  1297. // 获取当前 Table 下的所有 Step 节点
  1298. XmlNodeList stepNodes = tableNode.SelectNodes("Step");
  1299. #region
  1300. string strLoopEndStep, strJumpStep;
  1301. strLoopEndStep = strJumpStep = string.Empty;
  1302. var recipeData = new List<RecipeStep>();
  1303. for (int i = 0; i < stepNodes.Count; i++)
  1304. {
  1305. var recipeStep = new RecipeStep();
  1306. recipeStep.RecipeType = recipeType;
  1307. recipeData.Add(recipeStep);
  1308. XmlElement stepNode = stepNodes[i] as XmlElement;
  1309. Dictionary<string, string> dic = new Dictionary<string, string>();
  1310. //遍历Step节点
  1311. foreach (XmlAttribute att in stepNode.Attributes)
  1312. {
  1313. if (recipeAllowedCommands.Contains(att.Name))
  1314. {
  1315. dic.Add(att.Name, att.Value);
  1316. }
  1317. }
  1318. //遍历Step子节点中所有的attribute属性节点
  1319. foreach (XmlElement subStepNode in stepNode.ChildNodes)
  1320. {
  1321. foreach (XmlAttribute att in subStepNode.Attributes)
  1322. {
  1323. if (recipeAllowedCommands.Contains(att.Name))
  1324. {
  1325. dic.Add(att.Name, att.Value);
  1326. }
  1327. }
  1328. //遍历Step子节点的子节点中所有的attribute属性节点
  1329. foreach (XmlElement subsubStepNode in subStepNode.ChildNodes)
  1330. {
  1331. foreach (XmlAttribute att in subsubStepNode.Attributes)
  1332. {
  1333. if (recipeAllowedCommands.Contains(att.Name))
  1334. {
  1335. dic.Add(att.Name, att.Value);
  1336. }
  1337. }
  1338. }
  1339. }
  1340. recipeStep.StepName = dic["Name"];
  1341. if (dic["Name"] == strLoopEndStep)
  1342. {
  1343. recipeStep.IsLoopEndStep = true;
  1344. strLoopEndStep = string.Empty;
  1345. }
  1346. recipeStep.IsJumpStep = false;
  1347. if (dic.ContainsKey("Command"))
  1348. {
  1349. string commandStr = dic["Command"];
  1350. if (commandStr.Contains("CallSystemRecipe"))
  1351. {
  1352. }
  1353. else if (commandStr.ToUpper().StartsWith("CALL"))
  1354. {
  1355. int subTableID = 0;
  1356. var subPara = commandStr.Replace("CALL", "").Replace("[", "").Replace("]", "").Split('*');
  1357. if (subPara != null && subPara.Length > 1)
  1358. {
  1359. int.TryParse(subPara[0], out int loopCount);
  1360. var tablePara = subPara[1].Split(':');
  1361. if (tablePara != null && tablePara.Length > 1)
  1362. {
  1363. int.TryParse(tablePara[0], out subTableID);
  1364. if (subTableID > 0)
  1365. {
  1366. recipeStep.IsCallSubStep = true;
  1367. recipeStep.SubRecipeLoopCount = loopCount;
  1368. }
  1369. }
  1370. recipeStep.SubRecipeTableInfo = subPara[1];
  1371. }
  1372. }
  1373. else if (commandStr.ToUpper().StartsWith("LOOP"))
  1374. {
  1375. recipeStep.IsLoopEndStep = true;
  1376. var loopPara = commandStr.Replace("LOOP", "").Replace("[", "").Replace("]", "").Split('*');
  1377. if (loopPara != null && loopPara.Length > 1)
  1378. {
  1379. int.TryParse(loopPara[0], out int loopCount);
  1380. recipeStep.LoopCount = loopCount + 1;//加1是因为第一次从正常的start-》end的执行算是一次循环,所以要额外加1
  1381. int loopStartStep = -1;
  1382. for (int index = 0; index < recipeData.Count; index++)
  1383. {
  1384. if (recipeData[index].StepName == loopPara[1])
  1385. {
  1386. loopStartStep = index;
  1387. break;
  1388. }
  1389. }
  1390. if (loopStartStep < 0)
  1391. {
  1392. reason = $"Recipe file does not contains LOOP step {loopPara[1]}";
  1393. return false;
  1394. }
  1395. if (loopPara[1] != null)
  1396. {
  1397. if (loopStartStep < 0 ||
  1398. (recipeType == "Process" && loopStartStep == 0))//Process recipe的standby不参与循环
  1399. recipeStep.IsLoopEndStep = false;
  1400. else
  1401. {
  1402. recipeStep.LoopStartStep = loopStartStep;
  1403. if (recipeData.Count > loopStartStep)
  1404. {
  1405. recipeData[loopStartStep].IsLoopStartStep = true;
  1406. recipeData[loopStartStep].LoopCount = loopCount + 1;
  1407. recipeStep.LoopEndStep = recipeType == "Process" ? i + 1 : i;//Process recipe包含standby,从0开始;其他recipe不包含standby
  1408. }
  1409. }
  1410. }
  1411. }
  1412. }
  1413. else if (commandStr.ToUpper().StartsWith("JUMP"))
  1414. {
  1415. var jumpPara = commandStr.Replace("Jump:", string.Empty).Replace("[", "").Replace("]", "");//JumpStepNo
  1416. if (jumpPara != null)
  1417. {
  1418. //int.TryParse(jumpPara[0], out int jumpStepNo);
  1419. //recipeStep.JumpStepNo = recipeType == "Process" ? jumpStepNo : jumpStepNo - 1;//Process recipe包含standby,从0开始;其他recipe不包含standby
  1420. recipeStep.IsJumpStep = true;
  1421. recipeStep.JumpStepName = jumpPara;
  1422. }
  1423. }
  1424. }
  1425. if (dic.ContainsKey("AbortRecipeTableIndex"))
  1426. {
  1427. if (dic["AbortRecipeTableIndex"].ToLower() != "none")
  1428. {
  1429. recipeStep.AbortRecipeTableInfo = dic["AbortRecipeTableIndex"];
  1430. }
  1431. recipeStep.AbortRecipeSteps = null;
  1432. }
  1433. if (dic.ContainsKey("EventSetting"))
  1434. {
  1435. string eventSettingStr = dic["EventSetting"];
  1436. if (eventSettingStr.ToLower() == "start")
  1437. {
  1438. recipeStep.IsTimeMeasurementStartStep = true;
  1439. }
  1440. else if (eventSettingStr.ToLower() == "stop")
  1441. {
  1442. recipeStep.IsTimeMeasurementStopStep = true;
  1443. }
  1444. }
  1445. if (dic.ContainsKey("FilmThickFormula"))
  1446. {
  1447. recipeStep.FilmThickFormula = dic["FilmThickFormula"];
  1448. }
  1449. if (dic.ContainsKey("FilmThickCoefficientA"))
  1450. {
  1451. recipeStep.FilmThickCoefficientA = float.Parse(dic["FilmThickCoefficientA"]);
  1452. }
  1453. if (dic.ContainsKey("FilmThickCoefficientB"))
  1454. {
  1455. recipeStep.FilmThickCoefficientB = float.Parse(dic["FilmThickCoefficientB"]);
  1456. }
  1457. if (dic.ContainsKey("AlarmConditionTable"))
  1458. {
  1459. recipeStep.AlarmConditionTable = dic["AlarmConditionTable"];
  1460. }
  1461. for (int j = 1; j < 11; j++)
  1462. {
  1463. string tempType = "Ignore Alarm";
  1464. string tempDetails = "";
  1465. if (dic.ContainsKey($"AlarmAction.{j}"))
  1466. {
  1467. tempType = dic[$"AlarmAction.{j}"];
  1468. }
  1469. if (dic.ContainsKey($"AlarmDetails.{j}"))
  1470. {
  1471. tempDetails = dic[$"AlarmDetails.{j}"];
  1472. }
  1473. recipeStep.AlarmActionSets.Add(j, new AlarmActions()
  1474. {
  1475. ProcessingType = tempType,
  1476. ProcessingDetails = tempDetails
  1477. });
  1478. }
  1479. //if(dic.ContainsKey("Loop"))
  1480. //{
  1481. // string loopStr = dic["Loop"];
  1482. // recipeStep.IsLoopStartStep = System.Text.RegularExpressions.Regex.Match(loopStr, @"Loop\x20\d+\s*$").Success;
  1483. // recipeStep.IsLoopEndStep = System.Text.RegularExpressions.Regex.Match(loopStr, @"Loop End$").Success;
  1484. // if (recipeStep.IsLoopStartStep)
  1485. // recipeStep.LoopCount = Convert.ToInt32(loopStr.Replace("Loop", string.Empty));
  1486. // else
  1487. // recipeStep.LoopCount = 0;
  1488. //}
  1489. //recipe time
  1490. if (dic["Name"].ToLower() == "standby")
  1491. {
  1492. if (DateTime.TryParse(dic["Time"], out DateTime time))
  1493. {
  1494. recipeStep.StepTime = time.Second + time.Minute * 60 + time.Hour * 3600 + time.Millisecond / 1000.0;
  1495. }
  1496. else if (float.TryParse(dic["Time"], out float timeInSec))
  1497. {
  1498. recipeStep.StepTime = timeInSec;
  1499. recipeStep.EndBy = EnumEndByCondition.ByTime;
  1500. }
  1501. else
  1502. {
  1503. recipeStep.StepTime = 0;
  1504. recipeStep.EndBy = EnumEndByCondition.ByStandbyFactor;
  1505. }
  1506. }
  1507. else
  1508. {
  1509. if (System.Text.RegularExpressions.Regex.Match(dic["Time"], @"[a-zA-Z]").Success)
  1510. {
  1511. if (SC.ContainsItem($"{module}.RecipeEditParameter.StepTime.{dic["Time"]}"))
  1512. {
  1513. var time = DateTime.Parse(SC.GetStringValue($"{module}.RecipeEditParameter.StepTime.{dic["Time"]}"));
  1514. recipeStep.StepTime = time.Second + time.Minute * 60 + time.Hour * 3600;
  1515. }
  1516. else
  1517. {
  1518. reason = $"Configuration does not contains step time config {dic["Time"]}";
  1519. return false;
  1520. }
  1521. }
  1522. else
  1523. {
  1524. if (DateTime.TryParse(dic["Time"], out DateTime time))
  1525. {
  1526. recipeStep.StepTime = time.Second + time.Minute * 60 + time.Hour * 3600 + time.Millisecond / 1000.0;
  1527. }
  1528. else if (float.TryParse(dic["Time"], out float timeInSec))
  1529. {
  1530. recipeStep.StepTime = timeInSec;
  1531. }
  1532. else
  1533. {
  1534. reason = $"Step time {dic["Time"]} is invalid";
  1535. return false;
  1536. }
  1537. }
  1538. if (dic["ConditionCheck"].ToLower() == "none")
  1539. {
  1540. recipeStep.EndBy = EnumEndByCondition.ByTime;
  1541. }
  1542. else
  1543. {
  1544. recipeStep.EndBy = EnumEndByCondition.ByStandbyFactor;
  1545. }
  1546. }
  1547. //ReplaceControlName(ref dic, "GasLineMFC1.Flow", "MFC1.SetParameters");
  1548. //ReplaceControlName(ref dic, "GasLineMFC2.Flow", "MFC2.SetParameters");
  1549. //ReplaceControlName(ref dic, "GasLineMFC3.Flow", "MFC3.SetParameters");
  1550. //ReplaceControlName(ref dic, "GasLineMFC4.Flow", "MFC4.SetParameters");
  1551. //ReplaceControlName(ref dic, "GasLineMFC5.Flow", "MFC5.SetParameters");
  1552. //ReplaceControlName(ref dic, "GasLineMFC6.Flow", "MFC6.SetParameters");
  1553. //ReplaceControlName(ref dic, "GasLineMFC7.Flow", "MFC7.SetParameters");
  1554. //ReplaceControlName(ref dic, "GasLineMFC8.Flow", "MFC8.SetParameters");
  1555. //ReplaceControlName(ref dic, "GasLineMFC9.Flow", "MFC9.SetParameters");
  1556. //ReplaceControlName(ref dic, "GasLineMFC10.Flow", "MFC10.SetParameters");
  1557. //ReplaceControlName(ref dic, "GasLineMFC11.Flow", "MFC11.SetParameters");
  1558. //ReplaceControlName(ref dic, "GasLineMFC12.Flow", "MFC12.SetParameters");
  1559. //ReplaceControlName(ref dic, "GasLineMFC51.Flow", "MFC51.SetParameters");
  1560. AddParameter(ref dic, "MFC1.SetParameters", new string[8] { "MFC1.Flow.Set", "MFC1.Flow.Ramprate", "MFC1.Flow.SetUnit", "MFC1.Flow.RamprateUnit", "MFC1.Flow.Check", "MFC1.Flow.High", "MFC1.Flow.Low", "MFC1.Flow.Unit" });
  1561. AddParameter(ref dic, "MFC2.SetParameters", new string[8] { "MFC2.Flow.Set", "MFC2.Flow.Ramprate", "MFC2.Flow.SetUnit", "MFC2.Flow.RamprateUnit", "MFC2.Flow.Check", "MFC2.Flow.High", "MFC2.Flow.Low", "MFC2.Flow.Unit" });
  1562. AddParameter(ref dic, "MFC3.SetParameters", new string[8] { "MFC3.Flow.Set", "MFC3.Flow.Ramprate", "MFC3.Flow.SetUnit", "MFC3.Flow.RamprateUnit", "MFC3.Flow.Check", "MFC3.Flow.High", "MFC3.Flow.Low", "MFC3.Flow.Unit" });
  1563. AddParameter(ref dic, "MFC4.SetParameters", new string[8] { "MFC4.Flow.Set", "MFC4.Flow.Ramprate", "MFC4.Flow.SetUnit", "MFC4.Flow.RamprateUnit", "MFC4.Flow.Check", "MFC4.Flow.High", "MFC4.Flow.Low", "MFC4.Flow.Unit" });
  1564. AddParameter(ref dic, "MFC5.SetParameters", new string[8] { "MFC5.Flow.Set", "MFC5.Flow.Ramprate", "MFC5.Flow.SetUnit", "MFC5.Flow.RamprateUnit", "MFC5.Flow.Check", "MFC5.Flow.High", "MFC5.Flow.Low", "MFC5.Flow.Unit" });
  1565. AddParameter(ref dic, "MFC6.SetParameters", new string[8] { "MFC6.Flow.Set", "MFC6.Flow.Ramprate", "MFC6.Flow.SetUnit", "MFC6.Flow.RamprateUnit", "MFC6.Flow.Check", "MFC6.Flow.High", "MFC6.Flow.Low", "MFC6.Flow.Unit" });
  1566. AddParameter(ref dic, "MFC7.SetParameters", new string[8] { "MFC7.Flow.Set", "MFC7.Flow.Ramprate", "MFC7.Flow.SetUnit", "MFC7.Flow.RamprateUnit", "MFC7.Flow.Check", "MFC7.Flow.High", "MFC7.Flow.Low", "MFC7.Flow.Unit" });
  1567. AddParameter(ref dic, "MFC8.SetParameters", new string[8] { "MFC8.Flow.Set", "MFC8.Flow.Ramprate", "MFC8.Flow.SetUnit", "MFC8.Flow.RamprateUnit", "MFC8.Flow.Check", "MFC8.Flow.High", "MFC8.Flow.Low", "MFC8.Flow.Unit" });
  1568. AddParameter(ref dic, "MFC9.SetParameters", new string[8] { "MFC9.Flow.Set", "MFC9.Flow.Ramprate", "MFC9.Flow.SetUnit", "MFC9.Flow.RamprateUnit", "MFC9.Flow.Check", "MFC9.Flow.High", "MFC9.Flow.Low", "MFC9.Flow.Unit" });
  1569. AddParameter(ref dic, "MFC10.SetParameters", new string[8] { "MFC10.Flow.Set", "MFC10.Flow.Ramprate", "MFC10.Flow.SetUnit", "MFC10.Flow.RamprateUnit", "MFC10.Flow.Check", "MFC10.Flow.High", "MFC10.Flow.Low", "MFC10.Flow.Unit" });
  1570. AddParameter(ref dic, "MFC11.SetParameters", new string[8] { "MFC11.Flow.Set", "MFC11.Flow.Ramprate", "MFC11.Flow.SetUnit", "MFC11.Flow.RamprateUnit", "MFC11.Flow.Check", "MFC11.Flow.High", "MFC11.Flow.Low", "MFC11.Flow.Unit" });
  1571. AddParameter(ref dic, "MFC12.SetParameters", new string[8] { "MFC12.Flow.Set", "MFC12.Flow.Ramprate", "MFC12.Flow.SetUnit", "MFC12.Flow.RamprateUnit", "MFC12.Flow.Check", "MFC12.Flow.High", "MFC12.Flow.Low", "MFC12.Flow.Unit" });
  1572. AddParameter(ref dic, "MFC13.SetParameters", new string[8] { "MFC13.Flow.Set", "MFC13.Flow.Ramprate", "MFC13.Flow.SetUnit", "MFC13.Flow.RamprateUnit", "MFC13.Flow.Check", "MFC13.Flow.High", "MFC13.Flow.Low", "MFC13.Flow.Unit" });
  1573. AddParameter(ref dic, "MFC14.SetParameters", new string[8] { "MFC14.Flow.Set", "MFC14.Flow.Ramprate", "MFC14.Flow.SetUnit", "MFC14.Flow.RamprateUnit", "MFC14.Flow.Check", "MFC14.Flow.High", "MFC14.Flow.Low", "MFC14.Flow.Unit" });
  1574. AddParameter(ref dic, "MFC15.SetParameters", new string[8] { "MFC15.Flow.Set", "MFC15.Flow.Ramprate", "MFC15.Flow.SetUnit", "MFC15.Flow.RamprateUnit", "MFC15.Flow.Check", "MFC15.Flow.High", "MFC15.Flow.Low", "MFC15.Flow.Unit" });
  1575. AddParameter(ref dic, "MFC16.SetParameters", new string[8] { "MFC16.Flow.Set", "MFC16.Flow.Ramprate", "MFC16.Flow.SetUnit", "MFC16.Flow.RamprateUnit", "MFC16.Flow.Check", "MFC16.Flow.High", "MFC16.Flow.Low", "MFC16.Flow.Unit" });
  1576. AddParameter(ref dic, "MFC17.SetParameters", new string[8] { "MFC17.Flow.Set", "MFC17.Flow.Ramprate", "MFC17.Flow.SetUnit", "MFC17.Flow.RamprateUnit", "MFC17.Flow.Check", "MFC17.Flow.High", "MFC17.Flow.Low", "MFC17.Flow.Unit" });
  1577. AddParameter(ref dic, "MFC31.SetParameters", new string[8] { "MFC31.Flow.Set", "MFC31.Flow.Ramprate", "MFC31.Flow.SetUnit", "MFC31.Flow.RamprateUnit", "MFC31.Flow.Check", "MFC31.Flow.High", "MFC31.Flow.Low", "MFC31.Flow.Unit" });
  1578. AddParameter(ref dic, "MFC32.SetParameters", new string[8] { "MFC32.Flow.Set", "MFC32.Flow.Ramprate", "MFC32.Flow.SetUnit", "MFC32.Flow.RamprateUnit", "MFC32.Flow.Check", "MFC32.Flow.High", "MFC32.Flow.Low", "MFC32.Flow.Unit" });
  1579. //AddParameter(ref dic, "MFC51.SetParameters", new string[8] { "MFC51.Flow.Set", "MFC51.Flow.Ramprate", "MFC51.Flow.SetUnit", "MFC51.Flow.RamprateUnit", "MFC51.Flow.Check", "MFC51.Flow.High", "MFC51.Flow.Low", "MFC51.Flow.Unit" });
  1580. ReplaceControlName(ref dic, "MFM57Flow", "MFM57.SetParameters");
  1581. ReplaceControlName(ref dic, "MFM1Flow", "MFM1.SetParameters");
  1582. ReplaceControlName(ref dic, "MFM6Flow", "MFM6.SetParameters");
  1583. ReplaceControlName(ref dic, "MFM7Flow", "MFM7.SetParameters");
  1584. ReplaceControlName(ref dic, "MFM8Flow", "MFM8.SetParameters");
  1585. ReplaceControlName(ref dic, "MFM9Flow", "MFM9.SetParameters");
  1586. ReplaceControlName(ref dic, "MFM11Flow", "MFM11.SetParameters");
  1587. ReplaceControlName(ref dic, "MFM12Flow", "MFM12.SetParameters");
  1588. ReplaceControlName(ref dic, "MFM13Flow", "MFM13.SetParameters");
  1589. ReplaceControlName(ref dic, "MFM16Flow", "MFM16.SetParameters");
  1590. ReplaceControlName(ref dic, "ConditionCheck", "SetConditionCheck");
  1591. ReplaceControlName(ref dic, "Command", "SetCommand");
  1592. if (dic.ContainsKey("AlarmConditionTable"))
  1593. ReplaceControlName(ref dic, "AlarmConditionTable", "SetAlarmConditionTable");
  1594. //ReplaceControlName(ref dic, "Heater2", "ZoneU.SetParameters");
  1595. //ReplaceControlName(ref dic, "Heater4", "ZoneCU.SetParameters");
  1596. //ReplaceControlName(ref dic, "Heater6", "ZoneC.SetParameters");
  1597. //ReplaceControlName(ref dic, "Heater8", "ZoneCL.SetParameters");
  1598. //ReplaceControlName(ref dic, "Heater10", "ZoneL.SetParameters");
  1599. var controlMode = dic["Temperature.ControlMode"];
  1600. var correct = dic["Temperature.Correct"];
  1601. var PID = dic["Temperature.PID"];
  1602. //AddParameter(ref dic, "ZoneU.SetParameters", controlMode, correct, PID);
  1603. //AddParameter(ref dic, "ZoneCU.SetParameters", controlMode, correct, PID);
  1604. //AddParameter(ref dic, "ZoneC.SetParameters", controlMode, correct, PID);
  1605. //AddParameter(ref dic, "ZoneCL.SetParameters", controlMode, correct, PID);
  1606. //AddParameter(ref dic, "ZoneL.SetParameters", controlMode, correct, PID);
  1607. AddParameter(ref dic, "HeaterU.SetParameters", new string[9] { "HeaterU.ZoneName", "HeaterU.Set", "HeaterU.SetUnit", "HeaterU.Ramprate", "HeaterU.RamprateUnit", "HeaterU.Check", "HeaterU.High", "HeaterU.Low", "HeaterU.Unit" });
  1608. AddParameterValue(ref dic, "HeaterU.SetParameters", new string[8] { controlMode, correct, PID, "", "", "", dic["ValveAV91"], dic["BWR"] });
  1609. AddParameter(ref dic, "HeaterCU.SetParameters", new string[9] { "HeaterCU.ZoneName", "HeaterCU.Set", "HeaterCU.SetUnit", "HeaterCU.Ramprate", "HeaterCU.RamprateUnit", "HeaterCU.Check", "HeaterCU.High", "HeaterCU.Low", "HeaterCU.Unit" });
  1610. AddParameterValue(ref dic, "HeaterCU.SetParameters", new string[8] { controlMode, correct, PID, "", "", "", dic["ValveAV91"], dic["BWR"] });
  1611. AddParameter(ref dic, "HeaterC.SetParameters", new string[9] { "HeaterC.ZoneName", "HeaterC.Set", "HeaterC.SetUnit", "HeaterC.Ramprate", "HeaterC.RamprateUnit", "HeaterC.Check", "HeaterC.High", "HeaterC.Low", "HeaterC.Unit" });
  1612. AddParameterValue(ref dic, "HeaterC.SetParameters", new string[8] { controlMode, correct, PID, "", "", "", dic["ValveAV91"], dic["BWR"] });
  1613. AddParameter(ref dic, "HeaterCL.SetParameters", new string[9] { "HeaterCL.ZoneName", "HeaterCL.Set", "HeaterCL.SetUnit", "HeaterCL.Ramprate", "HeaterCL.RamprateUnit", "HeaterCL.Check", "HeaterCL.High", "HeaterCL.Low", "HeaterCL.Unit" });
  1614. AddParameterValue(ref dic, "HeaterCL.SetParameters", new string[8] { controlMode, correct, PID, "", "", "", dic["ValveAV91"], dic["BWR"] });
  1615. AddParameter(ref dic, "HeaterL.SetParameters", new string[9] { "HeaterL.ZoneName", "HeaterL.Set", "HeaterL.SetUnit", "HeaterL.Ramprate", "HeaterL.RamprateUnit", "HeaterL.Check", "HeaterL.High", "HeaterL.Low", "HeaterL.Unit" });
  1616. AddParameterValue(ref dic, "HeaterL.SetParameters", new string[8] { controlMode, correct, PID, "", "", "", dic["ValveAV91"], dic["BWR"] });
  1617. AddParameter(ref dic, "APC.SetParameters", new string[10] { "Press.Command", "Press.PID", "Press.Set", "Press.SlowVacSet", "Press.ValveAngleSet", "Press.IsWait", "Press.LowWait", "Press.HighWait", "Press.WaitUnit", "Press.WaitPress" });//APC
  1618. AddParameterValue(ref dic, "APC.SetParameters", new string[2] { "", dic["ValveAV71"] });//APC
  1619. AddParameter(ref dic, "SetBoatMotion", new string[5] { "Loader.Command", "Loader.Speed1", "Loader.Speed2", "Loader.Speed3", "Loader.RPM" });//Boat
  1620. List<string> auxCommands = new List<string>();
  1621. for (int k = 1; k < 200; k++)
  1622. {
  1623. if (!dic.ContainsKey($"AUX.{k}.Set"))
  1624. continue;
  1625. auxCommands.Add($"{k},{dic[$"AUX.{k}.Set"]},{dic[$"AUX.{k}.Check"]},{dic[$"AUX.{k}.High"]},{dic[$"AUX.{k}.Low"]},{dic[$"AUX.{k}.CheckUnit"]}");
  1626. dic.Remove($"AUX.{k}.Set");
  1627. dic.Remove($"AUX.{k}.Check");
  1628. dic.Remove($"AUX.{k}.High");
  1629. dic.Remove($"AUX.{k}.Low");
  1630. dic.Remove($"AUX.{k}.CheckUnit");
  1631. }
  1632. dic.Add("AUX.SetParameters", string.Join(";", auxCommands));
  1633. //ReplaceControlName(ref dic, "RFSwitch", "RfPower.SetParameters");
  1634. //AddParameter(ref dic, "RfPower.SetParameters", dic["RFSetpoint"], dic["ForwardPowerAlarmWatchTable"], dic["PrAlarmWatchTable"], dic["PIAlarmWatchTable"]);
  1635. //ReplaceControlName(ref dic, "C1Setpoint", "RfMatch.SetParameters");
  1636. //AddParameter(ref dic, "RfMatch.SetParameters", dic["C2Setpoint"], dic["C1AlarmWatchTable"], dic["C2AlarmWatchTable"], dic["VppAlarmWatchTable"]);
  1637. AddValveParameter(ref dic, "SetValves", new string[153] {
  1638. "ValveAV1",
  1639. "ValveAV2",
  1640. "ValveAV3",
  1641. "ValveAV4",
  1642. "ValveAV5",
  1643. "ValveAV6",
  1644. "ValveAV7",
  1645. "ValveAV8",
  1646. "ValveAV9",
  1647. "ValveAV10",
  1648. "ValveAV11",
  1649. "ValveAV12",
  1650. "ValveAV13",
  1651. "ValveAV14",
  1652. "ValveAV15",
  1653. "ValveAV16",
  1654. "ValveAV17",
  1655. "ValveAV18",
  1656. "ValveAV19",
  1657. "ValveAV20",
  1658. "ValveAV21",
  1659. "ValveAV22",
  1660. "ValveAV23",
  1661. "ValveAV24",
  1662. "ValveAV25",
  1663. "ValveAV26",
  1664. "ValveAV27",
  1665. "ValveAV28",
  1666. "ValveAV29",
  1667. "ValveAV30",
  1668. "ValveAV31",
  1669. "ValveAV32",
  1670. "ValveAV33",
  1671. "ValveAV34",
  1672. "ValveAV35",
  1673. "ValveAV36",
  1674. "ValveAV37",
  1675. "ValveAV38",
  1676. "ValveAV39",
  1677. "ValveAV40",
  1678. "ValveAV41",
  1679. "ValveAV42",
  1680. "ValveAV43",
  1681. "ValveAV44",
  1682. "ValveAV45",
  1683. "ValveAV46",
  1684. "ValveAV47",
  1685. "ValveAV48",
  1686. "ValveAV49",
  1687. "ValveAV50",
  1688. "ValveAV51",
  1689. "ValveAV52",
  1690. "ValveAV53",
  1691. "ValveAV60",
  1692. "ValveAV61",
  1693. "ValveAV62",
  1694. "ValveAV63",
  1695. "ValveAV64",
  1696. "ValveAV65",
  1697. "ValveAV66",
  1698. "ValveAV67",
  1699. "ValveAV68",
  1700. "ValveAV69",
  1701. "ValveAV70",
  1702. "ValveAV71",
  1703. "ValveAV72",
  1704. "ValveAV73",
  1705. "ValveAV74",
  1706. "ValveAV75",
  1707. "ValveAV76",
  1708. "ValveAV77",
  1709. "ValveAV78",
  1710. "ValveAV79",
  1711. "ValveAV80",
  1712. "ValveAV81",
  1713. "ValveAV82",
  1714. "ValveAV83",
  1715. "ValveAV84",
  1716. "ValveAV85",
  1717. "ValveAV86",
  1718. "ValveAV87",
  1719. "ValveAV88",
  1720. "ValveAV89",
  1721. "ValveAV90",
  1722. "ValveAV91",
  1723. "ValveAV92",
  1724. "ValveAV93",
  1725. "ValveAV94",
  1726. "ValveAV95",
  1727. "ValveAV96",
  1728. "ValveAV97",
  1729. "ValveAV98",
  1730. "ValveAV99",
  1731. "ValveAV100",
  1732. "ValveAV101",
  1733. "ValveAV102",
  1734. "ValveAV103",
  1735. "ValveAV104",
  1736. "ValveAV105",
  1737. "ValveAV106",
  1738. "ValveAV107",
  1739. "ValveAV108",
  1740. "ValveAV109",
  1741. "ValveAV110",
  1742. "ValveAV111",
  1743. "ValveAV112",
  1744. "ValveAV113",
  1745. "ValveAV114",
  1746. "ValveAV115",
  1747. "ValveAV116",
  1748. "ValveAV117",
  1749. "ValveAV118",
  1750. "ValveAV119",
  1751. "ValveAV120",
  1752. "ValveAV121",
  1753. "ValveAV122",
  1754. "ValveAV123",
  1755. "ValveAV124",
  1756. "ValveAV125",
  1757. "ValveAV126",
  1758. "ValveAV127",
  1759. "ValveAV128",
  1760. "ValveAV129",
  1761. "ValveAV130",
  1762. "ValveAV131",
  1763. "ValveAV132",
  1764. "ValveAV133",
  1765. "ValveAV134",
  1766. "ValveAV135",
  1767. "ValveAV136",
  1768. "DPR",
  1769. "AGV",
  1770. "AGV2",
  1771. "MBP",
  1772. "MBP1",
  1773. "MBP2",
  1774. "DP",
  1775. "BWR",
  1776. "F2Cln",
  1777. "HFCln",
  1778. "CEXH",
  1779. "DEPO",
  1780. "HTR1",
  1781. "HTR2",
  1782. "HTR3",
  1783. "DP1",
  1784. "DP2",
  1785. "HMNT",
  1786. "CMNT",
  1787. "HREF",
  1788. "CREF",
  1789. "HZERO",
  1790. "CZERO"
  1791. });
  1792. //dic.Remove("SetValves");
  1793. //dic.Remove("HeaterU.SetParameters");
  1794. //dic.Remove("HeaterCU.SetParameters");
  1795. //dic.Remove("HeaterC.SetParameters");
  1796. //dic.Remove("HeaterCL.SetParameters");
  1797. //dic.Remove("HeaterL.SetParameters");
  1798. //dic.Remove("MFC1.SetParameters");
  1799. //dic.Remove("MFC2.SetParameters");
  1800. //dic.Remove("MFC3.SetParameters");
  1801. //dic.Remove("MFC4.SetParameters");
  1802. //dic.Remove("MFC5.SetParameters");
  1803. //dic.Remove("MFC6.SetParameters");
  1804. //dic.Remove("MFC7.SetParameters");
  1805. //dic.Remove("MFC8.SetParameters");
  1806. //dic.Remove("MFC9.SetParameters");
  1807. //dic.Remove("MFC10.SetParameters");
  1808. //dic.Remove("MFC11.SetParameters");
  1809. //dic.Remove("MFC12.SetParameters");
  1810. //ReplaceControlNameForValve(ref dic, "ValveAV1");
  1811. //ReplaceControlNameForValve(ref dic, "ValveAV2");
  1812. //ReplaceControlNameForValve(ref dic, "ValveAV3");
  1813. //ReplaceControlNameForValve(ref dic, "ValveAV4");
  1814. //ReplaceControlNameForValve(ref dic, "ValveAV5");
  1815. //ReplaceControlNameForValve(ref dic, "ValveAV6");
  1816. //ReplaceControlNameForValve(ref dic, "ValveAV7");
  1817. //ReplaceControlNameForValve(ref dic, "ValveAV8");
  1818. //ReplaceControlNameForValve(ref dic, "ValveAV9");
  1819. //ReplaceControlNameForValve(ref dic, "ValveAV10");
  1820. //ReplaceControlNameForValve(ref dic, "ValveAV11");
  1821. //ReplaceControlNameForValve(ref dic, "ValveAV12");
  1822. //ReplaceControlNameForValve(ref dic, "ValveAV13");
  1823. //ReplaceControlNameForValve(ref dic, "ValveAV14");
  1824. //ReplaceControlNameForValve(ref dic, "ValveAV15");
  1825. //ReplaceControlNameForValve(ref dic, "ValveAV16");
  1826. //ReplaceControlNameForValve(ref dic, "ValveAV17");
  1827. //ReplaceControlNameForValve(ref dic, "ValveAV18");
  1828. //ReplaceControlNameForValve(ref dic, "ValveAV19");
  1829. //ReplaceControlNameForValve(ref dic, "ValveAV20");
  1830. //ReplaceControlNameForValve(ref dic, "ValveAV21");
  1831. //ReplaceControlNameForValve(ref dic, "ValveAV22");
  1832. //ReplaceControlNameForValve(ref dic, "ValveAV23");
  1833. //ReplaceControlNameForValve(ref dic, "ValveAV24");
  1834. //ReplaceControlNameForValve(ref dic, "ValveAV25");
  1835. //ReplaceControlNameForValve(ref dic, "ValveAV26");
  1836. //ReplaceControlNameForValve(ref dic, "ValveAV27");
  1837. //ReplaceControlNameForValve(ref dic, "ValveAV28");
  1838. //ReplaceControlNameForValve(ref dic, "ValveAV29");
  1839. //ReplaceControlNameForValve(ref dic, "ValveAV30");
  1840. //ReplaceControlNameForValve(ref dic, "ValveAV31");
  1841. //ReplaceControlNameForValve(ref dic, "ValveAV32");
  1842. //ReplaceControlNameForValve(ref dic, "ValveAV33");
  1843. //ReplaceControlNameForValve(ref dic, "ValveAV34");
  1844. //ReplaceControlNameForValve(ref dic, "ValveAV35");
  1845. //ReplaceControlNameForValve(ref dic, "ValveAV36");
  1846. //ReplaceControlNameForValve(ref dic, "ValveAV37");
  1847. //ReplaceControlNameForValve(ref dic, "ValveAV38");
  1848. //ReplaceControlNameForValve(ref dic, "ValveAV39");
  1849. //ReplaceControlNameForValve(ref dic, "ValveAV52");
  1850. ////ReplaceControlNameForValve(ref dic, "ValveAV54");
  1851. ////ReplaceControlNameForValve(ref dic, "ValveAV56");
  1852. ////ReplaceControlNameForValve(ref dic, "ValveAV57");
  1853. ////ReplaceControlNameForValve(ref dic, "ValveAV58");
  1854. ////ReplaceControlNameForValve(ref dic, "ValveAV59");
  1855. //ReplaceControlNameForValve(ref dic, "ValveAV60");
  1856. ////ReplaceControlNameForValve(ref dic, "ValveAV65");
  1857. ////ReplaceControlNameForValve(ref dic, "ValveAV66");
  1858. ////ReplaceControlNameForValve(ref dic, "ValveAV68");
  1859. //ReplaceControlNameForValve(ref dic, "ValveAV71");
  1860. //ReplaceControlNameForValve(ref dic, "ValveAV72");
  1861. //ReplaceControlNameForValve(ref dic, "ValveAV73");
  1862. //ReplaceControlNameForValve(ref dic, "ValveAV74");
  1863. //ReplaceControlNameForValve(ref dic, "ValveAV75");
  1864. //ReplaceControlNameForValve(ref dic, "ValveAV77");
  1865. //ReplaceControlNameForValve(ref dic, "ValveAV81");
  1866. //ReplaceControlNameForValve(ref dic, "ValveAV82");
  1867. //ReplaceControlNameForValve(ref dic, "ValveAV83");
  1868. //ReplaceControlNameForValve(ref dic, "ValveAV91");
  1869. dic.Remove("StepNo");
  1870. dic.Remove("Name");
  1871. dic.Remove("EndBy");
  1872. dic.Remove("Time");
  1873. dic.Remove("ZAxisPosition");
  1874. dic.Remove("ZAxisSpeed");
  1875. dic.Remove("RotatePosition");
  1876. dic.Remove("RotateSpeed");
  1877. dic.Remove("RotateDirection");
  1878. dic.Remove("Heater1");
  1879. dic.Remove("Heater2");
  1880. dic.Remove("Heater3");
  1881. dic.Remove("Heater4");
  1882. dic.Remove("Heater5");
  1883. dic.Remove("ValveAV54");
  1884. dic.Remove("ValveAV55");
  1885. dic.Remove("ValveAV56");
  1886. dic.Remove("ValveAV57");
  1887. dic.Remove("ValveAV58");
  1888. dic.Remove("ValveAV59");
  1889. dic.Remove("ValveAV65");
  1890. dic.Remove("ValveAV66");
  1891. dic.Remove("ValveAV68");
  1892. dic.Remove("ExternalOn");
  1893. dic.Remove("ExternalOff");
  1894. dic.Remove("ExternalSensor");
  1895. dic.Remove("TempStabilize");
  1896. dic.Remove("FinishAutoProfile");
  1897. dic.Remove("ReachTempWait");
  1898. dic.Remove("ReachTemp");
  1899. dic.Remove("TempUpper");
  1900. dic.Remove("TempLower");
  1901. dic.Remove("ReachPressureWait");
  1902. dic.Remove("ReachPressure");
  1903. dic.Remove("PressureUpper");
  1904. dic.Remove("PressureLower");
  1905. dic.Remove("PressureStabilize");
  1906. dic.Remove("External.Out1");
  1907. dic.Remove("External.Out2");
  1908. dic.Remove("External.Out3");
  1909. dic.Remove("External.Out4");
  1910. dic.Remove("External.Out5");
  1911. dic.Remove("External.Out6");
  1912. dic.Remove("RFSwitch");
  1913. dic.Remove("RFSetpoint");
  1914. dic.Remove("ForwardPowerAlarmWatchTable");
  1915. dic.Remove("PrAlarmWatchTable");
  1916. dic.Remove("PIAlarmWatchTable");
  1917. dic.Remove("C1Setpoint");
  1918. dic.Remove("C2Setpoint");
  1919. dic.Remove("C1AlarmWatchTable");
  1920. dic.Remove("C2AlarmWatchTable");
  1921. dic.Remove("VppAlarmWatchTable");
  1922. dic.Remove("VdcAlarmWatchTable");
  1923. dic.Remove("AbortRecipeTableIndex");
  1924. dic.Remove("Temperature.ControlMode");
  1925. dic.Remove("Temperature.Correct");
  1926. dic.Remove("Temperature.PID");
  1927. dic.Remove("Temperature.Profile");
  1928. dic.Remove("Temperature.Stabilize");
  1929. dic.Remove("Temperature.TempReadyCond");
  1930. dic.Remove("FilmThickFormula");
  1931. dic.Remove("FilmThickCoefficientA");
  1932. dic.Remove("FilmThickCoefficientB");
  1933. dic.Remove("APC.SetPressure");
  1934. dic.Remove("PressureSettingVG");
  1935. dic.Remove("PressureSonserValue");
  1936. dic.Remove("PressureValveAngle");
  1937. dic.Remove("PressureAlarmTableNo");
  1938. dic.Remove("EventSetting");
  1939. dic.Remove("AlarmTableIndex");
  1940. dic.Remove("AlarmDetails.1");
  1941. dic.Remove("AlarmAction.1");
  1942. dic.Remove("AlarmDetails.2");
  1943. dic.Remove("AlarmAction.2");
  1944. dic.Remove("AlarmDetails.3");
  1945. dic.Remove("AlarmAction.3");
  1946. dic.Remove("AlarmDetails.4");
  1947. dic.Remove("AlarmAction.4");
  1948. dic.Remove("AlarmDetails.5");
  1949. dic.Remove("AlarmAction.5");
  1950. dic.Remove("AlarmDetails.6");
  1951. dic.Remove("AlarmAction.6");
  1952. dic.Remove("AlarmDetails.7");
  1953. dic.Remove("AlarmAction.7");
  1954. dic.Remove("AlarmDetails.8");
  1955. dic.Remove("AlarmAction.8");
  1956. dic.Remove("AlarmDetails.9");
  1957. dic.Remove("AlarmAction.9");
  1958. dic.Remove("AlarmDetails.10");
  1959. dic.Remove("AlarmAction.10");
  1960. //List<string> mfcCheckInstall = new List<string>()
  1961. //{
  1962. // "MfcN1",
  1963. // "MfcN2",
  1964. // "MfcN3",
  1965. // "MfcH1",
  1966. // "MfcJ1",
  1967. // "MfcXN1",
  1968. //};
  1969. //foreach(var mfc in mfcCheckInstall)
  1970. //{
  1971. // if (!SC.GetValue<bool>($"PM1.MFC.{mfc}.IsMFCInstalled"))
  1972. // dic.Remove($"{mfc}.SetParameters");
  1973. //}
  1974. foreach (string key in dic.Keys)
  1975. recipeStep.RecipeCommands.Add(key, dic[key]);
  1976. }
  1977. for (int i = 0; i < recipeData.Count; i++)
  1978. {
  1979. if (recipeData[i].IsJumpStep)
  1980. {
  1981. bool findJumpStep = false;
  1982. for (int j = 0; j < recipeData.Count; j++)
  1983. {
  1984. if (recipeData[j].StepName == recipeData[i].JumpStepName)
  1985. {
  1986. recipeData[i].JumpStepNo = j;
  1987. findJumpStep = true;
  1988. break;
  1989. }
  1990. }
  1991. if (!findJumpStep)
  1992. {
  1993. reason = $"Recipe file does not contains jump step {recipeData[i].JumpStepName}";
  1994. return false;
  1995. }
  1996. }
  1997. }
  1998. #endregion
  1999. recipeDatas.Add(x + 1, recipeData);
  2000. }
  2001. }
  2002. catch (Exception ex)
  2003. {
  2004. LOG.Write(ex);
  2005. reason = $"Recipe file content not valid, {recipeFile}, {ex.Message}";
  2006. return false;
  2007. }
  2008. return true;
  2009. }
  2010. }
  2011. }