|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace BPASmartClient.KLMCoffee.Protocal
- {
- public class UpkeepMessage :BitValue
- {
- /// <summary>
- /// 1 冲泡器需要清洗,
- /// /// </summary>
- public bool 冲泡器需要清洗 { get; set; }
- /// <summary>
- /// 1 奶沫器需要清洗,
- /// /// </summary>
- public bool 奶沫器需要清洗 { get; set; }
- /// <summary>
- /// 1 咖啡机需要除垢,
- /// /// </summary>
- public bool 咖啡机需要除垢 { get; set; }
- /// <summary>
- /// 1 需要更换滤芯,
- /// /// </summary>
- public bool 需要更换滤芯 { get; set; }
-
- public UpkeepMessage(byte value)
- {
- 冲泡器需要清洗 = GetBitValue(value,3);
- 奶沫器需要清洗 = GetBitValue(value,2);
- 咖啡机需要除垢 = GetBitValue(value,1);
- 需要更换滤芯 = GetBitValue(value,0);
- }
-
- public bool IsUpkeep()
- {
- foreach (System.Reflection.PropertyInfo info in this.GetType().GetProperties())
- {
- if ((bool)info.GetValue(this) == true)
- {
- return true;
- }
- }
- return false;
- }
- }
- }
|