InputCarrierInfoViewModel.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. using Caliburn.Micro;
  2. using Caliburn.Micro.Core;
  3. using FurnaceUI.Models;
  4. using MECF.Framework.Common.DataCenter;
  5. using OpenSEMI.ClientBase;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Text.RegularExpressions;
  11. using System.Threading.Tasks;
  12. using System.Windows;
  13. namespace FurnaceUI.Views.Jobs
  14. {
  15. public class InputCarrierInfoViewModel: FurnaceModuleUIViewModelBase
  16. {
  17. private string _carrierID;
  18. public string CarrierID
  19. {
  20. get => _carrierID;
  21. set
  22. {
  23. _carrierID = value;
  24. NotifyOfPropertyChange(nameof(CarrierID));
  25. }
  26. }
  27. private string _waferCount = "0";
  28. public string WaferCount
  29. {
  30. get => _waferCount;
  31. set
  32. {
  33. _waferCount = value;
  34. NotifyOfPropertyChange(nameof(WaferCount));
  35. }
  36. }
  37. private string _waferType;
  38. public string WaferType
  39. {
  40. get => _waferType;
  41. set
  42. {
  43. _waferType = value;
  44. NotifyOfPropertyChange(nameof(WaferType));
  45. }
  46. }
  47. private string _waferNo;
  48. public string WaferNo
  49. {
  50. get => _waferNo;
  51. set
  52. {
  53. _waferNo = value;
  54. NotifyOfPropertyChange(nameof(WaferNo));
  55. }
  56. }
  57. private bool _isExistChecked = true;
  58. public bool IsExistChecked
  59. {
  60. get => _isExistChecked;
  61. set
  62. {
  63. _isExistChecked = value;
  64. NotifyOfPropertyChange(nameof(IsExistChecked));
  65. }
  66. }
  67. private bool _isNoneChecked = true;
  68. public bool IsNoneChecked
  69. {
  70. get => _isNoneChecked;
  71. set
  72. {
  73. _isNoneChecked = value;
  74. NotifyOfPropertyChange(nameof(IsNoneChecked));
  75. }
  76. }
  77. private string _slotMap;
  78. public string SlotMap
  79. {
  80. get => _slotMap;
  81. set
  82. {
  83. _slotMap = value;
  84. NotifyOfPropertyChange(nameof(SlotMap));
  85. }
  86. }
  87. protected override void OnActivate()
  88. {
  89. base.OnActivate();
  90. for (int i = 0; i < (int)QueryDataClient.Instance.Service.GetConfig("System.CassetteSlotCount"); i++)
  91. {
  92. SlotMap += 0;
  93. }
  94. }
  95. public void EditMap()
  96. {
  97. var windowManager = IoC.Get<IWindowManager>();
  98. SpecifiedMapViewModel specifiedMapViewModel = new SpecifiedMapViewModel();
  99. specifiedMapViewModel.WaferType = WaferType;
  100. if((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(specifiedMapViewModel, null, "Slot Map Info"))
  101. {
  102. SlotMap = specifiedMapViewModel.SlotMap;
  103. WaferCount = Regex.Matches(SlotMap, "1").Count.ToString();
  104. if (SlotMap.Contains("1"))
  105. IsExistChecked = true;
  106. else
  107. IsNoneChecked = !IsExistChecked;
  108. }
  109. }
  110. public void AcceptCmd()
  111. {
  112. if (string.IsNullOrEmpty(SlotMap))
  113. {
  114. DialogBox.ShowWarning("Specified Map is empty");
  115. return;
  116. }
  117. ((Window)GetView()).DialogResult = true;
  118. }
  119. public void ClosedCmd(string cmdPar)
  120. {
  121. ((Window)GetView()).DialogResult = false;
  122. }
  123. }
  124. }