LeakCheckConditionTable.cs 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. using Caliburn.Micro.Core;
  2. using RecipeEditorLib.RecipeModel.Params;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Collections.ObjectModel;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace MECF.Framework.UI.Client.CenterViews.Parameter
  10. {
  11. public class LeakCheckConditionTable : ParameterTable
  12. {
  13. private string _pressSensor;
  14. public string PressSensor
  15. {
  16. get => _pressSensor;
  17. set
  18. {
  19. _pressSensor = value;
  20. NotifyOfPropertyChange(nameof(PressSensor));
  21. }
  22. }
  23. private DoubleParam _pHHighLimit;
  24. public DoubleParam PHHighLimit
  25. {
  26. get => _pHHighLimit;
  27. set
  28. {
  29. _pHHighLimit = value;
  30. NotifyOfPropertyChange(nameof(PHHighLimit));
  31. }
  32. }
  33. private DoubleParam _pLLowLimit;
  34. public DoubleParam PLLowLimit
  35. {
  36. get => _pLLowLimit;
  37. set
  38. {
  39. _pLLowLimit = value;
  40. NotifyOfPropertyChange(nameof(PLLowLimit));
  41. }
  42. }
  43. private DoubleParam _bPLimit;
  44. public DoubleParam BPLimit
  45. {
  46. get => _bPLimit;
  47. set
  48. {
  49. _bPLimit = value;
  50. NotifyOfPropertyChange(nameof(BPLimit));
  51. }
  52. }
  53. private string _delayTime;
  54. public string DelayTime
  55. {
  56. get => _delayTime;
  57. set
  58. {
  59. _delayTime = value;
  60. NotifyOfPropertyChange(nameof(DelayTime));
  61. }
  62. }
  63. private string _checkTime;
  64. public string CheckTime
  65. {
  66. get => _checkTime;
  67. set
  68. {
  69. _checkTime = value;
  70. NotifyOfPropertyChange(nameof(CheckTime));
  71. }
  72. }
  73. private DoubleParam _leakLimit;
  74. public DoubleParam LeakLimit
  75. {
  76. get => _leakLimit;
  77. set
  78. {
  79. _leakLimit = value;
  80. NotifyOfPropertyChange(nameof(LeakLimit));
  81. }
  82. }
  83. private NumParam _retryLimit;
  84. public NumParam RetryLimit
  85. {
  86. get => _retryLimit;
  87. set
  88. {
  89. _retryLimit = value;
  90. NotifyOfPropertyChange(nameof(RetryLimit));
  91. }
  92. }
  93. private string _hightLimitCommand;
  94. public string HightLimitCommand
  95. {
  96. get => _hightLimitCommand;
  97. set
  98. {
  99. _hightLimitCommand = value;
  100. NotifyOfPropertyChange(nameof(HightLimitCommand));
  101. }
  102. }
  103. private string _lowLimitCommand;
  104. public string LowLimitCommand
  105. {
  106. get => _lowLimitCommand;
  107. set
  108. {
  109. _lowLimitCommand = value;
  110. NotifyOfPropertyChange(nameof(LowLimitCommand));
  111. }
  112. }
  113. private string _basePressureLimitCommand;
  114. public string BasePressureLimitCommand
  115. {
  116. get => _basePressureLimitCommand;
  117. set
  118. {
  119. _basePressureLimitCommand = value;
  120. NotifyOfPropertyChange(nameof(BasePressureLimitCommand));
  121. }
  122. }
  123. private string _errorCommand;
  124. public string ErrorCommand
  125. {
  126. get => _errorCommand;
  127. set
  128. {
  129. _errorCommand = value;
  130. NotifyOfPropertyChange(nameof(ErrorCommand));
  131. }
  132. }
  133. private string _retryOverCommand;
  134. public string RetryOverCommand
  135. {
  136. get => _retryOverCommand;
  137. set
  138. {
  139. _retryOverCommand = value;
  140. NotifyOfPropertyChange(nameof(RetryOverCommand));
  141. }
  142. }
  143. public LeakCheckConditionTable() : base()
  144. {
  145. }
  146. public LeakCheckConditionTable(ParameterDataBase recipeData)
  147. {
  148. if (recipeData.Steps.Count <= 0) return;
  149. SetCurrentRecipeStep(recipeData, recipeData.Steps[0]);
  150. }
  151. public LeakCheckConditionTable(ParameterDataBase recipeData, int selectedStepNo)
  152. {
  153. ParameterTable step = recipeData.Steps.Where(x => x.StepNo == selectedStepNo).FirstOrDefault();
  154. SetCurrentRecipeStep(recipeData, step);
  155. }
  156. public void SetTempPIDData(string value)
  157. {
  158. if (string.IsNullOrEmpty(value)) return;
  159. string[] strTempPID = value.Split('|');
  160. foreach (var item in strTempPID)
  161. {
  162. if (string.IsNullOrEmpty(item)) continue;
  163. string[] subTempPID = item.Split(';');
  164. Dictionary<string, string> dictTempPID = new Dictionary<string, string>();
  165. foreach (var pid in subTempPID)
  166. {
  167. if (string.IsNullOrEmpty(item)) continue;
  168. var keyValue = pid.Split(':');
  169. if (keyValue == null || keyValue.Length != 2) continue;
  170. dictTempPID[keyValue[0]] = keyValue[1];
  171. }
  172. }
  173. }
  174. }
  175. }