From e14171a5d6eca8bb525e9a281af388a0fb8ea98b Mon Sep 17 00:00:00 2001 From: Nah <15196688790@163.com> Date: Mon, 23 Oct 2023 15:06:53 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=94=B9=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=85=8D=E6=96=B9=E5=BD=93=E5=89=8D=E5=B7=A5=E4=BD=8D=E7=9A=84?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E9=98=B2=E6=AD=A2=E6=AD=BB=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BPA.SingleDevice/Business/ProcessControl.cs | 34 +++++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/BPA.SingleDevice/Business/ProcessControl.cs b/BPA.SingleDevice/Business/ProcessControl.cs index b09a7a5..cc95d99 100644 --- a/BPA.SingleDevice/Business/ProcessControl.cs +++ b/BPA.SingleDevice/Business/ProcessControl.cs @@ -292,17 +292,17 @@ namespace BPA.SingleDevice.Business case MoveConveyerStep.Moveing: if (moveCompleteTrig) { - logService.LogRunInfo($"控制传送带移动结束。"); - + logService.LogRunInfo($"控制传送带移动结束,复位传送带移动指令,开始更新配方工位。"); + Conveyer.InitalMoveParam(); global.MoveConveyerStep = MoveConveyerStep.MoveComplete; } break; case MoveConveyerStep.MoveComplete: - Conveyer.InitalMoveParam(); - UpdateRecipe(); - global.MoveConveyerStep = MoveConveyerStep.WaitMove; - //不会执行该步骤,会直接跳出循环。 + if (UpdateRecipeCurrentSataion()) + { + global.MoveConveyerStep = MoveConveyerStep.WaitMove; + } break; } //} @@ -458,6 +458,28 @@ namespace BPA.SingleDevice.Business } } } + /// 刷新配方的当前工站。 + private bool UpdateRecipeCurrentSataion() + { + bool result = true; + foreach (var item in CurrentRecipes) + { + if (item.CurrentStation < 5 && item.IsMakeComplete[item.CurrentStation - 1]==true) + { + if (Conveyer.HaveVessel[item.CurrentStation]) + { + item.CurrentStation++; + } + else + { + logService.LogRunInfo($"未检测到配方【{item.Name}】在工位【{item.CurrentStation + 1}】的容器到位信号,请检查。"); + Task.Delay(3000).Wait(); + result = false; + } + } + } + return result; + } /// 适用于多配方的配料。 private void Batching()