GasLeakCheckViewModel.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. internal class GasLeakCheckViewModel : BindableBase
  12. {
  13. #region 私有字段
  14. private List<string> m_LeakCheckMode;
  15. private int m_LeakCheckModeSelectedIndex;
  16. private int m_VentTime;
  17. private int m_CheckTime;
  18. private int m_LeakRateUpperLimit;
  19. private bool[] m_GasIsCheck=new bool[8];
  20. #endregion
  21. #region 属性
  22. public List<string> LeakCheckMode
  23. {
  24. get { return m_LeakCheckMode; }
  25. set { SetProperty(ref m_LeakCheckMode, value); }
  26. }
  27. public int LeakCheckModeSelectedIndex
  28. {
  29. get { return m_LeakCheckModeSelectedIndex; }
  30. set { SetProperty(ref m_LeakCheckModeSelectedIndex, value); }
  31. }
  32. public int VentTime
  33. {
  34. get { return m_VentTime; }
  35. set { SetProperty(ref m_VentTime, value); }
  36. }
  37. public int CheckTime
  38. {
  39. get { return m_CheckTime; }
  40. set { SetProperty(ref m_CheckTime, value); }
  41. }
  42. public int LeakRateUpperLimit
  43. {
  44. get { return m_LeakRateUpperLimit; }
  45. set { SetProperty(ref m_LeakRateUpperLimit, value); }
  46. }
  47. public bool[] GasIsCheck
  48. {
  49. get { return m_GasIsCheck; }
  50. set { SetProperty(ref m_GasIsCheck, value); }
  51. }
  52. #endregion
  53. #region 命令
  54. private DelegateCommand _CheckCommand;
  55. public DelegateCommand CheckCommand =>
  56. _CheckCommand ?? (_CheckCommand = new DelegateCommand(OnCheck));
  57. #endregion
  58. #region 构造函数
  59. public GasLeakCheckViewModel()
  60. {
  61. m_LeakCheckMode = new List<string>() { "ChamberOnly", "ChamberAndGasLine", "ChamberAndGasLineAndFAC" };
  62. m_LeakCheckModeSelectedIndex = 0;
  63. m_VentTime = 120;
  64. m_CheckTime = 180;
  65. m_LeakRateUpperLimit = 10;
  66. }
  67. #endregion
  68. #region 命令方法
  69. private void OnCheck()
  70. {
  71. InvokeClient.Instance.Service.DoOperation($"PMA.LeakCheck", new[]
  72. {
  73. VentTime.ToString()
  74. }); ;
  75. }
  76. #endregion
  77. }
  78. }