WaferMoveManager.cs 2.9 KB

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