Recipe.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770
  1. using System;
  2. using System.Collections.ObjectModel;
  3. using System.ComponentModel;
  4. using System.Diagnostics;
  5. using System.IO;
  6. using System.Linq;
  7. using Newtonsoft.Json;
  8. using Newtonsoft.Json.Converters;
  9. using Venus_Core.Attributes;
  10. namespace Venus_Core
  11. {
  12. public enum RecipeType
  13. {
  14. Chuck,
  15. DeChuck,
  16. Process,
  17. Clean,
  18. }
  19. public enum StepType
  20. {
  21. Time,
  22. Stable,
  23. EndPoint,
  24. OverEtch,
  25. }
  26. public enum ProcessModule
  27. {
  28. Pressure,
  29. TCP, // Transformer Coupled Plasma (转换耦合等离子)
  30. Bias,
  31. Gas,
  32. ESC,
  33. Process,
  34. Compound,
  35. }
  36. public enum GeneratorMode
  37. {
  38. Pulsing,
  39. CW,
  40. }
  41. public enum PressureUnitMode
  42. {
  43. Pressure,
  44. Valve
  45. }
  46. public class RecipeHead : INotifyPropertyChanged
  47. {
  48. private string m_name;
  49. [IsOnlyRead]
  50. public string Name
  51. {
  52. get { return m_name; }
  53. set { m_name = value; InvokePropertyChanged("Name"); }
  54. }
  55. private string _Version = "TestVersion";
  56. public string Version
  57. {
  58. get { return _Version; }
  59. set { _Version = value; InvokePropertyChanged("Version"); }
  60. }
  61. private JetChamber _ChamberType = JetChamber.Venus;
  62. public JetChamber ChamberType
  63. {
  64. get { return _ChamberType; }
  65. set { _ChamberType = value; InvokePropertyChanged("ChamberType"); }
  66. }
  67. private RecipeType m_Type;
  68. [JsonConverter(typeof(StringEnumConverter))]
  69. public RecipeType Type
  70. {
  71. get { return m_Type; }
  72. set { m_Type = value; InvokePropertyChanged("Type"); }
  73. }
  74. private string m_ChunckRecipe;
  75. public string ChuckRecipe
  76. {
  77. get { return m_ChunckRecipe; }
  78. set { m_ChunckRecipe = value; InvokePropertyChanged("ChuckRecipe"); }
  79. }
  80. private string m_DechuckRecipe;
  81. public string DechuckRecipe
  82. {
  83. get { return m_DechuckRecipe; }
  84. set { m_DechuckRecipe = value; InvokePropertyChanged("DechuckRecipe"); }
  85. }
  86. private string m_CreateTime;
  87. [IsOnlyRead]
  88. public string CreateTime
  89. {
  90. get { return m_CreateTime; }
  91. set { m_CreateTime = value; InvokePropertyChanged("CreateTime"); }
  92. }
  93. private string m_EditTime;
  94. [IsOnlyRead]
  95. public string EditTime
  96. {
  97. get { return m_EditTime; }
  98. set { m_EditTime = value; InvokePropertyChanged("EditTime"); }
  99. }
  100. private string m_LastModifiedBy;
  101. [IsOnlyRead]
  102. public string LastModifiedBy
  103. {
  104. get { return m_LastModifiedBy; }
  105. set { m_LastModifiedBy = value; InvokePropertyChanged("LastModifiedBy"); }
  106. }
  107. private string m_Barcode;
  108. public string Barcode
  109. {
  110. get { return m_Barcode; }
  111. set { m_Barcode = value; InvokePropertyChanged("Barcode"); }
  112. }
  113. private string m_BasePressure;
  114. public string BasePressure
  115. {
  116. get { return m_BasePressure; }
  117. set { m_BasePressure = value; InvokePropertyChanged("BasePressure"); }
  118. }
  119. private string m_ChillerTemp;
  120. public string ChillerTemp
  121. {
  122. get { return m_ChillerTemp; }
  123. set { m_ChillerTemp = value; InvokePropertyChanged("ChillerTemp"); }
  124. }
  125. private int m_RFHoldTime = 1000;
  126. public int RFHoldTime
  127. {
  128. get { return m_RFHoldTime; }
  129. set { m_RFHoldTime = value; InvokePropertyChanged("RFHoldTime"); }
  130. }
  131. private int m_BiasRFHoldTime = 1000;
  132. public int BiasRFHoldTime
  133. {
  134. get { return m_BiasRFHoldTime; }
  135. set { m_BiasRFHoldTime = value; InvokePropertyChanged("BiasRFHoldTime"); }
  136. }
  137. private string m_Comment;
  138. public string Comment
  139. {
  140. get { return m_Comment; }
  141. set { m_Comment = value; InvokePropertyChanged("Comment"); }
  142. }
  143. //private string m_ChillerTemp1;
  144. //public string ChillerTemp1
  145. //{
  146. // get { return m_ChillerTemp1; }
  147. // set { m_ChillerTemp1 = value; InvokePropertyChanged("ChillerTemp1"); }
  148. //}
  149. //private string m_ChillerTemp2;
  150. //public string ChillerTemp2
  151. //{
  152. // get { return m_ChillerTemp2; }
  153. // set { m_ChillerTemp2 = value; InvokePropertyChanged("ChillerTemp2"); }
  154. //}
  155. //private string m_ChillerTemp3;
  156. //public string ChillerTemp3
  157. //{
  158. // get { return m_ChillerTemp3; }
  159. // set { m_ChillerTemp3 = value; InvokePropertyChanged("ChillerTemp3"); }
  160. //}
  161. //private string m_ChillerTemp4;
  162. //public string ChillerTemp4
  163. //{
  164. // get { return m_ChillerTemp4; }
  165. // set { m_ChillerTemp4 = value; InvokePropertyChanged("ChillerTemp4"); }
  166. //}
  167. public event PropertyChangedEventHandler PropertyChanged;
  168. public void InvokePropertyChanged(string propertyName)
  169. {
  170. if (PropertyChanged != null)
  171. {
  172. PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
  173. }
  174. }
  175. }
  176. public class ProcessUnitBase
  177. {
  178. [JsonIgnore]
  179. public Func<ProcessUnitBase, RecipeStep, RState> checker;
  180. [JsonIgnore]
  181. public Func<ProcessUnitBase, RecipeStep, RState> starter;
  182. [JsonIgnore]
  183. public Action<ProcessUnitBase, RecipeStep> end;
  184. //[JsonIgnore]
  185. //public string Name { get; set; }
  186. //[JsonIgnore]
  187. //public ProcessModule Moudle { get; set; }
  188. public RState Start(RecipeStep step)
  189. {
  190. if (starter != null)
  191. return starter(this, step);
  192. return RState.Running;
  193. }
  194. public RState Run(RecipeStep step)
  195. {
  196. if (checker != null)
  197. return checker(this, step);
  198. return RState.Running;
  199. }
  200. public void End(RecipeStep step)
  201. {
  202. if (end != null)
  203. end(this, step);
  204. }
  205. }
  206. [Serializable]
  207. public class RecipeStep : INotifyPropertyChanged
  208. {
  209. [JsonIgnore]
  210. public Func<RecipeStep, RState> checker;
  211. [JsonIgnore]
  212. public Func<RecipeStep, RState> starter;
  213. [JsonIgnore]
  214. public Func<RecipeStep, RState> ender;
  215. private int m_StepNo=1;
  216. [IsOnlyRead]
  217. public int StepNo
  218. {
  219. get { return m_StepNo; }
  220. set { m_StepNo = value; InvokePropertyChanged("StepNo"); }
  221. }
  222. private StepType m_StepType;
  223. [JsonConverter(typeof(StringEnumConverter))]
  224. public StepType Type
  225. {
  226. get { return m_StepType; }
  227. set { m_StepType = value; InvokePropertyChanged("Type"); }
  228. }
  229. private int m_Time;
  230. public int Time
  231. {
  232. get { return m_Time; }
  233. set { m_Time = value; InvokePropertyChanged("Time"); }
  234. }
  235. private string m_Description;
  236. public string Description
  237. {
  238. get { return m_Description; }
  239. set { m_Description = value; InvokePropertyChanged("Description"); }
  240. }
  241. private string m_EPDConfigName;
  242. public string EPDConfig
  243. {
  244. get { return m_EPDConfigName; }
  245. set { m_EPDConfigName = value; InvokePropertyChanged("EPDConfig"); }
  246. }
  247. private int m_MinEndPointTime;
  248. public int MinEndPointTime
  249. {
  250. get { return m_MinEndPointTime; }
  251. set { m_MinEndPointTime = value; InvokePropertyChanged("MinEndPointTime"); }
  252. }
  253. private int m_MaxEndPointTime;
  254. public int MaxEndPointTime
  255. {
  256. get { return m_MaxEndPointTime; }
  257. set { m_MaxEndPointTime = value; InvokePropertyChanged("MaxEndPointTime"); }
  258. }
  259. //private bool m_EnableRamp;
  260. //public bool EnableRamp
  261. //{
  262. // get { return m_EnableRamp; }
  263. // set { m_EnableRamp = value; InvokePropertyChanged("EnableRamp"); }
  264. //}
  265. private int m_OverEtchPercent;
  266. public int OverEtchPercent
  267. {
  268. get { return m_OverEtchPercent; }
  269. set { m_OverEtchPercent = value; InvokePropertyChanged("OverEtchPercent"); }
  270. }
  271. private bool m_CycleStart;
  272. public bool CycleStart
  273. {
  274. get { return m_CycleStart; }
  275. set { m_CycleStart = value; InvokePropertyChanged("CycleStart"); }
  276. }
  277. private bool m_CycleEnd;
  278. public bool CycleEnd
  279. {
  280. get { return m_CycleEnd; }
  281. set { m_CycleEnd = value; InvokePropertyChanged("CycleEnd"); }
  282. }
  283. private int m_CycleNumber;
  284. public int CycleNumber
  285. {
  286. get { return m_CycleNumber; }
  287. set { m_CycleNumber = value; InvokePropertyChanged("CycleNumber"); }
  288. }
  289. private ObservableCollection<Object> lstUnit = new ObservableCollection<Object>();
  290. public ObservableCollection<Object> LstUnit
  291. {
  292. get { return lstUnit; }
  293. set { lstUnit = value; InvokePropertyChanged("LstUnit"); }
  294. }
  295. private Stopwatch _stepTimer = new Stopwatch();
  296. public long ElapsedTime()
  297. {
  298. return _stepTimer.ElapsedMilliseconds;
  299. }
  300. public void StartStepTimer()
  301. {
  302. _stepTimer.Restart();
  303. }
  304. private long _lastEPDStepTimne = 0;
  305. public void RecordEPDStepTime()
  306. {
  307. _lastEPDStepTimne = _stepTimer.ElapsedMilliseconds;
  308. }
  309. public long GetLastEPDStepTime()
  310. {
  311. return _lastEPDStepTimne;
  312. }
  313. public RState Start()
  314. {
  315. starter(this);
  316. foreach (var unit in lstUnit)
  317. {
  318. var processUnit = unit as ProcessUnitBase;
  319. if (processUnit != null)
  320. {
  321. var state = processUnit.Start(this);
  322. if (state != RState.Running)
  323. return state;
  324. }
  325. else
  326. return RState.Failed;
  327. }
  328. return RState.Running;
  329. }
  330. public RState Run()
  331. {
  332. if (checker(this) == RState.End)
  333. return RState.End;
  334. bool bStable = true;
  335. foreach (var unit in lstUnit)
  336. {
  337. var processUnit = unit as ProcessUnitBase;
  338. if (processUnit != null)
  339. {
  340. var state = processUnit.Run(this);
  341. if (Type == StepType.Stable)
  342. {
  343. if (state != RState.Running && state != RState.End)
  344. return state;
  345. if (state == RState.Running)
  346. bStable = false;
  347. }
  348. else
  349. {
  350. if (state != RState.Running)
  351. return state;
  352. }
  353. }
  354. else
  355. return RState.Failed;
  356. }
  357. return (Type == StepType.Stable && bStable) ? RState.End : RState.Running;
  358. }
  359. public void End()
  360. {
  361. foreach (var unit in lstUnit)
  362. {
  363. var processUnit = unit as ProcessUnitBase;
  364. if (processUnit != null)
  365. {
  366. processUnit.End(this);
  367. }
  368. }
  369. ender(this);
  370. }
  371. public double RampFactor()
  372. {
  373. return _stepTimer.ElapsedMilliseconds / (Time * 1000.0);
  374. }
  375. public void AppendUnit(ProcessUnitBase unit)
  376. {
  377. lstUnit.Append(unit);
  378. }
  379. public event PropertyChangedEventHandler PropertyChanged;
  380. public void InvokePropertyChanged(string propertyName)
  381. {
  382. if (PropertyChanged != null)
  383. {
  384. PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
  385. }
  386. }
  387. }
  388. public class Recipe : INotifyPropertyChanged
  389. {
  390. private RecipeHead m_Header = new RecipeHead();
  391. public RecipeHead Header
  392. {
  393. get { return m_Header; }
  394. set { m_Header = value; InvokePropertyChanged("Header"); }
  395. }
  396. private ObservableCollection<RecipeStep> m_Steps;
  397. public ObservableCollection<RecipeStep> Steps
  398. {
  399. get { return m_Steps; }
  400. set { m_Steps = value; InvokePropertyChanged("Steps"); }
  401. }
  402. public static Recipe Load(string recipeFile)
  403. {
  404. var recipe = JsonConvert.DeserializeObject<Recipe>(recipeFile);
  405. if (recipe == null)
  406. {
  407. return null;
  408. }
  409. foreach (var step in recipe.Steps)
  410. {
  411. ObservableCollection<ProcessUnitBase> unit = new ObservableCollection<ProcessUnitBase>();
  412. //int count = step.LstUnit.Count / 2;
  413. //for (int i = 0; i < count; i++)
  414. //{
  415. // Type t = Type.GetType(step.LstUnit[i].ToString());
  416. // //unit.Add(JsonConvert.DeserializeObject<t>(step.LstUnit[i+count].ToString()));
  417. // unit.Add(JsonConvert.DeserializeObject<ProcessUnitBase>(step.LstUnit[i + count].ToString()));
  418. //}
  419. //var item = step.LstUnit[0];
  420. for (int i = 0; i < step.LstUnit.Count; i++)
  421. {
  422. //object item=step.LstUnit[i];
  423. //step.LstUnit[i].
  424. string value = step.LstUnit[i].ToString();
  425. string[] striparr = value.Split(new string[] { "\r\n" }, StringSplitOptions.None);
  426. string item1 = striparr[1].Remove(0, 15);
  427. string item2 = item1.Remove(item1.Length - 2, 2);
  428. //var item= value.Substring(value.IndexOf("UnitName"));
  429. //Type t = Type.GetType(value);
  430. switch (item2)
  431. {
  432. case "PressureModeUnit":
  433. unit.Add(JsonConvert.DeserializeObject<PressureByPressureModeUnit>(step.LstUnit[i].ToString()));
  434. break;
  435. //case "PressureByValveModeUnit":
  436. // unit.Add(JsonConvert.DeserializeObject<PressureByValveModeUnit>(step.LstUnit[i].ToString()));
  437. // break;
  438. case "TCPUnit":
  439. unit.Add(JsonConvert.DeserializeObject<TCPUnit>(step.LstUnit[i].ToString()));
  440. break;
  441. case "BiasUnit":
  442. unit.Add(JsonConvert.DeserializeObject<BiasUnit>(step.LstUnit[i].ToString()));
  443. break;
  444. case "GasControlUnit":
  445. unit.Add(JsonConvert.DeserializeObject<GasControlUnit>(step.LstUnit[i].ToString()));
  446. break;
  447. case "ESCHVUnit":
  448. unit.Add(JsonConvert.DeserializeObject<ESCHVUnit>(step.LstUnit[i].ToString()));
  449. break;
  450. case "ProcessKitUnit":
  451. unit.Add(JsonConvert.DeserializeObject<ProcessKitUnit>(step.LstUnit[i].ToString()));
  452. break;
  453. case "HeaterUnit":
  454. unit.Add(JsonConvert.DeserializeObject<HeaterUnit>(step.LstUnit[i].ToString()));
  455. break;
  456. case "GasUnit":
  457. unit.Add(JsonConvert.DeserializeObject<Kepler2200GasControlUnit>(step.LstUnit[i].ToString()));
  458. break;
  459. }
  460. }
  461. step.LstUnit.Clear();
  462. unit.ToList().ForEach(x =>
  463. {
  464. step.LstUnit.Add(x);
  465. });
  466. }
  467. return recipe;
  468. }
  469. public bool Validate()
  470. {
  471. return true;
  472. }
  473. public bool Save(string recipeFile)
  474. {
  475. return true;
  476. }
  477. public event PropertyChangedEventHandler PropertyChanged;
  478. public void InvokePropertyChanged(string propertyName)
  479. {
  480. if (PropertyChanged != null)
  481. {
  482. PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
  483. }
  484. }
  485. }
  486. public class RecipeUnity
  487. {
  488. public static string ConvertJsonString(string str)
  489. {
  490. JsonSerializer serializer = new JsonSerializer();
  491. TextReader tr = new StringReader(str);
  492. JsonTextReader jtr = new JsonTextReader(tr);
  493. object obj = serializer.Deserialize(jtr);
  494. if (obj != null)
  495. {
  496. StringWriter textWriter = new StringWriter();
  497. JsonTextWriter jsonWriter = new JsonTextWriter(textWriter)
  498. {
  499. Formatting = Newtonsoft.Json.Formatting.Indented,
  500. Indentation = 4,
  501. IndentChar = ' '
  502. };
  503. serializer.Serialize(jsonWriter, obj);
  504. return textWriter.ToString();
  505. }
  506. else
  507. {
  508. return str;
  509. }
  510. }
  511. public static string RecipeToString(Recipe recipe)
  512. {
  513. return JsonConvert.SerializeObject(recipe);
  514. }
  515. public static String CreateRecipe(JetChamber currentChamber, RecipeType recipeType, string recipeName)
  516. {
  517. Recipe recipe = new Recipe();
  518. recipe.Header = new RecipeHead();
  519. recipe.Header.CreateTime = DateTime.Now.ToString();
  520. recipe.Header.EditTime = DateTime.Now.ToString();
  521. recipe.Header.Type = recipeType;
  522. recipe.Header.ChamberType = currentChamber;
  523. recipe.Header.Name = recipeName;
  524. recipe.Header.LastModifiedBy = "Admin";
  525. recipe.Steps = new ObservableCollection<RecipeStep>();
  526. RecipeStep recipeStep = new RecipeStep();
  527. recipeStep.LstUnit = GetAllUnits(currentChamber,recipeType);
  528. //switch (currentChamber)
  529. //{
  530. // case JetChamber.Venus:
  531. // foreach (var item in Enum.GetValues(typeof(VenusUnits)))
  532. // {
  533. // Type t = Type.GetType($"Venus_Core.{item.ToString()}");
  534. // var obj = System.Activator.CreateInstance(t);
  535. // recipeStep.LstUnit.Add(obj);
  536. // }
  537. // break;
  538. // case JetChamber.Kepler2300:
  539. // foreach (var item in Enum.GetValues(typeof(Kepler2300Uints)))
  540. // {
  541. // Type t = Type.GetType($"Venus_Core.{item.ToString()}");
  542. // var obj = System.Activator.CreateInstance(t);
  543. // recipeStep.LstUnit.Add(obj);
  544. // }
  545. // break;
  546. // case JetChamber.Kepler2200A:
  547. // foreach (var item in Enum.GetValues(typeof(Kepler2200AUnits)))
  548. // {
  549. // Type t = Type.GetType($"Venus_Core.{item.ToString()}");
  550. // var obj = System.Activator.CreateInstance(t);
  551. // recipeStep.LstUnit.Add(obj);
  552. // }
  553. // break;
  554. //case JetChamber.Venus:
  555. // recipe.Steps.Add(new RecipeStep()
  556. // {
  557. // //StepNo = 1,
  558. // LstUnit = new ObservableCollection<Object>()
  559. // {
  560. // new PressureByPressureModeUnit(),
  561. // new TCPUnit(),
  562. // new BiasUnit(),
  563. // new GasControlUnit(),
  564. // new ESCHVUnit(),
  565. // new ProcessKitUnit()
  566. // }
  567. // });
  568. // break;
  569. //case JetChamber.Kepler2300:
  570. // recipe.Steps.Add(new RecipeStep()
  571. // {
  572. // //StepNo = 1,
  573. // LstUnit = new ObservableCollection<Object>()
  574. // {
  575. // new PressureByPressureModeUnit(),
  576. // new TCPUnit(),
  577. // new BiasUnit(),
  578. // new GasControlUnit(),
  579. // new ProcessKitUnit()
  580. // }
  581. // });
  582. // break;
  583. //case JetChamber.Kepler2200A:
  584. // recipe.Steps.Add(new RecipeStep()
  585. // {
  586. // //StepNo = 1,
  587. // LstUnit = new ObservableCollection<Object>()
  588. // {
  589. // new Kepler2200GasControlUnit(),
  590. // new HeaterUnit(),
  591. // new Kepler2200RFUnit()
  592. // }
  593. // });
  594. // break;
  595. //}
  596. recipe.Steps.Add(recipeStep);
  597. var recipeString = JsonConvert.SerializeObject(recipe);
  598. return recipeString;
  599. }
  600. public static ObservableCollection<Object> GetAllUnits(JetChamber jetChamber)
  601. {
  602. ObservableCollection<Object> LstUnit = new ObservableCollection<object>();
  603. switch (jetChamber)
  604. {
  605. case JetChamber.Venus:
  606. foreach (var item in Enum.GetValues(typeof(VenusUnits)))
  607. {
  608. Type t = Type.GetType($"Venus_Core.{item.ToString()}");
  609. var obj = System.Activator.CreateInstance(t);
  610. LstUnit.Add(obj);
  611. }
  612. break;
  613. case JetChamber.Kepler2300:
  614. foreach (var item in Enum.GetValues(typeof(Kepler2300Uints)))
  615. {
  616. Type t = Type.GetType($"Venus_Core.{item.ToString()}");
  617. var obj = System.Activator.CreateInstance(t);
  618. LstUnit.Add(obj);
  619. }
  620. break;
  621. case JetChamber.Kepler2200A:
  622. foreach (var item in Enum.GetValues(typeof(Kepler2200AUnits)))
  623. {
  624. Type t = Type.GetType($"Venus_Core.{item.ToString()}");
  625. var obj = System.Activator.CreateInstance(t);
  626. LstUnit.Add(obj);
  627. }
  628. break;
  629. }
  630. return LstUnit;
  631. }
  632. public static ObservableCollection<Object> GetAllUnits(JetChamber jetChamber,RecipeType recipeType)
  633. {
  634. ObservableCollection<Object> LstUnit = new ObservableCollection<object>();
  635. switch (jetChamber)
  636. {
  637. case JetChamber.Venus:
  638. if (recipeType == RecipeType.Clean)
  639. {
  640. foreach (var item in Enum.GetValues(typeof(VenusCleanRecipeUnits)))
  641. {
  642. Type t = Type.GetType($"Venus_Core.{item.ToString()}");
  643. var obj = System.Activator.CreateInstance(t);
  644. LstUnit.Add(obj);
  645. }
  646. }
  647. else
  648. {
  649. foreach (var item in Enum.GetValues(typeof(VenusUnits)))
  650. {
  651. Type t = Type.GetType($"Venus_Core.{item.ToString()}");
  652. var obj = System.Activator.CreateInstance(t);
  653. LstUnit.Add(obj);
  654. }
  655. }
  656. break;
  657. case JetChamber.Kepler2300:
  658. if (recipeType == RecipeType.Clean)
  659. {
  660. foreach (var item in Enum.GetValues(typeof(Kepler2300CleanRecipeUints)))
  661. {
  662. Type t = Type.GetType($"Venus_Core.{item.ToString()}");
  663. var obj = System.Activator.CreateInstance(t);
  664. LstUnit.Add(obj);
  665. }
  666. }
  667. else
  668. {
  669. foreach (var item in Enum.GetValues(typeof(Kepler2300Uints)))
  670. {
  671. Type t = Type.GetType($"Venus_Core.{item.ToString()}");
  672. var obj = System.Activator.CreateInstance(t);
  673. LstUnit.Add(obj);
  674. }
  675. }
  676. break;
  677. case JetChamber.Kepler2200A:
  678. foreach (var item in Enum.GetValues(typeof(Kepler2200AUnits)))
  679. {
  680. Type t = Type.GetType($"Venus_Core.{item.ToString()}");
  681. var obj = System.Activator.CreateInstance(t);
  682. LstUnit.Add(obj);
  683. }
  684. break;
  685. }
  686. return LstUnit;
  687. }
  688. }
  689. }