Recipe.cs 25 KB

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