WaferMoveManagerDual.cs 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. using System;
  2. using Aitex.Core.RT.Log;
  3. using Caliburn.Micro;
  4. using MECF.Framework.Common.Equipment;
  5. using MECF.Framework.Common.OperationCenter;
  6. using OpenSEMI.Ctrlib.Controls;
  7. namespace MECF.Framework.UI.Client.ClientBase
  8. {
  9. public class WaferMoveManagerDual
  10. {
  11. #region single Instance
  12. private WaferMoveManagerDual()
  13. {
  14. }
  15. private static WaferMoveManagerDual m_Instance = null;
  16. public static WaferMoveManagerDual Instance
  17. {
  18. get
  19. {
  20. if (m_Instance == null)
  21. {
  22. m_Instance = new WaferMoveManagerDual();
  23. }
  24. return m_Instance;
  25. }
  26. }
  27. #endregion
  28. public void TransferWafer(Slot p_from, Slot p_to, bool showAligner = true, bool showCooling = true)
  29. {
  30. try
  31. {
  32. if (p_from == null || p_to == null || !p_from.IsValidSlot() || !p_to.IsValidSlot())
  33. return;
  34. //DialogButton btns = DialogButton.Transfer | DialogButton.Cancel;
  35. string info = " from " + p_from.ModuleID + " slot " + (p_from.SlotID + 1).ToString() + " to " + p_to.ModuleID + " slot " + (p_to.SlotID + 1).ToString();
  36. string message = "Are you sure to transfer the wafer: \n" + info;
  37. //DialogButton m_dResult = DialogBox.ShowDialog(btns, DialogType.CONFIRM, message);
  38. bool displayAlignerCondition = false;
  39. if (showAligner)
  40. {
  41. displayAlignerCondition = (p_from.ModuleID == "TMRobot" || ModuleHelper.IsVCE(ModuleHelper.Converter(p_from.ModuleID))) &&(p_to.ModuleID == "TMRobot" || ModuleHelper.IsPm(ModuleHelper.Converter(p_to.ModuleID)));
  42. displayAlignerCondition = displayAlignerCondition && (!ModuleHelper.IsAligner(ModuleHelper.Converter(p_from.ModuleID)) && !ModuleHelper.IsAligner(ModuleHelper.Converter(p_to.ModuleID)));
  43. }
  44. else
  45. displayAlignerCondition = false;
  46. bool displayPassCoolingCondition = false;
  47. if(showCooling)
  48. {
  49. displayPassCoolingCondition = (p_from.ModuleID.Contains("PM") || p_from.ModuleID == "TMRobot");
  50. displayPassCoolingCondition = displayPassCoolingCondition && (!p_to.ModuleID.Contains("PM")) && (p_to.ModuleID != "TMRobot")
  51. && (p_to.ModuleID != "LLA") && (p_to.ModuleID != "LLB");
  52. }
  53. else
  54. displayPassCoolingCondition = false;
  55. WindowManager wm = new WindowManager();
  56. WaferTransferDualDialogViewModel _transferVM = new WaferTransferDualDialogViewModel(message, displayAlignerCondition, displayPassCoolingCondition);
  57. bool? bret = wm.ShowDialogWithNoStyle(_transferVM);
  58. if ((bool)bret)
  59. {
  60. //get and use transfer conditions
  61. WaferTransferCondition conditions = _transferVM.DialogResult;
  62. InvokeClient.Instance.Service.DoOperation("System.MoveWafer",
  63. p_from.ModuleID, p_from.SlotID, p_to.ModuleID, p_to.SlotID, _transferVM.AddMoreWafer);
  64. }
  65. p_from.ClearDragDropStatus();
  66. p_to.ClearDragDropStatus();
  67. }
  68. catch (Exception ex)
  69. {
  70. LOG.Write(ex);
  71. }
  72. }
  73. }
  74. }