WaferTransferDialog.xaml.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. using Aitex.Core.Common;
  2. using Aitex.Sorter.Common;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Shapes;
  15. using MECF.Framework.Common.Equipment;
  16. using MECF.Framework.Common.OperationCenter;
  17. namespace Aitex.Sorter.UI.Controls
  18. {
  19. /// <summary>
  20. /// WaferTransferDialog.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class WaferTransferDialog : Window
  23. {
  24. public WaferTransferDialog(WaferInfo waferInfo, ModuleName sourceStation, int sourceSlot, ModuleName destinationStation, int destinationSlot, WaferTransferOption option = null)
  25. {
  26. InitializeComponent();
  27. if (waferInfo.Status == WaferStatus.Dummy)
  28. {
  29. grid.RowDefinitions[7].Height = new GridLength(0);
  30. }
  31. else
  32. {
  33. grid.RowDefinitions[8].Height = new GridLength(0);
  34. if (destinationStation == ModuleName.Robot)
  35. {
  36. if (destinationSlot == 0)
  37. {
  38. chkBlade1.IsChecked = true;
  39. if (option != null) option.Blade = 0;
  40. }
  41. else if (destinationSlot == 1)
  42. {
  43. chkBlade2.IsChecked = true;
  44. if (option != null) option.Blade = 1;
  45. }
  46. chkBlade1.IsEnabled = false;
  47. chkBlade2.IsEnabled = false;
  48. }
  49. if (sourceStation == ModuleName.Robot)
  50. {
  51. if (sourceSlot == 0)
  52. {
  53. chkBlade1.IsChecked = true;
  54. if (option != null) option.Blade = 0;
  55. }
  56. else if (sourceSlot == 1)
  57. {
  58. chkBlade2.IsChecked = true;
  59. if (option != null) option.Blade = 1;
  60. }
  61. chkBlade1.IsEnabled = false;
  62. chkBlade2.IsEnabled = false;
  63. }
  64. if (ModuleHelper.IsLoadLock(sourceStation) || ModuleHelper.IsLoadLock(destinationStation))
  65. {
  66. //chkBlade3.IsEnabled = false;
  67. }
  68. }
  69. if (option != null)
  70. {
  71. if (!option.Setting.ShowAlign)
  72. {
  73. grid.RowDefinitions[4].Height = new GridLength(0);
  74. grid.RowDefinitions[8].Height = new GridLength(0);
  75. }
  76. if (!option.Setting.ShowLaserMarker)
  77. {
  78. grid.RowDefinitions[5].Height = new GridLength(0);
  79. }
  80. if (!option.Setting.ShowT7Code)
  81. {
  82. grid.RowDefinitions[6].Height = new GridLength(0);
  83. }
  84. if (!option.Setting.ShowBlade)
  85. {
  86. grid.RowDefinitions[7].Height = new GridLength(0);
  87. }
  88. if (!option.Setting.ShowTurnOver)
  89. {
  90. grid.RowDefinitions[9].Height = new GridLength(0);
  91. }
  92. chkAligner.IsChecked = option.Align;
  93. chkReadID.IsChecked = option.ReadLaserMarker;
  94. chkReadID2.IsChecked = option.ReadT7Code;
  95. chkTurnOver.IsChecked = option.TurnOver;
  96. if (option.Blade == 0)
  97. {
  98. chkBlade1.IsChecked = true;
  99. }
  100. else
  101. {
  102. chkBlade2.IsChecked = true;
  103. }
  104. tbAngle.Text = option.AlignerAngle.ToString();
  105. }
  106. //else
  107. //{
  108. // grid.RowDefinitions[9].Height = new GridLength(0);
  109. //}
  110. //chkAligner.IsChecked = true;
  111. lbSource.Content = sourceStation;
  112. lbSourceSlot.Content = sourceSlot+1;
  113. lbDest.Content = destinationStation;
  114. lblDestSlot.Content = destinationSlot+1;
  115. _sourceModule = sourceStation;
  116. _sourceSlotIndex = sourceSlot;
  117. _destModule = destinationStation;
  118. _destSlotIndex = destinationSlot;
  119. }
  120. private ModuleName _sourceModule;
  121. private int _sourceSlotIndex;
  122. private ModuleName _destModule;
  123. private int _destSlotIndex;
  124. public bool Aligner
  125. {
  126. get
  127. {
  128. return chkAligner.IsChecked.Value;
  129. }
  130. }
  131. public bool TurnOver => chkTurnOver.IsChecked != null && chkTurnOver.IsChecked.Value;
  132. public bool ReadLaserMarker
  133. {
  134. get
  135. {
  136. return chkReadID.IsChecked.Value;
  137. }
  138. }
  139. public bool ReadT7Code
  140. {
  141. get
  142. {
  143. return chkReadID2.IsChecked.Value;
  144. }
  145. }
  146. public int Blade
  147. {
  148. get
  149. {
  150. // if (chkBlade3.IsChecked != null && chkBlade3.IsChecked.Value)
  151. // {
  152. // return 2;
  153. // }
  154. // else
  155. // {
  156. return chkBlade1.IsChecked.Value ? 0 : 1;
  157. // }
  158. }
  159. }
  160. public double AlignerAngle
  161. {
  162. get
  163. {
  164. double value = 0d;
  165. double.TryParse(tbAngle.Text, out value);
  166. return value;
  167. }
  168. }
  169. public void SetControlShow(bool isShow)
  170. {
  171. if (isShow)
  172. {
  173. grid.RowDefinitions[6].Height = new GridLength(40);
  174. grid.RowDefinitions[7].Height = new GridLength(40);
  175. grid.RowDefinitions[8].Height = new GridLength(0);
  176. }
  177. else
  178. {
  179. grid.RowDefinitions[6].Height = new GridLength(0);
  180. grid.RowDefinitions[7].Height = new GridLength(0);
  181. grid.RowDefinitions[8].Height = new GridLength(0);
  182. }
  183. }
  184. private void btnOK_Click(object sender, RoutedEventArgs e)
  185. {
  186. DialogResult = true;
  187. Close();
  188. }
  189. private void btnCancel_Click(object sender, RoutedEventArgs e)
  190. {
  191. DialogResult = false;
  192. Close();
  193. }
  194. private void btnMoveWaferInfo_Click(object sender, RoutedEventArgs e)
  195. {
  196. InvokeClient.Instance.Service.DoOperation("WaferManagerMoveWaferInfo", new object[] { _sourceModule,_sourceSlotIndex,_destModule,_destSlotIndex});
  197. DialogResult = false;
  198. Close();
  199. }
  200. }
  201. }