终端一体化运控平台
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

UpkeepMessage.cs 1.6 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. }
  45. }