WaferMoveManager.cs 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Aitex.Core.RT.Log;
  7. using Aitex.Sorter.Common;
  8. using Caliburn.Micro;
  9. using MECF.Framework.Common.OperationCenter;
  10. using OpenSEMI.ClientBase;
  11. using OpenSEMI.Ctrlib.Controls;
  12. using VirgoUI.Client.Dialog;
  13. namespace VirgoUI.Client
  14. {
  15. public class WaferMoveManager
  16. {
  17. #region single Instance
  18. private WaferMoveManager()
  19. {
  20. }
  21. private static WaferMoveManager m_Instance = null;
  22. public static WaferMoveManager Instance
  23. {
  24. get
  25. {
  26. if (m_Instance == null)
  27. {
  28. m_Instance = new WaferMoveManager();
  29. }
  30. return m_Instance;
  31. }
  32. }
  33. #endregion
  34. public void TransferWafer(Slot p_from, Slot p_to, float tempToChamber)
  35. {
  36. try
  37. {
  38. if (p_from == null || p_to == null || !p_from.IsValidSlot() || !p_to.IsValidSlot())
  39. return;
  40. string info = " from " + p_from.ModuleID + " slot " + (p_from.SlotID + 1).ToString() + " to " + p_to.ModuleID + " slot " + (p_to.SlotID + 1).ToString();
  41. string message = "Are you sure to transfer the wafer: \n" + info;
  42. bool displayAlignerCondition = (p_from.ModuleID != "Aligner1" && p_to.ModuleID != "Aligner1"
  43. && p_from.ModuleID != "Aligner2" && p_to.ModuleID != "Aligner2"
  44. && p_from.ModuleID != "Cooling1" && p_to.ModuleID != "Cooling1"
  45. && p_from.ModuleID != "Cooling2" && p_to.ModuleID != "Cooling2") && !p_from.ModuleID.Contains("PM");
  46. bool displayCoolingCondition = (p_from.ModuleID.Contains("PM") );
  47. displayCoolingCondition = displayCoolingCondition && !p_to.ModuleID.Contains("PM");
  48. string labelChamber = "";
  49. if (p_to.ModuleID.Contains("PM"))
  50. {
  51. labelChamber = $"{p_to.ModuleID} Temp. {tempToChamber:F2}℃";
  52. }
  53. WindowManager wm = new WindowManager();
  54. WaferTransferDialogViewModel _transferVM = new WaferTransferDialogViewModel(message, displayAlignerCondition, true, labelChamber);
  55. bool? bret = wm.ShowDialogWithNoStyle(_transferVM);
  56. if ((bool)bret)
  57. {
  58. //get and use transfer conditions
  59. WaferTransferCondition conditions = _transferVM.DialogResult;
  60. InvokeClient.Instance.Service.DoOperation("System.MoveWafer",
  61. p_from.ModuleID, p_from.SlotID, p_to.ModuleID, p_to.SlotID,
  62. conditions.IsPassAligner, conditions.AlignerAngle, conditions.IsPassCooling, conditions.CoolingTime, "Blade1");
  63. }
  64. p_from.ClearDragDropStatus();
  65. p_to.ClearDragDropStatus();
  66. }
  67. catch (Exception ex)
  68. {
  69. LOG.Write(ex);
  70. }
  71. }
  72. }
  73. }