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

660 lines
26 KiB

  1. using BPA.Message;
  2. using BPA.Message.Enum;
  3. using BPASmartClient.Device;
  4. using BPASmartClient.EventBus;
  5. using BPASmartClient.Helper;
  6. using BPASmartClient.Message;
  7. using BPASmartClient.Model;
  8. using BPASmartClient.Model.PLC;
  9. using static BPASmartClient.EventBus.EventBus;
  10. namespace BPASmartClient.MorkF
  11. {
  12. public class Control_MorkF : BaseDevice
  13. {
  14. public override DeviceClientType DeviceType => DeviceClientType.MORKSF;
  15. GVL_MorkF morkF = new GVL_MorkF();//全局对象声明
  16. //private OrderMaterialDelivery orderMaterialDelivery { get; set; } = new OrderMaterialDelivery();
  17. //private RecipeBoms recipeBoms { get; set; } = new RecipeBoms();
  18. //int OrderCount;
  19. /// <summary>
  20. /// 入口
  21. /// </summary>
  22. public override void DoMain()
  23. {
  24. ReadData(); //plc状态量读取
  25. DataParse();//数据解析
  26. //Main();
  27. //ResetProgram();
  28. MessageLog.GetInstance.Show("MORKF 设备初始化完成");
  29. }
  30. public override void ResetProgram()
  31. {
  32. morkF = null;
  33. morkF = new GVL_MorkF();
  34. }
  35. /// <summary>
  36. /// PLC数据读取
  37. /// </summary>
  38. public override void ReadData()
  39. {
  40. //ThreadManage.GetInstance().StartLong(new Action(() =>
  41. //{
  42. GetStatus("M0.1", new Action<bool[]>((bools) =>
  43. {
  44. morkF.InitialComplete = bools[0];
  45. }));
  46. GetStatus("M1.0", new Action<bool[]>((bools) =>
  47. {
  48. morkF.ProvidePlateModule = bools[0];
  49. morkF.ProvidePlateComplete = bools[2];
  50. morkF.CleanModule = bools[3];
  51. morkF.CleanComplete = bools[5];
  52. }));
  53. GetStatus("M2.0", new Action<bool[]>((bools) =>
  54. {
  55. morkF.KitchenOneStatus = bools[1];
  56. morkF.FallOilComplete = bools[8];
  57. }));
  58. GetStatus("M8.0", new Action<bool[]>((bools) =>
  59. {
  60. morkF.TurnMachineUpComplete = bools[1];
  61. morkF.TurnMachineDownComplete = bools[3];
  62. }));
  63. GetStatus("M13.5", new Action<bool[]>((bools) =>
  64. {
  65. morkF.MaterialArriveComplete = bools[0];
  66. }));
  67. GetStatus("M16.0", new Action<bool[]>((bools) =>
  68. {
  69. morkF.PutPotToKitchenComlete = bools[1];
  70. morkF.TakeMaterialComplete = bools[2];
  71. morkF.PlaceRinseTableComplete = bools[5];
  72. morkF.RoobotIdle = bools[6];
  73. }));
  74. // Thread.Sleep(500);
  75. //}), "ReadPLCData");
  76. }
  77. private void ServerInit()
  78. {
  79. //物料信息
  80. EventBus.EventBus.GetInstance().Subscribe<MaterialDeliveryEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
  81. {
  82. if (@event == null) return;
  83. if (@event is MaterialDeliveryEvent material)
  84. {
  85. orderMaterialDelivery = material.orderMaterialDelivery;
  86. }
  87. });
  88. //配方数据信息
  89. EventBus.EventBus.GetInstance().Subscribe<RecipeBomEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
  90. {
  91. if (@event == null) return;
  92. if (@event is RecipeBomEvent recipe)
  93. {
  94. recipeBoms = recipe.recipeBoms;
  95. WriteRecipeBoms();
  96. }
  97. });
  98. }
  99. private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS)
  100. {
  101. EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Id = DeviceId, Status = oRDER_STATUS, SubOrderId = subid });
  102. }
  103. /// <summary>
  104. /// 写入配方数据到 PLC
  105. /// </summary>
  106. private void WriteRecipeBoms()
  107. {
  108. //List<ushort> recipeBoms = new List<ushort>();
  109. //if (this.recipeBoms == null) return;
  110. //foreach (var item in this.recipeBoms.RecipeIds)
  111. //{
  112. // foreach (var rec in item.Recipes)
  113. // {
  114. // recipeBoms.Add((ushort)rec);
  115. // }
  116. //}
  117. //if (recipeBoms.Count > 0)
  118. //{
  119. // //配方数据地址范围:VW2000 - VW2278
  120. // WriteData("VW2000", recipeBoms.ToArray());
  121. //}
  122. //else { MessageLog.GetInstance.Show("配方数据为空"); }
  123. }
  124. /// <summary>
  125. /// 数据解析
  126. /// </summary>
  127. private void DataParse()
  128. {
  129. EventBus.EventBus.GetInstance().Subscribe<DoOrderEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle)
  130. {
  131. if (@event == null) return;
  132. if (@event is DoOrderEvent order)
  133. {
  134. if (order.MorkOrder.GoodBatchings == null) return;
  135. OrderCount++;
  136. MessageLog.GetInstance.Show($"接收到{OrderCount}次订单");
  137. foreach (var item in order.MorkOrder.GoodBatchings)
  138. {
  139. var res = orderMaterialDelivery?.BatchingInfo?.FirstOrDefault(p => p.BatchingId == item.BatchingId);
  140. if (res != null)
  141. {
  142. if (ushort.TryParse(res.BatchingLoc, out ushort loc))
  143. {
  144. if (loc >= 1 && loc <= 5)
  145. {
  146. if (morkF.TakeMaterialQueue.FirstOrDefault(p => p.SuborderId == order.MorkOrder.SuborderId) == null)
  147. morkF.TakeMaterialQueue.Enqueue(new OrderLocInfo() { Loc = ushort.Parse(res.BatchingLoc), SuborderId = order.MorkOrder.SuborderId, BatchingId = res.BatchingId });
  148. }
  149. else if (loc >= 10 && loc <= 11)
  150. {
  151. int index = 0;
  152. if (recipeBoms != null)
  153. {
  154. index = Array.FindIndex(recipeBoms.RecipeIds?.ToArray(), p => p.RecipeId == order.MorkOrder.RecipeId);
  155. index++;
  156. }
  157. if (morkF.TakePlateQueue.FirstOrDefault(p => p.SuborderId == order.MorkOrder.SuborderId) == null)
  158. morkF.TakePlateQueue.Enqueue(new OrderLocInfo()
  159. {
  160. Loc = ushort.Parse(res.BatchingLoc),
  161. SuborderId = order.MorkOrder.SuborderId,
  162. RecipeNumber = (index >= 1 && index <= 10) ? (ushort)index : (ushort)0
  163. });
  164. }
  165. }
  166. }
  167. }
  168. }
  169. });
  170. }
  171. /// <summary>
  172. /// 流程控制
  173. /// </summary>
  174. public override void MainTask()
  175. {
  176. //ThreadManage.GetInstance().StartLong(new Action(() =>
  177. //{
  178. IsHealth = true; //心跳
  179. TakePlatelTask();
  180. TakePotTask();
  181. TakeVegBurdenATask();
  182. TakeMeatBurdenATask();
  183. TakeVegBurdenBTask();
  184. TakeBurdenCTask();
  185. StartCookingTask();
  186. OutDishTask();
  187. CleanPotTask();
  188. TurntableControl();
  189. SingleProcess();
  190. //}), "MainTask");
  191. }
  192. /// <summary>
  193. /// 信号处理
  194. /// </summary>
  195. private void SingleProcess()
  196. {
  197. //转台互锁解除
  198. if (morkF.TakeMaterialComplete && morkF.TurnTableLock)
  199. {
  200. morkF.TurnTableLock = false;
  201. }
  202. //待定
  203. if (morkF.TakeVegALock && morkF.TakeMeatALock && morkF.TakeVegBLock)
  204. {
  205. morkF.TakeAllBurdenComplete = true;
  206. }
  207. //出餐完成,相应变量复位
  208. if (morkF.OutMealComplete)
  209. {
  210. morkF.TakePlateLock = false;
  211. morkF.TakePotLock = false;
  212. morkF.TakeVegALock = false;
  213. morkF.TakeMeatALock = false;
  214. morkF.TakeVegBLock = false;
  215. morkF.TakeBurdenCLcok = false;
  216. }
  217. }
  218. /// <summary>
  219. /// 转台控制
  220. /// </summary>
  221. private void TurntableControl()
  222. {
  223. //正常轮询
  224. if (morkF.InitialComplete && morkF.TakeMaterialQueue.Count > 0 && !morkF.TurnTableLock)
  225. {
  226. var result = orderMaterialDelivery.BatchingInfo.Where(p => p.BatchingId == morkF.TakeMaterialQueue.ElementAt(0).BatchingId).ToList();
  227. if (result != null)
  228. {
  229. if (ushort.TryParse(result[0].BatchingLoc, out ushort loc))
  230. {
  231. TurnMaterialStore(loc);
  232. MessageLog.GetInstance.Show($"转台转到【{loc}】位置");
  233. morkF.TurnTableLock = true; //取料完成后置false
  234. }
  235. }
  236. else MessageLog.GetInstance.Show("未找到可用的物料信息");
  237. }
  238. }
  239. /// <summary>
  240. /// 供盘
  241. /// </summary>
  242. /// <exception cref="NotImplementedException"></exception>
  243. private void TakePlatelTask()
  244. {
  245. if (!morkF.RoobotIdle && morkF.InitialComplete && morkF.TakePlateQueue.Count > 0 && !morkF.ProvidePlateModule && !morkF.TakePlateLock)
  246. {
  247. if (morkF.TakePlateQueue.TryDequeue(out OrderLocInfo order))
  248. {
  249. StartTakePlate();
  250. morkF.CurrentOrderId = order.SuborderId;
  251. morkF.TakePlateLock = true; //订单完成后置false
  252. MessageLog.GetInstance.Show($"订单【{ morkF.CurrentOrderId}】执行取碗控制,位置:[{order.Loc}]");
  253. }
  254. }
  255. }
  256. /// <summary>
  257. /// 取锅到灶台
  258. /// </summary>
  259. /// <exception cref="NotImplementedException"></exception>
  260. private void TakePotTask()
  261. {
  262. if (!morkF.RoobotIdle && morkF.InitialComplete && morkF.TakePlateQueue.Count > 0 && !morkF.CleanModule && morkF.CleanComplete && !morkF.KitchenOneStatus && !morkF.TakePotLock)
  263. {
  264. TakePotToKitchen();
  265. morkF.TakePotLock = true; //订单完成后置false
  266. MessageLog.GetInstance.Show($"订单【{ morkF.CurrentOrderId}】执行取锅到灶台控制");
  267. }
  268. }
  269. /// <summary>
  270. /// 取素菜A料
  271. /// </summary>
  272. private void TakeVegBurdenATask()
  273. {
  274. if (!morkF.RoobotIdle && morkF.PotInPlace && morkF.TurnMachineUpComplete && !morkF.TakeVegALock && morkF.AllowTakeMaterial)
  275. {
  276. if (morkF.TakeMaterialQueue.TryDequeue(out OrderLocInfo order))
  277. {
  278. int loc = order.Loc;
  279. TakeBurden(loc);
  280. morkF.TakeVegALock = true;//订单完成置false
  281. morkF.AllowTakeMaterial = false;
  282. MessageLog.GetInstance.Show($"订单【{ order.SuborderId},翻转机上升完成,执行取素菜A控制");
  283. }
  284. }
  285. }
  286. /// <summary>
  287. /// 取荤菜A料
  288. /// </summary>
  289. private void TakeMeatBurdenATask()
  290. {
  291. if (!morkF.RoobotIdle && morkF.PotInPlace && morkF.TurnMachineUpComplete && morkF.TakeVegALock && !morkF.TakeMeatALock && morkF.AllowTakeMaterial)
  292. {
  293. if (morkF.TakeMaterialQueue.TryDequeue(out OrderLocInfo order))
  294. {
  295. int loc = order.Loc;
  296. TakeBurden(loc);
  297. morkF.TakeMeatALock = true;//订单完成置false
  298. morkF.AllowTakeMaterial = false;
  299. MessageLog.GetInstance.Show($"订单【{ order.SuborderId}】,,翻转机上升完成,执行取荤菜A控制");
  300. }
  301. }
  302. }
  303. /// <summary>
  304. /// 取素菜B料
  305. /// </summary>
  306. private void TakeVegBurdenBTask()
  307. {
  308. if (!morkF.RoobotIdle && morkF.PotInPlace && morkF.TurnMachineUpComplete && morkF.TakeMeatALock && !morkF.TakeVegBLock && morkF.AllowTakeMaterial)
  309. {
  310. if (morkF.TakeMaterialQueue.TryDequeue(out OrderLocInfo order))
  311. {
  312. int loc = order.Loc;
  313. TakeBurden(loc);
  314. morkF.TakeVegBLock = true;//订单完成置false
  315. morkF.AllowTakeMaterial = false;
  316. MessageLog.GetInstance.Show($"订单【{ order.SuborderId}】,,翻转机上升完成,执行取素菜B控制");
  317. }
  318. }
  319. }
  320. /// <summary>
  321. /// 取调味品C料
  322. /// </summary>
  323. /// <exception cref="NotImplementedException"></exception>
  324. private void TakeBurdenCTask()
  325. {
  326. if (!morkF.RoobotIdle && morkF.PotInPlace && morkF.TurnMachineUpComplete && morkF.TakeAllBurdenComplete && !morkF.TakeBurdenCLcok && morkF.AllowTakeMaterial)
  327. {
  328. if (morkF.TakeMaterialQueue.TryDequeue(out OrderLocInfo order))
  329. {
  330. int loc = order.Loc;
  331. TakeBurden(loc);
  332. morkF.TakeBurdenCLcok = true;//订单完成置false
  333. morkF.AllowTakeMaterial = false;
  334. morkF.TakeAllBurdenComplete = false;
  335. MessageLog.GetInstance.Show($"订单【{ order.SuborderId}】,,翻转机上升完成,执行取调味品C料控制");
  336. }
  337. }
  338. }
  339. /// <summary>
  340. /// 开始烹饪
  341. /// </summary>
  342. /// <exception cref="NotImplementedException"></exception>
  343. private void StartCookingTask()
  344. {
  345. if (morkF.InitialComplete && morkF.TakeMaterialQueue.Count > 0 && morkF.PutPotToKitchenComlete && !morkF.CookingLock)
  346. {
  347. MessageLog.GetInstance.Show($"订单【{morkF.CurrentOrderId}】开始烹饪");
  348. morkF.CookingLock = true;
  349. morkF.PotInPlace = morkF.PutPotToKitchenComlete;//锅到位
  350. Task.Run(new Action(() =>
  351. {
  352. KitchenAdjustGears(3);
  353. Task.Delay(1000).Wait(); //大火加热1s
  354. AddOil();//注油
  355. KitchenAdjustGears(2);
  356. Task.Delay(2000).Wait(); //中火2s
  357. TurnDownStatusDetect();//翻转机下降及检测
  358. KitchenAdjustGears(1);//灶台1挡
  359. TurnMachineGearsControl(1);//翻炒机1挡
  360. Task.Delay(2000).Wait();
  361. TurnMachineGearsControl(0);//关闭翻炒机
  362. TurnUpStatusDetect();//翻转机上升及检测
  363. TurnDownStatusDetect();//翻转机下降及检测
  364. KitchenAdjustGears(3);//灶台3挡
  365. TurnMachineGearsControl(3);//翻炒机3挡
  366. Task.Delay(2000).Wait();//葱姜蒜断生
  367. KitchenAdjustGears(1);//灶台1挡
  368. TurnMachineGearsControl(0);//关闭翻炒机
  369. TurnUpStatusDetect();//翻转机上升及检测
  370. TurnDownStatusDetect();//翻转机下降及检测
  371. KitchenAdjustGears(3);//灶台3挡
  372. TurnMachineGearsControl(3);//翻炒机3挡
  373. Task.Delay(2000).Wait();//B料断生
  374. KitchenAdjustGears(1);//灶台1挡
  375. TurnMachineGearsControl(0);//关闭翻炒机
  376. TurnUpStatusDetect();//翻转机上升及检测
  377. TurnDownStatusDetect();//翻转机下降及检测
  378. KitchenAdjustGears(2);//灶台3挡
  379. TurnMachineGearsControl(3);//翻炒机3挡
  380. Task.Delay(2000).Wait();//煸炒入味
  381. KitchenAdjustGears(0);//灶台0挡
  382. TurnMachineGearsControl(0);//关闭翻炒机
  383. TurnMachineOrientControl("Top");//翻转机上升
  384. while (!morkF.TurnMachineUpComplete)
  385. {
  386. Task.Delay(5).Wait();
  387. }
  388. EventBus.EventBus.GetInstance().Publish(new WriteModel() { Address = "M8.1", Value = false });
  389. morkF.CookingComplete = true; //烹饪完成
  390. MessageLog.GetInstance.Show($"订单【{morkF.CurrentOrderId}】烹饪完成");
  391. }));
  392. }
  393. }
  394. /// <summary>
  395. /// 出餐
  396. /// </summary>
  397. private void OutDishTask()
  398. {
  399. if (!morkF.RoobotIdle && morkF.CookingComplete && morkF.ProvidePlateComplete && !morkF.CleanModule)
  400. {
  401. RobotOutMeal();
  402. MessageLog.GetInstance.Show($"订单【{morkF.CurrentOrderId}】正在出餐");
  403. }
  404. }
  405. /// <summary>
  406. /// 洗锅放锅
  407. /// </summary>
  408. private void CleanPotTask()
  409. {
  410. if (morkF.PlaceRinseTableComplete && !morkF.CleanModule)
  411. {
  412. CleanModuleControl("Start");
  413. Task.Delay(5000).Wait();
  414. CleanModuleControl("Stop");
  415. }
  416. }
  417. /// <summary>
  418. /// 任务复位重启
  419. /// </summary>
  420. //private void ResetProgram()
  421. //{
  422. // ThreadManage.GetInstance().StartLong(new Action(() =>
  423. // {
  424. // if (RTrig.GetInstance("ResetProgram").Start(morkF.DevicDataInite))
  425. // {
  426. // ThreadManage.GetInstance().StopTask("MainTask", new Action(() =>
  427. // {
  428. // ThreadManage.GetInstance().StopTask("ReadPLCData", new Action(() =>
  429. // {
  430. // morkF = null;
  431. // morkF = new GVL_MorkF();
  432. // ActionManage.GetInstance.Send("ResetProgram");
  433. // ActionManage.GetInstance.Send("ClearOrders");
  434. // ReadData();
  435. // Main();
  436. // }));
  437. // }));
  438. // }
  439. // Thread.Sleep(10);
  440. // }), "ResetProgram");
  441. //}
  442. /// <summary>
  443. /// 翻转机下降及状态检测
  444. /// </summary>
  445. public void TurnDownStatusDetect()
  446. {
  447. TurnMachineOrientControl("Down");
  448. while (!morkF.TurnMachineDownComplete)//等待翻转机下降完成
  449. {
  450. Task.Delay(5).Wait();
  451. }
  452. EventBus.EventBus.GetInstance().Publish(new WriteModel() { Address = "M8.3", Value = false });//复位
  453. MessageLog.GetInstance.Show($"翻转机下降执行完成");
  454. }
  455. /// <summary>
  456. /// 翻转机上升及状态检测
  457. /// </summary>
  458. public void TurnUpStatusDetect()
  459. {
  460. TurnMachineOrientControl("Top");//翻转机上升
  461. morkF.AllowTakeMaterial = true;
  462. while (!morkF.TurnMachineUpComplete || !morkF.TakeMaterialComplete)//等待翻转机上升完成以及取料完成
  463. {
  464. Task.Delay(5).Wait();
  465. }
  466. EventBus.EventBus.GetInstance().Publish(new WriteModel() { Address = "M8.1", Value = false });
  467. MessageLog.GetInstance.Show("翻转机上升执行完成");
  468. }
  469. private void GetStatus(string key, Action<bool[]> action)
  470. {
  471. if (peripheralStatus.ContainsKey(key))
  472. {
  473. action((bool[])peripheralStatus[key]);//获取PLC指定地址的状态值
  474. }
  475. }
  476. /// <summary>
  477. /// 写数据
  478. /// </summary>
  479. /// <param name="address"></param>
  480. /// <param name="value"></param>
  481. private void WriteData(string address, object value)
  482. {
  483. EventBus.EventBus.GetInstance().Publish(new WriteModel() { Id = DeviceId, Address = address, Value = value });
  484. }
  485. /// <summary>
  486. /// 灶台档位调节
  487. /// </summary>
  488. public void KitchenAdjustGears(int number)
  489. {
  490. switch (number)
  491. {
  492. case 0:
  493. WriteData("352", new bool[] { false, false, false, false, false, false, false, false });//0000 0000
  494. break;
  495. case 1:
  496. WriteData("352", new bool[] { true, false, false, false, false, false, false, false });//0000 0001
  497. break;
  498. case 2:
  499. WriteData("352", new bool[] { false, true, false, false, false, false, false, false });//0000 0010
  500. break;
  501. case 3:
  502. WriteData("352", new bool[] { true, true, false, false, false, false, false, false });//0000 0011
  503. break;
  504. case 4:
  505. WriteData("352", new bool[] { false, false, true, false, false, false, false, false });//0000 0100
  506. break;
  507. case 5:
  508. WriteData("352", new bool[] { true, false, true, false, false, false, false, false });//0000 0101
  509. break;
  510. case 6:
  511. WriteData("352", new bool[] { false, true, true, false, false, false, false, false });//0000 0110
  512. break;
  513. case 7:
  514. WriteData("352", new bool[] { true, true, true, false, false, false, false, false });//0000 0111
  515. break;
  516. case 8:
  517. WriteData("355", new bool[] { false, false, false, true, false, false, false, false });//0000 1000
  518. break;
  519. case 9:
  520. WriteData("352", new bool[] { true, false, false, true, false, false, false, false });//0000 1001
  521. break;
  522. }
  523. MessageLog.GetInstance.Show($"订单【{morkF.CurrentOrderId}】,加热档位调至{number}挡");
  524. }
  525. public void TurnMaterialStore(int loc)
  526. {
  527. switch (loc)
  528. {
  529. case 1:
  530. WriteData("M13.0", true);
  531. break;
  532. case 2:
  533. WriteData("M13.1", true);
  534. break;
  535. case 3:
  536. WriteData("M13.2", true);
  537. break;
  538. case 4:
  539. WriteData("M13.3", true);
  540. break;
  541. case 5:
  542. WriteData("M13.4", true);
  543. break;
  544. }
  545. }
  546. /// <summary>
  547. /// 供盘启动
  548. /// </summary>
  549. public void StartTakePlate()
  550. {
  551. WriteData("M1.1", true);
  552. }
  553. /// <summary>
  554. /// 取锅到灶台
  555. /// </summary>
  556. public void TakePotToKitchen()
  557. {
  558. WriteData("M14.0", true);
  559. }
  560. /// <summary>
  561. /// 机器人出餐并将锅放置清洗台位置
  562. /// </summary>
  563. public void RobotOutMeal()
  564. {
  565. WriteData("M14.2", true);
  566. }
  567. /// <summary>
  568. /// 注油
  569. /// </summary>
  570. public void AddOil()
  571. {
  572. WriteData("M2.7", true);
  573. MessageLog.GetInstance.Show("开始注油");
  574. while (!morkF.FallOilComplete)
  575. {
  576. Task.Delay(5).Wait();
  577. }
  578. MessageLog.GetInstance.Show("注油完成");
  579. }
  580. /// <summary>
  581. /// 翻转机方向控制
  582. /// </summary>
  583. /// <param name="orientation"></param>
  584. public void TurnMachineOrientControl(string orientation)
  585. {
  586. switch (orientation)
  587. {
  588. case "Top": WriteData("M8.0", true); break;
  589. // case "Middle": WriteData("", 1); break;
  590. case "Down": WriteData("M8.2", true); break;
  591. }
  592. MessageLog.GetInstance.Show($"翻转机执行{orientation}操作");
  593. }
  594. /// <summary>
  595. /// 翻转机档位控制
  596. /// </summary>
  597. public void TurnMachineGearsControl(int gear)
  598. {
  599. switch (gear)
  600. {
  601. case 0: WriteData("M7.0", true); break;//关闭翻炒机
  602. case 1: WriteData("M7.1", true); break;//翻炒机1挡
  603. case 2: WriteData("M7.2", true); break;//翻炒机2挡
  604. case 3: WriteData("M7.3", true); break;//翻炒机3挡
  605. }
  606. MessageLog.GetInstance.Show($"翻转机档位调至{gear}挡");
  607. }
  608. /// <summary>
  609. /// 取A,B,C料
  610. /// </summary>
  611. public void TakeBurden(int loc)
  612. {
  613. WriteData("M14.1", true);//机器人取料
  614. }
  615. /// <summary>
  616. /// 清洗模组1启停控制
  617. /// </summary>
  618. public void CleanModuleControl(string status)
  619. {
  620. if (status == "Start")
  621. {
  622. WriteData("M1.4", true);
  623. }
  624. if (status == "Stop")
  625. {
  626. WriteData("M1.4", false);
  627. }
  628. MessageLog.GetInstance.Show($"清洗模组执行【{status}】操作");
  629. }
  630. public override void Stop()
  631. {
  632. }
  633. }
  634. }