Recipe.cs 25 KB

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