WaferTransferDialogViewModel.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. using System;
  2. using System.Windows;
  3. using System.Windows.Input;
  4. using Aitex.Core.RT.Log;
  5. using MECF.Framework.Common.DataCenter;
  6. using OpenSEMI.ClientBase;
  7. using OpenSEMI.ClientBase.Command;
  8. namespace VirgoUI.Client.Dialog
  9. {
  10. public class WaferTransferDialogViewModel : DialogViewModel<WaferTransferCondition>
  11. {
  12. #region properties
  13. private WaferTransferCondition _Conditions;
  14. public WaferTransferCondition Conditions
  15. {
  16. get { return _Conditions; }
  17. set { _Conditions = value; }
  18. }
  19. private string _ConfirmText;
  20. public string ConfirmText
  21. {
  22. get { return _ConfirmText; }
  23. set { _ConfirmText = value; }
  24. }
  25. public bool DisplayPassAlignerCondition { get; set; }
  26. public bool DisplayPassCoolingCondition { get; set; }
  27. private string _ChamberTemperatureText;
  28. public string ChamberTemperatureText
  29. {
  30. get { return _ChamberTemperatureText; }
  31. set { _ChamberTemperatureText = value; }
  32. }
  33. #endregion
  34. #region Command
  35. private ICommand _TransferCommand;
  36. public ICommand TransferCommand
  37. {
  38. get
  39. {
  40. if (this._TransferCommand == null)
  41. this._TransferCommand = new BaseCommand<EventCommandParameter<object, RoutedEventArgs>>((EventCommandParameter<object, RoutedEventArgs> arg) => this.OnTransferCommand(arg));
  42. return this._TransferCommand;
  43. }
  44. }
  45. private ICommand _BtnCancelCommand;
  46. public ICommand CancelCommand
  47. {
  48. get
  49. {
  50. if (this._BtnCancelCommand == null)
  51. this._BtnCancelCommand = new BaseCommand<EventCommandParameter<object, RoutedEventArgs>>((EventCommandParameter<object, RoutedEventArgs> arg) => this.OnCancelCommand(arg));
  52. return this._BtnCancelCommand;
  53. }
  54. }
  55. #endregion
  56. #region Function
  57. protected override void OnInitialize()
  58. {
  59. base.OnInitialize();
  60. }
  61. public WaferTransferDialogViewModel(string message, bool displayPassAlignerCondition, bool displayPassCoolingCondition, string chamberLabel)
  62. {
  63. this.DisplayName = "Wafer Transfer Dialog";
  64. ConfirmText = message;
  65. Conditions = new WaferTransferCondition();
  66. ChamberTemperatureText = chamberLabel;
  67. DisplayPassAlignerCondition = displayPassAlignerCondition;
  68. DisplayPassCoolingCondition = displayPassCoolingCondition;
  69. try
  70. {
  71. var defaultAutoAlign = QueryDataClient.Instance.Service.GetConfig("System.AutoAlignManualTransfer");
  72. if (!displayPassAlignerCondition)
  73. defaultAutoAlign = false;
  74. var defaultPassCooling = QueryDataClient.Instance.Service.GetConfig("System.AutoPassCooling");
  75. if (!displayPassCoolingCondition)
  76. defaultPassCooling = false;
  77. Conditions.IsPassAligner = false;
  78. Conditions.IsPassCooling = defaultPassCooling == null || (bool)defaultPassCooling;
  79. //var alignerAngle = QueryDataClient.Instance.Service.GetConfig("Aligner.DefaultNotchDegree");
  80. //var coolingTime = QueryDataClient.Instance.Service.GetConfig("LoadLock.DefaultCoolingTime");
  81. //Conditions.AlignerAngle = (int)((double)alignerAngle);
  82. //Conditions.CoolingTime = (int)coolingTime;
  83. //ChamberTemperatureText = chamberLabel;
  84. }
  85. catch (Exception ex)
  86. {
  87. LOG.Write(ex);
  88. }
  89. }
  90. private void OnTransferCommand(EventCommandParameter<object, RoutedEventArgs> arg)
  91. {
  92. DialogResult = Conditions;
  93. TryClose(true);
  94. }
  95. private void OnCancelCommand(EventCommandParameter<object, RoutedEventArgs> arg)
  96. {
  97. TryClose(false);
  98. }
  99. #endregion
  100. }
  101. }