终端一体化运控平台
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

ICMSG_Heart_UP.cs 3.0 KiB

2 anni fa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using BPASmartClient.Model.冰淇淋.Enum;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Runtime.InteropServices;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using static BPASmartClient.GSIceCream.MessageDefine;
  9. namespace BPASmartClient.GSIceCream
  10. {
  11. /// <summary>
  12. /// 心跳下发
  13. /// </summary>
  14. [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
  15. public class ICMSG_Heart_UP
  16. {
  17. public byte Header1;
  18. public byte Header2;
  19. public IC_CMD Cmd;
  20. public MORKI_MODE Mode;
  21. public byte YLWD_H;
  22. public byte YLWD_L;
  23. public byte HQWD_H;
  24. public byte HQWD_L;
  25. public byte HJWD_H;
  26. public byte HJWD_L;
  27. public byte DL_H;
  28. public byte DL_L;
  29. public byte DY_H;
  30. public byte DY_L;
  31. public byte GZ_H;
  32. public byte GZ_L;
  33. public MORKI_MODE MS;
  34. public byte DLTJ;
  35. public byte CXB;
  36. public byte DLBS_H;
  37. public byte DLBS_L;
  38. public short CalcCode;
  39. public ICMSG_Heart_UP()
  40. {
  41. Header1 = HEADER1;
  42. Header2 = HEADER2_UP;
  43. Cmd = IC_CMD.HEART;
  44. }
  45. public bool HasGZ(out string msg)
  46. {
  47. msg = string.Empty;
  48. msg += ((GZ_H >> 7) & 1) == 1 ? "通讯故障" : string.Empty;
  49. msg += ((GZ_H >> 6) & 1) == 1 ? "电流过载" : string.Empty;
  50. msg += ((GZ_H >> 5) & 1) == 1 ? "环境温度过高" : string.Empty;
  51. msg += ((GZ_H >> 4) & 1) == 1 ? "环境温度异常" : string.Empty;
  52. msg += ((GZ_H >> 3) & 1) == 1 ? "进气温度故障" : string.Empty;
  53. msg += ((GZ_H >> 2) & 1) == 1 ? "保鲜温度异常" : string.Empty;
  54. msg += ((GZ_H >> 1) & 1) == 1 ? "冷冻温度异常" : string.Empty;
  55. msg += ((GZ_L >> 7) & 1) == 1 ? "电压过高" : string.Empty;
  56. msg += ((GZ_L >> 6) & 1) == 1 ? "电压过低" : string.Empty;
  57. msg += ((GZ_L >> 5) & 1) == 1 ? "制冷不良" : string.Empty;
  58. msg += ((GZ_L >> 4) & 1) == 1 ? "转速传感器异常" : string.Empty;
  59. msg += ((GZ_L >> 3) & 1) == 1 ? "皮带打滑" : string.Empty;
  60. msg += ((GZ_L >> 2) & 1) == 1 ? "冻缸报警" : string.Empty;
  61. msg += ((GZ_L >> 1) & 1) == 1 ? "缺料报警" : string.Empty;
  62. msg = msg == string.Empty ? "无异常" : msg;
  63. return string.IsNullOrEmpty(msg);
  64. }
  65. public string DLTJ_Desc()
  66. {
  67. if ((DLTJ >> 7 & 1) == 1) return "有料";
  68. if ((DLTJ >> 6 & 1) == 1) return "缺料";
  69. if ((DLTJ >> 5 & 1) == 1) return "未使用";
  70. if ((DLTJ >> 4 & 1) == 1) return "未使用";
  71. if ((DLTJ >> 3 & 1) == 1) return "未使用";
  72. if ((DLTJ >> 2 & 1) == 1) return "打料电机复位完成";
  73. if ((DLTJ >> 1 & 1) == 1) return "未使用";
  74. if ((DLTJ & 1) == 1) return "成型比大于或等于87";
  75. return string.Empty;
  76. }
  77. }
  78. }