DepRecipeViewModel.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678
  1. using Aitex.Core.RT.DataCenter;
  2. using Aitex.Core.RT.Log;
  3. using Aitex.Core.UI.Dialog;
  4. using Aitex.Core.UI.MVVM;
  5. using Aitex.Core.Utilities;
  6. using Caliburn.Micro.Core;
  7. using MECF.Framework.Common.DataCenter;
  8. using MECF.Framework.Common.RecipeCenter;
  9. using CyberX8_Core;
  10. using CyberX8_MainPages.PMs;
  11. using CyberX8_Themes.UserControls;
  12. using Prism.Mvvm;
  13. using System;
  14. using System.Collections.Generic;
  15. using System.Collections.ObjectModel;
  16. using System.ComponentModel;
  17. using System.Linq;
  18. using System.Reflection;
  19. using System.Text;
  20. using System.Threading.Tasks;
  21. using System.Windows;
  22. using System.Windows.Controls;
  23. using System.Windows.Input;
  24. namespace CyberX8_MainPages.ViewModels
  25. {
  26. public class DepRecipeViewModel : BindableBase
  27. {
  28. #region 常量
  29. private const string ENGINEERING = "Engineering";
  30. private const string DEP = "dep";
  31. #endregion
  32. #region 内部变量
  33. /// <summary>
  34. /// Recipe节点字典
  35. /// </summary>
  36. private Dictionary<string, RecipeNode> _recipeNodeDic = new Dictionary<string, RecipeNode>();
  37. /// <summary>
  38. /// 属性检验结果字典
  39. /// </summary>
  40. private Dictionary<string, bool> _propertyValidResultDic = new Dictionary<string, bool>();
  41. /// <summary>
  42. /// Recipe节点集合
  43. /// </summary>
  44. private ObservableCollection<RecipeNode> _recipeNodes;
  45. /// <summary>
  46. /// uiRecipeManager
  47. /// </summary>
  48. private UiRecipeManager _uiRecipeManager = new UiRecipeManager();
  49. /// <summary>
  50. /// recipe
  51. /// </summary>
  52. private DepRecipe _recipe;
  53. /// <summary>
  54. /// 编辑可用性
  55. /// </summary>
  56. private bool _editEnable;
  57. /// <summary>
  58. /// 创建可用性
  59. /// </summary>
  60. private bool _createEnable;
  61. /// <summary>
  62. /// 当前节点
  63. /// </summary>
  64. private RecipeNode _currentNode;
  65. /// <summary>
  66. /// 是否可用
  67. /// </summary>
  68. private bool _enable = false;
  69. /// <summary>
  70. /// 是否为编辑(true-Edit,false-add)
  71. /// </summary>
  72. private bool _isEdit = false;
  73. /// <summary>
  74. /// 化学液集合
  75. /// </summary>
  76. private List<string> _chemistryLst = new List<string>();
  77. /// <summary>
  78. /// 显示MultiZone列
  79. /// </summary>
  80. private bool _multiZoneShow = false;
  81. /// <summary>
  82. /// 显示SingleZone列
  83. /// </summary>
  84. private bool _singleZoneShow = false;
  85. /// <summary>
  86. /// 选择AnodeType
  87. /// </summary>
  88. private string _selectAnodeType;
  89. /// <summary>
  90. /// Ramp DataGrid选择索引
  91. /// </summary>
  92. private int _selectedRampIndex = -1;
  93. /// <summary>
  94. /// Pulse DataGrid选择索引
  95. /// </summary>
  96. private int _selectedPulseIndex = -1;
  97. /// <summary>
  98. /// Pulse类型集合
  99. /// </summary>
  100. private List<string> _pulseTypeList = new List<string>();
  101. #endregion
  102. #region 属性
  103. public ObservableCollection<RecipeNode> RecipeNodes
  104. {
  105. get { return _recipeNodes; }
  106. set { SetProperty(ref _recipeNodes, value); }
  107. }
  108. /// <summary>
  109. /// Recipe
  110. /// </summary>
  111. public DepRecipe Recipe
  112. {
  113. get { return _recipe; }
  114. set { SetProperty(ref _recipe, value); }
  115. }
  116. /// <summary>
  117. /// 创建可用性
  118. /// </summary>
  119. public bool CreateEnable
  120. {
  121. get { return _createEnable; }
  122. set { SetProperty(ref _createEnable, value);}
  123. }
  124. /// <summary>
  125. /// 编辑可用性
  126. /// </summary>
  127. public bool EditEnable
  128. {
  129. get { return _editEnable; }
  130. set { SetProperty(ref _editEnable, value);}
  131. }
  132. /// <summary>
  133. /// 当前节点
  134. /// </summary>
  135. public RecipeNode CurrentNode
  136. {
  137. get { return _currentNode; }
  138. set { SetProperty(ref _currentNode, value);}
  139. }
  140. /// <summary>
  141. /// 可用性
  142. /// </summary>
  143. public bool Enable
  144. {
  145. get { return _enable; }
  146. set { SetProperty(ref _enable, value); }
  147. }
  148. /// <summary>
  149. /// 属性数据检验结果
  150. /// </summary>
  151. public Dictionary<string, bool> PropertyValidResultDic
  152. {
  153. get { return _propertyValidResultDic; }
  154. set { SetProperty(ref _propertyValidResultDic, value); }
  155. }
  156. /// <summary>
  157. /// 化学液集合
  158. /// </summary>
  159. public List<string> ChemistryLst
  160. {
  161. get { return _chemistryLst; }
  162. set { SetProperty(ref _chemistryLst, value); }
  163. }
  164. /// <summary>
  165. /// MultiZone 显示
  166. /// </summary>
  167. public bool MultiZoneShow
  168. {
  169. get { return _multiZoneShow; }
  170. set
  171. {
  172. SetProperty(ref _multiZoneShow, value);
  173. SingleZoneShow = !value;
  174. }
  175. }
  176. /// <summary>
  177. /// SingleZone显示列
  178. /// </summary>
  179. public bool SingleZoneShow
  180. {
  181. get { return _singleZoneShow; }
  182. set { SetProperty(ref _singleZoneShow, value);}
  183. }
  184. /// <summary>
  185. /// 选择Anode Type
  186. /// </summary>
  187. public string SelectedAnodeType
  188. {
  189. get { return _selectAnodeType; }
  190. set
  191. {
  192. SetProperty(ref _selectAnodeType, value);
  193. UpdateDataGridShow();
  194. }
  195. }
  196. /// <summary>
  197. /// DataGrid 索引
  198. /// </summary>
  199. public int SelectedRampIndex
  200. {
  201. get { return _selectedRampIndex; }
  202. set { SetProperty(ref _selectedRampIndex, value);}
  203. }
  204. /// <summary>
  205. /// Pulse Datagrid选择索引
  206. /// </summary>
  207. public int SelectedPulseIndex
  208. {
  209. get { return _selectedPulseIndex; }
  210. set { SetProperty(ref _selectedPulseIndex, value); }
  211. }
  212. public List<string> PulseTypeList
  213. {
  214. get { return _pulseTypeList; }
  215. set { SetProperty(ref _pulseTypeList, value); }
  216. }
  217. #endregion
  218. #region 指令
  219. [IgnorePropertyChange]
  220. public ICommand OperationCommand
  221. {
  222. get;
  223. private set;
  224. }
  225. [IgnorePropertyChange]
  226. public ICommand CreateCommand { get; private set; }
  227. [IgnorePropertyChange]
  228. public ICommand EditCommand { get; private set; }
  229. [IgnorePropertyChange]
  230. public ICommand SaveRecipeCommand { get; private set; }
  231. [IgnorePropertyChange]
  232. public ICommand SaveAsRecipeCommand { get; private set; }
  233. [IgnorePropertyChange]
  234. public ICommand AddBelowCommand { get;private set; }
  235. [IgnorePropertyChange]
  236. public ICommand AddAboveCommand { get; private set; }
  237. [IgnorePropertyChange]
  238. public ICommand MoveUpCommand { get; private set; }
  239. [IgnorePropertyChange]
  240. public ICommand MoveDownCommand { get; private set; }
  241. [IgnorePropertyChange]
  242. public ICommand DeleteCommand { get;private set; }
  243. [IgnorePropertyChange]
  244. public ICommand AddBelowPulseCommand { get; private set; }
  245. [IgnorePropertyChange]
  246. public ICommand AddAbovePulseCommand { get; private set; }
  247. [IgnorePropertyChange]
  248. public ICommand MoveUpPulseCommand { get; private set; }
  249. [IgnorePropertyChange]
  250. public ICommand MoveDownPulseCommand { get; private set; }
  251. [IgnorePropertyChange]
  252. public ICommand DeletePulseCommand { get; private set; }
  253. #endregion
  254. /// <summary>
  255. /// 构造函数
  256. /// </summary>
  257. public DepRecipeViewModel()
  258. {
  259. OperationCommand = new DelegateCommand<object>(SelectionChangedAction);
  260. CreateCommand = new DelegateCommand<object>(CreateAction);
  261. EditCommand = new DelegateCommand<object>(EditAction);
  262. SaveRecipeCommand = new DelegateCommand<object>(SaveAction);
  263. AddBelowCommand = new DelegateCommand<object>(AddBelowAction);
  264. AddAboveCommand = new DelegateCommand<object>(AddAboveAction);
  265. MoveUpCommand=new DelegateCommand<object>(MoveUpAction);
  266. MoveDownCommand=new DelegateCommand<object>(MoveDownAction);
  267. DeleteCommand=new DelegateCommand<object>(DeleteAction);
  268. AddBelowPulseCommand = new DelegateCommand<object>(AddBelowPulseAction);
  269. AddAbovePulseCommand = new DelegateCommand<object>(AddAbovePulseAction);
  270. MoveUpPulseCommand=new DelegateCommand<object>(MoveUpPulseAction);
  271. MoveDownPulseCommand = new DelegateCommand<object>(MoveDownPulseAction);
  272. DeletePulseCommand =new DelegateCommand<object>(DeletePulseAction);
  273. string chemistryContent = QueryDataClient.Instance.Service.GetConfig($"System.ChemistryList").ToString();
  274. if (!string.IsNullOrEmpty(chemistryContent))
  275. {
  276. ChemistryLst = chemistryContent.Split(',').ToList();
  277. }
  278. PulseTypeList.Add("Plus");
  279. PulseTypeList.Add("Minus");
  280. PulseTypeList.Add("Off");
  281. InitializeProprtyValidResultDictionary();
  282. }
  283. /// <summary>
  284. /// 初始化属性数据检验结果字典
  285. /// </summary>
  286. private void InitializeProprtyValidResultDictionary()
  287. {
  288. PropertyValidResultDic["CurrentWarningLevel"] = false;
  289. PropertyValidResultDic["FaultPercent"] = false;
  290. PropertyValidResultDic["VolatageLimitMin"] = false;
  291. PropertyValidResultDic["VolatageLimitMax"] = false;
  292. PropertyValidResultDic["VoltageWarningLevel"] = false;
  293. PropertyValidResultDic["PlatingDelaySeconds"] = false;
  294. }
  295. /// <summary>
  296. /// 加载数据
  297. /// </summary>
  298. public void LoadRecipeData()
  299. {
  300. RecipeNodes = _uiRecipeManager.GetRecipesByType(DEP);
  301. _recipeNodeDic.Clear();
  302. InitializeDictionary(RecipeNodes);
  303. }
  304. /// <summary>
  305. /// 初始化字典
  306. /// </summary>
  307. /// <param name="nodes"></param>
  308. private void InitializeDictionary(ObservableCollection<RecipeNode> nodes)
  309. {
  310. if (nodes != null)
  311. {
  312. foreach (var node in nodes)
  313. {
  314. if (node.NodeType == RecipeNodeType.File)
  315. {
  316. _recipeNodeDic[node.Name] = node;
  317. }
  318. InitializeDictionary(node.Children);
  319. }
  320. }
  321. }
  322. /// <summary>
  323. /// 操作
  324. /// </summary>
  325. /// <param name="param"></param>
  326. private void SelectionChangedAction(object param)
  327. {
  328. if(_recipeNodeDic.ContainsKey(param.ToString()))
  329. {
  330. CurrentNode = _recipeNodeDic[param.ToString()];
  331. if(CurrentNode.NodeType==RecipeNodeType.File)
  332. {
  333. if (CurrentNode.RecipeLocation == ENGINEERING)
  334. {
  335. EditEnable = true;
  336. CreateEnable = true;
  337. }
  338. else
  339. {
  340. EditEnable= false;
  341. CreateEnable = false;
  342. }
  343. }
  344. Recipe = _uiRecipeManager.LoadRecipe<DepRecipe>(CurrentNode.RecipeFullFileName);
  345. if(Recipe==null)
  346. {
  347. MessageBox.Show("Invalid Recipe", "Load Recipe", MessageBoxButton.OK, MessageBoxImage.Error);
  348. EditEnable = false;
  349. CreateEnable = false;
  350. }
  351. Enable = false;
  352. }
  353. else
  354. {
  355. if(param.ToString()==ENGINEERING)
  356. {
  357. CreateEnable= true;
  358. }
  359. else
  360. {
  361. CreateEnable = false;
  362. }
  363. CurrentNode = null;
  364. Recipe = null;
  365. EditEnable = false;
  366. Enable = false;
  367. }
  368. }
  369. #region Action
  370. /// <summary>
  371. /// 创建
  372. /// </summary>
  373. /// <param name="param"></param>
  374. private void CreateAction(object param)
  375. {
  376. RecipeNameDialog recipeNameDialog = new RecipeNameDialog();
  377. if (recipeNameDialog.ShowDialog().Value)
  378. {
  379. Recipe = new DepRecipe();
  380. Recipe.CreateDate = DateTime.Now;
  381. Recipe.Ppid = recipeNameDialog.RecipeName;
  382. Recipe.Description=recipeNameDialog.RecipeDescription;
  383. Recipe.CurrentRampProfileSteps = new ObservableCollection<CurrentRampProfile>();
  384. Recipe.PulsePowerSupplySteps = new ObservableCollection<PulsePowerSupplyStep>();
  385. Enable = true;
  386. _isEdit = false;
  387. }
  388. }
  389. /// <summary>
  390. /// 编辑
  391. /// </summary>
  392. /// <param name="param"></param>
  393. private void EditAction(object param)
  394. {
  395. Enable = true;
  396. _isEdit= false;
  397. }
  398. /// <summary>
  399. /// 保存
  400. /// </summary>
  401. /// <param name="param"></param>
  402. private void SaveAction(object param)
  403. {
  404. if (CheckValid(_isEdit))
  405. {
  406. Recipe.SaveDate = DateTime.Now;
  407. int platingsteps = 0;
  408. int totaltime = 0;
  409. double totalcurrent = 0;
  410. foreach(var obj in Recipe.CurrentRampProfileSteps)
  411. {
  412. totaltime += obj.CurrentRampDurartionSeconds;
  413. totalcurrent += (obj.CurrentRampDurartionSeconds * obj.ForwardAmps);
  414. platingsteps++;
  415. }
  416. //计算Deposition PlatingSteps
  417. Recipe.DepositionPlatingSteps = platingsteps;
  418. //计算Deposition Totaltimes
  419. string date = string.Empty;
  420. var seconds = (int)(totaltime % 60);
  421. var minutes = (int)(totaltime / 60) % 60;
  422. var hours = (int)(totaltime / 3600) % 60;
  423. date = string.Format("{0:00}:{1:00}:{2:00}", hours + "h", minutes + "m", seconds + "s");
  424. Recipe.DepositionTotalTime = date;
  425. //计算Deposition TotalCurrent
  426. Recipe.DepositionTotalCurrent = totalcurrent / 3600;
  427. //计算TotalTime
  428. Recipe.TotalTime = totaltime + Recipe.PlatingDelaySeconds;
  429. try
  430. {
  431. _uiRecipeManager.SaveRecipe<DepRecipe>(ENGINEERING, Recipe.Ppid,"dep", Recipe);
  432. LoadRecipeData();
  433. MessageBox.Show("Save Recipe Success", "Save Recipe", MessageBoxButton.OK, MessageBoxImage.Information);
  434. Enable = false;
  435. }
  436. catch (Exception ex)
  437. {
  438. MessageBox.Show(ex.Message, "Save Recipe", MessageBoxButton.OK, MessageBoxImage.Error);
  439. }
  440. }
  441. }
  442. /// <summary>
  443. /// 检验合法性
  444. /// </summary>
  445. /// <param name="editType"></param>
  446. /// <returns></returns>
  447. private bool CheckValid(bool editType)
  448. {
  449. foreach(string key in _propertyValidResultDic.Keys)
  450. {
  451. bool valid = _propertyValidResultDic[key];
  452. if(!valid)
  453. {
  454. MessageBox.Show($"{key} data invalid", "Save Recipe", MessageBoxButton.OK, MessageBoxImage.Error);
  455. return false;
  456. }
  457. }
  458. return true;
  459. }
  460. /// <summary>
  461. /// 更新表格显示
  462. /// </summary>
  463. private void UpdateDataGridShow()
  464. {
  465. if(Recipe!=null)
  466. {
  467. if(Recipe.AnodeType==0)
  468. {
  469. MultiZoneShow = true;
  470. }
  471. else
  472. {
  473. MultiZoneShow = false;
  474. }
  475. }
  476. }
  477. #region Ramp按钮
  478. /// <summary>
  479. /// 增加
  480. /// </summary>
  481. /// <param name="param"></param>
  482. private void AddBelowAction(object param)
  483. {
  484. if (Recipe != null)
  485. {
  486. CurrentRampProfile currentRampProfile = new CurrentRampProfile();
  487. Recipe.CurrentRampProfileSteps.Insert(SelectedRampIndex + 1, currentRampProfile);
  488. SelectedRampIndex++;
  489. }
  490. }
  491. /// <summary>
  492. /// 增加
  493. /// </summary>
  494. /// <param name="param"></param>
  495. private void AddAboveAction(object param)
  496. {
  497. if (Recipe != null)
  498. {
  499. CurrentRampProfile currentRampProfile = new CurrentRampProfile();
  500. if (SelectedRampIndex == -1)
  501. {
  502. Recipe.CurrentRampProfileSteps.Add(currentRampProfile);
  503. SelectedRampIndex = 0;
  504. }
  505. else
  506. {
  507. Recipe.CurrentRampProfileSteps.Insert(SelectedRampIndex, currentRampProfile);
  508. SelectedRampIndex--;
  509. }
  510. }
  511. }
  512. /// <summary>
  513. /// 上移
  514. /// </summary>
  515. /// <param name="param"></param>
  516. private void MoveUpAction(object param)
  517. {
  518. if (Recipe != null)
  519. {
  520. if(SelectedRampIndex>0)
  521. {
  522. int currentIndex = SelectedRampIndex;
  523. CurrentRampProfile currentRampProfile = Recipe.CurrentRampProfileSteps[SelectedRampIndex];
  524. Recipe.CurrentRampProfileSteps.RemoveAt(SelectedRampIndex);
  525. Recipe.CurrentRampProfileSteps.Insert(currentIndex - 1,currentRampProfile);
  526. SelectedRampIndex = currentIndex - 1;
  527. }
  528. }
  529. }
  530. /// <summary>
  531. /// 下移
  532. /// </summary>
  533. /// <param name="param"></param>
  534. private void MoveDownAction(object param)
  535. {
  536. if (Recipe != null)
  537. {
  538. if (SelectedRampIndex>=0&&SelectedRampIndex <Recipe.CurrentRampProfileSteps.Count-1 &&Recipe.CurrentRampProfileSteps.Count>1)
  539. {
  540. int currentIndex = SelectedRampIndex;
  541. CurrentRampProfile currentRampProfile = Recipe.CurrentRampProfileSteps[SelectedRampIndex];
  542. Recipe.CurrentRampProfileSteps.RemoveAt(SelectedRampIndex);
  543. Recipe.CurrentRampProfileSteps.Insert(currentIndex + 1, currentRampProfile);
  544. SelectedRampIndex = currentIndex + 1;
  545. }
  546. }
  547. }
  548. /// <summary>
  549. /// 删除
  550. /// </summary>
  551. /// <param name="param"></param>
  552. private void DeleteAction(object param)
  553. {
  554. if (SelectedRampIndex != -1)
  555. {
  556. if (Recipe != null && Recipe.CurrentRampProfileSteps.Count > SelectedRampIndex)
  557. {
  558. Recipe.CurrentRampProfileSteps.RemoveAt(SelectedRampIndex);
  559. }
  560. }
  561. }
  562. #endregion
  563. #region Pulse按钮
  564. /// <summary>
  565. /// 增加
  566. /// </summary>
  567. /// <param name="param"></param>
  568. private void AddBelowPulseAction(object param)
  569. {
  570. if (Recipe != null)
  571. {
  572. if (Recipe.PulsePowerSupplySteps.Count < 4)
  573. {
  574. PulsePowerSupplyStep pulsePowerSupplyStep = new PulsePowerSupplyStep();
  575. Recipe.PulsePowerSupplySteps.Insert(SelectedPulseIndex + 1, pulsePowerSupplyStep);
  576. SelectedPulseIndex++;
  577. }
  578. }
  579. }
  580. /// <summary>
  581. /// 增加
  582. /// </summary>
  583. /// <param name="param"></param>
  584. private void AddAbovePulseAction(object param)
  585. {
  586. if (Recipe != null)
  587. {
  588. if (Recipe.PulsePowerSupplySteps.Count < 4)
  589. {
  590. PulsePowerSupplyStep pulsePowerSupplyStep = new PulsePowerSupplyStep();
  591. if (SelectedPulseIndex == -1)
  592. {
  593. Recipe.PulsePowerSupplySteps.Add(pulsePowerSupplyStep);
  594. SelectedPulseIndex = 0;
  595. }
  596. else
  597. {
  598. Recipe.PulsePowerSupplySteps.Insert(SelectedPulseIndex, pulsePowerSupplyStep);
  599. SelectedPulseIndex--;
  600. }
  601. }
  602. }
  603. }
  604. /// <summary>
  605. /// 上移
  606. /// </summary>
  607. /// <param name="param"></param>
  608. private void MoveUpPulseAction(object param)
  609. {
  610. if (Recipe != null)
  611. {
  612. if (SelectedPulseIndex > 0)
  613. {
  614. int currentIndex = SelectedPulseIndex;
  615. PulsePowerSupplyStep pulsePowerSupplyStep = Recipe.PulsePowerSupplySteps[currentIndex];
  616. Recipe.PulsePowerSupplySteps.RemoveAt(currentIndex);
  617. Recipe.PulsePowerSupplySteps.Insert(currentIndex - 1, pulsePowerSupplyStep);
  618. SelectedPulseIndex = currentIndex - 1;
  619. }
  620. }
  621. }
  622. /// <summary>
  623. /// 下移
  624. /// </summary>
  625. /// <param name="param"></param>
  626. private void MoveDownPulseAction(object param)
  627. {
  628. if (Recipe != null)
  629. {
  630. if (SelectedPulseIndex >= 0 && SelectedPulseIndex < Recipe.PulsePowerSupplySteps.Count - 1 && Recipe.PulsePowerSupplySteps.Count > 1)
  631. {
  632. int currentIndex = SelectedPulseIndex;
  633. PulsePowerSupplyStep pulsePowerSupplyStep = Recipe.PulsePowerSupplySteps[currentIndex];
  634. Recipe.PulsePowerSupplySteps.RemoveAt(currentIndex);
  635. Recipe.PulsePowerSupplySteps.Insert(currentIndex + 1, pulsePowerSupplyStep);
  636. SelectedPulseIndex = currentIndex + 1;
  637. }
  638. }
  639. }
  640. /// <summary>
  641. /// 删除
  642. /// </summary>
  643. /// <param name="param"></param>
  644. private void DeletePulseAction(object param)
  645. {
  646. if (Recipe != null)
  647. {
  648. if(SelectedPulseIndex!=-1&&Recipe.PulsePowerSupplySteps.Count>SelectedPulseIndex)
  649. {
  650. Recipe.PulsePowerSupplySteps.RemoveAt(SelectedPulseIndex);
  651. }
  652. }
  653. }
  654. #endregion
  655. #endregion
  656. }
  657. }