终端一体化运控平台
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

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