Recipe.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765
  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. [JsonIgnore]
  236. public int StepNo
  237. {
  238. get { return m_StepNo; }
  239. set { m_StepNo = value; InvokePropertyChanged("StepNo"); }
  240. }
  241. private StepType m_StepType;
  242. [JsonConverter(typeof(StringEnumConverter))]
  243. public StepType Type
  244. {
  245. get { return m_StepType; }
  246. set { m_StepType = value; InvokePropertyChanged("Type"); }
  247. }
  248. private int m_Time;
  249. [CustomName("Time(s)")]
  250. public int Time
  251. {
  252. get { return m_Time; }
  253. set { m_Time = value; InvokePropertyChanged("Time"); }
  254. }
  255. private string m_Description;
  256. public string Description
  257. {
  258. get { return m_Description; }
  259. set { m_Description = value; InvokePropertyChanged("Description"); }
  260. }
  261. private string m_EPDConfigName;
  262. public string EPDConfig
  263. {
  264. get { return m_EPDConfigName; }
  265. set { m_EPDConfigName = value; InvokePropertyChanged("EPDConfig"); }
  266. }
  267. private int m_MinEndPointTime;
  268. [CustomName("MinEndPointTime(s)")]
  269. public int MinEndPointTime
  270. {
  271. get { return m_MinEndPointTime; }
  272. set { m_MinEndPointTime = value; InvokePropertyChanged("MinEndPointTime"); }
  273. }
  274. private int m_MaxEndPointTime;
  275. [CustomName("MaxEndPointTime(s)")]
  276. public int MaxEndPointTime
  277. {
  278. get { return m_MaxEndPointTime; }
  279. set { m_MaxEndPointTime = value; InvokePropertyChanged("MaxEndPointTime"); }
  280. }
  281. //private bool m_EnableRamp;
  282. //public bool EnableRamp
  283. //{
  284. // get { return m_EnableRamp; }
  285. // set { m_EnableRamp = value; InvokePropertyChanged("EnableRamp"); }
  286. //}
  287. private int m_OverEtchPercent;
  288. [CustomName("OverEtchPercent(%)")]
  289. public int OverEtchPercent
  290. {
  291. get { return m_OverEtchPercent; }
  292. set { m_OverEtchPercent = value; InvokePropertyChanged("OverEtchPercent"); }
  293. }
  294. private bool m_CycleStart;
  295. public bool CycleStart
  296. {
  297. get { return m_CycleStart; }
  298. set { m_CycleStart = value; InvokePropertyChanged("CycleStart"); }
  299. }
  300. private bool m_CycleEnd;
  301. public bool CycleEnd
  302. {
  303. get { return m_CycleEnd; }
  304. set { m_CycleEnd = value; InvokePropertyChanged("CycleEnd"); }
  305. }
  306. private int m_CycleNumber;
  307. public int CycleNumber
  308. {
  309. get { return m_CycleNumber; }
  310. set { m_CycleNumber = value; InvokePropertyChanged("CycleNumber"); }
  311. }
  312. private ObservableCollection<object> lstUnit = new ObservableCollection<object>();
  313. public ObservableCollection<object> LstUnit
  314. {
  315. get { return lstUnit; }
  316. set { lstUnit = value; InvokePropertyChanged("LstUnit"); }
  317. }
  318. private Stopwatch _stepTimer = new Stopwatch();
  319. public long ElapsedTime()
  320. {
  321. return _stepTimer.ElapsedMilliseconds;
  322. }
  323. public void StartStepTimer()
  324. {
  325. _stepTimer.Restart();
  326. }
  327. //private long _lastEPDStepTime = 0;
  328. //public void RecordEPDStepTime()
  329. //{
  330. // _lastEPDStepTime = _stepTimer.ElapsedMilliseconds;
  331. //}
  332. //public long GetLastEPDStepTime()
  333. //{
  334. // return _lastEPDStepTime;
  335. //}
  336. public RState Start()
  337. {
  338. starter(this);
  339. foreach (var unit in lstUnit)
  340. {
  341. var processUnit = unit as ProcessUnitBase;
  342. if (processUnit != null)
  343. {
  344. var state = processUnit.Start(this);
  345. if (state != RState.Running)
  346. return state;
  347. }
  348. else
  349. return RState.Failed;
  350. }
  351. return RState.Running;
  352. }
  353. public RState Start(int steps, int currentstep)
  354. {
  355. starter(this);
  356. foreach (var unit in lstUnit)
  357. {
  358. var processUnit = unit as ProcessUnitBase;
  359. if (processUnit != null)
  360. {
  361. var state = processUnit.Start(this);
  362. if (state != RState.Running)
  363. return state;
  364. }
  365. else
  366. return RState.Failed;
  367. }
  368. return RState.Running;
  369. }
  370. public RState Run()
  371. {
  372. var checkerState= checker(this);
  373. if (checkerState == RState.End)
  374. {
  375. return RState.End;
  376. }
  377. else if (checkerState == RState.Failed)
  378. {
  379. return RState.Failed;
  380. }
  381. bool bStable = true;
  382. foreach (var unit in lstUnit)
  383. {
  384. var processUnit = unit as ProcessUnitBase;
  385. if (processUnit != null)
  386. {
  387. var state = processUnit.Run(this);
  388. if (Type == StepType.Stable)
  389. {
  390. if (state != RState.Running && state != RState.End)
  391. return state;
  392. if (state == RState.Running)
  393. bStable = false;
  394. }
  395. else
  396. {
  397. if (state != RState.Running)
  398. return state;
  399. }
  400. }
  401. else
  402. return RState.Failed;
  403. }
  404. return (Type == StepType.Stable && bStable) ? RState.End : RState.Running;
  405. }
  406. public void End()
  407. {
  408. foreach (var unit in lstUnit)
  409. {
  410. var processUnit = unit as ProcessUnitBase;
  411. if (processUnit != null)
  412. {
  413. processUnit.End(this);
  414. }
  415. }
  416. ender(this);
  417. }
  418. public double RampFactor()
  419. {
  420. return _stepTimer.ElapsedMilliseconds / (Time * 1000.0);
  421. }
  422. public void AppendUnit(ProcessUnitBase unit)
  423. {
  424. lstUnit.Append(unit);
  425. }
  426. public event PropertyChangedEventHandler PropertyChanged;
  427. public void InvokePropertyChanged(string propertyName)
  428. {
  429. if (PropertyChanged != null)
  430. {
  431. PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
  432. }
  433. }
  434. }
  435. public class Recipe : INotifyPropertyChanged
  436. {
  437. private RecipeHead m_Header = new RecipeHead();
  438. public RecipeHead Header
  439. {
  440. get { return m_Header; }
  441. set { m_Header = value; InvokePropertyChanged("Header"); }
  442. }
  443. private ObservableCollection<RecipeStep> m_Steps;
  444. public ObservableCollection<RecipeStep> Steps
  445. {
  446. get { return m_Steps; }
  447. set { m_Steps = value; InvokePropertyChanged("Steps"); }
  448. }
  449. public static Recipe Load(string recipeFile)
  450. {
  451. var recipe = JsonConvert.DeserializeObject<Recipe>(recipeFile);
  452. if (recipe == null)
  453. {
  454. return null;
  455. }
  456. foreach (var step in recipe.Steps)
  457. {
  458. ObservableCollection<object> unit = new ObservableCollection<object>();
  459. for (int i = 0; i < step.LstUnit.Count; i++)
  460. {
  461. string value = step.LstUnit[i].ToString();
  462. string[] striparr = value.Split(new string[] { "\r\n" }, StringSplitOptions.None);
  463. string item1 = striparr[1].Remove(0, 15);
  464. string item2 = item1.Remove(item1.Length - 2, 2);
  465. switch (item2)
  466. {
  467. case "PressureModeUnit":
  468. unit.Add(JsonConvert.DeserializeObject<PressureByPressureModeUnit>(step.LstUnit[i].ToString()));
  469. break;
  470. //case "PressureByValveModeUnit":
  471. // unit.Add(JsonConvert.DeserializeObject<PressureByValveModeUnit>(step.LstUnit[i].ToString()));
  472. // break;
  473. case "TCPUnit":
  474. unit.Add(JsonConvert.DeserializeObject<TCPUnit>(step.LstUnit[i].ToString()));
  475. break;
  476. case "BiasUnit":
  477. unit.Add(JsonConvert.DeserializeObject<BiasUnit>(step.LstUnit[i].ToString()));
  478. break;
  479. case "GasControlUnit":
  480. unit.Add(JsonConvert.DeserializeObject<GasControlUnit>(step.LstUnit[i].ToString()));
  481. break;
  482. case "ESCHVUnit":
  483. unit.Add(JsonConvert.DeserializeObject<ESCHVUnit>(step.LstUnit[i].ToString()));
  484. break;
  485. case "ProcessKitUnit":
  486. unit.Add(JsonConvert.DeserializeObject<ProcessKitUnit>(step.LstUnit[i].ToString()));
  487. break;
  488. case "HeaterUnit":
  489. unit.Add(JsonConvert.DeserializeObject<HeaterUnit>(step.LstUnit[i].ToString()));
  490. break;
  491. case "RFBoxUnit":
  492. unit.Add(JsonConvert.DeserializeObject<RFBoxUnit>(step.LstUnit[i].ToString()));
  493. break;
  494. case "GasUnit":
  495. unit.Add(JsonConvert.DeserializeObject<Kepler2200GasControlUnit>(step.LstUnit[i].ToString()));
  496. break;
  497. case "SEGasControlUnit":
  498. unit.Add(JsonConvert.DeserializeObject<VenusSEGasControlUnit>(step.LstUnit[i].ToString()));
  499. break;
  500. case "DEGasControlUnit":
  501. unit.Add(JsonConvert.DeserializeObject<VenusDEGasControlUnit>(step.LstUnit[i].ToString()));
  502. break;
  503. case "Magnet":
  504. unit.Add(JsonConvert.DeserializeObject<MagnetUnit>(step.LstUnit[i].ToString()));
  505. break;
  506. }
  507. }
  508. step.LstUnit.Clear();
  509. unit.ToList().ForEach(x =>
  510. {
  511. step.LstUnit.Add(x);
  512. });
  513. }
  514. return recipe;
  515. }
  516. public static string ShowEAPRecipe(string recipeContent, ObservableCollection<RecipeStep> Steps)
  517. {
  518. JObject jobject = JObject.Parse(recipeContent);
  519. JArray Firsttokenselect = jobject.SelectToken("Steps") as JArray;
  520. if (Firsttokenselect != null)
  521. {
  522. foreach (JObject firstItem in Firsttokenselect)
  523. {
  524. JArray Secondtokenselect = firstItem.SelectToken("LstUnit") as JArray;
  525. foreach (JObject secondItem in Secondtokenselect)
  526. {
  527. for (int i = 0; i < Steps.Count; i++)
  528. {
  529. for (int j = 0; j < Steps[i].LstUnit.Count; j++)
  530. {
  531. Type type = Steps[i].LstUnit[j].GetType();
  532. foreach (var propertyInfo in type.GetProperties())
  533. {
  534. object[] toleranceAttrs = propertyInfo.GetCustomAttributes(typeof(IsTolerance), true);
  535. if (toleranceAttrs.Length > 0)
  536. {
  537. secondItem.Remove(propertyInfo.Name);
  538. }
  539. }
  540. }
  541. }
  542. }
  543. }
  544. }
  545. return jobject.ToString();
  546. }
  547. public bool Validate()
  548. {
  549. return true;
  550. }
  551. public bool Save(string recipeFile)
  552. {
  553. return true;
  554. }
  555. public event PropertyChangedEventHandler PropertyChanged;
  556. public void InvokePropertyChanged(string propertyName)
  557. {
  558. if (PropertyChanged != null)
  559. {
  560. PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
  561. }
  562. }
  563. }
  564. public class RecipeUnity
  565. {
  566. public static string ConvertJsonString(string str)
  567. {
  568. JsonSerializer serializer = new JsonSerializer();
  569. TextReader tr = new StringReader(str);
  570. JsonTextReader jtr = new JsonTextReader(tr);
  571. object obj = serializer.Deserialize(jtr);
  572. if (obj != null)
  573. {
  574. StringWriter textWriter = new StringWriter();
  575. JsonTextWriter jsonWriter = new JsonTextWriter(textWriter)
  576. {
  577. Formatting = Newtonsoft.Json.Formatting.Indented,
  578. Indentation = 4,
  579. IndentChar = ' '
  580. };
  581. serializer.Serialize(jsonWriter, obj);
  582. return textWriter.ToString();
  583. }
  584. else
  585. {
  586. return str;
  587. }
  588. }
  589. public static string RecipeToString(Recipe recipe)
  590. {
  591. return JsonConvert.SerializeObject(recipe);
  592. }
  593. public static String CreateRecipe(JetChamber currentChamber, RecipeType recipeType, string recipeName)
  594. {
  595. Recipe recipe = new Recipe();
  596. recipe.Header = new RecipeHead();
  597. recipe.Header.CreateTime = DateTime.Now.ToString();
  598. recipe.Header.EditTime = DateTime.Now.ToString();
  599. recipe.Header.Type = recipeType;
  600. recipe.Header.ChamberType = currentChamber;
  601. recipe.Header.Name = recipeName;
  602. recipe.Header.LastModifiedBy = "Admin";
  603. recipe.Steps = new ObservableCollection<RecipeStep>();
  604. RecipeStep recipeStep = new RecipeStep();
  605. recipeStep.LstUnit = GetAllUnits(currentChamber, recipeType);
  606. recipe.Steps.Add(recipeStep);
  607. var recipeString = JsonConvert.SerializeObject(recipe);
  608. return recipeString;
  609. }
  610. public static ObservableCollection<object> GetAllUnits(JetChamber jetChamber, RecipeType recipeType)
  611. {
  612. ObservableCollection<object> LstUnit = new ObservableCollection<object>();
  613. switch (jetChamber)
  614. {
  615. //case JetChamber.Venus:
  616. // if (recipeType == RecipeType.Clean)
  617. // {
  618. // foreach (var item in Enum.GetValues(typeof(VenusCleanRecipeUnits)))
  619. // {
  620. // Type t = Type.GetType($"Venus_Core.{item.ToString()}");
  621. // var obj = System.Activator.CreateInstance(t);
  622. // LstUnit.Add(obj);
  623. // }
  624. // }
  625. // else
  626. // {
  627. // foreach (var item in Enum.GetValues(typeof(VenusUnits)))
  628. // {
  629. // Type t = Type.GetType($"Venus_Core.{item.ToString()}");
  630. // var obj = System.Activator.CreateInstance(t);
  631. // LstUnit.Add(obj);
  632. // }
  633. // }
  634. // break;
  635. case JetChamber.Kepler2300:
  636. if (recipeType == RecipeType.Clean)
  637. {
  638. foreach (var item in Enum.GetValues(typeof(Kepler2300CleanRecipeUints)))
  639. {
  640. Type t = Type.GetType($"Venus_Core.{item.ToString()}");
  641. var obj = System.Activator.CreateInstance(t);
  642. LstUnit.Add(obj as ProcessUnitBase);
  643. }
  644. }
  645. else
  646. {
  647. foreach (var item in Enum.GetValues(typeof(Kepler2300Uints)))
  648. {
  649. Type t = Type.GetType($"Venus_Core.{item.ToString()}");
  650. var obj = System.Activator.CreateInstance(t);
  651. LstUnit.Add(obj as ProcessUnitBase);
  652. }
  653. }
  654. break;
  655. case JetChamber.Kepler2200A:
  656. foreach (var item in Enum.GetValues(typeof(Kepler2200AUnits)))
  657. {
  658. Type t = Type.GetType($"Venus_Core.{item.ToString()}");
  659. var obj = System.Activator.CreateInstance(t);
  660. LstUnit.Add(obj as ProcessUnitBase);
  661. }
  662. break;
  663. case JetChamber.Kepler2200B:
  664. foreach (var item in Enum.GetValues(typeof(Kepler2200BUnits)))
  665. {
  666. Type t = Type.GetType($"Venus_Core.{item.ToString()}");
  667. var obj = System.Activator.CreateInstance(t);
  668. LstUnit.Add(obj as ProcessUnitBase);
  669. }
  670. break;
  671. case JetChamber.VenusSE:
  672. foreach (var item in Enum.GetValues(typeof(VenusSEUnits)))
  673. {
  674. Type t = Type.GetType($"Venus_Core.{item.ToString()}");
  675. var obj = System.Activator.CreateInstance(t);
  676. LstUnit.Add(obj as ProcessUnitBase);
  677. }
  678. break;
  679. case JetChamber.VenusDE:
  680. foreach (var item in Enum.GetValues(typeof(VenusDEUnits)))
  681. {
  682. Type t = Type.GetType($"Venus_Core.{item.ToString()}");
  683. var obj = System.Activator.CreateInstance(t);
  684. LstUnit.Add(obj as ProcessUnitBase);
  685. }
  686. break;
  687. }
  688. return LstUnit;
  689. }
  690. }
  691. }