终端一体化运控平台
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.
 
 
 

373 lines
14 KiB

  1. using BPASmartClient.Device;
  2. using BPASmartClient.Model.大炒;
  3. using BPASmartClient.MorkBF.Model;
  4. using System;
  5. using System.Collections.Concurrent;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace BPASmartClient.MorkBF
  11. {
  12. internal class GVL_MorkBF : IStatus
  13. {
  14. /// <summary>
  15. /// 炒锅1订单队列
  16. /// </summary>
  17. public ConcurrentQueue<FryPotMessages> FirePan1_Order { get; set; } = new ConcurrentQueue<FryPotMessages>();
  18. /// <summary>
  19. /// 炒锅2订单队列
  20. /// </summary>
  21. public ConcurrentQueue<FryPotMessages> FirePan2_Order { get; set; } = new ConcurrentQueue<FryPotMessages>();
  22. /// <summary>
  23. /// 机器人队列
  24. /// </summary>
  25. public ConcurrentQueue<RobotAction_Pot> RobotActinQueue { get; set; } = new ConcurrentQueue<RobotAction_Pot>();
  26. /// <summary>
  27. /// 炒锅1忙碌
  28. /// </summary>
  29. public bool FirePan1_Busy = false;
  30. /// <summary>
  31. /// 炒锅2忙碌
  32. /// </summary>
  33. public bool FirePan2_Busy = false;
  34. #region 炒锅1读取数据
  35. /// <summary>
  36. /// 炒锅1锅低温度
  37. /// </summary>
  38. [VariableMonitor("炒锅1锅低温度", "VW120","160")]
  39. public int FirePot1_Temperature { get; set; }
  40. /// <summary>
  41. /// 炒锅1脉冲值
  42. /// </summary>
  43. [VariableMonitor("炒锅1脉冲值", "VW122", "161")]
  44. public int FirePot1_Pulse { get; set; }
  45. /// <summary>
  46. /// 炒锅1初始化完成
  47. /// </summary>
  48. [VariableMonitor("炒锅1初始化完成", "M20.0", "480")]
  49. public bool FirePot1_InitCompleted { get; set; } = false;
  50. /// <summary>
  51. /// 炒锅1手动自动模式
  52. /// </summary>
  53. [VariableMonitor("炒锅1手动自动模式", "M20.1", "481")]
  54. public bool FirePot1_IsAuto { get; set; }
  55. /// <summary>
  56. /// 炒锅1急停
  57. /// </summary>
  58. [VariableMonitor("炒锅1急停", "M20.2", "482")]
  59. public bool FirePot1_Emergencystop{ get; set; }
  60. /// <summary>
  61. /// 1#炒锅荤菜盆有无检测
  62. /// </summary>
  63. [VariableMonitor("1#炒锅1锅低温度", "M20.3", "483")]
  64. public bool FirePot1_MealTubExist{ get; set; }
  65. /// <summary>
  66. /// 1#炒锅素菜盆1有无检测
  67. /// </summary>
  68. [VariableMonitor("炒锅素菜盆1有无检测", "M20.4", "484")]
  69. public bool FirePot1_VegetablesTub1Exist{ get; set; }
  70. /// <summary>
  71. /// 1#炒锅素菜盆2有无检测
  72. /// </summary>
  73. [VariableMonitor("1#炒锅素菜盆2有无检测", "M20.5", "485")]
  74. public bool FirePot1_VegetablesTub2Exist{ get; set; }
  75. /// <summary>
  76. /// 1#炒锅调料盆1有无检测
  77. /// </summary>
  78. [VariableMonitor("1#炒锅调料盆1有无检测", "M20.6", "486")]
  79. public bool FirePot1_Seasoning1Exist{ get; set; }
  80. /// <summary>
  81. /// 1#炒锅调料盆2有无检测
  82. /// </summary>
  83. [VariableMonitor("1#炒锅调料盆2有无检测", "M20.7", "487")]
  84. public bool FirePot1_Seasoning2Exist{ get; set; }
  85. /// <summary>
  86. /// 1#炒锅辅料盆1有无检测
  87. /// </summary>
  88. [VariableMonitor("1#炒锅辅料盆1有无检测", "M21.0", "488")]
  89. public bool FirePot1_Accessories1Exist{ get; set; }
  90. /// <summary>
  91. /// 1#炒锅辅料盆2有无检测
  92. /// </summary>
  93. [VariableMonitor("1#炒锅辅料盆2有无检测", "M21.1", "489")]
  94. public bool FirePot1_Accessories2Exist{ get; set; }
  95. /// <summary>
  96. /// 1#炒锅出餐空盆有无检测
  97. /// </summary>
  98. [VariableMonitor("1#炒锅出餐空盆有无检测", "M21.2", "490")]
  99. public bool FirePot1_OutFoodTubExist{ get; set; }
  100. /// <summary>
  101. /// 1#炒锅在原点反馈
  102. /// </summary>
  103. [VariableMonitor("1#炒锅在原点反馈", "M21.3", "491")]
  104. public bool FirePot1_OnOrigin{ get; set; }
  105. /// <summary>
  106. /// 1#炒制位置1反馈
  107. /// </summary>
  108. [VariableMonitor("1#炒制位置1反馈", "M21.4", "492")]
  109. public bool FirePot1_FirePosition1{ get; set; }
  110. /// <summary>
  111. /// 1#炒制位置2反馈
  112. /// </summary>
  113. [VariableMonitor("1#炒制位置2反馈", "M21.5", "493")]
  114. public bool FirePot1_FirePosition2{ get; set; }
  115. /// <summary>
  116. /// 1#炒制位置3反馈
  117. /// </summary>
  118. [VariableMonitor("1#炒制位置3反馈", "M21.6", "494")]
  119. public bool FirePot1_FirePosition3{ get; set; }
  120. /// <summary>
  121. /// 1#炒制位置4反馈
  122. /// </summary>
  123. [VariableMonitor("1#炒制位置4反馈", "M21.7", "495")]
  124. public bool FirePot1_FirePosition4{ get; set; }
  125. /// <summary>
  126. /// 1#炒锅在出餐倒料位置反馈
  127. /// </summary>
  128. [VariableMonitor("1#炒锅在出餐倒料位置反馈", "M22.0", "496")]
  129. public bool FirePot1_PotOnOutFoodPosition{ get; set; }
  130. /// <summary>
  131. /// 1#炒锅在投料位置反馈、
  132. /// </summary>
  133. [VariableMonitor("1#炒锅在投料位置反馈", "M22.1", "497")]
  134. public bool FirePot1_PotOnIntoFoodPosition{ get; set; }
  135. /// <summary>
  136. /// 1#炒锅在洗锅位置反馈
  137. /// </summary>
  138. [VariableMonitor("1#炒锅在洗锅位置反馈", "M22.2", "498")]
  139. public bool FirePot1_PotOnCleanPosition{ get; set; }
  140. #endregion
  141. #region 炒锅2读取数据
  142. /// <summary>
  143. /// 炒锅2锅低温度
  144. /// </summary>
  145. [VariableMonitor("炒锅2锅低温度", "VW150", "175")]
  146. public int FirePot2_Temperature{ get; set; }
  147. /// <summary>
  148. /// 炒锅2脉冲值
  149. /// </summary>
  150. [VariableMonitor("炒锅2脉冲值", "VW152", "176")]
  151. public int FirePot2_Pulse{ get; set; }
  152. /// <summary>
  153. /// 炒锅2初始化完成
  154. /// </summary>
  155. [VariableMonitor("炒锅2初始化完成", "M25.0", "520")]
  156. public bool FirePot2_InitCompleted { get; set; } = false;
  157. /// <summary>
  158. /// 炒锅2手动自动模式
  159. /// </summary>
  160. [VariableMonitor("炒锅2手动自动模式", "M25.1", "521")]
  161. public bool FirePot2_IsAuto{ get; set; }
  162. /// <summary>
  163. /// 炒锅2急停
  164. /// </summary>
  165. [VariableMonitor("炒锅2急停", "M25.2", "522")]
  166. public bool FirePot2_Emergencystop{ get; set; }
  167. /// <summary>
  168. /// 2#炒锅荤菜盆有无检测
  169. /// </summary>
  170. [VariableMonitor("2#炒锅荤菜盆有无检测", "M25.3", "523")]
  171. public bool FirePot2_MealTubExist{ get; set; }
  172. /// <summary>
  173. /// 2#炒锅素菜盆1有无检测
  174. /// </summary>
  175. [VariableMonitor("2#炒锅素菜盆1有无检测", "M25.4", "524")]
  176. public bool FirePot2_VegetablesTub1Exist{ get; set; }
  177. /// <summary>
  178. /// 2#炒锅素菜盆2有无检测
  179. /// </summary>
  180. [VariableMonitor("2#炒锅素菜盆2有无检测", "M25.5", "525")]
  181. public bool FirePot2_VegetablesTub2Exist{ get; set; }
  182. /// <summary>
  183. /// 2#炒锅调料盆1有无检测
  184. /// </summary>
  185. [VariableMonitor("2#炒锅调料盆1有无检测", "M25.6", "526")]
  186. public bool FirePot2_Seasoning1Exist{ get; set; }
  187. /// <summary>
  188. /// 2#炒锅调料盆2有无检测
  189. /// </summary>
  190. [VariableMonitor("2#炒锅调料盆2有无检测", "M25.7", "527")]
  191. public bool FirePot2_Seasoning2Exist{ get; set; }
  192. /// <summary>
  193. /// 2#炒锅辅料盆1有无检测
  194. /// </summary>
  195. [VariableMonitor("2#炒锅1锅低温度", "M26.0", "528")]
  196. public bool FirePot2_Accessories1Exist{ get; set; }
  197. /// <summary>
  198. /// 2#炒锅辅料盆2有无检测
  199. /// </summary>
  200. [VariableMonitor("2#炒锅辅料盆2有无检测", "M26.1", "529")]
  201. public bool FirePot2_Accessories2Exist{ get; set; }
  202. /// <summary>
  203. /// 2#炒锅出餐空盆有无检测
  204. /// </summary>
  205. [VariableMonitor("2#炒锅出餐空盆有无检测", "M26.2", "530")]
  206. public bool FirePot2_OutFoodTubExist{ get; set; }
  207. /// <summary>
  208. /// 2#炒锅在原点反馈
  209. /// </summary>
  210. [VariableMonitor("2#炒锅在原点反馈", "M26.3", "531")]
  211. public bool FirePot2_OnOrigin{ get; set; }
  212. /// <summary>
  213. /// 2#炒制位置1反馈
  214. /// </summary>
  215. [VariableMonitor("2#炒制位置1反馈", "M26.4", "532")]
  216. public bool FirePot2_FirePosition1{ get; set; }
  217. /// <summary>
  218. /// 2#炒制位置2反馈
  219. /// </summary>
  220. [VariableMonitor("2#炒制位置2反馈", "M26.5", "533")]
  221. public bool FirePot2_FirePosition2{ get; set; }
  222. /// <summary>
  223. /// 2#炒制位置3反馈
  224. /// </summary>
  225. [VariableMonitor("2#炒制位置3反馈", "M26.6", "534")]
  226. public bool FirePot2_FirePosition3{ get; set; }
  227. /// <summary>
  228. /// 2#炒制位置4反馈
  229. /// </summary>
  230. [VariableMonitor("2#炒制位置4反馈", "M26.7", "535")]
  231. public bool FirePot2_FirePosition4{ get; set; }
  232. /// <summary>
  233. /// 2#炒锅在出餐倒料位置反馈
  234. /// </summary>
  235. [VariableMonitor("2#炒锅在出餐倒料位置反馈", "M27.0", "536")]
  236. public bool FirePot2_PotOnOutFoodPosition{ get; set; }
  237. /// <summary>
  238. /// 2#炒锅在投料位置反馈、
  239. /// </summary>
  240. [VariableMonitor("2#炒锅在投料位置反馈", "M27.1", "537")]
  241. public bool FirePot2_PotOnIntoFoodPosition{ get; set; }
  242. /// <summary>
  243. /// 2#炒锅在洗锅位置反馈
  244. /// </summary>
  245. [VariableMonitor("2#炒锅在洗锅位置反馈", "M27.2", "538")]
  246. public bool FirePot2_PotOnCleanPosition{ get; set; }
  247. #endregion
  248. #region 机器人数据读取
  249. public bool Robot_IsBusy;
  250. /// <summary>
  251. /// 机器人在原点位
  252. /// </summary>
  253. [VariableMonitor("机器人在原点位", "GM105", "4201")]
  254. public bool Robot_Origin { get; set; }
  255. /// <summary>
  256. /// 1号锅倒荤菜完成
  257. /// </summary>
  258. [VariableMonitor("机器人#1号锅倒荤菜完成", "GM500", "4596")]
  259. public bool Robot_FirePot1OutMeal{ get; set; }
  260. /// <summary>
  261. /// 1号炒锅倒素菜1完成
  262. /// </summary>
  263. [VariableMonitor("机器人#1号炒锅倒素菜1完成", "GM501", "4597")]
  264. public bool Robot_FirePot1OutVegetables1{ get; set; }
  265. /// <summary>
  266. /// 1号炒锅倒素菜2完成
  267. /// </summary>
  268. [VariableMonitor("机器人#1号炒锅倒素菜2完成", "GM502", "4598")]
  269. public bool Robot_FirePot1OutVegetables2{ get; set; }
  270. /// <summary>
  271. /// 1号炒锅倒调料完成
  272. /// </summary>
  273. [VariableMonitor("机器人#1号炒锅倒调料完成", "GM503", "4599")]
  274. public bool Robot_FirePot1OutSeasoning{ get; set; }
  275. /// <summary>
  276. /// 1号炒锅倒辅料完成
  277. /// </summary>
  278. [VariableMonitor("机器人#1号炒锅倒辅料完成", "GM504", "4600")]
  279. public bool Robot_FirePot1OutAccessories{ get; set; }
  280. /// <summary>
  281. /// 机器人到位,请求1#炒锅倒菜
  282. /// </summary>
  283. [VariableMonitor("机器人到位,请求1#炒锅倒菜", "GM505", "4601")]
  284. public bool Robot_ArriveFirePot1{ get; set; }
  285. /// <summary>
  286. /// 1号炒锅出餐完成
  287. /// </summary>
  288. [VariableMonitor("机器人#1号炒锅出餐完成", "GM506", "4602")]
  289. public bool Robot_FirePot1OutFoodComplete{ get; set; }
  290. /// <summary>
  291. /// 2号锅倒荤菜完成
  292. /// </summary>
  293. [VariableMonitor("机器人#2号锅倒荤菜完成", "GM510", "4606")]
  294. public bool Robot_FirePot2OutMeal { get; set; }
  295. /// <summary>
  296. /// 2号炒锅倒素菜1完成
  297. /// </summary>
  298. [VariableMonitor("机器人#2号炒锅倒素菜1完成", "GM511", "4607")]
  299. public bool Robot_FirePot2OutVegetables1{ get; set; }
  300. /// <summary>
  301. /// 2号炒锅倒素菜2完成
  302. /// </summary>
  303. [VariableMonitor("2号炒锅倒素菜2完成", "GM512", "4608")]
  304. public bool Robot_FirePot2OutVegetables2{ get; set; }
  305. /// <summary>
  306. /// 2号炒锅倒调料完成
  307. /// </summary>
  308. [VariableMonitor("机器人#2号炒锅倒调料完成", "GM513", "4609")]
  309. public bool Robot_FirePot2OutSeasoning{ get; set; }
  310. /// <summary>
  311. /// 2号炒锅倒辅料完成
  312. /// </summary>
  313. [VariableMonitor("机器人#2号炒锅倒辅料完成", "GM514", "4610")]
  314. public bool Robot_FirePot2OutAccessories{ get; set; }
  315. /// <summary>
  316. /// 机器人到位,请求1#炒锅倒菜
  317. /// </summary>
  318. [VariableMonitor("机器人#机器人到位,请求1#炒锅倒菜", "GM515", "4611")]
  319. public bool Robot_ArriveFirePot2{ get; set; }
  320. /// <summary>
  321. /// 2号炒锅出餐完成
  322. /// </summary>
  323. [VariableMonitor("机器人#2号炒锅出餐完成", "GM516", "4612")]
  324. public bool Robot_FirePot2OutFoodComplete{ get; set; }
  325. /// <summary>
  326. /// 机器人动作反馈
  327. /// </summary>
  328. [VariableMonitor("机器人动作反馈", "GI5", "5")]
  329. public int Robot_ActionCallback{ get; set; }
  330. #endregion
  331. public Dictionary<int, bool> FirePot1_CompleteSingle { get; set; }
  332. public Dictionary<int, bool> FirePot2_CompleteSingle { get; set; }
  333. public GVL_MorkBF()
  334. {
  335. FirePot1_CompleteSingle = new Dictionary<int, bool>
  336. {
  337. {1,Robot_FirePot1OutMeal },
  338. {2,Robot_FirePot1OutVegetables1 },
  339. {3,Robot_FirePot1OutVegetables2 },
  340. };
  341. FirePot2_CompleteSingle = new Dictionary<int, bool>
  342. {
  343. {1,Robot_FirePot2OutMeal },
  344. {2,Robot_FirePot2OutVegetables1 },
  345. {3,Robot_FirePot2OutVegetables2 },
  346. };
  347. }
  348. public DateTime FirePan1_Date;
  349. public DateTime FirePan2_Date;
  350. }
  351. }