RecipeParser.cs 119 KB

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