using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BPASmartClient.KLMCoffee.Protocal { public class FaultMessage :BitValue { /// /// 蓄水盘没有安装 /// /// public bool 安装蓄水盘 { get; set; } /// /// 水箱缺水 /// public bool 水箱缺水 { get; set; } /// /// 磨豆异常,无豆检测有豆子,可能是磨豆少、磨豆机不转等问题。 /// public bool 磨豆异常 { get; set; } /// /// 蓄水盘废水满 /// public bool 蓄水盘满 { get; set; } /// /// 咖啡机满渣 /// public bool 咖啡渣满 { get; set; } /// /// 系统缺水 /// public bool 系统缺水 { get; set; } /// /// 冲泡器下压位置异常 /// public bool 冲泡器故障L { get; set; } /// /// 冲泡器复位位置异常 /// public bool 冲泡器故障H { get; set; } /// /// 咖啡机电热盘温度过高,高于设定上限温度 /// public bool 高温报警 { get; set; } /// /// 咖啡机开机温度检测环境温度低于 0°。需要温度升到 1° C 以上才可以使用 /// public bool 低温报警 { get; set; } /// /// NTC 损坏,阻值无穷大 /// public bool ERROR2 { get; set; } /// /// 豆盒中没有豆了 /// public bool 咖啡豆用尽 { get; set; } /// /// 电热盘保险丝烧断,加热 NTC 阻值无变化 /// /// public bool ERROR1 { get; set; } /// /// 制作咖啡时管路压力过大 /// public bool 压力过大 { get; set; } /// /// 连续 3 次系统补水,仍补不上水 /// public bool ERROR6 { get; set; } /// /// A & B 中没有牛奶 /// public bool 牛奶已用尽 { get; set; } public FaultMessage(byte valueL,byte valueH) { 安装蓄水盘 = GetBitValue(valueL,0); 水箱缺水 = GetBitValue(valueL,1); 磨豆异常 = GetBitValue(valueL,2); 蓄水盘满 = GetBitValue(valueL,3); 咖啡渣满 = GetBitValue(valueL,4); 系统缺水 = GetBitValue(valueL,5); 冲泡器故障L = GetBitValue(valueL,6); 冲泡器故障H = GetBitValue(valueL,7); 高温报警 = GetBitValue(valueL,0); 低温报警 = GetBitValue(valueH,1); ERROR2 = GetBitValue(valueH,2); 咖啡豆用尽 = GetBitValue(valueH,3); ERROR1 = GetBitValue(valueH,4); 压力过大 = GetBitValue(valueH,5); ERROR6 = GetBitValue(valueH,6); 牛奶已用尽 = GetBitValue(valueH,7); } public bool IsFault() { foreach (System.Reflection.PropertyInfo info in this.GetType().GetProperties()) { if ((bool)info.GetValue(this) == true) { return true; } } return false; } } }