Recipe.cs 25 KB

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