终端一体化运控平台
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

357 linhas
12 KiB

  1. using BPA.Message;
  2. using BPA.Models;
  3. using BPASmartClient.Device;
  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.MorkF
  11. {
  12. internal class GVL_MorkF
  13. {
  14. /// <summary>
  15. /// 小炒队列
  16. /// </summary>
  17. public ConcurrentQueue<OrderLocInfo> StirFryGoodsQuenes { get; set; } = new ConcurrentQueue<OrderLocInfo>();
  18. public bool IsAuto = true;
  19. #region 炒锅
  20. /// <summary>
  21. /// 炒锅上一次搅拌档位
  22. /// </summary>
  23. public int Stir { set; get; }
  24. /// <summary>
  25. /// 炒锅上一次火力
  26. /// </summary>
  27. public int Fire { get; set; }
  28. /// <summary>
  29. /// 炒锅是否在工作状态中
  30. /// </summary>
  31. public bool FryWorking { get; set; }
  32. /// <summary>
  33. /// 炒锅自动模式
  34. /// </summary>
  35. [VariableMonitor("炒锅1锅低温度", "VW120", "160")]
  36. public bool AutoMode { get; set; }
  37. /// <summary>
  38. /// 炒锅1初始化完成
  39. /// </summary>
  40. public bool FryPot1_InitialComplete { get; set; }
  41. /// <summary>
  42. /// 炒锅1允许HBOT放盒
  43. /// </summary>
  44. public bool FryPot1_HOBTPut { get; set; }
  45. /// <summary>
  46. /// 炒锅1允许HBOT取盒
  47. /// </summary>
  48. public bool FryPot1_HOBTGet { get; set; }
  49. /// <summary>
  50. /// 往炒锅倒菜完成
  51. /// </summary>
  52. public bool FryPot1_MaterialIntoPot { get; set; }
  53. /// <summary>
  54. /// 出餐完成
  55. /// </summary>
  56. public bool OutFoodCompelete { get; set; }
  57. /// <summary>
  58. /// 允许出餐倒菜
  59. /// </summary>
  60. public bool CanOutFood { get; set; }
  61. /// <summary>
  62. /// 窗口取餐完成
  63. /// </summary>
  64. public bool GetFoodCompelete { set; get; }
  65. /// <summary>
  66. /// 允许倒洗锅水
  67. /// </summary>
  68. public bool CanOutPotWashingWater { get; set; }
  69. /// <summary>
  70. /// 搅拌臂在原点位
  71. /// </summary>
  72. public bool ArmOnOrigin { get; set; }
  73. /// <summary>
  74. /// 搅拌臂在工作位
  75. /// </summary>
  76. public bool ArmOnWorking { get; set; }
  77. /// <summary>
  78. /// 锅在原点位
  79. /// </summary>
  80. public bool PotOnOrigin { get; set; }
  81. /// <summary>
  82. /// 获取菜品是否完成
  83. /// </summary>
  84. public bool GetMaterialComplete { get; set; }
  85. #endregion
  86. #region 炒锅大屏相关
  87. /// <summary>
  88. /// 异常订单数量统计
  89. /// </summary>
  90. public int orderAbnormalCount { get; set; } = 0;
  91. /// <summary>
  92. /// 订单数量统计
  93. /// </summary>
  94. public int orderCount { get; set; } = 0;
  95. /// <summary>
  96. /// 当前炒制菜品
  97. /// </summary>
  98. public string GoodName { get; set; }
  99. /// <summary>
  100. /// 当前任务
  101. /// </summary>
  102. public string Task { get; set; }
  103. /// <summary>
  104. /// 当前加热档位
  105. /// </summary>
  106. public string FireNow { get; set; }
  107. /// <summary>
  108. /// 搅拌档位
  109. /// </summary>
  110. public string StirNow { get; set; }
  111. /// <summary>
  112. /// 炒锅当前锅底温度
  113. /// </summary>
  114. public string TempNow { get; set; }
  115. /// <summary>
  116. /// 当前炒锅进展
  117. /// </summary>
  118. public List<ProcessModel> processModels { get; set; } = new List<ProcessModel>();
  119. public void UpdateProcess(PotActions potActions)
  120. {
  121. switch (potActions.Actions)
  122. {
  123. case nameof(StirFryPotActionEnum.搅拌臂炒制位):
  124. //设置为开始
  125. SetState(0);
  126. Task = "开始";
  127. break;
  128. case nameof(StirFryPotActionEnum.加热开启):
  129. Task = "热油";
  130. //设置为热油
  131. SetState(1);
  132. break;
  133. ///以下为不处理,炒制菜品可能为热油阶段,不处理,取原料可能在开启后立即开始
  134. case nameof(StirFryPotActionEnum.取原料):
  135. case nameof(StirFryPotActionEnum.炒制菜品):
  136. break;
  137. case nameof(StirFryPotActionEnum.设置搅拌挡位1):
  138. StirNow = "1";
  139. break;
  140. case nameof(StirFryPotActionEnum.设置搅拌挡位2):
  141. StirNow = "2";
  142. break;
  143. case nameof(StirFryPotActionEnum.设置搅拌挡位3):
  144. StirNow = "3";
  145. break;
  146. case nameof(StirFryPotActionEnum.关闭搅拌):
  147. StirNow = "0";
  148. break;
  149. case nameof(StirFryPotActionEnum.设置加热挡位1):
  150. TempNow = "60";
  151. FireNow = "1";
  152. break;
  153. case nameof(StirFryPotActionEnum.设置加热挡位2):
  154. TempNow = "100";
  155. FireNow = "2";
  156. break;
  157. case nameof(StirFryPotActionEnum.设置加热挡位3):
  158. TempNow = "120";
  159. FireNow = "3";
  160. break;
  161. case nameof(StirFryPotActionEnum.设置加热挡位4):
  162. TempNow = "150";
  163. FireNow = "4";
  164. break;
  165. case nameof(StirFryPotActionEnum.设置加热挡位5):
  166. TempNow = "200";
  167. FireNow = "5";
  168. break;
  169. case nameof(StirFryPotActionEnum.设置加热挡位6):
  170. TempNow = "250";
  171. FireNow = "6";
  172. break;
  173. case nameof(StirFryPotActionEnum.设置加热挡位7):
  174. TempNow = "300";
  175. FireNow = "7";
  176. break;
  177. case nameof(StirFryPotActionEnum.设置加热挡位8):
  178. TempNow = "350";
  179. FireNow = "8";
  180. break;
  181. case nameof(StirFryPotActionEnum.设置加热挡位9):
  182. TempNow = "400";
  183. FireNow = "9";
  184. break;
  185. case nameof(StirFryPotActionEnum.设置加热挡位10):
  186. TempNow = "500";
  187. FireNow = "10";
  188. break;
  189. ///以下为待定
  190. case nameof(StirFryPotActionEnum.停止加热):
  191. break;
  192. case nameof(StirFryPotActionEnum.开启搅拌):
  193. break;
  194. case nameof(StirFryPotActionEnum.道菜启动):
  195. case nameof(StirFryPotActionEnum.加调料):
  196. Task = "炒制";
  197. //设置为炒制
  198. SetState(2);
  199. break;
  200. case nameof(StirFryPotActionEnum.出餐启动):
  201. Task = "出餐";
  202. SetState(3);
  203. break;
  204. ///设置为结束
  205. case nameof(StirFryPotActionEnum.搅拌臂原点位):
  206. case nameof(StirFryPotActionEnum.洗锅):
  207. Task = "完成";
  208. SetState(4);
  209. break;
  210. default:
  211. break;
  212. }
  213. }
  214. private void SetState(int c)
  215. {
  216. for (int i = 0; i < processModels.Count; i++)
  217. {
  218. if (i == c)
  219. {
  220. processModels[i].Status = ProcessStatus.正在执行;
  221. }
  222. else if (i < c) processModels[i].Status = ProcessStatus.执行完成;
  223. else if (i > c) processModels[i].Status = ProcessStatus.未执行;
  224. }
  225. }
  226. public void ScreenInit()
  227. {
  228. processModels.Clear();
  229. //初始化进度列表
  230. processModels.Add(new ProcessModel() { Id = 1, Name = "开始", Status = ProcessStatus.未执行 });
  231. processModels.Add(new ProcessModel() { Id = 2, Name = "热油", Status = ProcessStatus.未执行 });
  232. processModels.Add(new ProcessModel() { Id = 3, Name = "炒制", Status = ProcessStatus.未执行 });
  233. processModels.Add(new ProcessModel() { Id = 4, Name = "出餐", Status = ProcessStatus.未执行 });
  234. processModels.Add(new ProcessModel() { Id = 5, Name = "完成", Status = ProcessStatus.未执行 });
  235. }
  236. #endregion
  237. #region 调料通道
  238. public bool PassWay1_1Compelete { get; set; }
  239. public bool PassWay1_2Compelete { get; set; }
  240. public bool PassWay1_3Compelete { get; set; }
  241. public bool PassWay1_4Compelete { get; set; }
  242. public bool PassWay1_5Compelete { get; set; }
  243. public bool PassWay1_6Compelete { get; set; }
  244. public bool PassWay1_7Compelete { get; set; }
  245. public bool PassWay1_8Compelete { get; set; }
  246. public bool PassWay1_9Compelete { get; set; }
  247. public bool PassWay1_10Compelete { get; set; }
  248. public bool PassWay1_11Compelete { get; set; }
  249. public bool PassWay1_12Compelete { get; set; }
  250. public bool PassWay1_13Compelete { get; set; }
  251. public bool PassWay1_14Compelete { get; set; }
  252. public Dictionary<int, bool> PassWay1_Compelete = new Dictionary<int, bool>();
  253. #endregion
  254. public GVL_MorkF()
  255. {
  256. PassWay1_Compelete.Add(1,PassWay1_1Compelete);
  257. PassWay1_Compelete.Add(2,PassWay1_2Compelete);
  258. PassWay1_Compelete.Add(3,PassWay1_3Compelete);
  259. PassWay1_Compelete.Add(4,PassWay1_4Compelete);
  260. PassWay1_Compelete.Add(5,PassWay1_5Compelete);
  261. PassWay1_Compelete.Add(6,PassWay1_6Compelete);
  262. PassWay1_Compelete.Add(7,PassWay1_7Compelete);
  263. PassWay1_Compelete.Add(8,PassWay1_8Compelete);
  264. PassWay1_Compelete.Add(9,PassWay1_9Compelete);
  265. PassWay1_Compelete.Add(10,PassWay1_10Compelete);
  266. PassWay1_Compelete.Add(11,PassWay1_11Compelete);
  267. PassWay1_Compelete.Add(12,PassWay1_12Compelete);
  268. PassWay1_Compelete.Add(13,PassWay1_13Compelete);
  269. PassWay1_Compelete.Add(14,PassWay1_14Compelete);
  270. //初始化进度列表
  271. ScreenInit();
  272. }
  273. /// <summary>
  274. /// 订单取配料队列
  275. /// </summary>
  276. public ConcurrentQueue<OrderLocInfo> TakeMaterialQueue = new ConcurrentQueue<OrderLocInfo>();
  277. /// <summary>
  278. /// 订单供盘队列
  279. /// </summary>
  280. public ConcurrentQueue<OrderLocInfo> TakePlateQueue = new ConcurrentQueue<OrderLocInfo>();
  281. #region 单口锅逻辑变量
  282. /// <summary>
  283. /// 订单唯一ID
  284. /// </summary>
  285. public string CurrentOrderId { get; set; }
  286. #endregion
  287. public Dictionary<int,string> StartPassWay { get; set; } = new Dictionary<int, string>()
  288. {
  289. {1,"LB24" },
  290. {2,"LB25" },
  291. {3,"LB26" },
  292. {4,"LB27" },
  293. {5,"LB28" },
  294. {6,"LB29" },
  295. {7,"LB30" },
  296. {8,"LB31" },
  297. {9,"LB32" },
  298. {10,"LB33" },
  299. {11,"LB34" },
  300. {12,"LB35" },
  301. {13,"LB36" },
  302. {14,"LB37" },
  303. };
  304. public Dictionary<int, string> PassWayValue { get; set; } = new Dictionary<int, string>()
  305. {
  306. {1,"LW0" },
  307. {2,"LW1" },
  308. {3,"LW2" },
  309. {4,"LW3" },
  310. {5,"LW4" },
  311. {6,"LW5" },
  312. {7,"LW6" },
  313. {8,"LW7" },
  314. {9,"LW8" },
  315. {10,"LW9" },
  316. {11,"LW10" },
  317. {12,"LW11" },
  318. {13,"LW12" },
  319. {14,"LW13" },
  320. };
  321. }
  322. }