RobotCommandViewModel.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. using OpenSEMI.ClientBase;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using FurnaceUI.Models;
  9. using Caliburn.Micro.Core;
  10. using Caliburn.Micro;
  11. namespace FurnaceUI.Views.Operations
  12. {
  13. public class RobotCommandViewModel : FurnaceUIViewModelBase
  14. {
  15. private Visibility robotCommandVisibility = Visibility.Visible;
  16. public Visibility RobotCommandVisibility
  17. {
  18. get => robotCommandVisibility;
  19. set
  20. {
  21. robotCommandVisibility = value;
  22. NotifyOfPropertyChange(nameof(RobotCommandVisibility));
  23. }
  24. }
  25. public Visibility waferChargeVisibility = Visibility.Visible;
  26. public Visibility WaferChargeVisibility
  27. {
  28. get => waferChargeVisibility;
  29. set
  30. {
  31. waferChargeVisibility = value;
  32. NotifyOfPropertyChange(nameof(WaferChargeVisibility));
  33. }
  34. }
  35. public bool IsEnabled { get; set; } = true;
  36. public bool IsEnabledAction { get; set; } = true;
  37. private string showTitle="";
  38. public string ShowTitle
  39. {
  40. get => showTitle;
  41. set
  42. {
  43. showTitle = value;
  44. NotifyOfPropertyChange(nameof(ShowTitle));
  45. }
  46. }
  47. public RobotCommandViewModel()
  48. {
  49. ShowRobotVisibilityChanged();
  50. }
  51. private void ShowRobotVisibilityChanged()
  52. {
  53. RobotCommandVisibility = Visibility.Visible;
  54. WaferChargeVisibility = Visibility.Hidden;
  55. ShowTitle = "Please select Robot Command";
  56. }
  57. private void WaferChargeVisibilityChanged()
  58. {
  59. RobotCommandVisibility = Visibility.Hidden;
  60. WaferChargeVisibility = Visibility.Visible;
  61. ShowTitle = "Please select Command Type";
  62. }
  63. public void RobotCommand(string command)
  64. {
  65. switch (command)
  66. {
  67. case "Initial":
  68. break;
  69. case "Home":
  70. break;
  71. case "AlarmReset":
  72. break;
  73. case "WaferTransfer":
  74. WaferChargeVisibilityChanged();
  75. break;
  76. case "BoatTransfer":
  77. break;
  78. case "MaterialMove":
  79. break;
  80. case "MachineMove":
  81. break;
  82. case "AbortStatus":
  83. break;
  84. default:
  85. break;
  86. }
  87. }
  88. public void WaferChargeCommand()
  89. {
  90. var windowManager = IoC.Get<IWindowManager>();
  91. SelectProductAndMonitorChargeViewModel selectProductAndMonitorChargeViewModel = new SelectProductAndMonitorChargeViewModel();
  92. (windowManager as WindowManager)?.ShowDialogWithTitle(selectProductAndMonitorChargeViewModel, null, "Wafer Charge");
  93. }
  94. public void WaferDisChargeCommand()
  95. {
  96. }
  97. public void BackCmd()
  98. {
  99. ShowRobotVisibilityChanged();
  100. }
  101. public void CancelCmd()
  102. {
  103. ((Window)GetView()).DialogResult = false;
  104. }
  105. }
  106. }