GasLeakCheckViewModel.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. private string ModuleName="PMA";
  21. #endregion
  22. #region 属性
  23. public List<string> LeakCheckMode
  24. {
  25. get { return m_LeakCheckMode; }
  26. set { SetProperty(ref m_LeakCheckMode, value); }
  27. }
  28. public int LeakCheckModeSelectedIndex
  29. {
  30. get { return m_LeakCheckModeSelectedIndex; }
  31. set { SetProperty(ref m_LeakCheckModeSelectedIndex, value); }
  32. }
  33. public int VentTime
  34. {
  35. get { return m_VentTime; }
  36. set { SetProperty(ref m_VentTime, value); }
  37. }
  38. public int CheckTime
  39. {
  40. get { return m_CheckTime; }
  41. set { SetProperty(ref m_CheckTime, value); }
  42. }
  43. public int LeakRateUpperLimit
  44. {
  45. get { return m_LeakRateUpperLimit; }
  46. set { SetProperty(ref m_LeakRateUpperLimit, value); }
  47. }
  48. public bool[] GasIsCheck
  49. {
  50. get { return m_GasIsCheck; }
  51. set { SetProperty(ref m_GasIsCheck, value); }
  52. }
  53. #endregion
  54. #region 命令
  55. private DelegateCommand _CheckCommand;
  56. public DelegateCommand CheckCommand =>
  57. _CheckCommand ?? (_CheckCommand = new DelegateCommand(OnCheck));
  58. #endregion
  59. #region 构造函数
  60. public GasLeakCheckViewModel()
  61. {
  62. m_LeakCheckMode = new List<string>() { "ChamberOnly", "ChamberAndGasLine", "ChamberAndGasLineAndFAC" };
  63. m_LeakCheckModeSelectedIndex = 0;
  64. m_VentTime = 120;
  65. m_CheckTime = 180;
  66. m_LeakRateUpperLimit = 10;
  67. }
  68. #endregion
  69. #region 命令方法
  70. private void OnCheck()
  71. {
  72. //InvokeClient.Instance.Service.DoOperation("System.SetConfig", $"{ModuleName}.Pump.LeakCheckPumpingTime", VentTime.ToString());
  73. //InvokeClient.Instance.Service.DoOperation("System.SetConfig", $"{ModuleName}.Pump.LeakCheckWaitTime", CheckTime.ToString());
  74. //InvokeClient.Instance.Service.DoOperation("System.SetConfig", $"{ModuleName}.Pump.LeakRate", LeakRateUpperLimit.ToString());
  75. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.LeakCheck", new[]
  76. {
  77. VentTime.ToString(),
  78. CheckTime.ToString(),
  79. LeakCheckMode[LeakCheckModeSelectedIndex],
  80. LeakRateUpperLimit.ToString(),
  81. GasIsCheck[0].ToString(),
  82. GasIsCheck[1].ToString(),
  83. GasIsCheck[2].ToString(),
  84. GasIsCheck[3].ToString(),
  85. GasIsCheck[4].ToString(),
  86. GasIsCheck[5].ToString(),
  87. GasIsCheck[6].ToString(),
  88. GasIsCheck[7].ToString(),
  89. });
  90. }
  91. #endregion
  92. }
  93. }