终端一体化运控平台
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

348 lines
11 KiB

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