TempProfileTable.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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 TempProfileTable : ParameterTable
  12. {
  13. private string _preheatTime;
  14. public string PreheatTime
  15. {
  16. get => _preheatTime;
  17. set
  18. {
  19. _preheatTime = value;
  20. NotifyOfPropertyChange("PreheatTime");
  21. }
  22. }
  23. private string _checkTime;
  24. public string CheckTime
  25. {
  26. get => _checkTime;
  27. set
  28. {
  29. _checkTime = value;
  30. NotifyOfPropertyChange("CheckTime");
  31. }
  32. }
  33. private DoubleParam _limitU;
  34. public DoubleParam LimitU
  35. {
  36. get => _limitU;
  37. set
  38. {
  39. _limitU = value;
  40. NotifyOfPropertyChange("LimitU");
  41. }
  42. }
  43. private DoubleParam _limitCU;
  44. public DoubleParam LimitCU
  45. {
  46. get => _limitCU;
  47. set
  48. {
  49. _limitCU = value;
  50. NotifyOfPropertyChange("LimitCU");
  51. }
  52. }
  53. private DoubleParam _limitC;
  54. public DoubleParam LimitC
  55. {
  56. get => _limitC;
  57. set
  58. {
  59. _limitC = value;
  60. NotifyOfPropertyChange("LimitC");
  61. }
  62. }
  63. private DoubleParam _limitCL;
  64. public DoubleParam LimitCL
  65. {
  66. get => _limitCL;
  67. set
  68. {
  69. _limitCL = value;
  70. NotifyOfPropertyChange("LimitCL");
  71. }
  72. }
  73. private DoubleParam _limitL;
  74. public DoubleParam LimitL
  75. {
  76. get => _limitL;
  77. set
  78. {
  79. _limitL = value;
  80. NotifyOfPropertyChange("LimitL");
  81. }
  82. }
  83. private string _totalTime;
  84. public string TotalTime
  85. {
  86. get => _totalTime;
  87. set
  88. {
  89. _totalTime = value;
  90. NotifyOfPropertyChange("TotalTime");
  91. }
  92. }
  93. private DoubleParam _alarmLimit;
  94. public DoubleParam AlarmLimit
  95. {
  96. get => _alarmLimit;
  97. set
  98. {
  99. _alarmLimit = value;
  100. NotifyOfPropertyChange("AlarmLimit");
  101. }
  102. }
  103. public TempProfileTable() : base()
  104. {
  105. }
  106. public TempProfileTable(ParameterDataBase recipeData)
  107. {
  108. if (recipeData.Steps.Count <= 0) return;
  109. SetCurrentRecipeStep(recipeData, recipeData.Steps[0]);
  110. }
  111. public TempProfileTable(ParameterDataBase recipeData, int selectedStepNo)
  112. {
  113. ParameterTable step = recipeData.Steps.Where(x => x.StepNo == selectedStepNo).FirstOrDefault();
  114. SetCurrentRecipeStep(recipeData, step);
  115. }
  116. public void SetTempCorrectionData(string value)
  117. {
  118. if (string.IsNullOrEmpty(value)) return;
  119. string[] strTempCorrection = value.Split('|');
  120. foreach (var item in strTempCorrection)
  121. {
  122. if (string.IsNullOrEmpty(item)) continue;
  123. string[] subTempCorrection = item.Split(';');
  124. Dictionary<string, string> dictTempCorrection = new Dictionary<string, string>();
  125. foreach (var pid in subTempCorrection)
  126. {
  127. if (string.IsNullOrEmpty(item)) continue;
  128. var keyValue = pid.Split(':');
  129. if (keyValue == null || keyValue.Length != 2) continue;
  130. dictTempCorrection[keyValue[0]] = keyValue[1];
  131. }
  132. }
  133. }
  134. }
  135. }