PlatformViewModel.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. using MECF.Framework.Common.OperationCenter;
  2. using Prism.Commands;
  3. using Prism.Mvvm;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace Venus_MainPages.ViewModels
  10. {
  11. public class PlatformViewModel : BindableBase
  12. {
  13. #region 私有字段
  14. private bool m_LoadLockDoorIsOpen;
  15. private bool m_PumpValveIsOpen;
  16. private bool m_VentValveIsOpen;
  17. private bool m_IsATM;
  18. private string ModuleName="PMA";
  19. #endregion
  20. #region 属性
  21. public bool LoadLockDoorIsOpen
  22. {
  23. get { return m_LoadLockDoorIsOpen; }
  24. set { SetProperty(ref m_LoadLockDoorIsOpen, value); }
  25. }
  26. public bool PumpValveIsOpen
  27. {
  28. get { return m_PumpValveIsOpen; }
  29. set { SetProperty(ref m_PumpValveIsOpen, value); }
  30. }
  31. public bool VentValveIsOpen
  32. {
  33. get { return m_VentValveIsOpen; }
  34. set { SetProperty(ref m_VentValveIsOpen, value); }
  35. }
  36. public bool IsATM
  37. {
  38. get { return m_IsATM; }
  39. set { SetProperty(ref m_IsATM, value); }
  40. }
  41. #endregion
  42. #region 命令
  43. private DelegateCommand _PurgeCommand;
  44. public DelegateCommand PurgeCommand =>
  45. _PurgeCommand ?? (_PurgeCommand = new DelegateCommand(OnPurge));
  46. private DelegateCommand _VentCommand;
  47. public DelegateCommand VentCommand =>
  48. _VentCommand ?? (_VentCommand = new DelegateCommand(OnVent));
  49. private DelegateCommand _PumpCommand;
  50. public DelegateCommand PumpCommand =>
  51. _PumpCommand ?? (_PumpCommand = new DelegateCommand(OnPump));
  52. #endregion
  53. #region 构造函数
  54. public PlatformViewModel()
  55. {
  56. m_IsATM = true;
  57. }
  58. #endregion
  59. #region 命令方法
  60. private void OnPump()
  61. {
  62. //PumpValveIsOpen = true;
  63. IsATM = !IsATM;
  64. }
  65. private void OnPurge()
  66. {
  67. //if (RtDataValues[$"{ModuleName}.FsmState"].ToString() == "Purge")
  68. //{
  69. // InvokeClient.Instance.Service.DoOperation($"{ModuleName}.StopPurge");
  70. //}
  71. //else
  72. //{
  73. // InvokeClient.Instance.Service.DoOperation($"{ModuleName}.Purge");
  74. //}
  75. }
  76. private void OnVent()
  77. {
  78. //if (RtDataValues[$"{ModuleName}.FsmState"].ToString() == "Vent")
  79. //{
  80. // //InvokeClient.Instance.Service.DoOperation($"{ModuleName}.StopPurge");
  81. //}
  82. //else
  83. //{
  84. // InvokeClient.Instance.Service.DoOperation($"{ModuleName}.Vent");
  85. //}
  86. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.VentLoadLock");
  87. }
  88. #endregion
  89. }
  90. }