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