终端一体化运控平台
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

62 lines
2.0 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 UpkeepMessage :BitValue
  9. {
  10. /// <summary>
  11. /// 1 冲泡器需要清洗,
  12. /// /// </summary>
  13. public bool 冲泡器需要清洗 { get; set; }
  14. /// <summary>
  15. /// 1 奶沫器需要清洗,
  16. /// /// </summary>
  17. public bool 奶沫器需要清洗 { get; set; }
  18. /// <summary>
  19. /// 1 咖啡机需要除垢,
  20. /// /// </summary>
  21. public bool 咖啡机需要除垢 { get; set; }
  22. /// <summary>
  23. /// 1 需要更换滤芯,
  24. /// /// </summary>
  25. public bool 需要更换滤芯 { get; set; }
  26. public UpkeepMessage(byte value)
  27. {
  28. 冲泡器需要清洗 = GetBitValue(value,3);
  29. 奶沫器需要清洗 = GetBitValue(value,2);
  30. 咖啡机需要除垢 = GetBitValue(value,1);
  31. 需要更换滤芯 = GetBitValue(value,0);
  32. }
  33. public bool IsUpkeep()
  34. {
  35. foreach (System.Reflection.PropertyInfo info in this.GetType().GetProperties())
  36. {
  37. if ((bool)info.GetValue(this) == true)
  38. {
  39. return true;
  40. }
  41. }
  42. return false;
  43. }
  44. public string dataFault()
  45. {
  46. string message = string.Empty;
  47. foreach (System.Reflection.PropertyInfo info in this.GetType().GetProperties())
  48. {
  49. if ((bool)info.GetValue(this) == true)
  50. {
  51. message = message + " " + info.Name;
  52. }
  53. }
  54. return string.IsNullOrEmpty(message) ? "无" : message;
  55. }
  56. }
  57. }