终端一体化运控平台
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

122 строки
4.8 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace BPASmartClient.KLMCoffee.Protocal
  7. {
  8. public class FaultMessage :BitValue
  9. {
  10. /// <summary>
  11. /// 蓄水盘没有安装
  12. /// /// </summary>
  13. public bool 安装蓄水盘 { get; set; }
  14. /// <summary>
  15. /// 水箱缺水
  16. /// </summary>
  17. public bool 水箱缺水 { get; set; }
  18. /// <summary>
  19. /// 磨豆异常,无豆检测有豆子,可能是磨豆少、磨豆机不转等问题。
  20. /// </summary>
  21. public bool 磨豆异常 { get; set; }
  22. /// <summary>
  23. /// 蓄水盘废水满
  24. /// </summary>
  25. public bool 蓄水盘满 { get; set; }
  26. /// <summary>
  27. /// 咖啡机满渣
  28. /// </summary>
  29. public bool 咖啡渣满 { get; set; }
  30. /// <summary>
  31. /// 系统缺水
  32. /// </summary>
  33. public bool 系统缺水 { get; set; }
  34. /// <summary>
  35. /// 冲泡器下压位置异常
  36. /// </summary>
  37. public bool 冲泡器故障L { get; set; }
  38. /// <summary>
  39. /// 冲泡器复位位置异常
  40. /// </summary>
  41. public bool 冲泡器故障H { get; set; }
  42. /// <summary>
  43. /// 咖啡机电热盘温度过高,高于设定上限温度
  44. /// </summary>
  45. public bool 高温报警 { get; set; }
  46. /// <summary>
  47. /// 咖啡机开机温度检测环境温度低于 0°。需要温度升到 1° C 以上才可以使用
  48. /// </summary>
  49. public bool 低温报警 { get; set; }
  50. /// <summary>
  51. /// NTC 损坏,阻值无穷大
  52. /// </summary>
  53. public bool ERROR2 { get; set; }
  54. /// <summary>
  55. /// 豆盒中没有豆了
  56. /// </summary>
  57. public bool 咖啡豆用尽 { get; set; }
  58. /// <summary>
  59. /// 电热盘保险丝烧断,加热 NTC 阻值无变化
  60. /// /// </summary>
  61. public bool ERROR1 { get; set; }
  62. /// <summary>
  63. /// 制作咖啡时管路压力过大
  64. /// </summary>
  65. public bool 压力过大 { get; set; }
  66. /// <summary>
  67. /// 连续 3 次系统补水,仍补不上水
  68. /// </summary>
  69. public bool ERROR6 { get; set; }
  70. /// <summary>
  71. /// A & B 中没有牛奶
  72. /// </summary>
  73. public bool 牛奶已用尽 { get; set; }
  74. public FaultMessage(byte valueL,byte valueH)
  75. {
  76. 安装蓄水盘 = GetBitValue(valueL,0);
  77. 水箱缺水 = GetBitValue(valueL,1);
  78. 磨豆异常 = GetBitValue(valueL,2);
  79. 蓄水盘满 = GetBitValue(valueL,3);
  80. 咖啡渣满 = GetBitValue(valueL,4);
  81. 系统缺水 = GetBitValue(valueL,5);
  82. 冲泡器故障L = GetBitValue(valueL,6);
  83. 冲泡器故障H = GetBitValue(valueL,7);
  84. 高温报警 = GetBitValue(valueL,0);
  85. 低温报警 = GetBitValue(valueH,1);
  86. ERROR2 = GetBitValue(valueH,2);
  87. 咖啡豆用尽 = GetBitValue(valueH,3);
  88. ERROR1 = GetBitValue(valueH,4);
  89. 压力过大 = GetBitValue(valueH,5);
  90. ERROR6 = GetBitValue(valueH,6);
  91. 牛奶已用尽 = GetBitValue(valueH,7);
  92. }
  93. public bool IsFault()
  94. {
  95. foreach (System.Reflection.PropertyInfo info in this.GetType().GetProperties())
  96. {
  97. if ((bool)info.GetValue(this) == true)
  98. {
  99. return true;
  100. }
  101. }
  102. return false;
  103. }
  104. public string dataFault()
  105. {
  106. string message = string.Empty;
  107. foreach (System.Reflection.PropertyInfo info in this.GetType().GetProperties())
  108. {
  109. if ((bool)info.GetValue(this) == true)
  110. {
  111. message= message +" "+ info.Name;
  112. }
  113. }
  114. return string.IsNullOrEmpty(message)?"无": message;
  115. }
  116. }
  117. }