终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

351 lines
11 KiB

  1. using BPASmartClient.Device;
  2. using BPASmartClient.Model;
  3. using System;
  4. using System.Collections.Concurrent;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace BPASmartClient.MorkS
  10. {
  11. public class GVL_MORKS : IStatus
  12. {
  13. /// <summary>
  14. /// 机器人取面
  15. /// PLC -> M0.3
  16. /// ModbusTcp -> 323
  17. /// </summary>
  18. public bool RobotTakeNoodle { get; set; }
  19. /// <summary>
  20. /// 机器人出餐
  21. /// PLC -> M0.4
  22. /// ModbusTcp -> 324
  23. /// </summary>
  24. public bool RobotOutMeal { get; set; }
  25. /// <summary>
  26. /// 移动转台
  27. /// PLC -> M0.5
  28. /// ModbusTcp -> 325
  29. /// </summary>
  30. public bool MoveTurntable { get; set; }
  31. #region 临时变量
  32. /// <summary>
  33. /// 允许运行
  34. /// </summary>
  35. //[Circuit(new string[] { "机器人取面", "取碗控制" }, "允许运行")]
  36. [VariableMonitor("允许运行")]
  37. public bool AllowRun { get; set; }
  38. /// <summary>
  39. /// //机器人任务互锁信号
  40. /// </summary>
  41. //[Circuit(new string[] { "机器人取面", "出面控制" }, "机器人互锁", new bool[] { true, false })]
  42. [VariableMonitor("机器人任务互锁信号")]
  43. public bool RobotTaskInterlock { get; set; }
  44. /// <summary>
  45. /// 取碗互锁信号
  46. /// </summary>
  47. //[Circuit("取碗控制", "取碗互锁", true)]
  48. [VariableMonitor("取碗互锁信号")]
  49. public bool TakeBowlInterlock { get; set; }
  50. /// <summary>
  51. /// 取面互锁信号
  52. /// </summary>
  53. //[Circuit(new string[] { "机器人取面", "出面控制" }, "取面互锁信号", new bool[] { true, true })]
  54. [VariableMonitor("取面互锁信号")]
  55. public bool TakeNoodleInterlock { get; set; }
  56. /// <summary>
  57. /// 出面中
  58. /// </summary>
  59. //[Circuit("机器人取面", "出面中", true)]
  60. [VariableMonitor("出面中")]
  61. public bool OutNoodleing { get; set; }
  62. /// <summary>
  63. /// 允许取面
  64. /// </summary>
  65. //[Circuit(new string[] { "转台控制", "机器人取面" }, "允许取面", new bool[] { true, false })]
  66. [VariableMonitor("允许取面")]
  67. public bool AllowTakeNoodle { get; set; }
  68. /// <summary>
  69. /// 转台互锁信号
  70. /// </summary>
  71. [VariableMonitor("转台互锁信号")]
  72. public bool TurntableInterlock { get; set; }
  73. #endregion
  74. /// <summary>
  75. /// 初始化完成
  76. /// PLC -> M100.0
  77. /// ModbusTcp -> 1120
  78. /// </summary>
  79. //[Circuit(new string[] { "允许运行", "转台控制", "转台控制" }, "初始化完成")]
  80. [VariableMonitor("初始化完成", "M100.0", "1120")]
  81. public bool InitComplete { get; set; }
  82. /// <summary>
  83. /// 取碗机构空闲,True:忙碌,false:空闲
  84. /// PLC -> M100.1
  85. /// ModbusTcp -> 1121
  86. /// </summary>
  87. //[Circuit("取碗控制", "取碗机构空闲", true)]
  88. [VariableMonitor("取碗机构空闲", "M100.1", "1121")]
  89. public bool TakeBowlIdle { get; set; }
  90. /// <summary>
  91. /// 温度到达,True:表示到达,false:未到达
  92. /// PLC -> M100.2
  93. /// ModbusTcp -> 1122
  94. /// </summary>
  95. //[Circuit("允许运行", "温度到达")]
  96. [VariableMonitor("温度到达", "M100.2", "1122")]
  97. public bool TemperatureReached { get; set; }
  98. /// <summary>
  99. /// 允许到面,配料完成
  100. /// PLC -> M100.3
  101. /// ModbusTcp -> 1123
  102. /// </summary>
  103. //[Circuit("出面控制", "允许到面")]
  104. [VariableMonitor("允许到面", "M100.3", "1123")]
  105. public bool AllowFallNoodle { get; set; }
  106. /// <summary>
  107. /// 机器人取面完成
  108. /// PLC -> M100.4
  109. /// ModbusTcp -> 1124
  110. /// </summary>
  111. [VariableMonitor("机器人取面完成", "M100.4", "1124")]
  112. public bool RbTakeNoodleComplete { get; set; }
  113. /// <summary>
  114. /// 机器人倒面完成
  115. /// PLC -> M100.5
  116. /// ModbusTcp -> 1125
  117. /// </summary>
  118. [VariableMonitor("机器人倒面完成", "M100.5", "1125")]
  119. public bool RbFallNoodleComplete { get; set; }
  120. /// <summary>
  121. /// 机器人出餐完成,上报取餐完成
  122. /// PLC -> M100.6
  123. /// ModbusTcp -> 1126
  124. /// </summary>
  125. [VariableMonitor("机器人出餐完成", "M100.6", "1126")]
  126. public bool RbOutMealComplete { get; set; }
  127. /// <summary>
  128. /// 机器人空闲
  129. /// PLC -> M100.7
  130. /// ModbusTcp -> 1127
  131. /// </summary>
  132. //[Circuit(new string[] { "机器人取面", "出面控制" }, "机器人空闲")]
  133. [VariableMonitor("机器人空闲", "M100.7", "1127")]
  134. public bool RobotIdle { get; set; }
  135. /// <summary>
  136. /// 取餐口检测
  137. /// PLC -> M101.0
  138. /// ModbusTcp -> 1128
  139. /// </summary>
  140. //[Circuit("出面控制", "取餐口检测", true)]
  141. [VariableMonitor("取餐口检测", "M101.0", "1128")]
  142. public bool TakeMealDetect { get; set; }
  143. /// <summary>
  144. /// 缺碗信号,false:缺碗,true:有碗
  145. /// PLC -> M101.1
  146. /// ModbusTcp -> 1129
  147. /// </summary>
  148. [VariableMonitor("缺碗信号", "M101.1", "1129")]
  149. public bool MissingBowl { get; set; }
  150. /// <summary>
  151. /// 设备初始化中,执行中等于1,2秒后复位
  152. /// PLC -> M101.2
  153. /// ModbusTcp -> 1130
  154. /// </summary>
  155. [VariableMonitor("设备初始化中", "M101.2", "1130")]
  156. public bool DeviceIniting { get; set; }
  157. /// <summary>
  158. /// 转台下限检测
  159. /// PLC -> M101.3
  160. /// ModbusTcp -> 1131
  161. /// </summary>
  162. //[Circuit("转台控制", "转台下限检测有物料")]
  163. [VariableMonitor("转台下限检测", "M101.3", "1131")]
  164. public bool TurntableLowerLimit { get; set; }
  165. /// <summary>
  166. /// 缺碗信号 2
  167. /// PLC -> M101.4
  168. /// ModbusTcp -> 1132
  169. /// </summary>
  170. [VariableMonitor("缺碗信号 2", "M101.4", "1132")]
  171. public bool MissingBowlSignal2 { get; set; }
  172. /// <summary>
  173. /// 转台上限检测
  174. /// PLC -> M101.5
  175. /// ModbusTcp -> 1133
  176. /// </summary>
  177. [VariableMonitor("转台上限检测", "M101.5", "1133")]
  178. public bool TurntableUpLimit { get; set; }
  179. /// <summary>
  180. /// 补料完成
  181. /// PLC -> M101.6
  182. /// ModbusTcp -> 1134
  183. /// </summary>
  184. [VariableMonitor("补料完成", "M101.6", "1134")]
  185. public bool FeedComplete { get; set; }
  186. /// <summary>
  187. /// 转台移动到位
  188. /// PLC -> M101.7
  189. /// ModbusTcp -> 1135
  190. /// </summary>
  191. //[Circuit(new string[] { "转台控制", "机器人取面" }, "转台移动到位")]
  192. [VariableMonitor("转台移动到位", "M101.7", "1135")]
  193. public bool TurntableMoveInPlace { get; set; }
  194. /// <summary>
  195. /// 煮面炉状态,True:忙碌,false:空闲
  196. /// M102.0 - M102.5
  197. /// 1136 - 1141
  198. /// </summary>
  199. [VariableMonitor("煮面炉状态", "M102.0", "1136")]
  200. public bool[] NoodleCookerStatus { get; set; } = new bool[6] { false, false, false, false, false, false };
  201. /// <summary>
  202. /// 补料中
  203. /// M102.6
  204. /// 1142
  205. /// </summary>
  206. [VariableMonitor("补料中", "M102.6", "1142")]
  207. public bool Feeding { get; set; }
  208. /// <summary>
  209. /// 煮面完成,上升后给信号
  210. /// M103.0 - M103.5
  211. /// 1144 - 1149
  212. /// </summary>
  213. [VariableMonitor("煮面完成", "M103.0", "1144")]
  214. public bool[] CookNoodlesComplete { get; set; } = new bool[6] { false, false, false, false, false, false };
  215. /// <summary>
  216. /// 硬件设备异常
  217. /// PLC -> M235.0
  218. /// True:设备正常,False:设备异常
  219. /// </summary>
  220. [VariableMonitor("硬件设备异常", "M235.0", "")]
  221. public bool Error { get; set; } = false;
  222. /// <summary>
  223. /// 配方编号
  224. /// PLC -> VW0
  225. /// ModbusTcp -> 100
  226. /// </summary>
  227. [VariableMonitor("配方编号", "VW0", "100")]
  228. public ushort RecipeNumber { get; set; }
  229. /// <summary>
  230. /// 转台设置位置
  231. /// PLC -> VW2
  232. /// ModbusTcp -> 101
  233. /// </summary>
  234. [VariableMonitor("转台设置位置", "VW2", "101")]
  235. public ushort TurntableLoc { get; set; }
  236. /// <summary>
  237. /// 到面至煮面炉位置
  238. /// PLC -> VW4
  239. /// ModbusTcp -> 102
  240. /// </summary>
  241. [VariableMonitor("到面至煮面炉位置", "VW4", "102")]
  242. public ushort FallNoodleLoc { get; set; }
  243. /// <summary>
  244. /// 取面位置
  245. /// PLC -> VW6
  246. /// ModbusTcp -> 103
  247. /// </summary>
  248. [VariableMonitor("取面位置", "VW6", "103")]
  249. public ushort TakeNoodleLoc { get; set; }
  250. /// <summary>
  251. /// 转台反馈位置
  252. /// PLC -> VW372
  253. /// ModbusTcp -> 286
  254. /// </summary>
  255. [VariableMonitor("转台反馈位置", "VW372", "286")]
  256. public ushort TurntableFeedbackloc { get; set; }
  257. /// <summary>
  258. /// 机器人取面位置队列
  259. /// </summary>
  260. //[Circuit(new string[] { "转台控制", "机器人取面" }, "有机器人取面队列")]
  261. public ConcurrentQueue<OrderLocInfo> RBTakeNoodleTask { get; set; } = new ConcurrentQueue<OrderLocInfo>();
  262. /// <summary>
  263. /// 出碗队列
  264. /// </summary>
  265. //[Circuit("取碗控制", "有取碗队列数量")]
  266. public ConcurrentQueue<OrderLocInfo> TakeBowlTask { get; set; } = new ConcurrentQueue<OrderLocInfo>();
  267. public List<DoOrderEvent> doOrderEvents { get; set; } = new List<DoOrderEvent>();
  268. /// <summary>
  269. /// 是否有面条
  270. /// </summary>
  271. public bool IsNoodles { get; set; } = true;
  272. #region 订单ID记录
  273. /// <summary>
  274. /// 取碗订单ID
  275. /// </summary>
  276. public string TakeBowlId = string.Empty;
  277. /// <summary>
  278. /// 配料完成订单ID
  279. /// </summary>
  280. public string IngredientsCompleteId = string.Empty;
  281. /// <summary>
  282. /// 煮面口对应的订单ID
  283. /// </summary>
  284. public string[] CookNodelId = new string[6] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, };
  285. /// <summary>
  286. /// 出餐订单ID
  287. /// </summary>
  288. public string OutMealId = string.Empty;
  289. /// <summary>
  290. /// 转台位置轮询
  291. /// </summary>
  292. public List<ushort> TurntableLocLists = new List<ushort>();
  293. /// <summary>
  294. /// 转台当前启动位置
  295. /// </summary>
  296. [VariableMonitor("转台当前启动位置")]
  297. public ushort CurrentLoc { get; set; } = 0;
  298. #endregion
  299. }
  300. }