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

364 lines
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. Task = "准备";
  229. processModels.Clear();
  230. //初始化进度列表
  231. processModels.Add(new ProcessModel() { Id = 1, Name = "开始", Status = ProcessStatus.未执行 });
  232. processModels.Add(new ProcessModel() { Id = 2, Name = "热油", Status = ProcessStatus.未执行 });
  233. processModels.Add(new ProcessModel() { Id = 3, Name = "炒制", Status = ProcessStatus.未执行 });
  234. processModels.Add(new ProcessModel() { Id = 4, Name = "出餐", Status = ProcessStatus.未执行 });
  235. processModels.Add(new ProcessModel() { Id = 5, Name = "完成", Status = ProcessStatus.未执行 });
  236. }
  237. public void ScreenClear()
  238. {
  239. processModels.Clear();
  240. Task = string.Empty;
  241. GoodName = string.Empty;
  242. }
  243. #endregion
  244. #region 调料通道
  245. public bool PassWay1_1Compelete { get; set; }
  246. public bool PassWay1_2Compelete { get; set; }
  247. public bool PassWay1_3Compelete { get; set; }
  248. public bool PassWay1_4Compelete { get; set; }
  249. public bool PassWay1_5Compelete { get; set; }
  250. public bool PassWay1_6Compelete { get; set; }
  251. public bool PassWay1_7Compelete { get; set; }
  252. public bool PassWay1_8Compelete { get; set; }
  253. public bool PassWay1_9Compelete { get; set; }
  254. public bool PassWay1_10Compelete { get; set; }
  255. public bool PassWay1_11Compelete { get; set; }
  256. public bool PassWay1_12Compelete { get; set; }
  257. public bool PassWay1_13Compelete { get; set; }
  258. public bool PassWay1_14Compelete { get; set; }
  259. public Dictionary<int, bool> PassWay1_Compelete = new Dictionary<int, bool>();
  260. #endregion
  261. public GVL_MorkF()
  262. {
  263. PassWay1_Compelete.Add(1,PassWay1_1Compelete);
  264. PassWay1_Compelete.Add(2,PassWay1_2Compelete);
  265. PassWay1_Compelete.Add(3,PassWay1_3Compelete);
  266. PassWay1_Compelete.Add(4,PassWay1_4Compelete);
  267. PassWay1_Compelete.Add(5,PassWay1_5Compelete);
  268. PassWay1_Compelete.Add(6,PassWay1_6Compelete);
  269. PassWay1_Compelete.Add(7,PassWay1_7Compelete);
  270. PassWay1_Compelete.Add(8,PassWay1_8Compelete);
  271. PassWay1_Compelete.Add(9,PassWay1_9Compelete);
  272. PassWay1_Compelete.Add(10,PassWay1_10Compelete);
  273. PassWay1_Compelete.Add(11,PassWay1_11Compelete);
  274. PassWay1_Compelete.Add(12,PassWay1_12Compelete);
  275. PassWay1_Compelete.Add(13,PassWay1_13Compelete);
  276. PassWay1_Compelete.Add(14,PassWay1_14Compelete);
  277. ////初始化进度列表
  278. //ScreenInit();
  279. }
  280. /// <summary>
  281. /// 订单取配料队列
  282. /// </summary>
  283. public ConcurrentQueue<OrderLocInfo> TakeMaterialQueue = new ConcurrentQueue<OrderLocInfo>();
  284. /// <summary>
  285. /// 订单供盘队列
  286. /// </summary>
  287. public ConcurrentQueue<OrderLocInfo> TakePlateQueue = new ConcurrentQueue<OrderLocInfo>();
  288. #region 单口锅逻辑变量
  289. /// <summary>
  290. /// 订单唯一ID
  291. /// </summary>
  292. public string CurrentOrderId { get; set; }
  293. #endregion
  294. public Dictionary<int,string> StartPassWay { get; set; } = new Dictionary<int, string>()
  295. {
  296. {1,"LB24" },
  297. {2,"LB25" },
  298. {3,"LB26" },
  299. {4,"LB27" },
  300. {5,"LB28" },
  301. {6,"LB29" },
  302. {7,"LB30" },
  303. {8,"LB31" },
  304. {9,"LB32" },
  305. {10,"LB33" },
  306. {11,"LB34" },
  307. {12,"LB35" },
  308. {13,"LB36" },
  309. {14,"LB37" },
  310. };
  311. public Dictionary<int, string> PassWayValue { get; set; } = new Dictionary<int, string>()
  312. {
  313. {1,"LW0" },
  314. {2,"LW1" },
  315. {3,"LW2" },
  316. {4,"LW3" },
  317. {5,"LW4" },
  318. {6,"LW5" },
  319. {7,"LW6" },
  320. {8,"LW7" },
  321. {9,"LW8" },
  322. {10,"LW9" },
  323. {11,"LW10" },
  324. {12,"LW11" },
  325. {13,"LW12" },
  326. {14,"LW13" },
  327. };
  328. }
  329. }